Benchmarking


I just did some benchmarks on objic (objects in the cloud) my final year dissertation. The result was not very pleasing, it doesn't seam to scale too well. It becomes quite clear that the more loop iterations there are the longer it will take. Not even linear execution like python, looks more like exponential. I will have to investigate why this is but I think it might be the garbage collection algorithm. This was just a for loop done 10, 100, 1000 and 10000 times.

FFS more work

Talking at HAR2009

My Paper for HAR just got accepted. For those who don't know HAR stands for Hacking at Random.
On August 13-16, 2009 the 20th anniversary edition of the four-yearly Dutch outdoor technology-conference will take place near Vierhouten, NL.
And if you are a technological enthusiast like me you should really go. Here is the abstract
Cloud computing is rapidly gaining the interest of service providers, programmers and the public as no one wants to miss the new hype. While there are many theories on how the cloud will evolve no real discussion on the programmability has yet taken place. In this talk a programing language named objic is described, that enables programs to run in a distributed manner in the cloud. This is done by creating an object orientated syntax and interpretation environment that can create objects on various distributed locations throughout a network and address them in a scalable, fault tolerant and transparent way. This is followed by a discussion of the problems faced and an outlook into the future.
Cu @ HAR

Adding an at '@' symbol to LaTeX

I love Tex but sometimes you just bang your head against a wall because it just doesn't work. Here a little tip, if you need an "at" symbol in your file just adding @ will not work neither will \@. Some people say you have to \makeatletter @ \makeatother what seams stupid to me. There is a simple solution go into math mode
$@$
should do the trick.

Ulrich Drepper about Stallman

I knew that Ulrich and Stallman didn't get along but this email is a must read: http://sources.redhat.com/ml/libc-announce/2001/msg00000.html

My personal favorites are:
The only difference is that Stallman now has no right to complain anymore since the SC he wanted acknowledged the status quo. I hope he will now shut up forever.

The morale of this is that people will hopefully realize what a
control freak and raging manic Stallman is. Don't trust him. As soon
as something isn't in line with his view he'll stab you in the back.
*NEVER* voluntarily put a project you work on under the GNU umbrella
since this means in Stallman's opinion that he has the right to make
decisions for the project.

When I started porting glibc 1.09 to Linux (which
eventually became glibc 2.0) Stallman threatened me and tried to force
me to contribute rather to the work on the Hurd. Work on Linux would
be counter-productive to the Free Software course.

This part has a morale, too, and it is almost the same: don't trust
this person. Read the licenses carefully and rip out parts which give
Stallman any possibility to influence your future.

I cannot see this repeating, though. Despite what Stallman believes,
maintaining a GNU project is *NOT* a privilege. It's a burden, and
the bigger the project the bigger the burden.

Something I got in the mail ;)

hi xxx

Lets have a and then i will , which will make u . i will give u many than we can make love in the position. I can lick ur and u can massage my .
I am sure u will be like this and not gonna think of your , or for some timeFor me honey u are like , , and in .

Your are simply my and i u

GNU coreutils funny

Just had a look at the basename man page and found this:
AUTHOR
Written by FIXME unknown.
But they still claim to have the Copyright. Funny maybe the original author didn't approve with this.

Importance of dates

When browsing the web I don't want to look at old data, so when reading I try to find out when the page was last updated. Now blogging and wikis have become so popular there is normally a date associated with the post but otherwise you are normally left to guess based on version numbers of programs people used.
So if you are a web developer please never forget the date something was created.
Further I was looking for a tool which detects changes and dispays the last changed date. Google somtimes can display this but for about 80% of the pages this information is not available. Why has nobody written a tool that wgets pages and md5sums them to see it they have changed and displays this date. I know it is not always that easy, but a tool like that would be soo usefull. Maybe a firefox plugin could help.

A useful little bashrc addition

I really like checking if commands have executed successfully. This is something quite important if you are administering a machine. Normally I just echo $? but now I have added a new line to my .bashrc that will show me this in colour.

export PS1='\[\033[0;32m\]\u@\h \[\033[0;33m\]\w\[\033[${?/[^0]/31}m\]\$ \[\033[0;38m\]'

This will make the prompt green if everything went OK and red if the process didn't return 0. Nice little helper :)

CentOS help

Something people have asked me about is what to do when yum gives you the error
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
This is very simple

$ yum install yum-utils
$ /usr/sbin/yum-complete-transaction

Finished ;) Just a little cleanup of the completed transactions file

Howto reset your Windows Vista password

On my laptop I had forgotten my password because I always use the finger print reader. And I never really needed it because windows, once you are logged in, never really prompts you for it. But today I needed it and I didn't know it. So what do you do? Here are some simple steps.
  1. Create another user account with Admin rights
  2. Log in as that user
  3. Change your `real` user password
  4. Log in as your `real` user and delete the other account
Viola, password reset without knowing it. Thank you to Paul for this tip. Quite simple but I would have never thought about it.

detex for CentOS

So another little porting effort. This time it is detex
DeTeX is a filter program that removes the LaTeX (or TeX) control sequences from the input so that the real content can be passed to a spell or diction checker.
I am using this for my dissertation to count the words used
detex dissertation.tex | wc
Quite a useful little tool. When I get time I might rewrite it in perl to make it more portable.

Download the [RPM]

[SRPM] and spec file:

Summary: Strips Tex and LaTex commands from a file
Name: detex
Version: 2.8
Release: 1
License: BSD
Group: Applications/Text
URL: http://www.cs.purdue.edu/homes/trinkle/detex/

Source: http://www.cs.purdue.edu/homes/trinkle/detex/%{name}-%{version}.tar
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

Patch0: mallocandtroff.patch

BuildRequires: flex
BuildRequires: groff

%description
DeTeX is a filter program that removes the LaTeX (or TeX)
control sequences from the input so that the real content can be
passed to a spell or diction checker


%prep
%setup
%patch -p0

%build
%{__make} detex man-page prefix="%{_prefix}" CFLAGS="%{optflags} -DNO_MALLOC_DECL"

%install
%{__rm} -rf %{buildroot}
#%{__make} install DESTDIR="%{buildroot}"
%{__install} -Dp -m0755 detex %{buildroot}%{_bindir}/detex
%{__install} -Dp -m0644 detex.1 %{buildroot}%{_mandir}/man1/detex.1

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-, root, root, 0755)
%doc %{_mandir}/man1/detex.1*
%{_bindir}/detex

%changelog
* Tue Apr 21 2009 Hoffmann Geerd-Dietger - 2.8-1
- Initial package.


You will also need the little patch file
--- Makefile.orig 2009-04-21 01:50:44.735919044 +0100
+++ Makefile 2009-04-21 01:51:18.237692007 +0100
@@ -49,7 +49,7 @@
# Compile time flags, just uncomment the necessary lines
# Some say GNU make does not correctly handle += -- you may have to use :=
#
-DEFS =
+DEFS += -DNO_MALLOC_DECL
#
# Add -traditional for GNU cc on ISC 386/ix system and possibly others
# (reported by pinard@iro.umontreal.ca)
@@ -116,7 +116,7 @@
mv detex.c lexout.c

man-page:
- troff -man detex.1l
+ nroff -man detex.1l > detex.1

# If you want detex available as delatex, uncomment the last two lines of
# this target

My word was accepted

When talking about c (as in programming) you normally hear happyland for undefined memory. So I decided to submit one of my favorite terms to the urban dictionary.

Some people claim I came up with this term. Patent pending ;)

Using eval to use a string as comparison

I am just writing a little compiler and interpreter and I have a method to check if 2 values are equal, not equal greater and so on. My code looked something like this

if typeOfCompare == "==":
return firstVal == secondVal

elif typeOfCompare == "!=":
return firstVal != secondVal

elif typeOfCompare == "<=":
return firstVal <= secondVal

....
But this was quite inflexible and I didn't like all the returns. As the type of the comparison was already checked by the parser I came up with a simpler method
return eval(str(firstVal) + typeOfCompare  + str(secondVal))
This might be a performance hit and not as clear but its easier to code and more extensible. You got to love python enabling something like this using a string as comparison operator.

Some research into what other people have done

So I thought I might have a look at what other people on my course have done in previous years as a final year project and how they structured it. So I though quite a few people must have put their projects online as a pdf. So I wrote a little scrip that would query the online list and then Google search for the topic. Here is the script:
#!/usr/bin/ruby
require "open-uri"
require 'rubygems'
require 'hpricot'

page = open("cit0708.html")
doc = Hpricot.parse(page)

(doc/"table.body_showcase").each do |link|
a = (link/"p")
puts "firefox \'http://www.google.co.uk/search?q=\"" + a.first.inner_html + "\"\'"
end

And off I went to look at Google. But only one guy had put his dissertation online. Some people would conclude some stuff about Bournemouth uni students but I will restrain from this. But I still think the projects should be uploaded to somewhere. I know other Universities print books with all the projects in them so their students get publications.
On anther note: I really like the hpricot library, makes parsing HTML really easy. Even if you are not a big fan of ruby you might want to have a look at it.

Jonathan is runnig Mac

Have a look at this http://blogs.sun.com/jonathan/entry/unified_computing what do you notice?
I am sure this is a picture of a Mac window. So are you telling me the CEO of Sun which actually produce two desktop operating systems has a Mac. No wonder they are going down hill. How can a CEO even post something like this. I wish someone would get rid of this idiot.

Some speedup

I started using pmwiki for www.ribalba.de a few weeks ago. I put pmwiki in a folder on my server and then needed a solution to redirect from the index page to that folder. Edd suggested a php secipt that would change the header.
<?php
header( 'Location: http://www.ribalba.de/pmwiki/' ) ;
?>
and this worked fine, but it took ages for the page to load. So I did some benchmarking
Static HTML
real 0m39.731s
user 0m0.206s
sys 0m0.659s

PmWiki with php redirect
real 4m16.862s
user 0m0.260s
sys 0m0.717s

Just PmWiki
real 4m7.132s
user 0m0.259s
sys 0m0.743s
So what can we conclude? pmwiki is not a fast wiki and that the redirect took just a little time.
So now I have the start page as static html and if someone want's more information he has to wait.

Update: Of course the time is the average of 100 Queries

Little cal dashboard app


I am to lazy to remember which month is which number in the year and how many days the month has. Normally I just fire up my dashboard on my mac and use the calendar there, but today I was playing about with Xcode and so I decided to write a little dash app that will show me the calendar information. And so I wrote my first mac app in HTML, what is the world coming too. 

Maybe if I get more time I will add a few more features but for now it does everything I need. Show me the number of months in a Year :P

Howto have a long itemize or enumerate split over many pages

I think it is time I start blogging about all the LaTex stuff I discover all the time. This one was a little tricky. I had a 3 page long enumeration that was bound to a table. So in latex:
\begin{longtable}{|p{\textwidth}|} \hline
\begin{enumerate}
\item ....
\repeat 500 times
...
But of course the enumeration could not be split so it just went off the bottom. What to do? After some thinking I came up with this bodge. If you know a nicer way of doing this please tell me. 
I defined a new command \breaktable
\newcommand{\breaktable}{%
\setcounter{enumi_saved}{\value{enumi}}
\end{enumerate}\\
\begin{enumerate}
\setcounter{enumi}{\value{enumi_saved}}
}
which I now enter every time I see a sort of logic end to the enumeration. This saves the current counter stops the enumeration adds a new cell and starts the enumeration with the correct value again. You have to define
\newcounter{enumi_saved}
somewhere. Works quite nicely.