Search Results

Search found 69247 results on 2770 pages for 'problem solving'.

Page 14/2770 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Generating all unique combinations for "drive ya nuts" puzzle

    - by Yuval A
    A while back I wrote a simple python program to brute-force the single solution for the drive ya nuts puzzle. The puzzle consists of 7 hexagons with the numbers 1-6 on them, and all pieces must be aligned so that each number is adjacent to the same number on the next piece. The puzzle has ~1.4G non-unique possibilities: you have 7! options to sort the pieces by order (for example, center=0, top=1, continuing in clockwise order...). After you sorted the pieces, you can rotate each piece in 6 ways (each piece is a hexagon), so you get 6**7 possible rotations for a given permutation of the 7 pieces. Totalling: 7!*(6**7)=~1.4G possibilities. The following python code generates these possible solutions: def rotations(p): for i in range(len(p)): yield p[i:] + p[:i] def permutations(l): if len(l)<=1: yield l else: for perm in permutations(l[1:]): for i in range(len(perm)+1): yield perm[:i] + l[0:1] + perm[i:] def constructs(l): for p in permutations(l): for c in product(*(rotations(x) for x in p)): yield c However, note that the puzzle has only ~0.2G unique possible solutions, as you must divide the total number of possibilities by 6 since each possible solution is equivalent to 5 other solutions (simply rotate the entire puzzle by 1/6 a turn). Is there a better way to generate only the unique possibilities for this puzzle?

    Read the article

  • Need help programming with Mclauren series and Taylor series!

    - by user352258
    Ok so here's what i have so far: #include <stdio.h> #include <math.h> //#define PI 3.14159 int factorial(int n){ if(n <= 1) return(1); else return(n * factorial(n-1)); } void McLaurin(float pi){ int factorial(int); float x = 42*pi/180; int i, val=0, sign; for(i=1, sign=-1; i<11; i+=2){ sign *= -1; // alternate sign of cos(0) which is 1 val += (sign*(pow(x, i)) / factorial(i)); } printf("\nMcLaurin of 42 = %d\n", val); } void Taylor(float pi){ int factorial(int); float x; int i; float val=0.00, sign; float a = pi/3; printf("Enter x in degrees:\n"); scanf("%f", &x); x=x*pi/180.0; printf("%f",x); for(i=0, sign=-1.0; i<2; i++){ if(i%2==1) sign *= -1.0; // alternate sign of cos(0) which is 1 printf("%f",sign); if(i%2==1) val += (sign*sin(a)*(pow(x-a, i)) / factorial(i)); else val += (sign*cos(a)*(pow(x-a, i)) / factorial(i)); printf("%d",factorial(i)); } printf("\nTaylor of sin(%g degrees) = %d\n", (x*180.0)/pi, val); } main(){ float pi=3.14159; void McLaurin(float); void Taylor(float); McLaurin(pi); Taylor(pi); } and here's the output: McLaurin of 42 = 0 Enter x in degrees: 42 0.733038-1.00000011.0000001 Taylor of sin(42 degrees) = -1073741824 I suspect the reason for these outrageous numbers goes with the fact that I mixed up my floats and ints? But i just cant figure it out...!! Maybe its a math thing, but its never been a strength of mine let alone program with calculus. Also the Mclaurin fails, how does it equal zero? WTF! Please help correct my noobish code. I am still a beginner...

    Read the article

  • Closest Approach question for math/physics heads

    - by Kyle
    I'm using a Segment to Segment closest approach method which will output the closest distance between two segments of length. These objects are moving at variable speed each, so even when it succeeds I'm currently using a 10-step method and calculating the distance between 2 spheres as they move along the two segments. So, basically the length of each segment is the object's traverse in the physics step, and the radius is the objects radius. By stepping, I can tell where they collide, and if they collide (Sort of; for the MOST part.).. I get the feeling that there could be something better. While I sort of believe that the first closest approach call is required, I think that the method immediately following it is a TAD weak. Can anyone help me out? I can illustrate this if needed. Thanks alot!

    Read the article

  • What Does OSGi Solve?

    - by Pablo Fernandez
    I've read on wikipedia and other sites about OSGi, but I don't really see the big picture. It says that it's a component based platform, and that you can reload modules at runtime. Also the "practical example" given everywhere is the Eclipse Plugin Framework. My questions are: 1) What is the CLEAR and SIMPLE definition of OSGi? 2) What COMMON PROBLEMS does it solve? By "common problems" I mean problems we face everyday, like "what can OSGi do for making our jobs more efficient/fun/simple" Thanks.

    Read the article

  • best practices - multiple functions vs single function with switch case

    - by Amit
    I have a situation where I need to perform several small (but similar) tasks. I can think of two ways to achieve this. First Approach: function doTask1(); function doTask2(); function doTask3(); function doTask4(); Second Approach: // TASK1, TASK2, ... TASK4 are all constants function doTask(TASK) { switch(TASK) { case TASK1: // do task1 break; case TASK2: // do task2 break; case TASK3: // do task3 break; case TASK4: // do task4 break; } } A few more tasks may be added in future (though the chances are rare. but this cannot be ruled out) Please suggest which of the two approaches (or if any other) is a best practice in such a situation.

    Read the article

  • Most efficient way to solve system of equations involving the digamma function?

    - by Neil G
    What is the most efficient way to solve system of equations involving the digamma function? I have a vector v and I want to solve for a vector w such that for all i: digamma(sum(w)) - digamma(w_i) = v_i and w_i 0 I found the gsl function gsl_sf_psi, which is the digamma function. Is there an identity I can use to reduce the equations? Is my best bet to use a solver? I am using C++0x; which solver is easiest to use and fast?

    Read the article

  • What is the most efficient way to solve system of equations containing the digamma function?

    - by Neil G
    What is the most efficient way to solve system of equations involving the digamma function? I have a vector v and I want to solve for a vector w such that for all i: digamma(sum(w)) - digamma(w_i) = v_i and w_i 0 I found the gsl function gsl_sf_psi, which is the digamma function (calculated using some kind of series.) Is there an identity I can use to reduce the equations? Is my best bet to use a solver? I am using C++0x; which solver is easiest to use and fast?

    Read the article

  • What good timesheet should and shouldn't have for a small (non programming) 50 people company?

    - by MadBoy
    I'm sure most people here had to fill at least one time sheet in their life that made their life miserable, hell it's even the worst time taker ever especially after you have to fill it in hurry. I will be developing some simple TimeSheet application for a small company of 50 people (non programming related, it's actually 4 companies working together) and would like it to be user friendly and as less disturbing as possible. So what in your opinion makes it a good timesheet (lack of it doesn't count :p), what data it should store? Should be only hours per day with possibility to choose project, company and simple overview what you have worked on like: Day 1, 3:00, 'Company 1', 'Project5', 'Name', Short Overview Day 1, 5:00, 'Company 2', 'Project6', 'Name', Short Overview Or should it gather more data? Would it be realy bad if it were an WinForms application considering that I don't know ASP.NET or any other web based language? I would be deploying it using ClickOnce or so.

    Read the article

  • Getting Preferred, Varied Products -- Tough Pseudocode Question

    - by Volomike
    I have a Dallas client who has given me a tough process to work out. I'm seeking your advice. I use PHP, but the language doesn't matter. We can work this out in pseudocode. In a nutshell, this involves showing products on a page based on matching keyword phrases, and using a preferred product provider, but varying this up so that I try to show products from each provider as much as possible when I can. He has 3 product companies: Amazon, eBay, and Overstock. I already have worked out with the API to get products back in an array via a function. He wants to give the user the preference of which one to use primarily -- so a priority number on each. He wants to display anywhere from 1 to 6 products on a page from them. Let's go with 6 for now in this example to start with. Let's assume Amazon first, then eBay, then Overstock as far as priority. He wants me to attempt to take a keyword phrase and find relevant products (all the keywords found in product title) from Amazon, eBay, and Overstock. If we find 1 product from each provider, he wants me to only display one product from each. But if we run out of a particular provider with a matching product, I start over again and grab another product from another provider until we reach 6 products. If there just aren't 6 relevant products, then I do the best I can -- even if I only display one product. If no relevant products, then I don't display anything.

    Read the article

  • how to get unique values set from a repeating values list

    - by Mariselvam
    I need to parse a large log file (flat file), which contains two column of values (column-A , column-B). Values in both columns are repeating. I need to find for each unique value in column-A , I need to find a set of column-B values. Is this can be done using unix shell command or need to write any perl or python script? What are the ways this can be done? Example: xxxA 2 xxxA 1 xxxB 2 XXXC 3 XXXA 3 xxxD 4 output: xxxA - 2,1,3 xxxB - 2 xxxC - 3 xxxD - 4

    Read the article

  • Toshiba Qosmio: Battery Stuck at 60%, does not Charges, PC can't power up, can't remain on with out

    - by Fellknight
    Just like the tittle says, now let me try to give some more detail about the symptoms; The battery is stuck at 60 percent (68% at the moment of this writing).When hovering over the battery icon in Windows 7 Home Premium x64 it reads:"68% available (plugged in, charging)", there's no x or any sing the OS is displaying any error. No matter how much time left connected to the AC adapter the battery doesn't charge, it seems however it continues to discharge at its normal rate when disconnected from the laptop (about 1% each 2 weeks). Now this last symptom is the one i find most strange it "seems" the laptop somehow isn't recognizing the battery because even with the remaining charge of 60%(ish) the laptop wont power up or remain on if disconnected from its AC adapter(if it's on and is unplugged it will immediately turn off). Meaning that even with the battery attached correctly in its right place is as if running the laptop with no battery at all. Toshiba's Utilities haven't detected anything strange (or anything for that matter) with the battery or the hardware. The laptop when in use is connected 90% of the time to a Belkin surge protector (like my 1TB EHD). The protector is working correctly (green light on) and the 1TB HD too, thus a power surge having damaged it's very unlikely. Thnx in advance

    Read the article

  • Motherboard on, but nothing will start

    - by Geeklat
    I'll try and be as clear as possible. Recently I purchased a barebones kit for my first attempt at a full PC assembly. I've gone through and connected all the parts correctly based on numerous examples that confirm everything is connected correctly. The motherboard and the video card are receiving power based on the fact that the motherboard's power LED is on and the video card has some LEDs on. Nothing else in the computer will come on when pressing the power button on the case. No fans, no hard drive, no CPU fan. Not even for a split second. I also receive no beeping noise from the speaker connected to the motherboard. I've also tried swapping the reset and power connectors from the front of the case to no luck.

    Read the article

  • Why does winamp now play video very fast without sound in vidamp?

    - by gr33d
    Whenever I open a video in Winamp now, it loads in a new winamp-plugin-looking-window titled, "Vidamp", it plays very quickly (about 1 hour plays in 30 seconds) and without sound. I can't figure out how to disable this Vidamp plug-in if that's even what it is. Could this have anything to do with VLC Media Player? When I play a video in VLC, for some reason I can control the volume using Winamp in the background?!? Thanks in advance

    Read the article

  • JDownloader: lost my queue

    - by Fuxi
    hi, unfortunately my jDownloader crashed and my queue is empty. i've googled already and unzipped the database.zip into the config dir - but didn't help. any ideas how to get my queue back? thx

    Read the article

  • VPN Connects with local access only

    - by user20102
    I have Windows Server 2008 and I have set up a VPN. When a user logs into their VPN they can not view the internet. It comes up as local access only on the the client PC. On the server when I go to the Network And Sharing Centre it displays (Network) with local and internet below it has the RAS Dial-in interface and it displays as local only there as well. I want all users that connect to my VPN to have internet access (full access). If anyone can help me it would be appreciated. Also I've activated dial-in properties and I've done it via policy who can access the VPN and internet. It still doesn't work, but there is a connection but just local only. Thanks

    Read the article

  • Keynote changes Exposé shortcuts

    - by cpak
    Hey, Since upgrading to Snow Leopard (I think) playing a Keynote slide-show changes my Exposé shortcut keys. I have Exposé on Ctrl+KEY but after slide-show the its just KEY, the Ctrl-part is gone. I've tried toggling the "Allow Exposé... to use screen" option, no result. Any ideas?

    Read the article

  • Installing Exchange 2010 Error with Ipv6 disabled/enabled

    - by MadBoy
    I've tried installing Exchange 2010 on Windows 2k8 R2. Following error occurred when installing Hub Transport Role. Hub Transport Role Failed Error: The following error was generated when "$error.Clear(); install-ExsetdataAtom -AtomName SharedMachineSettings -DomainController $RoleDomainController" was run: "An error occurred with error code '2147950640' and message 'There is no such object on the server.'.". An error occurred with error code '2147950640' and message 'There is no such object on the server.' I have tried installation with both IPV6 turned on and off. Both failed and both required me to do some magic to uninstall Exchange, and try installation again. Feel free to shoot your ideas what can be done to resolve the error. In the end I will install HyperV and put Exchange 2010 on different server but that's not what the server owner wanted.

    Read the article

  • missing NTLDR / no CD drive recognition

    - by Daems
    I formatted C: after installing win 7 on F: partition. on startup reported missing NTLDR changed boot seq to CD. only bleep sounds and failing boot. I could try to put the files on a USB stick and boot, but are there better options ?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >