This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - AngelFish
Pages: 1 ... 49 50 [51] 52 53 ... 215
751
« on: June 17, 2011, 05:40:57 am »
As nice as it is to use HL, when you need to pass parameters back, chances are you'll end up storing it in a variable at some point. If you define a specific set of variables to be used for parameter passing, then your subroutine is no different than an object in OO language.
752
« on: June 17, 2011, 05:36:48 am »
Would you mind installing the Code Box template, Juju? Also, you should secure your front page. It's probably not a good idea to leave it editable by unregistered people.
753
« on: June 17, 2011, 03:09:23 am »
Well, you're not declaring x to be anything but null, so..
754
« on: June 17, 2011, 02:17:37 am »
As an alternative to the pain in the butt that is Mediawiki, I've heard some good things about Dokuwiki.
755
« on: June 17, 2011, 01:26:46 am »
Actually, it assumes a value from 0x0 to 0xF, which just proves that BCD is better
756
« on: June 17, 2011, 12:59:03 am »
Bingo.
757
« on: June 17, 2011, 12:58:22 am »
I recommend storing in decimal because he's going to have to output the values in human-readable format. I assume he won't want to make a routine to extract decimal digits from a large binary number.
It's not terribly difficult to convert to decimal, but yeah. Example psuedo-code for Hex array->Dec: int arraysize; char *array; char *output; int j = 0; For(i,i<arraysize,i++) { stream = *array[i];
if stream>0x0A { *array[j] = 0x31; j = j+1; stream = stream % 10; } *array[j] = stream + 0x30; j = j+1; }
758
« on: June 17, 2011, 12:41:25 am »
Ah, doubles will hold numbers as large as 170! but will you get all of the decimal precision? I think not, if I remember correctly the double in C only allows for around 16 decimal digits
If it's an integer data type, then yes. A double floating point number will not have the precision, though. As for BCD... Anyone who uses BCD for any reason other than ease of use should be shot  You get all the precision of a floating point number with a little more than half the space efficiency. If you need to operate on large numbers without math.h, then I recommend using arrays to store your numbers. 100! takes up 66 bytes in integer format, so a custom routine that malloc's an array and then applies the operations to that array will be able to represent massive numbers with no loss of precision. You'll also likely want to improve that algorithm with numbers like 100!
759
« on: June 17, 2011, 12:29:01 am »
17 is the optimal solution and let me assure you the solution does not involve anything tricky like leaving members in the middle of the bridge or anything 
Yep EDIT: My Linux automatically threw this link into this post, so enjoy http://community.linuxmint.com/
760
« on: June 17, 2011, 12:07:00 am »
From a game theory perspective, I'd have to agree that 19 is the minimum amount of time it can take unless there is something fundamental about this problem that I'm not understanding (which I assume there is).
-Each trip across must be a full trip due to the 3 person rule. Otherwise it could only increase the time.
Going forwards across the bridge, yes. One person must necessarily travel back across the bridge to bring the lamp back to the others. But I assure you that 19 is *not* the minimum time required and I also highly recommend not using Google for the answer.
761
« on: June 16, 2011, 07:36:00 pm »
That's still not the optimal solution
762
« on: June 16, 2011, 07:22:00 pm »
Four travelers, Mr. A, B, C, and D, have to cross a bridge over a deep ravine. It 's a very dark night and the they have only an old fashioned oil lamp for light. The light is essential for successfully crossing the ravine because the bridge is very old and has a lot of holes and loose boards. Even worse, its construction is really quite weak, and in its dilapidated condition, it can only support two of the men at a time. They are also out of cell phone range and are so unable to call for help. If two men cross the bridge together, the time for them to cross is equal to the crossing time of the slower man because the faster man must help the other along.
How should the men arrange themselves to cross the bridge in the fastest possible time?
Mr. A takes 1 minute to cross the bridge. Mr. B takes 2 minutes to cross. Mr. C takes 5 minutes to cross. Mr. D is recovering from surgery and takes 10 minutes to cross.
Example (not the best solution):
A and D cross first, taking 10 minutes to cross. A returns with the light, taking another 1 minute. B and C cross, taking 5 minutes. B returns with the light in 2 minutes. A and B cross, taking 2 more minutes. Total time = 10+1+5+2+2 = 20 Minutes.
It took me about 5 minutes to solve this problem. How long did it take you?
763
« on: June 16, 2011, 07:01:32 pm »
Guide to using Axe to its full functional form I'm not saying your guide isn't useful (+1), but Axe is a procedural/imperative language, not a functional one. Saying that it has a "full functional form" is kind of misleading. It's more accurate to say that you can synthesize other paradigms from imperative languages.
764
« on: June 16, 2011, 06:46:42 pm »
Yes, it's down for good. That address in particular was a feature of the former hosting provider and it's no longer available (unless someone wants to tell me how to set it up?).
765
« on: June 16, 2011, 04:51:30 pm »
Okay, Josjuice brought up an error that Prizmwiki was returning database errors. As it turns out, the database cache was pretty much fried. The problem has been fixed.
Pages: 1 ... 49 50 [51] 52 53 ... 215
|