chris blogs: June 2005

29jun2005 · Taschenputztuch, Swearmint und Schampeljongs

Das Schuljahr ist mehr oder weniger gelaufen, heute habe ich die wohl letzte Physik-Arbeit meines Lebens geschrieben… sie war unerwartet einfach. Es gilt also, noch meine Mathe-GLF abzuhalten und die übrigen verbleibenden 8 Schulstunden bis zum Wochenende abzusitzen.

Dann ist Schützen, und nach dem verlängerten Wochenende wird die Schule ab Mittwoch in eine riesige Ausnüchterungszelle umgewandelt. (Keine Angst, den SchützaBlog gibts auch dieses Jahr, immer die News und Quotes vom Morgen danach.)

Und noch die Quotes so weit möglich, live und in Farbe vom suchtgefährdeten WG:

Diese pubertierende Hähne…

Taschenputztuch

Verpeilt durch die Galaxis [meint den Anhalter]

Wrigley’s Swearmint — Spewing Gum

Moron 5

[Lehrer:] Nächstes Jahr kommt ‘ne Oberreferendarin. — [Schüler:] Ist die geil?

Schampeljongs

Jesus war ‘ne FrauDarum hat er auch am Kreuz so arg geblutet.

hängsel & gruntle

Was ist der Unterschied zwischen Benzin und Vaseline?Benzin scheidet die Fette…

NP: The Distillers—Dismantle Me

27jun2005 · The Dark Side of Atom

Yesterday antifuchs told me about a problem with the Atom feed of Anarchaia, that now and then includes IRC quotes like this:

#ruby-de
12:18 <ionas_> alles was nicht analog ist ist lossy ;p
12:18 <ionas_> und alles was analog ist geht schnell kaputt ,p

In raw HTML, this looks like that, this code is directly taken from the generated HTML:

<div class="ircquote">
<span class="channel">#ruby-de</span>
<div class="line">12:18 &lt;ionas_&gt;  alles was nicht analog ist ist lossy ;p</div>
<div class="line">12:18 &lt;ionas_&gt;  und alles was analog ist geht schnell kaputt ,p</div>
</div>

In default IRC style, I quote the nickname with < and >, but antifuchs tells me he doesn’t see any nicks when he looks at my blog with Bloglines. Weird, I think, and decide to have a look at it.

Just for fun, I subscribe to my blog in NetNewsWire and I see, …no nicknames! Now, how is my Atom feed generated? The snippet looks about like that:

<entry>
<title>25</title>
<!-- ... --->
<content mode="xml" xmlns="http://www.w3.org/1999/xhtml">
  <div class="ircquote">
  <span class="channel">#ruby-de</span>
  <div class="line">12:18 &lt;ionas_&gt;  alles was nicht analog ist ist lossy ;p</div>
  <div class="line">12:18 &lt;ionas_&gt;  und alles was analog ist geht schnell kaputt ,p</div>
  </div>
</content>
</entry>

And I start to wonder. My Atom feed is perfectly valid, and I just inserted the raw (and valid) XHTML as-is. This should be OK. To quote the Atom specification (emphasis mine):

3) If the value of “type” is “xhtml”, the content of atom:content MUST be a single XHTML div element [XHTML], and SHOULD be suitable for handling as XHTML. The XHTML div element itself MUST NOT be considered part of the content. Atom Processors that display the content MAY use the markup to aid in displaying it. The escaped versions of characters such as “&” and “>” represent those characters, not markup.

Now, apparently, both Bloglines and NetNewsWire somehow pass the XHTML to a rendering engine, in either case my browser respective HTMLKit. And those seem to parse it again, thereby creating the tag <ionas_>. Now, I fixed that by escaping all & in my Atom feeds with &amp;, so now the nick reads &amp;lt;ionas_&amp;gt;. Which is more than ugly and really pisses me off.

When I see such stuff, sometimes I think, RSS really did it better when they just decided to escape the whole stuff and stray their entities all over. That would be consistent, at least.

The civilization of today surely will go down because escaping doesn’t work (and don’t even get me started on encodings, oh my…).

NP: Le Tigre—Phanta

25jun2005 · Introducing Linko

This is just a small Saturday morning hack, but a rather useful one, I think.

Often, when you are blogging about something, you want to link to certain sites about topics that appear often, but you don’t always want to play around with URLs and stuff, and thus you are likely to insert no link at all, just because it is too much work.

Not so anymore with Linko, a Ruby1 link inserter I just wrote. Linko2 makes inserting links as easy as pie! For example, I just typed:

Not so anymore with *Linko__*, a Ruby_ link inserter I just wrote.
Linko_ makes inserting links as easy as pie!

And that’s all you need to do, provided that you have links for Linko and Ruby in your Linko mapping already.

Further, Linko2 also makes your life a lot easier if the commonly-linked page suddenly moves, you just fix the replacement and rerun Linko on your site.

Linko is currently written as a Ruby1 library following the *Cloth API, so you just can run it like this (or use a chaining mechanism like my ClothesLine):

Linko.new("Ruby_ is fun!").to_html
=> "Ruby<a href=\"http://www.ruby-lang.org/\"><sup>1</sup></a> is fun!"

Happy linking! Linko2 is available from my Darcs3 archive at http://chneukirchen.org/repos/linko

NP: Jimi Hendrix—Gypsy Eyes

24jun2005 · Cholerabär, Morgenlatte-TV und Viagra als Stilmittel

Das Schuljahr geht dem Ende zu, noch 2 bis 4 Klassenarbeiten, je nach Religion und Sprachfertigkeit, dann war’s das. Die letzte Latein-Arbeit ist auch draussen, mit der 2-3 bin ich dann doch sehr zufrieden.

Nur noch acht Tage bis Schützen! Hoffentlich spielt das Wetter mit; für’s Laupheimer Kinderfest ist es im Moment viel zu schön. *eg*

Der Cholerabär frisst Apokalyptusblätter.

Morgenlatte-TV [Idee für eine Pornosendung von sechs bis elf Uhr.]

Apfel und Eva haben Adam gegessen.

Anastasi

Donkey Shot

Ist Viagara auch ein Stilmittel?

Wer wohnt beim Mt. Everest?Die Neapolitaner!

NP: Jimi Hendrix—1983 … (A Merman I Should Turn To Be)

22jun2005 · Wikipedia Discrepancies

I know the following rant really is of no use, and that you better fix “Open Source” projects on your own instead of complaining, but I lack the knowledge to do that… maybe someone else wants to do it?

Recently, I had to prepare a presentation about Bayes’ Theorem and conditional probabilities. Therefore, I looked at these pages: Bayes-Theorem, Bayesscher Wahrscheinlichkeitsbegriff, and Bedingte Wahrscheinlichkeit. And, believe it or now, they all use different notations! What’s that?

Now, I needed to figure how to write p(A and B). One page says that’s p(A and B), another uses p(A & B). Same for negation. One page uses ¬A, one A̅ and I’ve seen !A too (but I know that that is wrong). A person profound in maths I asked says it actually is AC (and that’s what the english version of the page says). So what?

Whom should I trust and what should I believe? And what if we actually learned it totally different in school (if I could only remember…)?

It probably doesn’t matter—after all, the audience has even less clue than I do. But it would be nice to do things right, you know? And it would be nice to have a free and open encyclopedia that doesn’t dissent itself.

NP: Jimi Hendrix—Come On (Let The Good Times Roll)

19jun2005 · Summer has broken

Kurz vorm Sommeranfang hat die große Hitze also auch Biberach erreicht—ich war heute zum ersten Mal dieses Jahr am Ummendorfer Baggersee. Nur noch 10 mal hingehen bis zum “break-even point”, ab dem sich die Jahreskarte gelohnt hat. :-) Hoffen wir es bleibt so, besonders wenn in zwei Wochen ja schon Schützen ist.

Selbstverständlich wurde die ganze schöne freie Zeit gleich mit Terminen vollgepflastert… am Donnerstag waren wir nachts mit den Realschülern im Stadtgarten saufen, am Freitag gabs dann in der Dollinger Realschule Abschlussgag (bei uns am Gymasium ist eine Doppelstunde Deutsch ausgefallen) und am Abend waren wir bei Anna in Reute und haben Video geguckt (“Kids”, ein gutes Beispiel warum man Jugendfilme möglichst slangfrei drehen sollte). Gestern feierte Christian Welcker seinen 18. Geburtstag im Burrenwald, und die amerikanischen Austauschschüler sind heute nacht um zwei auch wieder abgereist. Nun kehrt wieder Ruhe in den (gebeutelten?) Haushalten ein (und der Platz neben dem Computer wird wieder frei *scnr*). Nein, ich hatte keinen Austauschschüler.

Und morgen ist—dank mündlichem Abitur—schulfrei, ebenso Dienstag. Mal gespannt was wir da alles machen werden.

Ist eigentlich toll, dass man selbst zu den belanglosesten, lokal höchst begrenzten Dingen sinnvoll verlinken kann… was wären bloß wir ohne das Internet.

NP: Bruce Springsteen—Hatamoros Bank

15jun2005 · Salad Bowl, French drivers und das elektrische Daktylon

Auch wenn die Amis da sind, die Quotes kommen weiterhin. Quotes aus einer Schule, wo Chemieschüler nach Strich und Faden verarscht werden (jaja, Lysin):

Do you think America is like a salad bowl?Well…, a Mexican salad bowl!

What’s wrong with the French drivers?They’re French.

Lady Die!

Kirche, n.: Institution für Geistesschwache

elektrisches Daktylon

Kameradschaft Aldi-Süd

NP: Pearl Jam & Neil Young—What Happened Yesterday

13jun2005 · A file manager for discriminating hackers

Being a “poweruser” spending a lot of his time developing software, I heavily use the command-line, like most others do too. You could say that I spend at least a third of my time in front of some shell (and my Emacs runs in an external window, mind).

Therefore, I strive for efficiency on the command-line, but recently I found out how I would get the biggest slowdown when working with the shell: I’d just need to sit down at a computer that doesn’t have the GNU Midnight Commander installed.

As you may know, the Midnight Commander—or mc for short—is a Unix clone of the Norton Commander, but last time I saw it, Norton Commander was quite different to Midnight Commander. Still, they share the basic concept, the two-panel fileview.

In my opinion, a two-panel file manager is the most effective way to interactively work with files—move around in directories, select, copy and move files. I know that there are lots of people that use single-panel file, or even the horrible (despite all the good reasons there may be for it) spatial view, where each directory gets it’s own window. I don’t know about you, but to get my stuff done quickly, I far prefer using the keyboard over the mouse, and that is (almost) impossible when you have thousands of windows open, and need to “drag” files from here to there.

While those surely are easy to pickup and consistent with models whatever user interface developers came up, they are not the way to go—for me, at last.

Therefore, I have investigated into my use of mc, and came to the following conclusions:

  • I need a shell at my fingertips. mc makes this very easy, I can simply type my commands into the minibuffer and run them. Also, by pressing C-o I can quickly switch to a full-screen shell. Often, I even forget that I am in mc (I only notice that when I open a second mc in the shell emulation, and C-o will switch between both commanders…)! Also, the current filename can be copied to the minibuffer with a simple M-RET.

  • Two panes are good, one large one is even better. In mc, I can switch the size of the panel with M-t, it will get half-screen size or full-width then. I often work with both panels in full-width, because I see change time and permissions then, all at once. I then use TAB to switch between both of those panels. Seeing both at once isn’t necessary very often.

  • Easy selection is essential. mc makes this very easy, you either press INS (which is inconvenient on the iBook) or C-t to toggle marking the current file, and then can conveniently operate on them. By pressing C-x t, they are all inserted into the minibuffer. + will mark all files that match a shell glob.

  • File searches rock. Typing C-s, I can interactively search for filenames; this is especially useful for directories with lots of different files. Just too bad that it only can search for the beginning, and not for any file matching the search.

  • Virtual file systems are a joy. Being able to just enter archives or go to ftp sites by cding to their URL makes lots of things easier and faster than having to fire up tar in some temporary directory or remember ftp syntax (and no completion, yuck).

Still, I have some gripes with mc:

  • Give me a bigger shell. Sometimes, a one-line shell minibuffer is just too small, but a full-screen shell is too big. Why can’t I just have a 5 line pty?

  • Change sorting. Usually, I browse sorted by filename, but then, I need to find all the big files, or all the old files. mc should make it easier to change the sorting criteria with key strokes, so far, I need to F9 into the menu, down, Listing mode, Sort Order, Down until Size, OK. That’s just far too complicated! Emacs dired gets it a lot easier, for example, with s I can toggle between file name and date. Still no size, though.

  • Does it need to be a TUI? I know there is(was?) a Gnome Midnight Commander, but it didn’t work as the one for the shell. Especially when you work with folders of pictures, thumbnails would be just too useful. A text user interface is nice, but a graphical user interface, even if it’s just for displaying files, would be a good alternative too. Just make sure I don’t need a mouse to use it.

With all these points, I’ve decided to design my own file manager; however, it is unlikely I’ll get around implementing it in near future, there is just so much else to do, and mc doesn’t suck enough to make me really need it. :-)

My main idea is a four-panel file manager, on the top there are three columns of file panes: the first always displays the current working directory, and the other two can be assigned to any directory. On the bottom of the screen, there is a resizable terminal emulation (I think multi-gnome-terminal would be a good fit, for example), maybe five lines high by default. It is very important that that shell works good and behaves just like any other terminal emulator (some keystrokes aside).

Switching from the shell to the file panels must be very easy, the same is true for switching between the three file panels. Each panel must be maximizable and minimizable with a single keystroke; full-window shell, full-window file panel.

The file panels will have different views, say “file list”, “extended file list” (of most use when maximized), or “thumbnails” (of different sizes, too). Ideally, the user can program his own views. For example, you could make a view that internally calls find or locate, so you have a “virtual” folder that actually is a search result.

With a single keystroke, the user can swap, rotate and copy the file-panels; the usage remembers me a bit of the old HP RPN calculators that only had a very limited stack. The user can copy, move and delete files from any panel to any other, all with the keyboard.

On the bottom of the file list, there could be a (hidable) preview box, that could show more file details like file times, permissions, even the beginning of text files, or thumbnails. On the top, there could be a menu to go to often used directories.

When tapping RET on a file, it should use an extremely configurable mechanism to find out what to do with the file; on C-RET, it could provide a menu of common tasks for that kind of file. Integration with external editors (especially Emacs) would be very useful.

All these things also need to be accessible from the shell, possibly over some kind of IPC.

I know my idea probably sounds weird, but I think I’d be a very comfortable way of managing files—comfortable for powerusers, not necessarily newbies. If you’d like to implement it (or a subset of it), feel free to contact me, I can provide you a bit more information then.

NP: Aimee Mann—I Can’t Get My Head Around It

10jun2005 · Latine blogero

Desitum adolorosus quam expectatum fuit. Heri nostrum ultimum opus Latinum scripsimus. Quadragesimum. Et supremum.

Ergo hodie me Latine blogere constitui. Me errores fieri possunt, veniam date, Latine antiquite non verterimus. Etiam constitui me prosa non carmen scripere, tum Ovidus Naso futurus ego non sum. Quadraginta opes labor difficilus erant, etiamsi in anni supremi non iam studeramus. Sed sic omnes facemus. Quisquis hic legere possuit, is gratulo, nisi leges, non interest.

Gratias Bavarium Carlum Lindauerumque Josephum suo libero ago, et Davidem corrigendum.

NP: Neil Young—Look Out For My Love

06jun2005 · Phytoplankton, Quadratliter und die Schleiereule

Für einen guten Start in die warscheinlich stressigste Woche dieses Jahr (Arbeiten in Geschichte, Biologie, Latein und Deutsch, Noten in Sport, Biologieexkursion und Biotechnolgie-Praktikum…), unsere Quotes:

Würdet ihr euere Ernährung auf Phytoplankton unstellen [dann]…Im Notfall schon!

Broadcast, n.: toleranter Gipsverband

Checkkarte

Die Schleiereule wurde doch von der RAF umgebracht, oder?

[Lehrer schreibt mit Kreide an die Wand:] Euer Wort in Gottes Ohren.

Schütte unser Herz über dich aus.

Und wenn ich ‘ne 7 schreib, das geht mir am Arsch vorbei!Hast du überhaupt einen?

Kaiser Karl V. war ein Drucker, er herrschte.

Quadratliter [das müsste doch eine 4-Dimensionale Größe sein, oder? Ist der Kubikliter dann 5-Dimensional?]

NP: Bright Eyes—Gold Mine Gutted

04jun2005 · Package, a future replacement for setup.rb and mkmf.rb

(This blog post will go to ruby-talk as soon as Gmail fixes its SMTP.)

Hello,

During a discussion on IRC, I started to wonder if Ruby’s install scripts are state of the art, what could be done better and how.

Ruby’s mkmf.rb and Aoki’s setup.rb probably have their roots in the oldest pieces of Ruby source still in use. While setup.rb had some changes in the latter time, mkmf.rb more or less stayed the same.

I have looked into how other languages install source and compile extensions, and the library I liked best so far is Python’s distutils. I’m not very familiar with Python, but I like the general approach and the essence of API. Basically, you create a file, setup.py, like this:

from distutils.core import setup

setup (name = "Distutils",
       version = "0.1.1",
       description = "Python Module Distribution Utilities",
       author = "Greg Ward",
       author_email = "gward@python.net",
       url = "http://www.python.org/sigs/distutils-sig/",

       packages = ['distutils', 'distutils.command'])

In Ruby, this would maybe look like that:

require 'package'

setup {
  name "Distutils"
  version "0.1.1"
  description "Python Module Distribution Utilities"
  author "Greg Ward"
  author_email "gward@python.net"
  url "http://www.python.org/sigs/distutils-sig/"

  packages ['distutils', 'distutils/command']
}

Given this file, we can simply run:

python setup.py install

and the files will get installed where they belong to. distutils can also handle different prefixes, installing into home directories, and complex cases like putting scripts to /usr/bin, but libraries to /opt/local and whatever.

Python’s distutils also handles compiling extensions:

name = 'DateTime.mxDateTime.mxDateTime'
src = 'mxDateTime/mxDateTime.c'
setup (
  ...
  ext_modules =
    [(name,
     { 'sources': [src]
       'include_dirs': ['mxDateTime'] }
    )]
)

Here, something like this would be possible in Ruby (I’m not yet sure about exact semantics of the Python version):

setup {
  # ...
  extension("DateTime/mxDateTime/mxDateTime") {
    sources "mxDateTime/mxDateTime.c"
    include_dirs "mxDateTime"
  }
}

Of course, more complex build descriptions can be represented too:

extension("foolib") {
  sources "foo.c", "bar.c"
  if have_library("foo", "fooble")
    define "HAVE_FOO_H"
    cflags << `foo-config --cflags`
    ldflags << `foo-config --libs`
  else
    fail "foolib is needed"
  end
}

Whether this will generate a Makefile (like mkmf.rb), a Rakefile or compile directly (like distutils) is still an open question.

To allow for an easy conversion of setup.rb usage, Package will provide convenience methods that will make it behave like setup.rb with respect to the directory structure.

Package doesn’t try to conquer the world, however, it aims to be just a tool that would be useful if it was standard and everyone could build on due to it’s policy-neutrality

What advantages will Package have over setup.rb and mkmf.rb, as they are now?

  • simple, clean and consistent working
  • unified library to handle both extensions and libraries
  • lightweight approach (if included in the standard library)
  • easy adaption
  • more flexible directory layout: especially small projects profit from this, as setup.rb’s directory layout is quite bulky by default and not very customizable
  • easier packaging by third-party packagers due to simple but flexible and standardized invocation

What do we need to get a wide adoption of Package?

  • inclusion in the standard library so it doesn’t need to be shipped with every package (as setup.rb unfortunately is).
  • backing from the community to make use of Package.
  • acceptance from packaging projects like RPA, RubyGems and distributions like Debian, FreeBSD and PLD.

Coding of Package has not started yet (the name is also not set into stone yet, so if you have better ideas, please tell me) because it would be pointless without a strong feedback from the community. I expect to get a first version done rather quickly, possibly borrowing code from setup.rb and mkmf.rb, but Package will not depend on these both. If anyone is interested in helping development, please mail me; helpful hands are always of use. Also, there will be need for testers on all and even the most weird platforms.

But now, I’ll ask you: Are you satisfied with the way installing Ruby extensions and libraries works? Do you think there is a place for Package? Do you have further improvements or can provide alternative ideas?

NP: Neil Young—My My, Hey Hey (Out Of The Blue)

02jun2005 · Abi-Gag im WG

Heute war also endlich auch Abi-Gag bei uns im Wieland-Gymnasium und man muss sagen, das haben sie wirklich geschickt eingefädelt. In der ersten Stunde war nämlich Unterricht (und alle mussten noch schnell Englisch abschreiben, grummel), dann kam eine Durchsage (bei weitem nicht die letzte für heute), man solle sich doch in den Pausenhof begeben, dort gäbe es ein Schulfoto.

Da standen wir dann also eine Stunde, während die Fotografen an ihren Apparaten fummelten, stets im Versuch, ein Foto zu machen auf dem niemand durch die langsam, aber stetig aufgehende Sonne geblendet wird. Ich weiss nicht, wie lange es gedauert hätte, hätten sie nicht gegenüber die kompletten Kulissen aufgebaut.

Ab der 2. Stunde war dann also Abi-Gag, wiederum mit einer Band, die nur marginal besser war als die des PG (trotzdem!), aber es gab auch Musik aus der Anlage. Besonderes Feature war eine Schaumkanone—ich war ja erst skeptisch—aber nachdem man selber erst mal voll mit Schaum ist, macht man halt doch gern ekstatisch bei dieser Schaumorgie mit.

Das Thema war Comics, alle Abiturienten liefen als Comicfiguren herum und man hatte im Allgemeinen recht viel Spass.

So gegen 10.00 meint natürlich unser Rektor, er müsse jetzt den Abi-Gag abblasen, es sei wieder normaler Unterricht. Diese extrem lächerliche, unnötig Zorn auf sich ziehende und stupide Aktion führt er jedes Jahr durch. So weit wie dieses Jahr ging es bisher aber nicht. Kurz nach zehn fanden wir uns tatsächlich im Klassenzimmer wieder und hatten Latein… für ungefähr 5 Minuten, als erneut eine Durchsage kam, die Lehrer sollen doch bitte die Anwesenheit der Schüler kontrollieren (einige waren natürlich schon gegangen). Dann inszenierten (mehr oder weniger) der Stufensprecher und der Rektor einen Streit, mit dem Ergebnis dass man jetzt ja doch weiter Abi-Gag machen könnte.

Dazu kam es dann auch, wir gingen wieder in den Pausenhof und die Band spielte “Smells Like Teen Spirit”. Es hätte kein besseres Lied für diesen Augenblick gegeben (erinnert sich jemand an den Videoclip?). Und die Unterbrechung war trotz meiner Befürchtungen nicht lethal für die Stimmung, stattdessen ging alles viel exzessiver weiter.

Alles in allem ein rundum gelungener Abi-Gag mit kurzer, schockierender Zäsur, die jedoch die Stimmung nicht trübte uns aber hoffentlich zum Denken angeregt hat. Ich habe keine Lust, das so etwas noch einmal passiert.

NP: Aimee Mann—She Really Wants You

Copyright © 2004–2016