Google PageRank matrix calculator (graphically)

May 19, 2004
2 comments Mathematics

Some time ago I wrote about the Google PageRank algorithm in Python. It's a matrix algorithm for calculating the PageRank values for every page in a web. All you have to do is define which pages links to which and the algorithm calculates the PageRanks for every page for you.

Now I'm going to try to illustrate it in practise for those of you who don't know what to do with a "Python script"n:/plog/blogitem-040321-1/PageRank.py.

Start calculating!
See the gallery of previous calculations.

Truncated! Read the rest by clicking the link below.

Bush votes: inverse proportional to education and IQ

May 17, 2004
1 comment Politics

First there was this chart where average US state IQ was listed in order. On that chart, states that voted in majority on Al Gore in the 2000 election were coloured blue and those states that voted in majority for George W. Bush were coloured red. See it for yourself! (IQ isn't really a measure of anything useful but it's funny.)

Then there's this study which lists states and their "Percent of People With a Bachelor's Degree or More". Clearly it shows where people are most likely to have a college/university education. Now, on metafilter they conclude that:

"... for those who are politically curious, of the top 15 states with Bachelor degrees 11 went to Gore, while 13 of the bottom 15 went to Bush."

One must of course admit many flaws in this logic but there is undoubtedly a correlation there.

Why should I use XHTML?

May 17, 2004
0 comments Web development

This site does not use XHTML although it will some time in the future. The next version of the IssueTrackerProduct will. I've never really understood why one should use XHTML but this site gives the answer:

"What's in it for me?
In the short term, probably not a lot, but the Web is moving very quickly and you always have to think ahead.
If using XHTML only helps to tighten-up your markup, getting rid of ambiguities and sloppy coding, then it's already improving the robustness of your pages across browsers."

and

"The use of valid XHTML helps to guarantee that any pages you build now will work well into the foreseeable future in all current and future browsers."

Good. Now I know.

Two done three to go

May 15, 2004
0 comments Mathematics

Today I had my second exam. This was Mathematical Methods. Something I had thought was going to be harder than it was. Next week on Monday I have Differential Equations; C++ on Tuesday and lastly Bottom Up Computing And Discrete Mathematics on Wednesday. So my whole BSc degree is all over on Wednesday!! Yippi!

Today after the exam we had a few drinks but I left earlier than most people, feeling both drunk (3 drinks :) and sleepy. Taking an exam plus all the pre-anxiety really tires you out. This weekend is going to be about studying. Sigh.

Krispy Kreme doughnuts store opening

May 13, 2004
1 comment Misc. links

Don't ask me how I came across this but it really caught my attention. Here are a few photos for the store opening of a doughnut shop in Indiana, USA. On the night before the opening they give the people who have been waiting all night company t-shirts with their queue number on the back. One guy waited outside the shop for 17 days, in a tent. What did he get for that? Cash? A car? No, he got the t-shirt with number 1 on it and the honour to switch on the big new neon sign. Wow!

Us europeans have a lot to learn from the north americans when it comes to commercialism. Many commerce ideas are copied with success here in the UK and Sweden but often with many years delay.

Here's another link about the marketing on the store opening

Zurich tram service problem

May 11, 2004
0 comments Mathematics

This is a little thought problem I learned during the Quantum Mechanics course I'm taking. It was (supposedly) A Einstein who thought about it first when he was working in Zurich.

As we all know, the tram service in Zurich runs like clockwork; all day every day. Or at least, let's assume so. This question appeared on one of my exercise sheets:

There is a tram service in the city of Zurich between two terminals A and B such that a tram (there is only one tram in service) leaves every five minutes from the terminals and makes the journey from A to B (B to A) in exactly five minutes. There is a passenger who comes to a stop C located 1/4 of the distance AB from A at completely random times. He takes always the first tram regardless of the direction in which it arrives. He keeps all his tickets and after a year he counts how many times he travelled in the directions AB and BA. Explain why he finds that he travelled many more times in one direction than the other. What is the ratio of the number of journeys from A to B to the number of journeys from B to A?
Tram service in Zurich problem

If you can't be asked to do the simple calculation, at least figure out which direction he travelled more than the other. It's not a hard problem to understand so anybody can do it without any math skills. It's just a little mind boggling at first.

Distributed compiling with distcc

May 9, 2004
1 comment Linux

distcc is a server-client program by the people behind "Samba"n:http://www.samba.org/ that allows compilation of C, C++, Objective C and Objective C++ to happen spread out on many computers, i.e. distributed. The daemon can be run on computers that have different processor as the one you're on. They can even be different operating systems.

The friend who told me about this had tried it to compile the latest Linux kernel. By using two workstations and his laptop he was able to do it in one fifth the time it usually takes. That's pretty damn impressive!

I really like distributed computing but my UNIX-foo is not good enough to use it without shooting myself in the foot all the time. But one thing I wonder. When you as a C developer sit and work on a big program, don't you mostly compile one single file that you're working on with its necessary header files? distcc seems to be more suitable for large compilations, not one at a time.

Heil Jed and Dave Kuhlman

May 9, 2004
1 comment Linux

I've said it before but I have to say it again: jed rocks! Now even more thanks to Dave Kuhlmans SLang script. (jed is a text editor that makes Emacs look like a space shuttle and MS Word like a snail)

Granted that this is more for programming than to write a book but it's still worth noting. I can now with one key command search backwards and forwards on the word that the cursor is currently at. The alternative before was to start searching and on the dialog you write the word that you're looking for. What a waste of time! Plus, with the old way it happens often that you misspell the word you intend to find. This is ideal when you're programming because you often want to inspect where a variable or a function is coming from or how it will be used. I suspect that it will take some getting used to but it was the same story for the emacs bindings and now they are second nature.

Truncated! Read the rest by clicking the link below.

Obfuscating C contest running now

May 7, 2004
2 comments Misc. links

The "obfuscating C code contest" is an international competition where people submit program source code written in C and when they submit it they aim to make the source code as obfuscated as possible.

Both 2002 and 2003 were cancelled but now the 2004 is on the way. The deadline has been reached. Now we're just waiting for the results!

The "obfuscating C code contest" is an international competition where people Here's some code from one of the 2001 winners:


'YfQ}$k$kr7dM#dcnWDg|PHdA#^j&q}$x@(a;k2JB]50ZKp{xRwbkTm.v\\a3fJ@V[`J#fN`s|sZeH\
mmHX7`JKiry4sm,bUfz69{rt'k*pBq^l,ut6UVvb9N%r%l:Py3r[.Z/pBkaz2J4u{GTu)hyp#%gbS$\
r`mzi9G|3M,r}-Dt?w)_##%fQt$k&n]e$HzFXu(|Fvt`i#$A#|ykrz+nhs'P#|pm*9[_#,5P#}$}$x\
&s(i,HzO'&d&g?/_$P#kZ7Dn]e$J{zi8ypi|hq$_.|cLx`sy;f8GRMQM#7R5$hym*:^`sxrvtfQ|z_\
N|ye[7dH[}#Ts\\59V@|#z}$}$y;usL)vXFiA0AukZ8H|fyKurd]|s5<|xq@Cpm,}${,e$KufO?/2M\
t$zmM#vtfQ|zRKlEA#P&amp;fPOwJ#pf_$?/2#@|$w}$?fLxA#^-}$cM^aA#&amp;g#wIv?^|yY#s)Lwt'K#ON\
yoXKYkpCl0m}D[9OGU7n([ZrL)[8eRy7uR*PJ#^5xRG>zSf>p]ZrJ_[9q?qgYe^4$r3lY$4SdsSyNv\
J_l&amp;w2I?q#fN*F1n|s9OGUv|w&amp;l+pR-3Nudtyn@|Dfq#^o|s9Pt=oZCol/{VdgkLdwyn1yDed}?Dzi\
}#Kje#d}Y${8pSt<q?qgIv|`DH?9}$O{k(LgE;|KU-tJnWOw*F@Y