Dave

around

galos.no-ip.org

Age: 24

I love C. Java less.

All original source snippets I post on stackoverflow are dedicated to the public domain. Do with them as you see fit.

Jul
23
awarded Popular Question
Jul
19
awarded Yearling
Jul
2
awarded Curious
Jun
13
awarded Nice Answer
Jun
13
awarded Enlightened
May
1
comment How slow is python really? (Or how fast is your language?)
your my_random is considerably slower than it needs to be; given res=(seed>>30)&3, replacing the switch with (res&1)-!!(res&2) is nearly thrice as fast on my machine
Mar
5
awarded Good Answer
Feb
18
comment Minimal code CPU stress-tester…
if you use @ace's scanf trick, you can get this down to 39: main(a){for(scanf("%d",&a),alarm(a);;);}
Dec
9
comment Using MongoDB data inside Hadoop with the help of Morphia
The reason that questions persist is so that they can be helpful to others. This is a really bad way of doing this, and I want to indicate that to future viewers. I only found this question because I needed the answer for something I'm working on now.
Dec
9
comment Type "Hello, World!"
No need to call tty it only works if stdin is a tty, in which case, 0 is already an open terminal fd.
Dec
9
awarded Autobiographer
Dec
9
comment Should we check if memory allocations fail?
@harris !v is equally as valid as v == NULL
Dec
9
comment Using MongoDB data inside Hadoop with the help of Morphia
-1: This is not the way to do this. There is no need to serialize and unserialize your data just to perform such a trivial conversion
Dec
9
answered Using MongoDB data inside Hadoop with the help of Morphia
Jul
16
awarded Yearling
Jun
13
comment Are there any practical differences between constructing a string via strdup() and malloc()?
@VladLazarenko snprintf() always terminates the string, you are thinking about the strncpy(). It's the second pargraph in the manpage
May
31
comment Careers 2.0 - Add project button does nothing
The problem seems to have been resolved
May
30
asked Careers 2.0 - Add project button does nothing
Apr
29
comment Build static ELF without libc using unistd.h from Linux headers
I did, but I also read the hand-waving you used to justify the 5K filesize. The dietlibc file, properly initialized and unstripped comes to 2.7K. I do find it interesting to see exactly how much glibc bloat is actually from the startup. I think that what you do could be more explicit from the start, and that -nostartfiles should be used rather than -nostdlib -lc
Apr
29
comment Build static ELF without libc using unistd.h from Linux headers
My point is that even write() is a "standard library" function and that not linking _start() is pretty much indefensible. And, if your binary is still 5K, then glibc's write() is absolutely bloated.
1 2 3 4 5