Some how, I think if I was the type for it, I would be stone cold drunk tonight… but as it is, I am sober as a codfish =/ Getting lit never helped any thing and my Families history is enough that it is not a fond concept. Although I must admit, a nice mixture of wodka, rum, and a little lemon juice does sound like an interesting idea.. Oh well, a spider can think lol.

trying to see if I can get QT (and possibly KDE) bindings for Ruby installed, I’ve had no luck with qtruby yet but so far korundum-3.5.5 is doing good, hope I don’t jinx it =/.

That’s not why I feel like getting drunk though, but even if I was that kind of person I’ve got to much crap to get done then to worry about it.

It is strange, how being busy is a two edged sword, in that it does have it’s advantages but it can be so damn exhausting some days !

damn, the build just blew, would be bloody nice if it would tell me *which* library is missing. Oh well, it’s not important. Hmm, what else to work on…

Funky dreams

From taking part in a commando raid on an out post, gone bad….

To being stuck on an Air Craft Carrier in the middle of a typhoon with a very Hot Blonde, and oh yeah how could I forget the dozens of goons with MP5’s trying to steal the ship! Oh well, what is a little adventure on the high sea without a woman that can fight?

All the way to being first mate on a rather super natural pirate ship = Like a cross between the Pirates of the Caribbean and a dark rendition of a old Peter Pan fairy tail.

I must admit, some times I have some very strange dreams.. Normally though it usually involves me coding, playing, or ‘taking a role in’ a Video Game or crack-pot adventure of some sort lol.

A more normal string of dreams for me would include joining the Colonial Marines for a bug hunt with a trusty M41A Pulse Rifle in hand. Once I even dreamed of fighting a Queen Alien one on one afther they took over a school building and chased me down… good thing Predators can make acid proof knifes 😉

I still remember one from many years ago though, rofl After fighting my way through 5y3 hive. I had signed a peace treaty ending the hostilities … and the Queen Alien endpushed me out an airlock xD

I don’t have nightmares but I do have the craziest dreams when I do get any +S

I’ve compiled all of my stored bookmarks (aside from the handfull on my laptop) into a single flat file…

One URL per line with a grand total of 662 lines.

Plenty are just enqueued to be read while others are perm storage.

Not bad for about 10 years of surfing =/

Now neatly redoing my bookmarks on ma.gnolia is the next big project of the day :'(.

And in the near future, properly using this for all my bookmarking needs.. lol.

Wasting time with the Euclidean Algorithm

The other night, I was very bored so… When I remembered reading about the Euclidean Algorithm on Wikipedia, which is a method of finding the greatest common denominator (gcd). I fed several implementations through ye ol’time(1) to get a rough idea of what differences they made.

At first I did it in Ruby and C for comparison, then I recompiled the *.c files with maximum optimization. Tonight I added a set of Java and Python files to the setup, I’ll probably include Bourne Shell and Perl later for fun.

For any one interested,

C // no optimization
./iteration 0.00s user 0.00s system 50% cpu 0.003 total
./recursion 0.00s user 0.00s system 66% cpu 0.002 total
./original 0.00s user 0.00s system 57% cpu 0.003 total
Ruby
./iteration.rb 0.01s user 0.00s system 59% cpu 0.014 total
./recursion.rb 0.00s user 0.00s system 79% cpu 0.010 total
./original.rb 0.00s user 0.01s system 75% cpu 0.010 total
C // optimized, -O3
./iteration-o 0.00s user 0.00s system 48% cpu 0.003 total
./recursion-o 0.00s user 0.00s system 32% cpu 0.005 total
./original-o 0.00s user 0.00s system 37% cpu 0.004 total
Java
java EuclideanIteration 0.39s user 0.38s system 66% cpu 1.165 total
java EuclideanRecursion 0.48s user 0.30s system 72% cpu 1.066 total
java EuclideanOriginal 0.36s user 0.42s system 67% cpu 1.155 total
Python
./iteration.py 0.01s user 0.01s system 59% cpu 0.034 total
./recursion.py 0.01s user 0.01s system 65% cpu 0.032 total
./original.py 0.01s user 0.01s system 65% cpu 0.031 total

done with:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd6]
gcc version 3.4.6 [FreeBSD] 20060305
javac 1.5.0
Python 2.5.1

The C versions were the same sources but compiled with -O3 for the optimized
version.

I’ve assigned each outcome a score, 3 for what I feel is fastest, 2 for the intermediate (often close) and 1 for the worst and totalled it:

method  C RB C(-O3) Java Python Total
iteration 2 1 3 2 2 10
recursion 3 2 2 1 1 9
original 1 3 1 3 3 11

And the code, which I tried to keep similar. Also the gcd()/mygcd() routines were always implemented as a function because of the recursive version in the tests.

#include <stdio.h>

#define A 1071
#define B 1029

int
mygcd( int a, int b ) {
int t = 0;
while ( b != 0 ) {
t = b;
b = a % b;
a = t;
}
return a;
}

int
main(void) {
mygcd(A, B);
return 0;
}


#include <stdio.h>

#define A 1071
#define B 1029

int
mygcd( int a, int b ) {
if ( b == 0 ) {
return a;
} else {
return mygcd( b, a%b );
}
}

int
main(void) {
mygcd(A, B);
return 0;
}


#include <stdio.h>
#define A 1071
#define B 1029


int
mygcd( int a, int b ) {
while ( b != 0 ) {
if ( a > b ) {
a = a-b;
} else {
b = b-a;
}
}
return a;
}

int
main(void) {
mygcd(A, B);
return 0;
}

#!/usr/local/bin/ruby -w

def gcd(a, b)
while b != 0
t = b
b = a % b
a = t
end
return a

gcd( 1071, 1029 )
#!/usr/local/bin/ruby -w

def gcd(a,b)
if b == 0
return a
else
return gcd(b, a % b )
end
end

gcd( 1071, 1029 )
#!/usr/local/bin/ruby -w

def gcd( a, b )
while b != 0
if a > b
a = a - b
else
b = b - a
end
end
return a
end

gcd( 1071, 1029 )

class EuclideanIteration {
static final int A = 1071;
static final int B = 1029;

public static int
mygcd( int a, int b ) {
int t = 0;
while ( b != 0 ) {
t = b;
b = a % b;
a = t;
}
return a;
}

public static void
main( String[] args ) {
mygcd(A, B);
}
}



class EuclideanRecursion {
static final int A = 1071;
static final int B = 1029;

public static int
mygcd( int a, int b ) {
if ( b == 0 ) {
return a;
} else {
return mygcd( b, a%b );
}
}


public static void
main( String[] args ) {
mygcd(A, B);
}
}


class EuclideanOriginal {
static final int A = 1071;
static final int B = 1029;

public static int
mygcd( int a, int b ) {
while ( b != 0 ) {
if ( a > b ) {
a = a-b;
} else {
b = b-a;
}
}
return a;
}


public static void
main( String[] args ) {
mygcd(A, B);
}
}

#!/usr/local/bin/python

def mygcd(a, b):
while b != 0:
t = b
b = a % b
a = t
return a


mygcd( 1071, 1029 )
#!/usr/local/bin/python

def mygcd( a, b ):
if b == 0:
return a
else:
return mygcd( b, a %b )


mygcd( 1071, 1029 )
#!/usr/local/bin/python

def mygcd( a, b ):
while b != 0:
if a > b:
a = a-b
else:
b = b-a
return a


mygcd( 1071, 1029 )

A good movie tonight, Night at the Museum. Ma likes to watch new movies but interestingly she never likes them rofl.

I enjoyed it though, much like Eight Legged Freaks it is a good movie to just sit back and let go.

S’no greatest movie ever made but still fun. Even more so for me because I love history! And the Museum of Natural History is probably the only reason I could think to visit New York other then to see the Statue of Liberty. The T-Rex on display, ohh baby would I love to get to see that. Paleontology is a field I would love to be closer to, it has always been very interesting to me, ever since I was a kid. But I don’t think my memory is good enough to even consider such a thing lol.

What I like is it is a family movie, think about it. Whats the best way to watch a film? With Family or with Friends or better yet both !!!

An interesting Apple

Could this bring the power of the command line, to the GUI?

An interesting idea, I wonder how it works from a security and flexibility point of view.

One reason I enjoy the Unix Shell is it is very easy to solve problems with the vast and expandable workbench provided. And to automate various tasks quickly, not to mention many good programs are extensible/scriptable 🙂

The only sad thing for new users of traditional unix-likes is that the interfaces are often different, such as Emacs Lisp Vs Vim Script, Various Shell scripting languages vs DOS/Windows batch files e.t.c. Although most of the best programs I’ve used do run on many different platforms hehe.

daily fortune cookie

Nothing is faster than the speed of light.

To prove this to yourself, try opening the
refrigerator door before the light comes on.

To days date is: Mon Nov 26 04:24:21 UTC 2007
Terry@Dixie$ 4:41

That so reminds me of some thing Lake posted xD

Dixie decked out

Since KateOS was a tad bit disappointing, I booted back into my PC-BSD v1.4 partition and set out to use Window Maker, by far my favorite window manager. I love the look and feel wmaker has but rarely have used it. The main reason I use PC-BSD, is I don’t want to go through the bother of installing/upgrading KDE, given the time involved…. If I used FreeBSD, I’d probably use Window Maker instead of KDE lol.

Here is some initial work,

PC-BSD v1.4, running Window Maker 0.92.0
screen shot hosted on imageshack

I’ve installed docker to gain a system tray, which I have done with Blackbox in the past. And I’ve used wmclock which I find less obstrusive then the wmclockmon program I’ve used in the past. I might experiment with running Window Maker as KDE’s window manager but I don’t mind hacking up my menu hehe.

Play time

About 25:17 woth of downloading later I burnt the disk, install went great but Linux hangs during the boot 🙁

I installed KateOS on my laptop using a spare storage partition. It works great aside from not auto-detecting my Atheros based PCMCIA card with the rest of my hardware. The default Desktop Environment is Xfce4, never used any of the Xfce’s but it’s a dandy GTK+ based one. I found it some one suprising that I had to create my own ~/.xinitrc to be able to log in through the GUI but it was as simple as coping roots to my home directory.

Surprisingly with the exception of Live CD’s, I have never had a Linux Distro that just ‘worked’ with my hardware :. I’ve always had to screw with them to get them work, even in Ubuntu when I tested 6.06 to try Gnome. Although I must admit having to rewrite Ubuntu’s /etc/fstab was not as annoying as Debian and NetBSD telling me I have no hard drive xD

FreeBSD has always worked well for me, except on one laptop. Which I could swear should have been marketed as a ‘Wintop’ lol.

Maybe it’s just a strange twist of fate, I generally get along with FreeBSD/OpenBSD more readidly and vice versa in terms of getting things done.

I must admit, I am tempted to either to use OpenBSD (for the first time with X11) or FreeBSD on the new system. Although I could probably roll my own Linux From Scratch but that’s a tad more time consuming !