Search Results

Search found 68949 results on 2758 pages for 'diamond problem'.

Page 6/2758 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Problem with jQuery slider - time

    - by Dawid
    Hello. I'd like to make a slider to choose time(from 1:00 to 4:00) but it doesn't work. It doesn't communicate with 'select'. Can anyone help me? <script> $(function() { var select = $( "#czastrwania" ); var slider = $( "<div id='slider'></div>" ).insertAfter( select ).slider({ min: 60, max: 240, step: 30, range: "min", value: select[ 0 ].selectedIndex + 1, slide: function( e, ui ) { var hours = Math.floor(ui.value / 60); var minutes = ui.value - (hours * 60); if(hours.length == 1) hours = '0' + hours; if(minutes.length == 1) minutes = '0' + minutes; select[ 0 ].selectedIndex = ui.value - 1; } }); $( "#czastrwania" ).change(function() { slider.slider( "value", this.selectedIndex + 1 ); }); }); </script> <select id="czastrwania" name="czastrwania"> <option value="1:00">1:00</option> <option value="1:30">1:30</option> <option value="2:00">2:00</option> <option value="2:30">2:30</option> <option value="3:00">3:00</option> <option value="3:30">3:30</option> <option value="4:00">4:00</option> </select>

    Read the article

  • How to shortcut diamond character in vim

    - by temujin.ya.ru
    In the dictionary file, which I am editing I often need to insert character "?" on place of <. Is there a way to map "?" to some key so that I press "r" for replace and then my_shortcut to have < replaced by "?"? I found a way to make imap mapping in .vimrc: :imap <> ? But changing to inset mode is sub-optimal, would that be possible to make it all in replace mode and what should I write in .vimrc for that?

    Read the article

  • Ads in whole app iPhone problem

    - by lars
    I am using mobclix together with admob. The code is to big to add it in all classes. So i created a new class: Ads Everytime i want an ad in a view, i have to send the view to the ad class: - (void)initAd:(UIView *) pView { NSLog(@"ads init"); self.loadedView = pView; ..... To create an ad in a class: Ad* ad = [Ads new]; [ad initAd:self.view]; I dont know if thats the right way. I have to create a new Ads object everytime i change a view (or class). Is there a way to always have an Ads instance running, or is there another better way? Thanks alot!!

    Read the article

  • Open closed prinicple, problem

    - by Marcus
    Hi, I'm trying to apply OCP to a code snippet I have that in it's current state is really smelly, but I feel I'm not getting all the way to the end. Current code: public abstract class SomeObject {} public class SpecificObject1 : SomeObject {} public class SpecificObject2 : SomeObject {} // Smelly code public class Model { public void Store(SomeObject someObject) { if (someObject is SpecificObject1) {} else if (someObject is SpecificObject2) {} } } That is really ugly, my new approach looks like this: // No so smelly code public class Model { public void Store(SomeObject someObject) { throw new Expception("Not allowed!"); } public void Store(SpecificObject1 someObject) {} public void Store(SpecificObject2 someObject) {} } When a new SomeObject type comes along I must implement how that specific object is stored, this will break OCP cause I need to alter the Model-class. To move the store logic to SomeObject also feels wrong cause then I will violate SRP (?), becuase in this case the SomeObject is almost like a DTO, it's resposibility it not how to know to store itself. If a new implementation to SomeObject comes along who's store implementation is missing I will get a runtime error due to exception in Store method in Model class, it also feels like a code smell. This is because calling code will in the form of IEnumerable<SomeObject> sequence; I will not know the specific types of the sequence objects. I can't seem to grasp the OCP-concept. Anyone has any concrete examples or links that is a bit more than just some Car/Fruit example?

    Read the article

  • libmysql c++ text problem :P

    - by stefan
    Im using libmysql for mysql in c++ and now i got a column, type= text, and i want the word(s) inside it. how to do this? when i use Blob (dont know what it is) it gives me e44158 :S. can somebody help me please?

    Read the article

  • PHP GD Incredibly Strange Problem

    - by ThinkingInBits
    if ($img = imagecreatefromjpeg("/var/www/images/upload/1/1.jpg")) { die("success"); } if ($img = imagecreatefromjpeg("/var/www/images/upload/1/1.jpg")) { $image_width = imagesx($img); $image_height = imagesy($img); $target_width = 150; $target_height = 150; if ($image_width > $image_height) { $percentage = ($target_width / $image_width); } else { $percentage = ($target_height / $image_height); } $new_image_width = round($image_width * $percentage); $new_image_height = round($image_height * $percentage); $imgResized = imagecreatetruecolor($new_image_width, $new_image_height); imagecopyresampled($imgResized, $img, 0, 0, 0, 0, $new_image_width, $new_image_height, $image_width, $image_height); imagejpeg($imgResized, $this->path, 100); imagedestroy($img); imagedestroy($imgResized); $this->storeThumbnailLocation(); } else { die ("image was not created or saved"); } The first if statement dies and echos success. If I take out the first if statement, the second one echos "image could not be created or saved" If honestly run out of ideas on this one, the code is identical

    Read the article

  • really weird DNS problem in Ubuntu {after one month, seems like ISP problem}

    - by OmniWired
    Hello everyone. I been having this random dns problem, in Ubuntu 10.04 and in 10.10 it started about 2 weeks ago after (I believe) an update. Basically when I go to a website randomly I get that the website I'm visiting is not available ("Oops! Google Chrome could not connect to ..." & "This webpage is not available."). I tested with Chromium "7.0.515.0 (58587)" and Firefox minefield (4.0ish) and 3.6.9. I did these 4 things already: /etc/default/grub GRUB_CMDLINE_LINUX="ipv6.disable=1" and this: /etc/sysctl.conf net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 *disabling Chromium DNS pre-fetching *using Google and OpenDNS servers as well as ISP DNS servers. But didn't improve, also no other computers in my network have the same problem. All computer wired to the same router. I'm a software engineer that run out of ideas, please help me. Thanks in advance. UPDATE: some programs (synaptic / firefox update/ vuze(azureus)) say connection refused for the error. Most of the time a second try will fix the "refusal". UPDATE2: I found out with Wireshark, that everytime I have this problem i've got this 192.168.0.10 8.8.8.8 ICMP Destination unreachable (Port unreachable) Confirmed an ISP error. ISP;Speedy Location: Argentina, Buenos Aires (capital Federal) Area.

    Read the article

  • GRUB Problem or Hardware Problem?

    - by Nikit Batale
    I have Windows XP Professional and Ubuntu Karmic Koala 9.10 on dual boot. I often get a GRUB loading failed error during boot-up. Or sometimes, when I try to boot into either Ubuntu or XP, I get a Could not read from source error. Now this is funny. After getting one of the above errors, if I simply unplug the SATA cable from Hard Drive end and plug it again, the problem gets solved. So what and whose problem is it? GRUB or My Hardware ? P.S.: I was suggested on StackOverflow that ServerFault is the right place for this question.

    Read the article

  • How do you avoid jumping to a solution when under pressure? [closed]

    - by GlenPeterson
    When under a particularly strict programming deadline (like an hour), if I panic at all, my tendency is to jump into coding without a real plan and hope I figure it out as I go along. Given enough time, this can work, but in an interview it's been pretty unsuccessful, if not downright counter-productive. I'm not always comfortable sitting there thinking while the clock ticks away. Is there a checklist or are there techniques to recognize when you understand the problem well enough to start coding? Maybe don't touch the keyboard for the first 5-10 minutes of the problem? At what point do you give up and code a brute-force solution with the hope of reasoning out a better solution later? A related follow-up question might be, "How do you ensure that you are solving the right problem?" Or "When is it most productive to think and design more vs. code some experiments to and figure out the design later?" EDIT: One close vote already, but I'm not sure why. I wrote this in the first person, but I doubt I'm the only programmer to ever choke in an interview. Here is a list of techniques for taking a math test and another for taking an oral exam. Maybe I'm not expressing myself well, but I'm asking if there is a similar list of techniques for handling a programming problem under pressure?

    Read the article

  • How to avoid jumping to a solution when under pressure? [closed]

    - by GlenPeterson
    When under a particularly strict programming deadline (like an hour), if I panic at all, my tendency is to jump into coding without a real plan and hope I figure it out as I go along. Given enough time, this can work, but in an interview it's been pretty unsuccessful, if not downright counter-productive. I'm not always comfortable sitting there thinking while the clock ticks away. Is there a checklist or are there techniques to recognize when you understand the problem well enough to start coding? Maybe don't touch the keyboard for the first 5-10 minutes of the problem? At what point do you give up and code a brute-force solution with the hope of reasoning out a better solution later? When is it most productive to think and design more vs. code some experiments to and figure out the design later? Here is a list of techniques for taking a math test and another for taking an oral exam. Is there is a similar list of techniques for handling a programming problem under pressure? ANSWERS: I think this is a valid answer: How To Solve It. I found the link as an answer to Steps to solve or approach towards a solution. There were also some really good tips at Is thinking out loud during an interview really the best strategy?. A great and concise argument for TDD is the first answer to TDD Writing code vs Figuring out the answer to a problem?. My question may be a near-duplicate of that one.

    Read the article

  • Flowchart for solving programming problems

    - by nurne
    I noticed that every developer implements a somewhat different flowchart for solving programming problems. By flowchart I mean a defined system of techniques that the developer goes through in a certain sequence, trying to solve the problem at hand. Some examples for techniques: Google "how to..." or "... tutorial". Search the java/msdn/apple/etc API doc for the specific class or method. Search in stack overflow the exact problem with some tags like [iphone]/[java] etc. Take a nap and let the subconscious work. Debug. Draw the algorithm or system. Google the logged error message. Ask a colleague or manager. Ask a new question in stack overflow. From your experience, what is the best flowchart for solving a programming problem?

    Read the article

  • Site failing randomly - could it be Cloudflare or something weird in the JS?

    - by James
    I've been working on a simple site that uses javascript to fade through some fullscreen background images as well as some other simple animations. I've tested the site on Chrome, Safari, FF and Opera on OSX, IE8+ on Win7 and Chrome & FF on Ubuntu and everything looks as I'd expect it to. However, I've had reports of the site failing to load (stops at the stage where the background fades up) on Safari and Chrome on OSX and Win. I can't replicate this on any setup so I'm finding it impossible to troubleshoot. Google's instant preview shows the site fine as does most of the options at browsershots.org so I'm really scratching my head. I'm running the site's traffic through Cloudflare and I'm wondering whether anyone can see (or knows from other sites) why Cloudflare might be mangling the JS or causing a problem somehow (I don't get any errors in the JS error console). Of course, if you can replicate the problem on your machine and can suggest an area to look at that would be amazing but I'm hoping that, like me, you don't see any problem with the site! Here's the site: http://www.bighornrevelstoke.com Thanks, James

    Read the article

  • Problem installing Ubuntu 10.04 64 bit side by side with Vista by using a bootable USB drive. What n

    - by Adam Siddhi
    What happened I decided to install Ubuntu 10.04 64 bit side by side with Vista Home Premium (I guess on another partition) with a USB stick. I found instructions on how to do this here: https://help.ubuntu.com/community/Installation/FromUSBStick To create the bootable USB drive I had to download a program called Unetbootin. That process was simple enough. All I had to do was just choose the disk image option, select the ubuntu-10.04-desktop-amd64.iso image, make sure it recognizes my USB drive and then press OK. It takes only like a few minutes to create a working bootable USB drive. Then I have to restart my computer, enter the BIOS, select my USB drive as the first boot drive, save options and continue with booting up. After this Ubuntu actually loads up. I think this is known as the Live version of Ubuntu so you can try it out before fully installing it. Any ways, on the Ubuntu 10.04 desktop I saw an installer. I click it and begin the installation process. Just so you know, I tried installing it 2 times. I will explain what happened each time: The first time I tried installing Ubuntu 10.04 I got stuck at step 4 of 7. I remember selecting the last option in the window which was Specify Partitions Manually (Advanced) I made my partition for Ubuntu like 52 gigs. I clicked forward and a little pop up window appeared saying Please Wait. So the installation process stalled on this window so I closed out of it and quit the installation process. So at this point I was worried because I had already selected the partition size and assumed it started making it. Since it stalled I had to quit out though. Anyways, once again I reached step 4 of 7 a decided to select the first option which is Install them side by side choosing between them each startup. I figured this was the safe way to go. I did that and the pop up window saying Please Wait popped up again but lasted only like 10 seconds. Then I got to I guess step 6 where it asks you to enter your desired name and password. Did that and clicked forward. The Ubuntu 10.04 installation load screen appeared and the loading bar at the bottom started filling up. So I got to 83% and stalled during the Importing other profile information (I think it was called this. I had the option to do this during I think step 6) process. So at this point I decided to get stop the installation process. I was getting very nervous. I tried to restart the computer but all that happened was that Ubuntu restarted. I finally got the computer to restart. I was pretty sure I had screwed something up big time by this point. As my computer was restarting I entered BIOS again and switched back to it booting from my main hard drive containing Vista. Saved it and continued the boot process. My worst fears were confirmed as Vista would not boot up. I mean I saw the little Microsoft Windows choppy animated green loading bar at the bottom of the screen and then boom! It decided to restart. When it restarted I had the option to run a memory test check to see if there was anything that needed to be repaired. That took like 20 minutes and at the end I saw that I did indeed have to repair something. I had to go through 2 repair processes. After each I had to restart the computer. The 2nd time it went through the repair process it said that it could not fully repair the damage. I was scared and restarted but Vista did load up. I got to my desktop and saw a message saying something like Repairs have been made, Please restart for changes to take effect I noticed that some Notification icons were missing and I could not hear volume in a video. Things were a bit funky. So I did restart and here I am. Now what?! So since I got back into Vista and thankfully have a working Internet connection I am trying to find answers to my problem (that is why I am writing this post). I am scared that I have partioned my hard drive 2 times after researching Installing Ubuntu 10.04 and seeing this post http://techie-buzz.com/foss/ubuntu-10-04-lts-installation-guide.html The author shows screen shots of installing Ubuntu 10.04. He shows the image of step 4 of 7 with a caption at the bottom. I will recreate it below: Select a partitioning option. Unless you want to format all the hard drive and install Ubuntu afresh, select the last option and proceed. Questions If I have indeed partitioned my HD 2 times (which I am sure it is), how do I get to a point where I can see all my bad, unfinished Ubuntu partitions and get rid of them? How do I clean this big mess up? & How can I ensure that this mess will not happen next time I try installing Ubuntu 10.04? Thank you Adam

    Read the article

  • Does one's native spoken language affect quality of code?

    - by Xepoch
    There is a school of thought in linguistics that problem solving is very much tied to the syntax, semantics, grammar, and flexibility of one's own native spoken language. Working with various international development teams, I can clearly see a mental culture (if you will) in the codebase. Programming language aside, the German coding is quite different from my colleagues in India. As well, code is distinctly different in Middle America as it is in Coastal America (actually, IBM noticed this years ago). Do you notice with your international colleagues (from ANY country) that coding style and problem solving are in-line with native tongues?

    Read the article

  • Are there non-programming related activities akin to solving programming problems ?

    - by julien
    I'm talking about particular activities, for which you can draw parallels with the specific kind of reasonning needed when solving programming problems. Counter examples are activities that would help in almost any situation, like : take a shower or any other, somewhat passive activities, which are only helpful in triggering this sort of asynchronous problem solving our brain does exercise, because you brain simply works better when you're fit EDIT : It seems this question was quite misunderstood. I wasn't asking about what you can do when stuck on a problem but rather, what kind of activities you have in you spare time that you think help you, more or less directly, solving programing problems.

    Read the article

  • Dealing with frustration when things don't work.

    - by John Isaacks
    You ever try to implement something simple but for some strange reason it doesn't work. So you try a possible solution but then something else doesn't work. You keep trying different workarounds but every time something different isn't working. Every time you get one step closer you also get one (or more) step farther from solving this problem and its now been 3 hours when this should have taken you 10 minutes. And it still isn't solved. There is no one in your company who can help, and you are about to put your fist through your screen. At this point you are so frustrated you can no longer think about the problem clearly. What should you do at this point? Or what can you do to avoid reaching this point?

    Read the article

  • How do you properly word a Google search when you don't even have a solution in mind? [closed]

    - by Bruno Romaszkiewicz
    So, I'm stuck on a problem, looking for a solution, my rubber duck can't help me, my co-workers can't help me. Next natural step is research, right? Google can help me, He always can. Or so I'm told. My problem is, I never found much use for Google when looking for a programming solution, it's very useful for finding how to implement one, but when you don't even know where to start, how do you properly word a Google search? Is there any other option?

    Read the article

  • My first time in the gambling industry

    - by sfrj
    I am a Java enterprise developer with almost 3 years of professional experience. Soon i am going to have a face to face interview with a company in the gambling industry. I already did successfully a phone screening and now for the personal interview i suppose they will ask me about some kind of white board problem or system design task. I think i am in the right place to ask about this, and would appreciate a lot if someone would give me some tips or share something related to his own experience. The things i am more interested in regarding my interview are: What are the most common challenges for programmers, in this industry? Any idea or suggestion on a white board problem they may ask me? Could you point me to some links where i can find information on the topic or sample problems in this industry?. I personally find this question very interesting not just for me. Also i think, the given answers can help also others in a similar situation. Just what i want to say whit this last comment is: Please avoid, answers like: www.google.com and so on...

    Read the article

  • Calculating 3d rotation around random axis

    - by mitim
    This is actually a solved problem, but I want to understand why my original method didn't work (hoping someone with more knowledge can explain). (Keep in mind, I've not very experienced in 3d programming, having only played with the very basic for a little bit...nor do I have a lot of mathematical experience in this area). I wanted to animate a point rotating around another point at a random axis, say a 45 degrees along the y axis (think of an electron around a nucleus). I know how to rotate using the transform matrix along the X, Y and Z axis, but not an arbitrary (45 degree) axis. Eventually after some research I found a suggestion: Rotate the point by -45 degrees around the Z so that it is aligned. Then rotate by some increment along the Y axis, then rotate it back +45 degrees for every frame tick. While this certainly worked, I felt that it seemed to be more work then needed (too many method calls, math, etc) and would probably be pretty slow at runtime with many points to deal with. I thought maybe it was possible to combine all the rotation matrixes involve into 1 rotation matrix and use that as a single operation. Something like: [ cos(-45) -sin(-45) 0] [ sin(-45) cos(-45) 0] rotate by -45 along Z [ 0 0 1] multiply by [ cos(2) 0 -sin(2)] [ 0 1 0 ] rotate by 2 degrees (my increment) along Y [ sin(2) 0 cos(2)] then multiply that result by (in that order) [ cos(45) -sin(45) 0] [ sin(45) cos(45) 0] rotate by 45 along Z [ 0 0 1] I get 1 mess of a matrix of numbers (since I was working with unknowns and 2 angles), but I felt like it should work. It did not and I found a solution on wiki using a different matirx, but that is something else. I'm not sure if maybe I made an error in multiplying, but my question is: this is actually a viable way to solve the problem, to take all the separate transformations, combine them via multiplying, then use that or not?

    Read the article

  • Trouble with my website and IE7

    - by Hamish Hagaheygui
    Hi there, sorry im new here but i have a serious problem; I changed the CSS style sheet for IE7 for my site http://bumblebbids.com , but now when using IE7 it has no graphics and all of the scripts code is printed ; I have tried replacing the original stylesheet but it made no difference, so please suggest ways that i can fix this? If not, would it be possible to have a 'Incompatible browser' message that only appears for IE7 users? Thanks

    Read the article

  • Is there a "good enough" solution for the halting problem?

    - by EpsilonVector
    It is known that the halting problem cannot have a definite solution, one that a) returns true <== the program does indeed halt, and b) handles any input, but I was wondering if there are good enough solutions to the problem, ones that can maybe handle certain types of program flows perfectly, or is able to identify it when it cannot correctly solve the problem, and so on.... If so, how good are they, and what ideas/limitations do they rely on?

    Read the article

  • Problem solving/ Algorithm Skill is a knack or can be developed with practice?

    - by KaluSingh Gabbar
    Every time I start a hard problem and if can not figure out the exact solution or can not get started, I get into this never ending discussion with myself, as below: That problem solving/mathematics/algorithms skills are gifted (not that you can learn by practicing, by practice, you only master the kind of problems that you already have solved before) only those who went to good schools can do it, as they learned it early. What are your thoughts, can one achieve awesomeness in problem solving/algorithms just by hard work or you need to have that extra-gene in you?

    Read the article

  • Automatically analyze excel files

    - by dole doug
    I have to replicate a manual generation of a large number of excel files. I started to manually track the relations between cells ( files, formulas, etc). I also had a talk with the person which generates those files. For now I have a general understanding about how the excel files are generated, but "devil is in the details". I assume that I can write a script which will generate the hierarchy between cells and files, but this might require the same effort as manually noticing the relations. Also, I'm afraid that I'm not too experienced and my app is more prone to error approach than a manual analyze. How to handle this problem? Do you know about an open source project which analyze the excel files in a recursive mode following the formulas ?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >