Archive for Dezember, 2007

Practical Common Lisp (PDF)

Montag, Dezember 24th, 2007

If you are looking for the PDF version of “Practical Common Lisp”, which is not anymore available from the “usual” address at apress.com, you can use this link: http://www.apress.com/resource/freeebook/9781590592397

Alternatively, go to apress.com, search for “Practical Common Lisp” and look for “Free eBook download” link in the left sidebar.

Loving and hating Rails

Montag, Dezember 24th, 2007

I’m actually trying to get the grasp of Ruby, but I have a hard time liking it. It’s mostly about people — Ruby itself seems a nice language, but Rails’ community is getting on my nerves. I haven’t seen many things that made me go “WTF?!?”, which could be attributed to pure Ruby, most go to Rails.

Let me give you just one example.

Every now and then I’ve tried to find some information on deploying Ruby and its “gems” system-wide. Apart from me hating the whole concept of “gems”, which rather defeats the whole package management of Linux and MacOS X, it seems to be possible, but at a very high price. Ruby fanboys like their local repositories of “vendor” code. Look at this:

But I highly recommend to freeze
rails (and any other gems you use) in vendor/.

Firstly, your app works with these versions correctly. Can you guarantee
that if a sysadmin decides to upgrade some gems (or downgrade one for
another app?) that your application still works as expected.
[...]
I think freezing all that stuff is just great to do. As far as I know
there are no performance downsides to this.

These people seem to have no clue about security. They don’t have a clue about why package management is good. All they care about is their MacBook, their TextMate und sliding down their Rails (oh, shiny!) Apart from wasting a lot of disk space for all of their “freezing”, there are two main things that piss me off at this stage.

First, it’s the inability to keep their own API stable. Either that, or you shouldn’t be using gems, which are in alpha on production servers. It doesn’t bother Rails advocates enough, it seems. Rails is now at 2.0 and there is still no indication there is any kind of stability. Every other product cares about their users and tries to keep all 1.x version compatible and break the APIs only at 2.x. At Rails the policy appears to be “minor version: minor breakage, major version: major breakage”.

Second problem is the administrator job, which can become a nightmare with Rails. Guys, have you ever heard of a thing called “Security”? Imagine a critical security error in one of Rails versions. A good administrator has to worry about upgrading all of available web servers and guess which servers he won’t be able to upgrade properly? Right, Rails ones, since there might be thousands of separate virtual servers with separate Ruby and gems collections. I don’t envy them. I am actually with Debian on this, who issued a position paper on RubyGems.

Rails community pisses many potential developers and administrators off. They make things easy for the developer, but not to others. I’ll continue to learn Ruby and to get a sense of Rails, but I don’t actually expect to like it a lot. Maybe after I’ve managed to install some Rails application without “frozen” gems — but this could actually take a long time.

Missing the point

Donnerstag, Dezember 20th, 2007

Jeff Atwood is missing the point when he talks about JavaScript performance. He’s talking about how “JavaScript is the Lingua Franca of the web”, whether “it [is] possible for browsers to run JavaScript significantly faster than they do today” and so on. Apparently, he doesn’t read Steve Yegge or reddit, since otherwise he would have read about JavaScript moving into the desktop domain:

As it happens, though, I’ve settled on Rhino. I’ll be working with the Rhino dev team to help bring it up to spec with EcmaScript Edition 4. I believe that ES4 brings JavaScript to rough parity with Ruby and Python in terms of (a) expressiveness and (b) the ability to structure and manage larger code bases. Anything it lacks in sugar, it more than makes up for with its optional type annotations. And I think JavaScript (especially on ES4 steroids) is an easier sell than Ruby or Python to people who like curly braces, which is anyone currently using C++, Java, C#, JavaScript or Perl.

Steve Yegge is excellent in talking about one thing and nailing several others on the way. He starts talking about his home-grown open-source game, moves over ranting about Java programmers onto some Gang-of-Four ranting and finally tells the public about his decision to rewrite his whole Java game in ECMAScript4. Actually, he’s talking only about his personal experiences, but these have a gigantic impact on the people. “A growing sense of doom” is a pretty good summary of the feeling. And while Reginald is particularly baffled about Java and millions of LOC, everybody is free to learn from Steve just about anything he mentions.

I wasn’t as amazed about Java, I rather had a lesson about JavaScript becoming mainstream. Real mainstream, a general-purpose language like Python or Ruby. Interpreters, JITs and compilers for ES4 are being developed, they are getting faster and it’s just a matter of time when JavaScript in browsers becomes a simple plugin, just like Java is now. JavaScript is the heart of Web2.0 now, but it’s extending to outer domains rapidly. Everyone who is not aware of this might be left far behind.

By the way, it feels good to be a part of a minority.

Ubuntu Hardy, Qt4.3 and anti-anti-aliased fonts

Mittwoch, Dezember 19th, 2007

Just for the record: ugly fonts in all of Qt4-applications in the current Ubuntu development release Hardy Heron result from a bug in Qt and this bug is triggered by the ttf-arphic-uming package. Remove it and you are ready to go again. Otherwise, you’d have to re-enable anti-aliasing for these fonts somewhere in /etc/fonts/conf.d/70-ttf-arphic-uming.conf.

Three steps to Google’s world domination

Samstag, Dezember 15th, 2007
  1. Create this new what-are-my-friends-sharing feature, Robert Scoble is so fond of, stripping LiveJournal of one of their benefits en passant (Friends’ Feed). At this point Google and LiveJournal, as just about any social platform, are closed up silos.
  2. Open up Google Reader (and thus Google Account) for anyone with an e-mail address, not just @gmail.com, thus making all of my non-googlified friends willing to use Google Reader now appear in my reading list (one more point for Google as opposed to LiveJournal) and enable anyone not willing to get a Google account to get a blog at Blogger (there you are, LJ, you are actually obsolete now). Google would be halfway-open now, since anyone can use their services without opting in for a Google Account.
  3. Convert Google Account to a full-fledged single-identity account (technically very challenging). Et voilà!

By the way, it’s actually creating a social network “that sucks less”™, since you already have messaging and IM, and you get to choose your friends according to what they do and what they like, not according to what they look like. Could be really interesting if Google adds a small text under each Google Reader article: “Shared by XX people”. Oh well, we’d need comments too, but it’s a good start.

Google is useless

Samstag, Dezember 15th, 2007

It seems an update for Google’s core, the search engine, is long overdue. Apart from tons of spam in it, Google also tries to be smarter than me, providing me with more useless search results. Ever tried searching for ubuntu islsm? islsm is a wireless driver. Apparently, Google doesn’t believe me I’m capable of writing my search terms correctly, so it silently corrects my search term to ubuntu islam. Yahoo is at least honest:

We have included ubuntu islam results - Show only ubuntu islsm

But, sadly, the best one in team is Live Search, which barely asks me, whether I’ve meant “ubuntu islam”.

That used to be Google’s default behaviour. It seems these glory times are over.

“Natural” Sorting

Donnerstag, Dezember 13th, 2007

Life could be so easy, according to CodingHorror.

Perhaps a more human-friendly natural sort option should be built into mainstream programming languages, too.

Just like that. So simple. Windows Vista Explorer does it right. Or does it? Maybe, if you are only considering English language and are only concerned about numbers. In any other case, we are talking about full-blown AI here. What about “The Beatles”? Should it sort under “B” or under “T”? How about Chinese language? How about lexicographical order in telephone books? What about diacritics in other languages? What about ordering “5 feet” and “2 meters”?

I could go on forever. “Natural” sorting is only about perception. It’s personal. It’s different for every person. It’s context-sensitive. Actually, the word “natural” is a problem too: something natural for a German is not natural for a Japanese. It’s not something we can decide either. Do we really want our computers or, even worse, our programming language to decide for us? Don’t think so.

If you ask me for a solution: maybe we should stick to putting context next to our data. If we know it’s a date, sort it like a date. If it’s a file name, sort it “naturally”, i.e. in the context of a file system. And if you really need to, implement a “natural”, context- and number-sensitive algorithm just for this file names list. Don’t bother including it into every single language in the world, since everyone needs something else, you’ll risk turning your language into PHP. If you really want to, make a class and implement sorting on it. Or maybe write a lot of mixins for different kinds of numbers-aware sorting — bad luck if your favourite language doesn’t support mixins.

There are a lot of alternatives. I agree that ASCII-collating is the easiest one, which should be avoided. But keep in mind that there is no such thing as a “natural sorting order”.

Update: Yes, Jeff and also most of the commenters on his article are mainly talking about sorting file names. Like I stated above, sensible sorting is only possible within a context and with file names there is no context since we don’t know anything about the naming principle. File names is a principle that should be abandoned in the near future, we should be using meta-data instead. File sorting problem would become non-existent then.

I feel like a prophet

Samstag, Dezember 8th, 2007

Today I’ve remembered something I posted on MozillaZine a long time ago and was eager to find it. It wasn’t that difficult, I still have an account there. Here it is.

Today that post is five years old. Holy crap. That much time I’ve been true to Mozilla. Sometime in year 2000, I’ve been using Mozilla M16 and told people it’ll be the next-gen browser. It became true with the release of Firefox 1.0. In that five-year-old post, I’ve said it’d be nice to have a common runtime and applications running on top of it. GRE has been a reality then, Firefox and Thunderbird were already born, but nobody really cared about GRE. Which is called XULRunner today and guess what they are basing future versions of Mozilla’s flagship products on.

I feel proud of myself.

We are in charge AKA Windows™ sucks at window management

Donnerstag, Dezember 6th, 2007

Focus stealing sucks. Yeah, like it’s something new. Free Software advocates have been praising something like this for ages, especially the sloppy-focus camp. Nevertheless, Jeff Atwood considers it important enough to write about, and, frankly, I must admit he’s right doing so, since maybe someone from his large audience will hear him and make Windows™ a better place someday. But the problems he describes are just symptoms for much bigger trouble you get into. And, sadly, these problems creep into other OS’ as well — the difference is that in most cases we can stop it, since these other OS’ are, well, free as in freedom.

(the idea is not new and not mine either, I just can’t find an appropriate link right now)

The main problem is that the OS is in charge of your work on your computer. No problem with that? Wrong. You are in charge of your work, the OS only has to enable the computer to help you. You are the one who is working, you are the one who decides what’s to be done and what not. Or so it should be. We are living in times when it’s perfectly acceptable not to know anything about your system so that all OS developers are trying to assume a total “dummy” is trying to do something with the computer and thus it just HAS to interfere and be “helpful”. Have you ever experienced a stove telling you something like “It seems you’re trying to boil some eggs, it might be better to grill them so I’ve turned on appropriate circuits”? This is however something we are experiencing with computers and particularly with Microsoft OS’. We are getting thousands of nag-screens, like “Would you like to register right now?”, “Updates are available, install now?” or “It seems you are writing a suicide note, need help with that or should I just call an ambulance?” It seems it is not enough for Microsoft.

That one particular dialog Jeff is talking about has been nagging me for ages, even when I’m logged in remotely onto a server 700 km away and editing some stuff in a configuration file, it still steals the focus and asks me (translated from UI-speech into human): “You’ve told me you’d reboot later, maybe now?” It’s just rude. My computer is forgetting who’s in charge. I am. I decide when my computer is to be rebooted, I consider staying unpatched for five more minutes (or days for that matter, it shouldn’t bother my computer), I decide when this “later” is. Don’t bug me.

Don’t bug me. Don’t treat me like an idiot. I’m not. This is why rm -rf / (Disclaimer: do not try this at home, it will damage your Unix system. You will be responsible — that’s kind of my point ;-)) starts working without any reminder — if I said so, I might actually know what I am doing. If I do not — well, that’s the reason we have driving licenses for the cars (I actually liked the idea of European Computer Driving License until I’ve seen the examination papers). The only difference is that computers won’t kill. Yet. That’s the reason users should read manuals or have some training. They are responsible for doing their job and doing it right.

Too bad we’re living in the wrong world for this.

It’s not like OS can’t help me do my work right. It should assist me, that was the whole point of pseudo-intelligent electronics. But it should respect me and consider that my current task is by definition more important than anything else. Even if it’s a warning about surging power in my laptop or an earthquake coming in about 30 seconds, it should notify me about this without interrupting my flow. Make it blink in the taskbar for that matter. Make it send me a mail if it’s less important. But do not jump into my face, telling me “Internet Explorer 7 JavaScript minor security update is available, download?” Even if I know what all these words mean, I don’t care at the moment. If I did, I’d probably have that patch already. It’s easy, right? It is really about assuming some kind of intelligence in the user. Hint him decently at the possibilities, he’ll be thankful. By the way, this is what Windows XP does with these notification bubbles, it works better than any dialog.

Back to this particular problem: focus stealing is nasty, no problem with that so far. But a particular application developer shouldn’t care about stealing or not stealing focus. This is treating symptoms instead of the illness. Windows just doesn’t have a decent window manager, like any decent Unix system has. What could be easier than putting all new windows in the background by default? Alas, Windows doesn’t do that. It’s just selecting some “sane” defaults. “Sane” as in “enough for beginners” and as in “what they don’t know, they won’t miss”. Poor souls like myself, who are stuck with better windowing at home and Windows at work, are screwed.

Arithmetics a là Microsoft: lies, damn lies… you know the drill

Mittwoch, Dezember 5th, 2007

Microsoft has apparently proudly declared, Vista has been pirated only half as much as XP. Huh? Twice as many pirated copies of XP vs. Vista, considering XP has definitely sold multiple times more copies than Vista has to date, means that Vista’s pirated-to-legal-ratio is much higher than that of XP. Do they consider their fan-boys and enemies that stupid? Let’s just hope they meant percentages or ratios…