Java Nested Classes and SCons
2008-09-02 | Filed Under Build systems, Coding, Java |
Google Summer of Code is over in which I participated working on SCons. I really like the project and I hope to keep contributing to its development. Therefore, I plan to pick an interesting issue from the SCons bug tracker from time to time and try to come up with a fix.
This week I looked into Java build problems related to nested classes. This appeared to be a small problem but it actually turned out to be a can of worms. SCons needs to deduce the names of the class files from the Java sources for internal dependency management. That is, before the Java compiler is invoked. In the simple case, computing the class file name is a trivial one-to-one mapping: Foo.java is compiled to Foo.class. Sort of. When nested classes come into play, this quickly gets nasty:
- Inner classes are appended with a dollar sign:
Foo$Inner.class - Inner classes defined in methods are assigned an index:
Foo$1Inner.class, Foo$2Inner.class - Anonymous inner classes get a counter:
Foo$1.class, Foo$2.class - Nested anonymous inner classes look like that:
Foo$1$1.class - And this is just for Sun Java 6 …
There is some prior art that tries really hard to extract all that information out of the sources. It cannot (yet) tell the difference between inner classes with or without indices (declared in the method or class body), detect anonymous classes in inner classes, and detect nested anonymous classes. Brain teaser ahead.
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Upgrade to Hardy Heron vs Trac and sqlite
2008-04-10 | Filed Under Ubuntu |
Today I tried something which I don’t really expected to work. After a direct upgrade from Dapper to Hardy, Trac stopped working:
“file is encrypted or is not a database”
There’s a version conflict between the Trac database and the accessing sqlite version. The best solution I found while searching the web, was to convert the databases manually:
cd /var/.../project/db
sudo -s
apt-get install sqlite
cd /var/your-trac-project
cd db
cp trac.db trac.db.orig
sqlite trac.db .dump > trac.sql
rm trac.db
sqlite3 trac.db “.read trac.sql”
chown www-data:www-data *
trac-admin .. upgrade
After that, Trac works again.
Ludwig
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Automatic make dependencies without sed
2008-03-01 | Filed Under Build systems, Coding |
I’m currently working with plain GNU Make based projects and - again - I tried to find a nice way to automatically track dependencies and finally found a nice solution when skimming over the g++ manpage. There is a lot of black art flowing around, e.g. this gem is from the GNU Make manual:
%.d: %.c
@set -e; rm -f $@; \
$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
Not for the faint of heart, also the thing done by sed is quite trivial. If all you have to support is gcc (portability is overrated!), there’s a much more simple way to achieve the same (and more):
%.o: %.c
$(CC) -MMD -MP -MT '$*.d' -c $(CFLAGS) $< -o $@
This way we compile the object file and generate the dependencies in one step (-MMD), we prefix the rule with the dependency file, to avoid sed (-MT ‘$*.d’) and we avoid nasty Make errors when moving header files (-MP). This has been tested with gcc 3.3, 3.4, 4.1 and 4.2.
Finally, some good reading:
Advanced Auto-Dependency Generation
Autodependencies with GNU make
That’s it for tonight, Ludwig
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Minerva Industries erfindet das Smartphone
2008-01-30 | Filed Under German |
Der jüngste Fall amerikanischer Trivialpatente, welche eigentlich vom US Supreme Court schon abgestraft worden sind. Warum dieses Patent durchgekommen ist, bleibt das Geheimnis des Patent-Amts.
Dieses ist dann auch Ziel des Spots des “Erfinders”:
Wir glauben, dass es in Fragen des geistigen Eigentums kein besseres Rechtssystem als das der Vereinigten Staaten gibt.
Desweiteren beweist er Selbstironie:
[...] großartiger Beitrag zur Welt der Technik [...]
[nicht nur] Mobilfunk-Geschichte schreiben, sondern auch Patent-Geschichte [...]
Man darf gespannt sein, wie gegen dieses neue Beispiel skrupelloser Innovationsbremsen, deren agressives Geschäftsmodell sich auf Patentklagen stützt, seitens weltweit operierender Smartphone-Hersteller vorgegangen werden wird.
Hier der Orginal-Artikel: heise online - Patentfirma verklagt Apple - und alle anderen
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
One note on citations in ms word 2007
2008-01-25 | Filed Under Office |
Currently my main task for university is writing a long paper about some description logic in context middle-ware stuff. Before I begun I had to make a decision: which flavour of word-processing-software do I want to use? Out of OpenOffice, MS Office 2003, LaTeX und MS Office 2007 I picked the latter, mainly because of evaluation purposes (and some curiosity I must admit).
And soon I stumbled into problems with the new built-in changable style of citations, which is for sure a feature scientists have long been waiten for. But if the about a dozen built-in styles aren’t satisfying you, it becomes critical.
One have to praise Microsoft for finally utilizing open standards (XSLT in this case) to realize things, since you can find all styles in the Programs\Microsoft Office\Office12\Bibliography\Style folder which contains a .xsl file for each. Actually one can imagine the whole Word-kernel is just a transformation engine working with XSL. But this time it was a flop regarding the usability of citations. Why? Even a very skilled expert would need months to decrypt those multi-thousand-lines monsters. Well, I believe making the styles editable with some kind of GUI or just with simple XML-files (should be possible) instead of using an open standard in a non-open way would have surely satisfied more people. Since everybody knows, coding experts usually don’t work with MS Word.
It was my luck, that some clever people on the web achieved it to identify enough code-lines to modify the built-in styles a bit. This is nevertheless a source of misconduct behaviour of the whole citation feature, but it works good enough to make use of it.
I won’t publish the modifications here, since they’re depending on the modified style-template. Furthermore, in the meantime MS has noticed that using the built-in styles isn’t satisfactory to many people, and published a short how-to for making your own, custom and simple XML-based bibliography style: Building a Bibliography Style.
Anyway, the main problem remains: Creating a satisfying style isn’t something a normal Word user is able to do. But since this feature seems more open than I thought, it’s just a matter of time, till there are comercial (or even free) style packs out there.
Cheers,
jek.
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Install RTAI 3.6 on Ubuntu AMD64
2008-01-02 | Filed Under RTAI, Ubuntu |
Here’s a short description of how to install RTAI 3.6 test2 on Ubuntu with an AMD 64 processor - mainly as a reminder for myself as I tend redo the same mistakes again after some months have passed. This has been tested on Ubuntu Gutsy (7.10) and should also work with small modifications on Edgy, Feisty and maybe even Dapper. This is based on the original article updated with some information from the really good (but only recently discovered) RTAI on Debian Etch wiki page.
$ sudo -s
$ cd /usr/src
$ export https_proxy=http://ssl-proxy:81
$ export http_proxy=http://http-proxy:81
$ wget https://www.rtai.org/RTAI/rtai-3.6-test2.tar.bz2 –no-check-certificate
$ tar tvf rtai-3.6-test2.tar.bz2 | grep x86_64/patches
Get a kernel which matches one of the available patches and try to pick a kernel version which is “close” to the one pre-installed by the distribution. Otherwise some system services may start to misbehave afterwards. If you get a proper kernel but fail to apply the patch later your best bet is to try a different minor (2.6.22.x) version. The kernel patches started to get picky lately. On Dapper I had some success with 2.6.19.6, on Gutsy, 2.6.23.12 seemed to work (well, it compiled at least).
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.xxx.tar.bz2
$ apt-get install linux-kernel-devel fakeroot kernel-wedge kernel-package libncurses5-dev
$ tar xjf linux-2.6.xxx.tar.bz2
$ ln -s linux-2.6.xxx linux
$ tar xjf rtai-3.6-test2.tar.bz2
$ cd linux
I believe the evms stuff is not used anymore, anyway, if I’m wrong apply the patch:
$ apt-get install kernel-patch-evms
$ zcat /usr/src/kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch.gz | patch -p1
Now, let’s see if the patch is able to alter the kernel without errors:
$ patch -p1 -b --dry-run < ../rtai-3.6-test2/base/arch/x86_64/patches/hal-linux-2.6.xxx.patch
$ patch -p1 -b < ../rtai-3.6-test2/base/arch/x86_64/patches/hal-linux-2.6.xxx.patch
Time to configure the kernel. No need to understand everything that happens in oldconfig, when in doubt hit enter … Afterwards be sure to disable CPU frequency scaling and to disable module versioning (still needed?).
$ cp /boot/config-`uname -r` .config
$ make oldconfig
$ make menuconfig
Make a last RTAI sanity check before compiling the kernel.
$ cd ../rtai-3.6-test2/
$ ./configure
$ cd ../linux/
$ make-kpkg --initrd --revision rt36 binary
$ cd ..
$ dpkg -i kernel-image-2.6.xxx_rt36_amd64.deb
$ dpkg -i kernel-headers-2.6.xxx_rt36_amd64.deb
After the coffee break, it’s time to build RTAI:
$ cd rtai-3.6-test2
$ make menuconfig
$ make
$ make install
Now would be a good moment to take another look at the RTAI manual. Good luck!
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Verlust der Anonymität
2007-12-30 | Filed Under German, Society |
Über die geplante Vorratsdatenspeicherung (VDS) ist ja schon viel geschrieben und gestritten wurden. In den (links-)liberalen bzw. libertären Publikationen gegen die VDS wird allerdings oft vom totalitären Polizeistaat gesprochen. Das kann man ja sehen wie man will, ob man allerdings den deutschen Durchschnittsbürger mit derartiger Argumentation für eine kritische Auseinandersetzung mit der Thematik gewinnen kann, ist zumindest fraglich. Je einschneidender die geplanten Maßnahmen werden, desto mehr verfällt die Kritik in Polemik. Alle Probleme der Rechtsstaatlichkeit an die Person Schäubles zu binden, ist da zu einfach, schließlich haben auch zahlreiche andere Abgeordnete den Entwurf unterschrieben.
Was mir in der ganzen Auseinandersetzung etwas fehlt, sind greifbare Beispiele, wie die VDS die Freiheit Aller real einschränkt. Und zwar hier und heute und nicht in einem zukünftigen imaginäre Polizeistaat.
Erst vor kurzem ist mir durch ein Post bewusst geworden, dass von der VDS auch Anonymisierungsdienste massiv betroffen sind. Mit der gewohnt schwammigen Formulierung und Komplexität des Gesetzes ist unklar wie es für diese Dienste weitergeht - die Nutzer sind verunsichert, ob und wie weit sie selbst zum Aufzeichnen verpflichtet sind. Nebenbei führt das natürlich das eigentliche Ziel dieser Dienste, die Anonymität ihrer Nutzer sicherzustellen, ad absurdum.
Anonymisierungsdienste?
Ich werde versuchen an zwei Beispielen aus meiner persönlichen Erfahrung zu zeigen, warum anonyme Kommunikation zunehmend bedeutsam für freie Meinungsäußerung ist. Nicht erst seit Facebook und StudiVZ ist deutlich, dass das Netz sehr gut zur Profilierung genutzt werden kann. Dass der zukünftige Arbeitgeber auch mal Google befragt, bevor er jemanden zum Bewerbungsgespräch einlädt, sollte jedem klar sein. Die Zeit hat in der aktuellen Ausgabe (2007 Nr. 52) dazu den lesenswerten Beitrag “Deine Daten währen ewig” veröffentlicht. Mir selbst haftet an, dass seit langem verjährte Usenet Postings immer noch auf den ersten Plätzen bei Google auftauchen, wenn ich meinen Namen eingebe. Da es zur damaligen Netiquette gehörte, mit vollem Namen zu posten, sind meine Beiträge, zu aus heutiger Sicht reichlich überflüssigen Flamewars und kontroversen politischen Themen, noch immer fest mit meinem Namen assoziiert. Damit kann ich zwar leben, aber es hat mir deutlich gezeigt, wie wenig Einfluss man auf einmal unter eigenem Namen veröffentlichten Informationen hat. In Zukunft werde ich meine Meinung, vor allem wenn sie Kontroversen hervorrufen könnte, anonym, oder wenn das nicht möglich ist, überhaupt nicht in der Öffentlichkeit äußern.
Ein anderer Fall ganz losgelöst vom Internet: Ein Bekannter von mir hat nach einem kritischen Leserbrief zur Kulturpolitik in einer hiesigen Lokalzeitung Post von der NPD bekommen. Die Adresse haben sie wahrscheinlich über das Telefonbuch erhalten. Abgesehen von der Tatsache, dass der Brief gemessen an seinem Inhalt und der Professionalität ebenso von der CDU, Linkspartei oder der FDP hätte kommen können - er hat vor allem eines: verunsichert. Dass politische Gruppen egal welcher Couleur die Foren der öffentlichen Meinungsäußerung aufmerksam beobachten und diese Meinungen an Namen binden, war mir zwar theoretisch klar. Aber damit auf diese Weise konfrontiert zu werden, führt dazu, dass sich Betroffene genau überlegen, auf welche Weise sie in Zukunft ihre Meinung äußern.
Wenn man jedoch die Plattform für anonymen Meinungsaustausch entzieht, die Menschen in Bezug auf ihre Kommunikationsgewohnheiten zunehmend verunsichert, dann blendet man auch die Meinungen und Ansichten von all denen aus, die sich öffentlich nicht äußern wollen oder können.
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Mord wegen Eintrag in Sexualstraftäter-Register
2007-12-11 | Filed Under German, Links |
Soweit musste es ja kommen. In Kalifornien wurde nun wahrscheinlich aufgrund der staatlichen und öffentlichen Sexualstraftäterdatenbank ein Mord verübt.
Unverständlich war für mich schon seinerzeit diese Sorglosigkeit bezüglich der Privatsphäre der Täter. Man gab sich nicht mit einer (Privatsphären-freien) Haftstrafe zufrieden und auch nach der Haft werden die Täter ja staatlich überwacht. Soweit so gut und nachvollziehbar.
Aber man öffnete einfach auch noch die Tür für jeden Amoklauf-gefährdeten Amerikaner mit zweifelhafter Rechtfertigung zusätzliche Selbstjustiz zu üben. War dies zur Reduktion des Überwachungsbudgets gedacht?
Un das beste ist, eine (möglicherweise etwas feige) involvierte Psychologin äußerte:
“Ich denke, dass beide Opfer des Internets sind”
Was hervorragend in die Strategie amerikanischer Politiker passt: Denn hätte man die Abrufe der Datenbank genauer überwacht und dabei den Gesichtsausdruck des vermeintlichen Täters über seine Webcam mitgeschnitten, hätte man diesen Mord ja verhindern können!
Nicht das Internet ist schuld, verehrte Damen und Herren, sondern die mangelnde Medienkompetenz amerikanischer Politiker und Behörden. Denn mit solchen Dingen war ja wohl zu rechnen und das sollte auch jedem klar sein, der guten Menschenverstandes ist.
Hey Kalifornien, hier noch ein paar Vorschläge für weitere öffentliche Datenbanken:
- Datenbank für korrupte und verurteilte Politiker/Manager die in lokalen Verwaltungen/Unternehmen tätig sind (mit Wohnort und Bild natürlich)
- Waffenbesitzer-Datenbank (falls man mal eine braucht…)
- Leute die ihre Hunde überallhin schei*en lassen (mit dem Bild vom Hund)
Kopfschüttelnde Grüße,
j.ek
Hier der Link zum Artikel: heise online - Kalifornien: Mord wegen Eintrag in Sexualstraftäter-Register.
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
On touchscreen-only phones
2007-12-03 | Filed Under Mobile |
I must admit: I’m a geek when it’s on small powerful PIM devices. After owning a Treo 180 since 2005 I wasn’t able to go back to standard boring mobile phones. So I was going to get the XDA mini from O2 Germany, which was one of the 1st generation touchscreen-only PocketPC-phones out there (don’t rely on that).
And as we all have to face the upcoming multi-touch-screen-hype started by Apples iPhone these days, I wonder why the hell everybody thinks this is the end of phone keys. In my two-year experience with a nearly keyless phone I need to clear up with a common mistake in rating those new LG Prada, LG Mobile KS20, HTC Touch, Samsung P520 and so on (this list is too long): Typing text is pain on those devices. For a demo-video and and overview on how keyless devices feel like, I recommend the article by Dieter Bohn on HTC Touch vs. iPhone, Part 2.
Regardless of soft-keyboards with auto-completion, vibration-on-touch and all other kinds of emulating real keys it will NEVER feel like typing on real keys, believe me. In fact, it’s not possible to write without looking on the screen, ’cause you never know whether you hit the right “key” or whether you hit it hard enough at all. I mean, it’s possible to write text, of course, and I did it for nearly 2 years now. But it’s definitly beaten by the feel of real keys. So my next phone will be the HTC Touch Dual slider, with a 20-key keypad.
Well, sure I am a fan of huge displays with touchscreen functionality and cool apps based upon them. But to make it short: When it comes to typing a text longer than about 100 characters, real keys are second to none.
cheers, jek.
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment
Schattenseiten des Schwarzhandels
2007-11-30 | Filed Under German, Links |
Vielleicht sollte man doch langsam über Legalisierung und Qualitätskontrolle nachdenken:
- Bleiverseuchtes Marihuana Vergiftungen in Leipzig [n-tv]
- Informationen über bleihaltige Cannabisprodukte [DHV]
- Blei im Gras FAQ [drug scouts]
Post Linx
Permalink | Trackback |
|
Print This Page | Leave a Comment