March 08, 2009 Archives

2009-03-08 21:28:53

mfactorial

Recently, I was playing around with the GNU Multiple Precision Arithmetic Library. While most of the resulting code snippets are pretty much useless, the attached C program might be worth a blog entry. It calculates the factorial of a given number. At first glance, nothing special at all, but it does this task rather fast:

/* Naive algorithm*/
time ./fak  500000 > /dev/null 

real    2m4.756s
user    2m4.637s
sys     0m0.094s


/*mfactorial*/
time ./mfactorial 500000 > /dev/null 

real    0m7.855s
user    0m13.226s
sys     0m0.050s
Maybe I'll re-implement the whole thing using a real clever algorithm (e.g. split-recursive) some day, but for now, I'm content with the current speed. :-)


BTW: The compiling instructions are included in the *.c file

Posted by haui | Permanent Link | Categories: misc, linux

2009-03-08 20:24:21

yaydl 0.9.1a

I just finished my work on yaydl 0.9.1a.
The most significant change might be the support for HD videos on youtube. Furthermore, if no HD version is available, yaydl will download the videos intended for IPODs (mp4 instead of flv) by default. You may override this behaviour by adding the --forceflv parameter to your command-line.



Posted by haui | Permanent Link | Categories: projects