Google Calendar, iCalendar Validator but not bloody Apple iCal

April 9, 2009
2 comments Web development

I've got a public ical at: http://m.fwckungfu.com/calendar.ics

This works in Google Calendar and in the iCalendar Validator but when I try to import this as a file in Apple iCal I get this message:

"Error subscribing to the calendar

Data downloaded from http://m.fwckungfu.com/calendar is not valid."

WTF? Who's ass have I not kissed to get this working in Apple iCal? Does anybody know any reason why Apple iCal is being so trixy?

Simple interface for Crosstips

April 8, 2009
0 comments Web development

Simple interface for Crosstips I've now made a simple interface alternative (not AJAX) to Crosstips. This one doesn't do any fancy AJAX to look up works and you just type in the unknown letters as a space (or a _ or a . or a *) so you don't have to know how many letters it is.

Here's an example

It feels refreshing somehow to go back from AJAX back to plain old GET requests. The best thing about this is that it will work on a mobile phone too. The way I've wired the page is so that if you visit the site with a mobile device (not an iPhone though) it will load the extremely cut down version of the layout which is more suitable for mobile phones. This means that people will be able to get unstuck doing crosswords in bed.

Head-to-head movie voting

March 31, 2009
0 comments Film

Head-to-head movie voting There's really no good way to explain what The Great Movie Experiment is other than just testing it. It's quite addictive and you somehow feel like you're contributing to something great.

"The gist is that we're compiling a list of movies based on head to head votes, matching them up in a giant round-robin tournament."

It's not really what head-to-head voting is about but there are times I would like a third button when a film sucks. Many times you're confronted by one mediocre film and one film which is only ok; then you're "forced" to vote for the one that is only ok.

Great work Matthias!

British or American English or just English

March 18, 2009
4 comments Web development

British or American English or just English My play site Crosstips.org is available in British English and American English. Obviously the difference is small but it's important.

What I've done is that if you're located in, say, France and visit the site it offers you the following language choices:

  • Svenska [goes to krysstips.se]
  • English (GB) [goes to en-gb.crosstips.org]
  • English (US) [goes to en-us.crosstips.org]

But if you're located in, say, England it only offers you the following language choices:

  • Svenska [goes to krysstips.se]
  • English [goes to en-gb.crosstips.org]

And likewise, if you visit the site from US computer you just get two options and it uses the en-us.crosstips.org domain. As an American or a Brit why would you be interested in the other English? I think this is a really good usability trick. It reduces the noise by removing options.

Truncated! Read the rest by clicking the link below.

Nginx vs. Squid

March 17, 2009
3 comments Linux

We all know that Nginx is fast and very lightweight. We also know that Squid is very fast too. But which one is fastest?

In an insanely unscientific way I added some rewrite rules to my current Nginx -> Squid -> Zope stack so that for certain static content, Nginx could go straight to the filesystem (where the Zope product holds the static stuff) to bypass the proxy pass. Then I did a quick and simple benchmark with ab comparing how to get a 700 bytes GIF image:


squid: 2275.62 [#/sec] (mean)
nginx: 7059.45 [#/sec] (mean)

Truncated! Read the rest by clicking the link below.

Too much Python makes Peter a shit Javascript developer

March 13, 2009
0 comments JavaScript

This murdered a good half hour of my time splattered with lots of alert() statements to debug. Basically, in Firefox you can do this:


var word = "Peter";
alert(word[1]); // "e" in Firefox, undefined in IE

This is the wrong way to get to character in a string in Javascript. The correct way is to use charAt() like this:


var word = "Peter";
alert(word.charAt(1)); // "e" in Firefox and IE

I don't know about the other browsers but finally Crosstips.org now works in IE7 too. I haven't even looked at it in IE6 and don't intend to either.

Sandisk SSD v/s HDD

March 4, 2009
2 comments Misc. links

Sandisk SSD v/s HDD I have for a long time been excited about getting one of those SSD drives to boost my laptop. Especially one of those SanDisk 40,000 RPM drop in replacement drives. Skimming around on YouTube there seem to be lots of videos showing how fast the new SSDs are at booting the operating system compared to HDDs.

BUT! These comments caught me attention:

chinesemilkman
"I've worked with those newfangled SSD Macs at my student computing support job and if memory serves, they run applications slower than your standard HDD Macs. I doubt any SDD storage product would run audio and visual as fast as a SATA II. Maybe one day they will optimize performance but in actuality, I have my doubts that any current SDD out performs top of the line HDDs in performance. AND COMPARING BOOTUP SPEED IS NOT A RELIABLE PERFORMANCE TEST! Lame marketing gimmick is what it is."

johnnyfast
"Interesting how NONE of the SSD tests show a real world multi-tasking environment.
I have an OCZ SSD 64 and it totally fails, as soon as my PC is doing 2 or more read/write multi tasks I get horrendous lock ups. It is going back to the shop as unfit for purpose.
SSD is a one trick (read speed) pony."

I mean, they "promise" speed, higher durability and lower power consumption. I was ready to almost accept the extreme prices and the disappointingly small sizes but if speed is only in boot up and single operations then I'd rather spend my money on RAM or CPU or something.

To $('#foo p') or to $('p', $('#foo'))

February 24, 2009
2 comments JavaScript

For the performance interested jQuery users please check out this thread

For the impatient, read Stephens reply He benchmarked what I asked and concluded that $("p", $("#foo")) is much faster in jQuery 1.3.2. I've been coding this style in jQuery for all recent projects so I'm happy with this outcome.

UPDATE

John Resig himself joined in on the discussion and had this to say:

"You should always use $("#foo").find("p") in favor of $("p", $("#foo")) - the second one ends up executing $(...) 3 times total - only to arrive at the same result as doing $("#foo").find("p")."

UPDATE 2

Not only did John join in on the discussion but it also made him work on jQuery 1.3.3 (not yet released at the time of writing) so that it doesn't matter which format you use you get the same performance. See the benchmark here

Propeller Island City Lodge Orange Room

February 23, 2009
0 comments

How cool are these rooms? This is a hotel in Berlin that was recommended to me by a friend. I haven't been there but after having seen the pictures I definitely want to go to this hotel if/when I visit Berlin.