Tuesday, June 20. 2006
George W. Bush ist heute in morgen in Wien. Ich auch (zumindest morgen). Und zwar auch der Demo des Jahres, eine der wenigen Demos, bei der es wirklich um was geht. Niko und ca. 9998 weitere Menschen werden auch mit von der Partie sein. Es kann also spannend werden. Ich bin auf jeden Fall paranoid und nehme mir meine eigene Schutzmaske mit. Man kann ja nie wissen.
Monday, June 19. 2006
Since the current temperatures are way too hot, I'm presenting a few temperature-scale-related Wikipedia links today.
I guess almosteveryone who learned programming also wrote a program to convert temperatures from one scale to another, e.g. Celsius to Fahrenheit and the other way round. This list provides an overview over other scales, some of which are quite interesting, like the Newton scale, which defines 0° to be the temperature where water starts freezing and 30° where water starts boiling, or Rankine, which is to Fahrenheit what Kelvin is to Celsius. But in my opinion, the most interesting scale is Delisle, which goes the other way round: the 0 Kelvin are 559.725 °Delisle, while 100 °C are 0 °Delisle, and the surface temperature of the sun (about 5526 °C) is -8140 °Delisle.
But besides the temperature scales, let's hope that temperature goes a bit down, almost everybody around me is suffering from the hot and the relatively high humidity makes sustaining the heat even harder.
Saturday, June 17. 2006
I really enjoy surfing on Wikipedia for surfing, discovering all kinds of articles, mostly of stuff I've never heard about before, or that are either just hilarious or extremely obscure. This brought me to the idea to present a funny, interesting or boring Wikipedia link (or even more) every day. I will tag such postings with "wplotd" (Wikipedia Link of the Day).
Today's links are:
Abecedarium
Glossarium verborum computatralium
Friday, June 9. 2006
In the last few days, I was working hard to finish a first working version of my "cwapd" (totally uninspired name, I know, it's supposed to mean "C++ Web Application Platform Daemon"). It is based on my previously-mentioned HTTP stack.
The basic concept of cwapd is that one or several base URLs can be mapped to so-called "contexts". As soon as a URL that begins with one of the registered base URLs is called, the "action" (i.e. the part of the URL after the base URL) is handed over to the registered context. This context then handles the request, and returns the result. As a feature, methods can be easily associated with actions (see my previous posting), which means that no manual dispatching is necessary. Alternatively, actions can also be handled manually, e.g. for cases where the "action" actually represents something like a filename (think of a context that delivers static files like a "normal" web server).
As a simple example, I also created a "wallpaper_context" class that automatically scales images to the optimal wallpaper size of the respective client, employing Magick++ and WURFL. This could be e.g. useful for people who want to deliver mobile phone wallpapers via WAP. The code itself is really simple, the wallpaper_context class contains nothing more than 77 SLOCs, showing that writing custom contexts is extremely simple.
The only "big" thing that is still missing from it is proper handling of configuration. Currently, many things that are actually supposed to be stored in configuration files are hard-coded in the source code. So, if anybody could recommend me a flexible configuration engine with an interface to C++, I'd be happy about it.
Anyway, if you're interested in the code, simply have a look at the SVN repository.
Wednesday, June 7. 2006
I just created a pretty neat callback mechanism for C++: template<typename T> class callback { public: callback(T* obj, unsigned int (T::*func)(string, ostream&, header_container&, cgiparam_container& )) : callee(obj), cb(func) { } ~callback(); unsigned int run(string actionstr, ostream& os, header_container& hdrs, cgiparam_container& params) { return (callee->*cb)(actionstr,os,hdrs,params); } private: T* callee; unsigned int (T::*cb) (string,ostream&, header_container&, cgiparam_container& ); }; class context { public: context(); ~context(); unsigned int dispatch_action(string actionstr, ostream& os, header_container& hdrs, cgiparam_container& cgiparams); protected: void register_action(string,callback<context>*); private: map<string,callback<context>*> actions; };
The implementation of register_action() looks like this: void context::register_action(string action, callback<context>* cb) { actions[action] = cb; }
And this is used in the following way (called from within the context class): register_action("foobar",new callback<context>(this,&context::some_method));
Now, the problem that I have is that that adding callbacks that are not actually within the context class but within a derived class is only possible with lots of ugly casting (but it seems to work afterwards): #define REGISTER_ACTION(name,action) do { register_action((name),new callback<context>((context*)this, (unsigned int (context::*)(std::string, std::ostream&, net::header_container&, net::cgiparam_container&))&action)); } while(0)
Do I see correctly that C++ seems to have certain problems with derived classes and templates, especially when it comes to using pointers to methods? Any input is welcome on how to remove this ugly casting while keeping the same functionality.
Microsoft hat seine Antivirensoftware für Email-Server namens Microsoft Antigen vorgestellt. Tja, wie der Titel dieses Beitrags schon andeutet, ist der Produktname ziemlich schlecht. Antigene sind nämlich Stoffe, die die Bildung von Antikörpern anregen. Dabei befinden sich die Antigene auf der Oberfläche von Bakterien und Viren oder auch z.B. Pollenkörnern. Und wie soll man das jetzt im Zusammenhang mit Microsoft-Produkten verstehen? MS Antigen haftet an der Oberfläche von MS Windows, und macht es eindeutig als schädliche Betriebssystem-Installation erkennbar? Ich nehme mal nicht an, dass das so beabsichtigt war.
Sunday, June 4. 2006
Tja, von gestern auf heute wieder mal Wachbereitschaft gehabt. Da uns ziemlich fad war, hab ich meine Digicam ausgepackt (siehe unten). Mehr Bundesheer-Fotos von mir, u.a. auch von heute, gibt's übrigens hier.
Im Gegensatz zu anderen Kasernen gab's bei uns übrigens noch nie einen Delta-Alarm.
Saturday, June 3. 2006
On this picture you can see one of the few rare "1337" dog tags of the Austrian Army. These are not officials ones, of course, as no Austrian soldiers will ever have this unique ID, but they are made out of the very same material and with the very same machine as all the dog tags that are produced in Upper Austria for the Austrian Army. A good friend (you know who you are) will get one of them, I will keep one for myself, and the other three that I have will be handed over to 1337 people at the right occasions...
Oh, and many thanks to Tjulz and "Lulu" Landerl for producing the dog tags for me!
Sunday, May 28. 2006
Gerade hab ich mir ein paar Sachen via apt-get gezogen, und war verwundert über die ungewöhnlich hohe Transferrate von ca. 730-750 kB/s. Nachdem ich downstream eigentlich "nur" 4 MBit habe, sollte das eigentlich nicht möglich sein. Ein kurzer Blick auf die Liwest-Seite hat allerdings schnell den Grund ergeben: das ehemalige 4-Mbit-Angebot wurde auf 6 MBit erhöht, ohne zusätzliche Kosten. Danke Liwest!
Monday, May 22. 2006
Nachdem sich niemand auf meinen Sammelbestellungsaufruf gemeldet hat, hab ich heute die Bestellung selbst alleine abgeschickt. Dabei hab ich gleich zu zwei Masken gegriffen (falls jemand auch noch bei der Anti-Bush-Demo teilnehmen will, kann ich gerne eine Maske herborgen), und zwar einerseits zum Bundeswehr-Modell und andererseits zur M-69. Die M9A1 habe -- obwohl von der Ausstattung her kompletter -- nicht genommen, weil die Filter non-standard sind, und zwar ein 60mm-Schraubgewinde anstatt des 40mm-NATO-Standards. Das Geld ist ebenfalls schon überwiesen, ich nehme also an, die Schutzmasken werden mich nächste Woche erreichen.
Friday, May 19. 2006
Am 21. Juni ist ja in Wien die bushgohome-Demo, IMHO eine Demo, bei der es endlich mal um was geht, d.h. ich habe vor, diese zu besuchen. Da ich mir allerdings oft genug worst-case-Szenarien ausmale, bin ich zu dem Schluss gekommen, mich mit einer Schutzmaske gegen eventuelle Angriffe mit CS-Gas o.ä. schützen zu müssen, das heisst, ich will mir eine Schutzmaske zulegen. Im lokalen Army-Shop kostet das Bundesheer-Modell EUR 72,- (!!!), während Onlineshops wie dieser hier Schutzmasken im Preisbereich von EUR 10,- bis ca. EUR 20,- haben. Da die Versandkosten allerdings EUR 12,- nach Österreich betragen, starte ich hier einen kleinen Aufruf: wer ist interessiert, an einer Sammelbestellung mitzumachen, um die Versandkosten zu teilen?
Interessante Modelle sind etwa die Schutzmaske der Bundeswehr (scheinbar baugleich mit dem österreichischen Modell), die kanadische M-69 oder die amerikanische M9A1.
Wer jetzt Bedenken anmeldet: nein, die Masken sollen keinen umfassenden ABC-Schutz liefern, gegen CS-Gas jedoch sind diese Masken (bei der Bundesheer-Maske weiss ich das konkret, weil selbst getestet) bei weitem ausreichend.
Wednesday, May 17. 2006
As Apple recently announced their new line of MacBooks (as successor of the iBook series), and since my iBook is feeling too slow for such a long time already and running out of disk space, I'm currently in the mood of searching for a new notebook.
Actually, the MacBook looks really sexy, but if you look closer, you will see that it only comes with a crappy graphics card, an on-board Intel GMA 950 with shared memory, which has also been used in the Mac Mini, with lousy graphics performance. That's what currently keeps me off from buying one of them. But still, the EUR 1319,- offer looks very nice.
The other alternative would be a MacBook Pro, and it seems that Apple has lowered its prices for them. The 15,4" 2 GHz model now only costs EUR 1999,- instead of the EUR 2689,- before (and Apple shops like McShark still list it with that price).
Where are the non-Apple models? In fact, I'm not really interested in getting some other notebook than one from Apple. Although I've had some troubles with my iBook in the last 3,5 years (due to a faulty series of mainboards), it was otherwise pretty stress-free, and using it was generally a joy. So that's why I currently don't plan to make any steps to move away from Apple.
Anyway, these are the choices, let's see what my nearest Apple dealer says about the new MacBooks, and how much money I really want to spend.
Today I was in the mood of buying some new music, especially having the new Pearl Jam album in my mind. I quickly that CD, but after that, I stumbled upon the CD "Youth" by Matisyahu, a Chasidic reggae musician. I listened to a few samples from that CD, and immediately found it great, so I decided to buy it.
At home, the first thing I did was playing the CD, and I must say, it was really worth the money. The music is definitely the most relaxed and innovative reggae I've listened to in the last few years. So, if you're into that kind of music, I can only recommend this album.
Tuesday, May 9. 2006
Although probably not quite finished yet, I decided to make my HTTP server stack for C++ publicly available (use Subversion to check out). Running "make" first compiles the stack itself an then simplehttpd, a simple HTTP server example only able to serve static files, and implementing simplehttpd was pretty easy.
And that leads me to a topic that I discussed before here. During implementation of simplehttpd, I thought about embedding some interpreter, in order to make it in some way possible to have dynamic content. During the research about this topic, I came across NJS, an embeddable, LGPL-licensed JavaScript interpreter. According to the examples delivered with it, it seems to be pretty easily usable, and even features cool stuff like compilation to byte code before execution. When I saw this, it immediately triggered my wildest fantasies of bytecode caching mechanisms.
Now I have two options: I could simply embed NJS into the existing simplehttpd (whenever such a server-side JS file is requested, it is executed by the interpreter and its output is sent back to the client), or I could build a servlet container around NJS. What do you think?
Wednesday, May 3. 2006
What a productive night... after several months, I just again wrote some lines of code. What did I do? I took the HTTP server stack that I built a few months ago in my effort to create a fast Ruby servlet container (which failed due to technical limitations in the Ruby interpreter), streamlined it in a few points, and used it to build a simple HTTP server that delivers static files, only. So far, the HTTP server is really very simple, but the size of both the stack and the server are quite nice: the stack contains of about 1000 lines of C++ (employing the C++ standard library, btw), while the server consists of about 200 lines. The latter one is still quite buggy in a few places (the prevention of /../../ URLs doesn't work quite correctly yet, nor does the directory index listing), but in its basic functionality, it works pretty good. Expect a release of both in a few days, when everything has been freed from the obvious bugs and cleaned up.
|