July 5th, 2010
I have always known that Ruby had bad performance, but I did not think it was this bad. Somehow ugliness correlates very well with higher performance. Surely you should pick the language that fits your challenges.
real: Elapsed real time in seconds
user: Total number of CPU-seconds that the process spent in user mode.
sys: Total number of CPU-seconds that the process spent in kernel mode.
Ruby
def fib(n)
n < 2 ? n : fib(n-1) + fib(n-2)
end
puts fib(45).to_s
time ruby fibonacci.rb
real 9m6.761s
user 1m52.923s
sys 7m4.379s
Java
public class Fib {
public static int fib(int n){
return n < 2 ? n : fib(n-1)+fib(n-2);
}
public static void main(String Args[]) {
System.out.println("fib 45 " + fib(45));
}
}
real 0m14.773s
user 0m13.589s
sys 0m0.073s
c
#include <stdio.h>
int fib(int n){
return n<2 ? n : fib(n-1)+fib(n-2);
}
int main() {
printf("Fibonacci 45 %d",fib(45));
}
Fibonacci 45 1134903170
real 0m10.948s
user 0m10.699s
sys 0m0.040s
(gcc -O3)
Tags: c, fibonacci, Java, Ruby
Posted in Uncategorized | 2 Comments »
June 6th, 2010
Posted in Uncategorized | No Comments »
May 31st, 2010
Tags: random
Posted in Uncategorized | No Comments »
May 28th, 2010
See it gratis here:
http://www.archive.org/details/The.House.of.Rothschild
It gives some historical background to the Napoleonic Wars – and of course financial wars…

Posted in Uncategorized | No Comments »
April 13th, 2010
Posted in Uncategorized | 1 Comment »
March 29th, 2010
kl 815 i dag; gav Dyrlægen Chap den sidste sprøjte – Chap havde haft en hård weekend, hvor han havde svært ved at spise.
Chap blev 16 år.

Men nu er Snowball kommet på heden, og den har fået et nyt navn ‘Snutbollen”, Og den er kommet ud af sin spiseforstyrelse.

Posted in Uncategorized | No Comments »
February 9th, 2010
Ja! jeg er ikke druknet i en svømmepøl, eller blevet kvalt af min egen opkast – jeg er heller ikke død af en overdosis heroin – jeg har heller ikke skudt mig selv med en shutgun – og mit hjerter tikker stadig. Nu er der simpelthen en klub jeg ikke må være med i. Det er ikke nemt at blive gammel….
Posted in Uncategorized | No Comments »
December 26th, 2009
What you might want to setup the computer in advanced, such that it seems like a complete system. Here is some of the things for which I found to be essential
medibuntu.org
sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list –output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get –yes -q –allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update
sudo apt-get install w32codecs libdvdcss2 googleearth non-free-codecs realplayer skype ssh flashplugin-nonfree openjdk-6-jre
Wine
https://help.ubuntu.com/community/Wine
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/winehq.list
apt-get install wine
ies4linux
$ wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
$ tar -zxvf ies4linux-latest.tar.gz
$ cd ies4linux-*
./ies4linux
VirtualBox seenlessly windows
There is a nice guide here http://www.raiden.net/articles/virtualbox_in_seamless_mode/
For me I just had to edit the ‘Desktop key’ regedit to x:
else it would make a directory called ;
To help her with the technicalities I have made two shortcuts on the Desktop
one called windows start;
VBoxManage startvm thenameofthevm
and the other windows shutdown
VBoxManage controlvm thenameofthevm savestate
I Also disabled compiz(what ever makes wobbly windows by default), because it did not work well with Virtualbox seemlessly windows
Now your girlfriend can have a stable superset of whatever she had before. One of my major hurtles with the windows platform is the impossibleness of giving support.
Tags: guide, Linux, X girlfriend converting to ubuntu
Posted in Uncategorized | 1 Comment »