Sat 2014-05-24 ( In En me )

ruut and me are setting up a new server. This blog is one of the first sites being migrated.

If you can read this, it has worked!

Fri 2013-05-24 ( In En )

I’ve seen myself as a visual person for a long time, but I think I never realized how much this defines me, until now.

It’s almost impossible for me to memorize things just by hearing them. Names, numbers, dates, directions – my mind disposes of them in minutes. But when I read something, when I look at a picture, when I see a map, then I’ll remember it because I understand it. (I’m not talking about photographic memory here; I don’t have that. I’m just much better digesting visually than orally.)

When everybody in my age group started using cell phones, I didn’t have one. I wasn’t interested in talking remotely to other people. Instead, I jumped on the train of modern smartphones at the first station: The week after the original iPhone was available in Germany, I got one. It’s become an extension of my world. Looking at that tiny screen has become an addiction. But I avoid using it as a phone; it’s muted.

I literally cannot understand when somebody is telling me how late it is, or gives me directions to an unknown place. But I can grasp diagrams, tables, structured texts, interfaces, signs, and images instantly. I’m not deaf; I love music, singing, the sounds of nature. But my ears seem to be connected only to my emotions, and not to my brain.

On the other hand, the connection between my eyes and my brain seems to be a fiber optics cable. I live inside my eyes. My job (which is also my hobby) is looking at code, interfaces, diagrams, articles, specifications, emails, search results, icons, wireframes, server logs. Being able to live in a digitized world is a heavenly gift for me. My eyes hunger for text since I learned to read; now I know I can dive into anything I want, whenever I want. I just have to put it on a screen.

When I watch a good movie for the first time, I often don’t get the story. I can’t remember the names of the characters. But I see colors, effects, materials, lights, shadows, signs in the background, textures, dust, skin, hair, tiny little details. I watch it with my eyes and my mind fully focussed on the screen, while the music and voices can stream directly to my heart. I can cry on a well-done emotional scene, but I never look away.

People get frustrated with me for not listening to them, not understanding them, or for having to tell me everything twice. I get frustrated at people for not seeing icons on their screen, not paying attention to spelling or typography, using gadgets that I find ugly, or using buggy syntax highlighting.

I spent years working on a syntax highlighter library. I’m not a designer, but I feel that getting the details of the presentation of source code right is essential. I’m still obsessed with it; I can dream in highlighted code (mostly Ruby) when I close my eyes.

It’s not about aesthetics. I don’t have good visual taste. It is about information. Truth. Seamlessness. Clarity. To me, the only way to make something clear is to visualize it, with text and code and pictures. This preference (or disability) has pushed me into a specific direction since school. It defines what I’m good at and what gives me trouble. It summarizes my strengths and weaknesses as a programmer.

I feel a bit like a penguin: Hearing is waddling on ice. Seeing is swimming in the ocean.

Sat 2013-01-05 ( In En bl pr ra )

TL;DR If you want to truncate a SQLite table, use DELETE FROM table; VACUUM.

While cleaning up my blog (backend, frontend and everything) for the new year, I noticed that the SQLite database I use to store its data had become quite huge — 28 MB huge to be exact. Since I could not dream of having written this much text, I had no idea what happened.

Since I despise writing SQL to inspect tables, I first searched for a simple, free graphical SQLite client (for OS X). No success in the Mac App Store. What I found then was a Firefox plugin called “SQLite Manager”. It’s horrible (Windows 3.1 style icons and poor interface design), but it did its job: After it hung up when I tried to look at the “sessions” table (connecting over SFTP wasn’t such a good idea), the culprit was found: ActiveRecord was storing sessions for each visitor without ever cleaning them up.


So, back to SQL:

Sun 2012-10-21 ( In En pr )

I totally missed this new Rouge gem which came out in September. It’s a Pygments port in pure Ruby!

Jay Adkisson did a great job in my opinion, and the project is destined to become popular — I guess, in the long run, even more popular than CodeRay. Like Pygments, it has a long list of supported languages, a plethora of compatible stylesheets (even with 256 color terminal output), and the ability to guess the language of a piece of code.

If you’re using CodeRay or one of the Pygments wrappers, you should definitely check out this project.

Rouge also inherits from Pygments the DSL-based lexer definitions, which means it’s much cleaner to maintain, and also slower to execute.

Here’s a very quick benchmark that helped me to get a first impression:

Fri 2012-10-19 ( In De En pi )
Sat 2012-10-13 ( In En pr pi )

At least when working with graphics and hexagons.

Sat 2012-08-04 ( In En ap )

In this article, I merely speculate based on publicly available information. Because it’s fun to speculate :)

Wed 2011-08-03 ( En pr )

Well, CodeRay has had support for Themes for a long time. Seems I need to push that more.

Wed 2011-07-20 ( En ap ra )

I think these pictures say a lot about why OS X Lion costs $29 and Windows 7 costs $119+:

Since the unit cost of software is minimal1, software companies effectively make up the unit prices.


Apple’s price for Lion is symbolic. Surely the development cost of their OS was less than what Microsoft had to invest in Windows 7; but with $29 per sold copy, and with much less Mac computers than PCs out there, it’s clear that Apple will never match the sales numbers of Windows XP or Windows 7.

Phil Schiller said that there are some 54 million active Mac users out there. Let’s be optimistic and say 30% of them buy Lion in the next quarter. This makes about $470M in revenue, which is less than 2% of their Q3 2011 revenue.

In addition, Apple pre-installs Lion on every new Mac from now on, even giving free upgrades to people who bought a new Mac just before the upgrade came out. But since they update their OS more frequently, more people actually buy the upgrade for their old Macs.

Apple could easily give Lion away for free without making a dent in their revenue graph. But at the same time, they won’t make profit in software department with a price like this; the design, development and testing of such a big software product easily costs billions.


In contrast, Windows 7 made up 27% of Microsoft’s revenue ($4.4B of $16.4B total) according to their last reported quarter. If they price it at, say, 50% of the current price, their overall revenue could go down 10% or more!

Of course, Microsoft doesn’t really sell Windows copies to users directly. They sell OEM licenses and company-wide business licenses. Which means, almost nobody buys a new version of Windows in any store, online or retail. And of course this means that the naming and pricing of all those different Windows versions does only reflect the funny ideas of Microsoft’s marketing department.

Micosoft is very dependent on Windows (and even more so, Office) sales and profits, while Apple is depending on hardware sales. Still, the shop prices of Windows 7 are almost as symbolic as Lion’s $29 price tag.


So, if you ever wondered about the strange difference in pricing of recent version of OS X and Windows: The prices say nothing about development costs, the product’s quality, its value for the customer, or the value it has in the eyes of the company which sells it.

They just make it up.

1 Or almost Zero in Lion’s case. Upload transfer costs might not even add up to $0.01.

Sun 2010-10-31 ( bl En )

You may have noticed that my blog has been down for the last week. We have moved to another server, and I am updating to the latest Camping version, which sadly broke some of the old API.

Expect quirks and 500s for the next days until I’m finished with the port.

Oh, and by the way: I’m in New Zealand! Follow @murphy_nz to find out a lot more about that (with photos!).

Update: It’s fixed, and runs on Passenger now!

Thu 2010-09-02 ( En pr )

When you include this in your ~/.bash_login file:

# Show current git branch or SVN subfolder in prompt.
function prompt_func() {
  branch_pattern="\* ([^$IFS]*)"
  if [[ -d "./.git" && "$(git branch --no-color 2> /dev/null)" =~ $branch_pattern ]]; then
  elif [[ -d "./.svn" ]]; then
    path_pattern="URL: ([^$IFS]*).*Repository Root: ([^$IFS]*).*Revision: ([0-9]*)"
    if [[ "$(svn info 2> /dev/null)" =~ ${path_pattern} ]]; then
      branch=`/usr/bin/ruby -e 'print ARGV[0][ARGV[1].size + 1..-1] || "/"' ${BASH_REMATCH[1]} ${BASH_REMATCH[2]}`
  PS1+=" "

…it should show you, depending on what kind of folder you’re in, the current git or svn branch:

~ cd ruby/coderay
~/ruby/coderay:trunk@644 cd ../coderay-0.9
~/ruby/coderay-0.9:branches/0.9@641 cd ~/studies/ikiwiki/

It is quite fast, but needs Ruby (any idea for a bash-only version?)

Update: Fixed a few things.
Update 2: Cleanup, SVN revison number.

Tue 2010-08-10 ( En pr bl )

Yes. I’m sorry. I’m busy with:

  • starting a new job at sofatutor
  • friends
  • Shadowrun
  • reading/writing on Twitter
  • preparing for my New Zealand trip from late October till New Year
  • watching JAG, season 5 (in English)

Because of this, I could not find the time yet to write about

  • rbJL’s Zucker gem
  • the latest updates to the Schatten project
  • CodeRay 1.0
  • my new iMac
  • my love for m&m‘s
  • what I like/hate about Twitter

You can follow me on @murphy_karasu (manchmal schreibe ich dort auch Deutsch), and/or you can have a completely unrelated “motivational” poster:

Sat 2010-07-10 ( En pr )

I’m sure I’m not the first one to find this, but here’s a working example for a i18n version of Integer#ordinalize.


First, you need to define <locale>.rb files in you lib/locales folder for each language. Here are examples for English, German, and French:

# lib/locales/en.rb
  :en => {
    :ordinal => proc { |number| number.ordinalize }

This is using the built-in ordinalize extension, which does the English job.

# lib/locales/de.rb
  :de => {
    :ordinal => proc { |number| "#{number}." }

German ordinalization is really easy.

# lib/locales/fr.rb
  :fr => {
    :ordinal => proc { |number| "#{number}#{number == 1 ? 'er/re' : 'e'}" }

You’ll have to find out how to apply the correct genus all by yourself if you don’t like the self-service-slash :P

More languages can be added, but it gets really complicated for Spanish or Finnish.


After you restart your server (also in development mode!), I18n.t('ordinal') will return a Proc object. You can use it in your view like this:

<%= I18n.t('ordinal')[count] + ' ' + I18n.t("article") %>

Notice the use of [] for the object returned by the I18n.t call: It’s calling the Proc, passing the number argument, which is then ordinalized according to the current locale. You could also use .call(count), or even .(count) in Ruby 1.9, but I prefer the brackets.

Wed 2010-07-07 ( En De pi fu )


Edit: Ich glaube, das war eine Zitronenpresse. Mist.

Fri 2010-06-25 ( En fu ap ra )

Wed 2010-06-23 ( En ap )

Apple didn’t manage to provide real photos of the iPhone 4’s new display’s quality on their website. 960×640 pixels sure sounds a lot (almost iPad resolution), but I wasn’t convinced, because those digital demos look nothing like a real display.

Thankfully, Engadget has now provided this great comparison photo:

That’s the icon for the Maps app, of course, on iPhone 3GS and 4. Its actual size on the display is 9mm (0.354in), or the width of a typical paperclip, or the height of those arrow keys on a modern Apple keyboard, or the distance between strings on a 6-string guitar, or half the width of my middle finger. It’s really small.

If you have an iPhone or iPod touch (any generation), look at that icon. Can you see the white line between the red and blue parts of the road sign? That’s almost 2 pixels high on an iPhone 4. See the number “280”? The lines are a little more than 2 pixels thick there. See the pin’s head? That’s about 20 pixels in diameter now. The vertical road is about 15 pixels wide.

Sat 2010-06-12 ( En fu )

Very cool music video from Mr Scruff:

Actually a remix of Kirsty Almeida’s Spider.

He draws and animates those videos himself, I read. Is this done with Adobe® Flash®?

Available from Ninja Tune on 12" only. Thanks for releasing it officially on YouTube, too!

Tue 2010-06-08 ( En ap )

Apple claims:

It works like this: As you browse the web, Safari detects if you’re on a web page with an article.

Something like Reader might actually turn Safari into my main browser – depending on how well it works.

So, how does this magical “detection”-thingy work? It works on sites like heise, SPIEGEL, or The Wall Street Journal. But it doesn’t work on TUAW or on my blog. Does Safari 5 have a list of well-known mainstream media news sites? Is this what Steve Jobs meant when he said:

I don’t want to see us descend into a nation of bloggers.

I mostly read blog articles nowadays, and Safari Reader is pretty useless to me for now.

Update: Funny thing, it works on Daring Fireball. Maybe this is because John Gruber is considered mainstream now ;)

Update: ars technica claims (Safari Reader enabled):

Safari 5 contains heuristics that will detect if a webpage contains an article and it will present a “Reader button” in the Smart Address field.

Well, how nice for your site. Which heuristics? I couldn’t find any hints in the Safari Dev Center.

Update: It gets funnier :-) With the last update, this article just became a Safari Reader heuristic winner. So it’s about content length?

Update: It looks like it. Yay :-D

Wed 2010-05-05 ( En ra )

Commercial advertising: I hate ads. I hate them. Lipstick commercials, infomercials, placards, Greenpeace booths, Spam. I hate them from the bottom of my heart. They are distracting, stupid, ugly brainwashers, lies and propaganda which reduce my ability to consume information or do work through any media. They are the reason I stopped listening to FM radio. They are turning my mailbox (the real one and the virtual ones) into a wastepaper bin. They make me angry. Like cigarette smoke.

The main reason I switched from TV, magazines, and radio to the computer is, apart from interactivity, that you can actually live pretty ad-free in there. I rarely see ads on my MacBook (mostly MSNBC ones that I simply mute). I installed anti-ad plugins on every browser I use (except one, see below). I uninstall every application that tries to ad me.

Tue 2010-05-04 ( En pr )


(defn <3 [love & loves]
  (loop [l (str "I love " love) loves loves]
    (let [[love & loves] loves]
      (if (nil? love)
        (str l ".")
        (if (empty? loves)
          (str l " and " love ".")
          (recur (str l ", " love) loves))))))
(<3 "cookies" "cake" "chocolat") ;; =>  "I love cookies, cake and chocolat." 


I =
def I.<(three, *args)
  puts "I love " + args[0..-2].join(', ') + ' and ' + args.last + '.'
I.<3, 'test', 'foo'
#~> I love test and foo.

I like the Clojure one better, even without syntax highlighting :)

Update: Licenser complained, so here’s an improved version:

Tue 2010-05-04 ( En pr fu )

Here’s the ultimate reason why Ruby is better than Python:

Jus ried o clean my keyboard, and now he key is suck. I can no longer run my Pyhon programs, bu I can sill run Ruby scrips. A definiive improvemen.

A gem from Fredrik Lundh, 2003.

Fri 2010-04-23 ( En De pi )

Nature 2.0 // Dux in a row

See more of her art on her website (sadly, it uses FRAMEs).

Fri 2010-04-23 ( En ap )

Well, Gizmodo spoiled a lot of secrets about the next iPhone in the last week. But I think this won’t hurt Apple, or Gizmodo, or anyone. It’s already internet history.

An interesting side of this is that this might be the first time that we actually see new Apple hardware from inside before we see how it looks to the average user. Apple always focuses on user experience, and never flaunts with tech specs without connecting them to real-world benefits. This is especially true about the iPhone; they don’t even mention the CPU’s speed or the size of the RAM anywhere on their side. Apple doesn’t provide specs for the iPad’s A4 – they just state that it’s fast and efficient. This time, Gizmodo has stripped down their next child before we saw her face. It’s tech porn. I prefer Apple’s reality distortion field.

Fri 2010-04-16 ( En po )

As Howard Fineman said on Tuesday in Countdown about Barack Obama’s Nuclear Security Summit:

And I think [Obama] also wants to show that in the 21st century, security is about links. It‘s a different paradigm from the Cold War. It‘s almost like the Internet in which you prosper, you profit by the links you make to the other people on the net. He‘s trying to do that in terms of diplomacy globally.

More and more world leaders really get globalization. We share enemies and threads. We are sitting in the same boat. We need to paddle together, and the US wants to be the cox.

Fri 2010-04-16 ( En )

I didn’t know where the strange name “Wizengamot” in the Harry Potter books came from (the Supreme Court of the Wizarding world). Now I found out about the Witenagemot: It was a ring of advisors to the Anglo-Saxon kings of the 7th – 11th century.

Interestingly, J.R.R. Tolkien’s term Entmood is also related to the terminology. Thing is another, earlier type of such political institutions and meetings.

Wed 2010-04-14 ( En ap )

I don’t know yet.

According to the first Geekbench results, the Intel i7-620M at 2.66/3.33 GHz in latest flagship MBPs is about 30% faster than the previous Core 2 Duo T9900 at 3.06 GHz. Compared to my early 2008 MacBook (which has a T8300), that’s a 70% speedup. That’s huge, but it’s just a synthetic benchmark. Still, it’s clear that the new MacBooks are speedy, and the new CPUs are not the only reason.

Cupertino finally dumped the crappy NVIDIA chipset in favor of Intel’s integrated graphics. It was a bad deal for MacBook Pros all along: While the MacBook really benefits from a more powerful GPU, especially when some applications use OpenCL, the Pros already have a good graphics chip built-in! All Apple achieved in the late 2008 update was to nullify the speedup that updating to DDR3 would have meant.

Today, Apple corrected their mistake. The i5 and i7 chips seem to be the fastest that Intel makes for the 35W class. I’ll be visiting a Mac shop in the next days to try out some my-world benchmarks. Hopefully, I can get what I have been searching for over a year now: More Speed™.

Update: Geekbench has confirmed my results.

Mon 2010-04-12 ( En ap )

A very minor point in the list of new APIs was this one:

Interesting. They didn’t have this feature before? Apple seems to realize that every weapon they give to developers, even if it’s just an optimized API for something you could also implement on your own, is another selling point against Android. Because Google can’t optimize that deeply: Android is polymorph, and hardware-level fine tuning is a lot of work. Or money, that is. Windows 7 and the other systems will have to fight the same uphill battle.

Having really fast text pattern matching on a mobile device is a feature in itself. Keep in mind that even the iPad is still an order of magnitude behind on raw processing power compared to current laptops. Everything can become a bottleneck in the iPhone OS world.

By the way: CodeRay for iPhone OS, anyone? :D Regular expressions are the core of every good syntax highlighter.

Sat 2010-04-03 ( En )

A short story by James Thurber, read by Countdown anchor Keith Olberman.

I’ll be hiding in the middle of nowhere (Rädel, Brandenburg, Germany) for the next 8 days with my Boy Scout Patrol “Berglöwe” (Mountain Lion) on an Easter camp. No computers, no internet, no electricity. Just cooking over the campfire, sleeping in black tents and singing to guitars.

Happy Easter holidays to you all!

Fri 2010-04-02 ( En pr )

Revision 534 of my syntax highlighting library updates the HTML output to HTML5 and CSS 3, which means IE users will need to install a browser to see CodeRay highlighted code.

Yes, I’m radical. Feels so good.

(By the way: Microsoft can choose to support CodeRay again if they wish :)

Mon 2010-03-29 ( En ap )

(See also my initial thoughts.)

I wondered why the latest Apple devices, including MacBooks (especially the Air), iPhones, and now the iPad all have rounded backs/bottoms. Well, the answer is very simple: Remember the last time you had problems picking up change from a counter? It would be nearly impossible to pick up a 700 gram (1.5 pounds) metal slate lying flat on a table without being able to put a fingertip under it:

It’s so simple that you don’t notice. Like some kind of industrial design typography. Sure, it doesn’t look nice from the back – but who cares? The only important part is the front.

Thu 2010-03-25 ( En fu pi )

Sun 2010-03-14 ( En pr )

I have written a little TextMate command (download) that allows you to count Lines of Code of the current file:

Here, this command is being used to verify that blokk stays at 318 LoC.

It needs CodeRay 0.9.1 or later.

Fri 2010-03-12 ( En )

My homepage was about:blank for over a year now. I was sick of slow-loading start pages, and I just don’t have any site I really frequent so much that I want to look at it every time I open a new browser window.

But today, TPUTH became my Home Page in Firefox. It’s a metablog about “tech and design”.

What got me? The whole digital yellow-press newspaper style combined with Socialist party medals of geek gods, a Cyrillic-looking title that you can’t pronounce (try it!)…it’s just cute, and funny, and stylish. It has daily funny pictures, and only features ironic headlines that link straight into the blogosphere.

Thu 2010-03-11 ( En pi )

Ever needed a or a ?

Here’s a nice generator by the French team Country and Kath. It produces animated GIFs for a style and background color you select. You can download them, and they are Public Domain (at least that’s how I understand totally free for use).

I know I’m contradicting myself here:

Seriously, drop animated GIFs. They stink.

AJAX loading indicators may be the only valid excuse for using an animated GIF. And maybe writing a blog post about them.

Sun 2010-03-07 ( En pr ap )

In January, I wrote about my thoughts on the iPad:

Somehow, I’d like to code on that thing! TextMate 2 for iPad?

Some weeks later, I realized that this might have been a stupid idea. Isn’t the iPad a media viewer, with editing capabilities for visual things like presentations at most?

On third thought…

Well, now Matt Gemmell writes about iPad Application Design. The first line that got me was:

Look like a viewer, and behave like an editor.

Wow, what a statement :) Isn’t that what TextMate is all about?

Wed 2010-02-24 ( En pr )

If something has more than, say, 5 parameters, it should be divided into components that have less.

Less is more. Hierarchies, if sensibly applied, can manage complexity.

Think LEGO.

Mon 2010-02-22 ( En pr )

1 puts, p, print

2 require

3 raise, throw, warn

4 new

5 to_s, to_i, to_f, to_sym

6 private, protected

7 class

Sun 2010-02-07 ( En bl )

Why did I name my blog “(almost)”? Two reasons:

  • My internet nickname is murphy, and I’m German. However, was taken. I thought I could use that as an idea for the name.
  • I’m an incomplete being. There’s a great Blues Brothers song called Almost (original by Downchild) which gave me the idea. I think “almost” is a nice word, too.

So, this is my explanation :) What about your blog’s name?

Sat 2010-02-06 ( En fu pi )

Thu 2010-02-04 ( En po )

Here’s a good article about the recent discussion about finally allowing gays (and lesbians) to serve openly in the US military. I hope Obama and the Admirals get this through.

And what about you, Turkey? Serbia? Greece? Singapore, Malaysia, Myanmar? North and South Korea? Sri Lanka, India, Pakistan? Western Asia (except Israel)? Venezuela, Chile? Cuba? And, for god’s sake: Jamaica.

Thu 2010-02-04 ( En fu pi )

Or, the original version:

Tue 2010-02-02 ( En pr )

They do. As do Germans, Spaniards, Californians, Czechs, Polish, Indians, and propably some Japanese. I think that’s cool :)

Sun 2010-01-31 ( En pi ra )

This has got to be one of the ugliest logo images of a professional project ever:

But it’s used on their official website! This is embarrassing for “The Industry’s Foundation for High Performance Graphics”, as they call themselves. Seriously, drop animated GIFs. They stink.

Website Copyright 1997 – 2010 Khronos Group. A-ha. How about updating it to today’s web standards? At least make it valid!

I hope they make a WebGL website in the future ;)

Thu 2010-01-28 ( En ap )

Well, my prediction was wrong. After all these years, rumors have become reality: The iPad exists.

So, here are my thoughts about it:

  • The name is silly.
  • The lack of multitasking (they would have mentioned it if it was allowed) is definitely a problem. I don’t mind this limitation on the iPhone, but I can’t see anybody doing office work without being able to switch to email, browser, calendar, and messaging applications. I’m sure Apple knows that, and has come up with some solution.
    • Maybe apps really save their state always, and are starting up so quick that it doesn’t really matter if an app is running or not, the springboard just mimics an Exposé.
  • The A4 is running at 1GHz and has a graphics chip built in. I think this is interesting; Apple may become CPU/GPU-independent in the future. A4 in the 4th-gen iPhone?
  • Nobody seems to know about the RAM. But I guess it’s not fast enough for tasks like video editing or compiling.
  • Somehow, I’d like to code on that thing! TextMate 2 for iPad?
  • The user interface seems strange to me…a crossover of the iPhone OS full-screen, one-app-at-a-time interface on a traditional Mac OS X desktop?
  • Why in the world did they put in a compass and a microphone?
  • The keyboard is “almost to scale” – what’s that supposed to mean? How am I to type on this thing? Do I always need a chair? (They really needed that armchair for the presentation.)
  • Price: $499 is cool, but why is it so much more expensive with 3G or more storage? But I guess 64GB would be enough for almost every task, for now.
  • GPS seems to be limited to the 3G model.
  • No camera…so, I take a camera with me and…how to get the photos on the iPad?
  • No ports. No USB, no micro display, no nothing. I want to be able to plug in USB sticks! They didn’t even put in one of those SD card slots that recently popped up in MacBooks and iMacs. The answer to this is Accessories. Some of those cost extra; I don’t know if the SD/USB dongles are included.
  • Apparently the 3G model uses Micro SIM. That may be a problem, even if it’s unlocked.
  • 10 hours battery are nice, but expected.

All in all, it seems I would still need a laptop to perform day-to-day tasks. In its current form, the iPad is no replacement for a MacBook, not even the Air. It will be compared to the Kindle and other tablets, and the price will surely be a major con.

But as Mel Martin says, I’m sure Apple improves it over the next years.

Wed 2010-01-20 ( En pr )

Ruby 1.8.6

…defines the following constants:

Mon 2010-01-18 ( En pr pi )

Two weeks ago, I demonstrated how to draw text on a WebGL texture. Eric Shepherd is even rendering video [warning: with sound]. Today, I’m rendering web content – that’s to say, a HTML page.

Again, I’m using the canvas 2d context to draw the content before using its data for the texture. The example is also based on Giles’ WebGL Lesson 7.

Mozilla’s Firefox has a unique feature called drawWindow. It’s not secure and thus you have to ask the user for explicit permission. So, it’s not ready for general usage, but it’s a nice demonstration.

Note: Before the example works, you have to enable the signed.applets.codebase_principal_support option in about:config. Disable it afterwards!

I also use an IFrame. So, this is about as evil as it gets.

Firefox only; you'll be asked for permission.
You need a WebGL-enabled Firefox to see this.

Here’s the code:

Thu 2010-01-14 ( En ap pi )

The world expects a “tablet/slate/unicorn/whatever”…as James Higgs puts it.

My prediction, and I go out on a limb with this, is:

There is no f*cking tablet!

Update: Oh wait, now they’re even dismissing a non-existing product!

Apropos…why not posting some more images of unicorns :)

Tue 2010-01-12 ( En pr )

Kirk Haines just stated:

If superior execution time is only achieved by offloading extra work
to an idle core, then that really isn’t a gain.

Agreed. Just because we have multiple cores now, that doesn’t mean we have to spawn threads for everything. In my opinion, achieving great single thread performance with good algorithms and clever optimization is still the best way of programming fast applications.

Fri 2010-01-08 ( En pr pi )

I compiled a pie graph of times needed for CodeRay scanner tests. More test data for a language means more time to run the tests.

As you can see, I have a lot of tests for Ruby (60,000 lines of code) and C (70,000), and less for Delphi (11,000). The combined “other” languages are C++, the CodeRay debug format, diff, ERB and Nitro HTML templates, Scheme, and XML.

I used the excellent Gruff graph library.

Here’s the code:

Thu 2010-01-07 ( En pr pi )

WebGL has no text rendering functions. But it’s pretty easy to create a texture with text using canvas 2D context:

Looks best in Safari. Firefox has some strange issues with the font rendering.
You need a WebGL-enabled browser to see this.

The interesting code:

Thu 2010-01-07 ( En pr )

When cp -r takes a lot of time, I want to have an estimate how long it will take. My first approach was based on checking the size of the copied data repeatedly with du -sh.

This is obviously now very clean. Marco (a fellow student) told me that cp reacts to the SIGINFO signal by printing the progress to stdout. The manpage says:

If cp receives a SIGINFO (see the status argument for stty(1)) signal, the current input and output file and the percentage complete will be written to the standard output.

This is what the output looks like:

$ cp3 large.file large.file.copy 
large.file -> large.file.copy  42%
large.file -> large.file.copy  88%

Here’s the code:

Wed 2010-01-06 ( En pr )

I’m trying out a new scanner/encoder concept for CodeRay that would (hopefully) make highlighting even faster while improving the code at the same time.

Basically, it’s about bypassing the Tokens representation altogether.

The tests can be seen at Odd-eyed code.

Here are my results so far:

Tue 2010-01-05 ( En pr )
(1..100).select { |n| p n if ('1' * n) !~ /^1?$|^(11+?)\1+$/ }

Basically, the /^(11+?)\1+$/ part checks if the 1-string can be factorized. See Avinash Meetoo.

Mon 2010-01-04 ( En pr )

I use TextMate for everything that is text. Programming, organizing, shell-foo, writing for studies, protocolling, writing songs or guitar tabs, looking at patches and code, organizing, learning. And I have given up some great editors for it – Delphi, RDE, VIM, Weaverslave…actually, I switched to Mac in 2006 because of this software.

Sun 2010-01-03 ( En pr )

I just found out that I am [one of] the 129th most busy Rails Contributor[s], for my work on 7 patches back in 2006 and 2007.

Actually, I’m even #97 because 3 tickets for murphy where counted separately. Yay! I’m one of the top 100 Rails contributers. Now that’s something to brag about :D [Update: Xavier Noria added the alias. Great!]

Funny: Ezra Zygmuntowicz, Ola Bini, Sam Ruby, _why (the lucky stiff) and Zed Shaw come in last with only 1 commit. Even JEG2 has only worked on 3 tickets.

Also funny: There are currently exactly 1337 contributors listed!

Sat 2010-01-02 ( En pr ), a new site about developers’ lifes and works by Ian Stewart, is using my CodeRay syntax highlighter :) Nice.

Quote from his mail to me:

*Such* a great gem!

Thu 2009-12-31 ( En pr )

But it’s more due to Perl being so unpopular lately. Ruby stagnates; maybe Ruby 1.9.2, Rails 3, JRuby, MacRuby and Gemcutter can make Ruby more interesting in the future.

Update: It seems my prediction was wrong. But I wait another month before I take it back :)

Update: Epic fail. I was totally wrong; instead, Ruby is out of the Top 10 (Delphi took its place again). Every Top 10 language except C and Perl seems to weaken because of the advent of Objective-C and Google Go (the so-called company languages).

Wed 2009-12-30 ( pr En )

A cool feature of JavaScript 1.6 is called E4X:

var xhtml = <html xmlns="">
                <title>Embedded SVG demo</title>
                <h1>Embedded SVG demo</h1>
                <svg xmlns="" 
                        viewBox="0 0 100 100">
                        <circle cx="50"
                                fill="yellow" />

alert(; // Alerts “html”
alert(; // Alerts “”

I’m trying to highlight this syntax with CodeRay, but it’s a bit more complicated than I thought.

Sun 2009-11-29 ( En pr pi )

The last weeks I have been experimenting with WebGL, the upcoming 3D extension to the HTML 5 Canvas element. It is supported by the latest WebKit and Firefox nightly builds (read about getting WebGL to run on your system).

Now, here’s a rotating 500 4000 about 4900 polygon semi-transparent 3D sphere complete with a texture and lightning, animated via OpenGL by your graphics card – no Flash plugin needed (click the image):

Click me!

If you want to stay updated about this developing technology, you can subscribe to the Planet WebGL meta-blog feed.

I can also recommend Giles’ step-by-step tutorials on, which I based my sphere example on.

This is just the beginning :) Some people are already creating games, demoscenes, and Viewers for 3D models with WebGL.

Update: Much faster mesh generation, more polygons. Always use Array.push instead of Array.concat.

Update 2: The Mesh library is now a separate file. Fixed some bugs with mesh generation.

Sun 2009-10-04 ( En pr )

In my tests, Ruby 1.8.7 runs simple benchmarks about 3-8% faster than 1.8.6 – that’s nice!

But Ruby 1.9.1 is far more fast, with speedups up to 2x for some real-life cases, and a reliable speedup around 10-20%.

JRuby performs better than 1.8, sometimes even better than 1.9, but only for longer tasks. For short benchmarks and day-to-day tasks, it’s often 2 or 3 times slower than any C-Ruby. The startup time is around 1 second, and thus JRuby is not the right tool for scripting tasks. It runs best on Java 6.

Wed 2009-09-30 ( En )

Draw here!

Draw the symbol you want to TeX in a HTML 5 Canvas, and it (mostly) gives you the command. Wow :)

Sat 2009-09-26 ( En pr )

I updated my Ruby 1.8 vs. 1.9 benchmark.

It seems they continue to speed up Ruby in the latest 1.9 trunk, eliminating some slowness and stabilizing the new VM.

For the projects I am programming lately, namely Fukubukuro (a JavaScript interpreter in Ruby) and EPIC/EVIL (a secret project ;), Ruby 1.9 turns out to be about twice as fast as Ruby 1.8.6. I also profit from faster testing, spec-checking and RDoc generation.

Sun 2009-08-02 ( En ap )

uptime says my MacBook with Leopard (OS X 10.5.7) has been running for over 21 days now without reboot, and with lots of sleep phases:

 9:55  up 21 days, 20:55, 3 users, load averages: 0.47 0.36 0.35
Wed 2009-07-22 ( En pr )

A Chess simulation with JavaScript and HTML 5 Canvas.

It is to be played by two human players. I’m planning a computer opponent.

  • shows board and pieces (as letters)
  • shows possible moves
  • move pieces: click on piece, then click on target square
    • all move rules except check, castling, en passant, draw game rules
  • tested with Safari 4.0.2, Firefox 3.5.1, Opera 9.64, and iPhone OS 3.0
    • No shadows on Opera :-(
  • graphical pieces, thanks to Cburnett from Wikipedia
    • I actually extended the Shapes library to interpret SVG paths!
Sat 2009-07-18 ( En pi )

I managed to build a readable QR Code (a 2D barcode) with my Lego blocks:

The encoded content is the URL of this blog, As you can see, I had not enough black pieces, and improvised with blue. I had to fill the background with white pieces to make it readable.

Fri 2009-07-17 ( pi fu En De )

I saw this one in my Finder sidebar on Wednesday.

Wed 2009-07-15 ( En fu )

Nice new campaign from Microsoft.

Sun 2009-07-05 ( pi En De )

Sat 2009-06-27 ( En ap )

Snow Leopard, the next version of Mac OS X, is scheduled for September, a month before Windows 7. It will be almost completely 64 bit, Intel-only, and cost $29€ for Leopard users. Apple first announced that Snow Leopard would merely include speedups and core improvements, but now they added a lot of new features as well – not all of which get the publicity they deserve.

Sun 2009-06-07 ( En pr )

Ever wanted to know how much longer your cp -r needs? This little Ruby script might help you.

$ cp2 coderay coderay-0.8
From: 307M	coderay
To:   154M	coderay-0.8

The second line updates every second while copying. It’s fast enough on OS X, but I’m sure it can be optimized.

Here’s the code:

Sat 2009-05-30 ( En po ra )

Today, President Barack Obama released plans to create a new government office dedicated to Cybersecurity. In his announcement, he stated:

Let me also be clear about what we will not do. Our pursuit of cybersecurity will not – I repeat, will not include – monitoring private sector networks or Internet traffic. We will preserve and protect the personal privacy and civil liberties that we cherish as Americans. Indeed, I remain firmly committed to net neutrality so we can keep the Internet as it should be — open and free.

Sun 2009-05-17 ( En pi fu )

I love this movie.

Mon 2009-05-04 ( En pr )

Here’s another experiment with canvas: a simple map editor (click on the image).

You need Firefox, Opera, or Safari to see this; preferably one of the current beta versions (Safari 4 runs fastest, Firefox 3.5 is okay).

Wed 2009-04-29 ( pi De En )

Sat 2009-04-25 ( En pi ap )

I’ve always been a fan of steampunk. This one is a nice calculator for the iPhone. It was made by Halle Winkler, a programmer in Berlin – and I haven’t found out yet whether this is a female name o_O

Thu 2009-04-23 ( En pr )

TeX is much to complicated for me, especially when it comes to simple text – I prefer the simplicity of Textile. But when it comes to typesetting formulas, there’s no real alternative.

So I’m trying to combine them, with this little Ruby script which runs on Leopard and uses latex2png:

Tue 2009-04-21 ( En pr )

Another great article about programming is the quite short piece Teach Yourself Programming in Ten Years from Peter Norvig, written 2001. The title should be enough to stir your interest :)

According to this article, I’m some years and a few programming languages away from becoming a “master”. Yay me!

Sat 2009-04-18 ( En fu )

Please don’t vote now.

Actually, I think blog polls are statistically ridiculous.

Sun 2009-04-12 ( En pr )

One of the best articles I’ve read about general programming language topics is Jonathan Amsterdam’s Java’s new Considered Harmful (click on “Print” for a less ad-cluttered version.) He criticizes the use of the new Constructor(...) statement in Java on a functional level, concluding that “…for statically typed languages, it may not be possible to do better…”.

If you are interested in the never-ending discussion about static versus dynamic typing, I encourage you to read it. If you’re not, well, do something else.

Amsterdam also mentions Ruby’s approach to object creation, stating that it fixes a problematic behaviour of Smalltalk. Still, according to him, one problem remains:

A second drawback with […] Ruby is that initialize, being an ordinary method, does not chain: You must remember to begin your initialize methods with a call to the superclass’s initialize method.

Wed 2009-04-08 ( En De pi )

Mon 2009-04-06 ( En De pr )

1 Ruby

2 Python

3 JavaScript

4 C

5 QBasic


7 Java

Mon 2009-03-30 ( En De ra )

Sarah Palin

Guido Westerwelle

Andrea Ypsilanti

Franz Josef Jung

Hans Joachim Schellnhuber

Hartmut Mehdorn

The Pope

Sun 2009-03-29 ( En ra pr )

-7 TeX – hate it, can’t find a replacement

-6 MSN Messenger, ICQ Client – I hate ads

-5 TWiki – the ulcer of Web 2.0

-4 coderay executable – ugly, cryptic, incomplete – needs a rewrite

-3 RDoc – hopelessly bad

-2 – so buggy that it hurts

-1 Internet Explorer 6 – it’s the devil

Sun 2009-03-29 ( En pr fu )

Wed 2009-03-18 ( an En )

The Sky Crawlers, the latest movie from Mamuro Oshii, the director of the Ghost in the Shell movies. A quiet, poetic, philosophic, dramatic, sad movie. With lots of silence, CG airfight, cigarettes, children, a mother, a father, and a dog. And to your enjoyment, it’s two hours long.

I’ll just re-post my message to Frostii here:

Tue 2009-02-24 ( pr En )

It’s final. I fell in love with JavaScript.

I still love Ruby, but she can’t do this:

Your browser sucks.

(Essentially the clock from the Mozilla Canvas tutorial, a little tweaked.)

No GIF, no Flash, no Silverlight, no SVG, no ugly hacks – just HTML and JavaScript. As an added bonus, it doesn’t work in Internet Exploder.

Mon 2009-02-23 ( En fu )

…or a meta version of them. Hard stuff.

And someone once wrote my CodeRay website was ugly!

But nothing is as cool as
Hey, their favicon resembles the CodeRay one o_O

Mon 2009-02-16 ( pi En pr )

Another variation of Ruby-chan for the CodeRay Website.

Fri 2009-02-06 ( fu En De )


  • harakiri-training.{net,com,org,de} – ceremonial suicide for perfectionists
  • son[-]schmar[r] – So’n Schmarrn!
  • – nicht M. Ülleimer
  • – Homepage des Dr. Schäuble
  • – master your SQL
  • perfect[-] – Der perfekte Käse.
  • – ein Rhinozeros, das “Miau!” macht
  • – Ey, Dude!
  • abc[-] – Buam!
  • – Die spannendste Sportart der Welt!
  • – Manage your insolvency online for FREE!
  • oddeyedcat.{net,org,de} – strangely beautiful
  • – *kick* — SOLD!
  • – Read My Fucking Blog!

Waldkitas sind langweilig!


(This is an open list, add your ideas in the comments.)

Tue 2009-02-03 ( En pr )

Nobody can solve a big problem. But some people are good at dividing big problems into smaller problems that everybody can solve.

Those people are called programmers; their skill is division.

Thu 2009-01-22 ( pi En De )

This was 4 years ago. I assume they are still computing the image of the 2006 map.

Sun 2009-01-18 ( En ra )

github commit comments

There’s a form for comments, but if you try to send it, you’re redirected to the login page! If you don’t know how to fight spam, at least don’t let me type my shit into the trash bin. I allow anonymous comments on my blog, and if you don’t, you stink.

nVidia Forums

Your captchas are so stinkin’ unreadable that I had to try at least a dozen times ! I’m not blind you know? And if you validate my email adress anyway, why bug me with captchas? And then, I couldn’t log in! After trying a dozillion times, I found out that you have to give your email and password, instead of the nickname you had to choose. Try reading some interface guidelines! Finally:

Sorry, your account has been locked due to an excessive number of failed login attempts within a defined period. Your account will automatically be unlocked in 14 minutes


Thu 2009-01-01 ( En pr )

Ever wondered where a deep symlink points to? Try tracelink.

13:59:48 ~ $ tl foo2
foo2 --> foo (relative)
foo --> bla (relative)
bla: empty
14:00:27 ~ $ tl `which tl`
/usr/local/bin/tl --> /usr/local/bin/tracelink (absolute)
/usr/local/bin/tracelink: a ruby script text executable
14:00:34 ~ $ cat `which tl`
Tue 2008-12-30 ( En fu pr pi )

Did you know?

Every time you run the Ruby 1.9 test suite, a child dies :(

Sat 2008-12-13 ( En pr )

I wrote a simple version of the UNIX directory disk usage tool du (disk usage). Its output should be exactly the same as du -sh. Call it with the name of a file or folder.

Update: This is the second version, using a better method for the bytesize output and guessing the system’s blocksize.

Fri 2008-12-05 ( En )

I find this incredible (needs Flash). And this, too (needs Java).

Wed 2008-12-03 ( En fu )

All Episodes of Road Runner, on YouTube.

Mon 2008-11-24 ( En pr )

Teaching Rails more languages is now as simple as:

  • downloading example locales,
  • putting them in your config/locales folder, and
  • adding a method to ApplicationController that detects the user’s language:
class ApplicationController < ActionController::Base
  before_filter :set_locale
  def set_locale
    I18n.locale = request.env.fetch('HTTP_ACCEPT_LANGUAGE', '')[/(?:,|^)(de|en)\b/, 1]

You have to adjust the regexp to allow automatic recognition of more languages; I haven’t found out yet how to get a list of all available locales without using I18n.load_path, but maybe the community helps me out.

It’s cool that changes to the locale files are applied instantly in development mode! A great improvement :D

Fri 2008-11-07 ( fu En po )

I just love Sinfest.

Sun 2008-11-02 ( En po fu )
Mon 2008-10-13 ( po En )

So far, ever stinking attack from the McCain/Palin campaign against Obama has turned out to be false, misleading, or groundless. But Obama’s connection to ACORN in the past and today (see this McCain Web Ad) could be problematic, since ACORN is a left-wing organization that has tolerated, supported or lead criminal activities, namely voter registration fraud.

Wed 2008-10-08 ( En po fu )

Maybe it’s that simple – Gallup finds that John McCain is too old.

Actually, 23/6 were the first to understand this.

(Barack Obama is 47, while John McCain is 72 years old. Michelle Obama is 44, while Cindy McCain is 54. Joe Biden is 65, while Sarah Palin is 44, and younger than Michelle. Together, they are 326 years old.)

Sun 2008-10-05 ( En po fu )

My father took that photo in 2004 in Miami:

Well, I’m not sure if this is possible, but then, everything’s possible. Can’t be worse than Palin.

(Thanks to my brother for sending me the picture.)

Fri 2008-10-03 ( En po )

Question: Right now a recent study says and the polls reflect that Barack Obama is gaining ever since this crisis has landed in everyone’s kitchen table, why is that?

McCain: Because life isn’t fair.

(Fox & Friends)

They say they love being underdogs. Well, let them be.

Thu 2008-10-02 ( En po fu )
Tue 2008-09-30 ( fu En )

Is Murphy’s Law the way the universe protects itself from destruction?

In addition to delivering such wonderful thoughts, Megan McArdle’s blog reports about things happening in the US and is really worth a read.

Sat 2008-09-20 ( pr En )

(German translation on Ruby-Mine.)

Now, I’m about to write the Java Scanner for CodeRay (ticket #42 btw), and I thought it would be nice to have a list of built-in types highlighted – like String or IllegalStateException. I knew that TextMate had quite good highlighting for Java, so I checked the bundle for something to use.

Indeed, some smart guy included a very long regular expression into the token definitions, it looks like this:

support-type-built-ins-java = {
  name = '';
  match = '\b(R(GBImageFilter|MI(S(ocketFactory|e(curity(Manager|Exception)|
    ...this goes on for several screens...

Apparently, they converted a long list of types into a minimal regexp, surely using a script for this. But that wasn’t exactly what I had searched for. How could I convert this back into the original plain list?1

Tue 2008-09-16 ( En ap fu )

Seen the new iPod 4G color lineup?

Well, let me tell you what those colors stand for:

Sun 2008-09-14 ( po En )

I love Barack Obama’s speeches, and I wish we had such a charismatic politician with such bold ideas of change here in Germany. He’s an attourney, and I assume a great one. But he seems to have some problems with math.

Thu 2008-08-28 ( ap pi fu En De )

Fri 2008-08-22 ( En pr bl )

Camping sessions not working lately? Well, it’s a problem with Rails 2.1, to be more precise: ActiveRecord 2.1.0.

This took me at least 5 hours, but I finally got it: the latest version of AR does Dirty tracking and partial SQL updates. This means it only saves a new value when it thinks the attribute has changed. Nice, but it bugs Camping. So, here’s the patch:

Wed 2008-07-23 ( ap En )

I was waiting eagerly for 3rd party apps on my iPhone since I bought it…but I didn’t expect the apps to be this good. Turns out the best game is actually free: “Aurora Feint: The Beginning”. The developers are very active and nice. Give it a try, if you have an iPhone or iPod touch :)

Screw that. Apple has taken it down (Thank you! No sarcasm!) because it actually sends your contact list over to the developers’ server.

Mon 2008-07-14 ( ap En )

Please read my other post on the topic.

Sat 2008-06-14 ( ap En )

I love MacBooks, here’s another reason: LiquidMac!

It works using the internal Sudden Motion Sensor that protects the hard drive from “disk failures if the computer is dropped or undergoes severe vibration” (official info). Nice toy!

Fri 2008-06-06 ( pi En )

Looks like a very old or very futuristic city, don’t you think?

Tue 2008-05-27 ( En fu )


Sorry, I have to do my tax declaration today and it suuuuuucks :/

Fri 2008-05-09 ( En fu )

Really one of the funniest websites I’ve seen:

Wed 2008-04-09 ( En fu )

I got naked! is celebrating the 3rd CSS Naked Day. Enjoy my blog without CSS :)

Fri 2008-03-07 ( En ap fu )

MacBooks are closed with two magnets in the top corners of the screen. I wondered how I could put them to further use. This is what I came up with:

Thu 2008-02-28 ( En pi )

I had a short trip to London (business, you know).

Thu 2008-02-28 ( En pi )

A beautiful butterfly took a rest outside of my window for a while and waited for me to make photos of it ^^.

Thu 2008-02-28 ( pi En )

Some pictures of my home city I took a while ago.

Wed 2008-01-16 ( ap En )

This new MacBook looks nice. But it has strange specifications:

  • just 4 plugs: power, USB, headphones, µ-DVI.
  • no optical drive
  • no user-replaceable everything
  • backlit keyboard <3 – sweet nonsense
  • optional SSD drive…finally!
  • 1,36 kg (10 iPhones, or a kilogramm lighter than a MacBook)

Still, I’m thinking about getting one later this year. And I want an SSD (that’s a non-mechanical hard drive – die, HDD!), which is currently just too expensive (900 $ extra!) Am I crazy? Let me explain.

Mon 2008-01-14 ( bl En )

I have a new blog :-)

Not much to say currently, but stay tuned…or linked.