Wednesday, December 23, 2009

On Font Rendering

If you have ever wondered (as I have years ago) why the text rendering on Linux usually looks inferior to both Mac OS X and Windows text, no matter how much you try and tweak the settings, there is a great and very in-depth article at http://www.antigrain.com/research/font_rasterization/index.html. It is quite long, but it contains excellent background information, theoretical and practical discussions of the concepts behind text rendering in general, what Windows and Mac OS do right/wrong and how to improve the situation in general.

This is a must read for anyone remotely interested in font rendering.


Saturday, December 19, 2009

Star Wars Review – Hilarious

I just came about this Star Wars – The Phantom Menace Review on Daring Fireball. Yes, the movie has been out for years, so why a review? Well, go see for yourself (it is 7x10 minutes long!). Be aware that if you loved it (who would?) you might be offended by the heresy against George Lucas’ creation, but I for one mostly agree with it.

You might have to get used to the guy’s voice, but the contents and the insight are definitely worth hanging on.

Technorati Tags: ,,


Thursday, December 17, 2009

51 Weeks since my book writing adventure began

In one week, on December 24th, it will be exactly one year since I was first contacted by Packt Publishing. After reading several posts from this blog they asked me if I’d be interested in writing a MySQL administration cookbook with hands-on recipes for those among us who have to make sure the MySQL servers are kept running and in good shape.

Funny thing, I almost deleted their email, because initially I thought GMail’s spam filter had not caught some sort of bulk or phishing email, because I had never heard of Packt Publishing before and at first only saw an unfamiliar sounding sender’s name. As I was one of very few people in the office on that day I decided to read it anyways. Turned out to be not so spammy after all…

What followed were several weeks of sending mails back and forth, convincing a colleague to co-author and together set up a chapter outline. Finally, around February we started writing actual contents. Boy did I underestimate the amount of work this was. This being my first book I was completely unable to make any educated guessing as to what was lying before me. The initial estimate from the publisher was an hour a day – I strongly doubt than anyone would be able to sit down for an hour every day and get anything done. Often just setting up some test scenario takes longer…

Even things I knew inside out turned out to be really time consuming in writing them down in a structured manner. Add to that preparing screenshots and diagrams, discovering bugs and unexpected behavior in the tools, fighting the word processor and you are in for many late nights in front of the computer, sometimes wondering if I’d ever be finished.

Nevertheless yesterday I submitted the edited – hopefully final – drafts of the last two chapters. If everything goes according to plan most of what’s left is for the publisher to do. Alas, now that I have said this, there will almost certainly be some more fine tuning for me to do as well…

Strangely enough – even though I had somehow almost expected this – editing and going through the stuff you wrote sometimes weeks ago is a real eye-opener. It is as if you were reading someone else’s material; things you thought were perfectly clear when you wrote them sometimes sound strange, sometimes are not clear to understand and sometimes even plain wrong. The feedback from the publisher and the reviewers was extremely helpful to get a different point of view and become aware of ambiguities and flaws you otherwise would probably not have seen at all.

If you are a regular reader you might have wondered why my blogging frequency somewhat stagnated over the past year – now you know what was eating up my time.

So if you like, you are welcome to pre-order the book right now. It is planned to be released in March of 2010 and I expect it to show up on Amazon and other online stores soon. Nevertheless, you can already read more about it on Packt’s website: MySQL Admin Cookbook.

When everything is really finished and I hold the first copy in my hands I plan to write some more on the process of planning, writing and editing. Until then, it might remain somewhat quiet around here for a little longer.


Wednesday, October 28, 2009

Google Navigation

You just gotta love this tech world...


Tuesday, October 20, 2009

Fluid app for TWiT.tv

For the last couple of weeks I have found myself regularly having a Safari or Firefox window open, showing the Bitgravity stream from http://live.twit.tv, Leo Laporte’s netcast site. Time and again however, I accidentally closed the video when I routinely quit the browser when I had finished using it for other web related stuff.

Today I got sufficiently annoyed by myself to resolve this situation once and for all. So I created a Fluid app, took a TWiT logo from their homepage and now have a standalone TWiT.tv application on my dock.

This is the setup in Fluid:

Fluid Settings

On first start I had to add live.twit.tv to the ClickToFlash white list again – the App in Dockwhite   list from the regular Safari settings was not taken into account by this standalone browser – and then resize the Window to precisely match the video size. This is remembered for any subsequent launches. I went for the popped out player available from the regular page (see the URL in the Fluid setup screenshot above), because I usually do not need the surrounding extra information like the production calendar or the web-based IRC chat room.

This is what it looks like now, when I have started it. I will not go so far and set it up to auto start on login, but keep it in the dock for quick access.

App Running

Technorati Tags: ,,,


Wednesday, October 07, 2009

Setting up iPod Touch for Google Sync

Google offers an Exchange/ActiveSync based option to keep your mails, contacts and calendars lined up nicely on your iPhone and iPod Touch. I succeeded in setting this up on my iPod Touch 2G as per their instructions, but when I tried to configure which of my calendars were to be synced by going to http://m.google.com/sync with the Mobile Safari browser, it told me that “Google Sync is not supported on your device” (well, actually in German, but never mind).
I suspect there is some user-agent filtering going on and that for some reason – even though from what I understand the iPod should be fine – it likes an iPhone better.
Mac OS X 10.6 Automator to the rescue:
Automator Setup for configuring Google Sync
Both options are from the Internet section of the Library on the left (not shown). Save this as an Application or just run it from Automator and you will get this:
Automator Webpage Popup in iPhone mode
This allowed me to set up the calendar on the iPod to sync more than just one Google calendar.
EDIT: Much simpler, it just did not like the German language. Switching to English on the iPod works, too.


Tuesday, October 06, 2009

Another note on code readability

Some time back I posted a piece of code I found that was trying hard to obscure its meaning (see this post from September 2008). Today I came across this:

long now = CalendarUtil.theCalendarUtil().getCalendar(new Date()).getTimeInMillis(); 
long milis = now - creationDate; 
milis = (milis < 0 ? milis * (-1) : milis); 
return (milis > 2 * 60 * 1000);

Now, do you immediately see what’s going on here?

Right – of course, you do. The method is called isInstanceTooOld(), the idea being that it should return true, if the current object was created less than two minutes ago. The constructor records the creationDate field to track that.

This nicely shows that convoluted code – even intended to provide a simple function like this one – is prone to errors: This one returns true, too, if the current object is two minutes newer than the current time. The correct function looks like this:

static final long MAX_AGE_THRESHOLD_MILLIS = 2L * 60 * 1000;
long now = System.currentTimeMillis(); 
long age = now - creationDate; 
return age > MAX_AGE_THRESHOLD_MILLIS;

Always a pleasure to see the face of people when they recognize what strange things they did only weeks ago, probably late at night :)

Technorati Tags: ,,,