You sir are brilliant! Brilliant!
The live mix performed on John Digweed’s show Kiss 100 FM in 2005 is one of the best musical journeys of this century. Really, it is that good. Grab it if you can.
You sir are brilliant! Brilliant!
The live mix performed on John Digweed’s show Kiss 100 FM in 2005 is one of the best musical journeys of this century. Really, it is that good. Grab it if you can.
Believe the hype. RMagick is an evil, memory leaking package. Do not use it. I always wondered why my Mongrels were sluggish; and why they often seemed to hang.
Of course I always knew I shouldn’t have used RMagick. But it’s just too darn handy. And it could not be that bad, right? Right?
Well, it can. It really can. RMagick eats memory like crazy and does not let go. Just shifting that stuff out is like night and day. Happy Mongrels, happy proxies, a happy front end, a happy admin and most importantly happy users.
If your Ruby/Rails app is acting slow: get rid of RMagick. Really.
Time to kick off this post with a priceless quote by Dale Carnegie. “About ninety-nine times out of a hundred, people don’t criticize themselves for anything, no matter how wrong it may be”.
It’s true you know (and I am certainly one of those ninety-nine, although I strive not to be). Case in point: disgruntled event organisers who are personally offended every time I won’t do exactly what they tell me to do.
There’s a reason I’m reluctant use a package manager.
They can be great when they work, but when they fail you’re dead in the water. And I mean really dead. Case in point: the rubygems package manager. Great when it works! But when I was confronted with a misbehaving Ruby app, here’s what happened.
How many pounds of illness can an ounce of prevention cure?
I bet it’s lots. Welcome to 2007. The year where spam has completely taken over the internet. Most admins will tell you that 90% of all email is now spam (not on my server though, thanks to spamhaus). On the web, spam is on the rise as well.
The second installment of the utf-8 saga I started last week.
Of course, per all the advice that’s out there, I needed to
run some nasty-ass updates directly in MySQL. Buh. Even in my utf-8 Terminal.app I could not display some weirdness properly. So it came down to hex() and unhex()’ing in MySQL. Joy!
Even if it’s only for myself, here is the code that was used:
update articles set body = replace(body, unhex('C3A23F3F'), "'") where body regexp unhex('C3A2');
and let’s not forget this beauty:
update articles set body = replace(body, unhex('C3A23FC29D'), "'") where body regexp unhex('C3A2');
both of which returned various combinations of ??? â?? and Japanese characters to a simple apostrophe.
And no, the character_set_server still isn’t utf-8. Most data is fine now though.
Oh. my. god.
This plugin is the mostest brilliantests I have discovered this entire week. Maybe even month! It allows you to render outgoing emails in a layout!
Recently I discovered all releases of Turn Up The Bass ever
made! How cool is that?
I remember hiring these CDs from the local video store since I couldn’t afford them. And now they’re available online, plus they fit on a DVD easily. Sweeeet.
In happier news I finished my piece for Time-Out Amsterdam a few weeks ago.
Time Out is a city guide, and I’m not lying if I told you it’s the best one on the planet. Maybe even the solar system. If you find yourself in Amsterdam and you don’t know what’s where, pick up one of these babies. I don’t even know if they’re free, but pick one up anyway. They rock.
Pay especially close attention to the club chapter; which I wrote, obviously.
It lists all the cool clubs to see [and hear] in Amsterdam if you’re visiting town. Places like 11, Studio 80 and Pakhuis Wilhelmina are all in there. And, I might add, were put in because of yours truly! The previous edition was quite old and even mentioned a club like More. Yawn!
So the good news is that tourists will be able to find cool places. The bad news is that they won’t be able to for several months.
TOA [as it's called by us professionals] will come out some time this fall, hopefully in time before Amsterdam Dance Event.
We’ll see. I’m just happy to have contributed. And proud!
In another series about web development, this is a pretty unhappy installment.
In 2007 it’s clear that your complete web application should be utf-8. This a way to encode characters for use by a computer [yes I know, actually it's a character set]. There are several character sets in use. Letters a-z are encoded in something called ASCII which has been in use for decades. More or less commonly used accented characters can be encoded in extended ASCII.
Regular ASCII only allows for 7 bits of information which translates to 128 characters. No accented stuff is allowed. So ASCII was extended to include an additional 128 characters. Of course, that wasn’t enough, so more character sets were thought up. One of these is iso-8859-1 and this is the one that was most popular in the 90s. It’s used all throughout the Western world.
But Eastern languages have lots more characters and the space for iso-8859-1 wasn’t big enough, so utf-8 entered the arena. This one offers a huge space and has provisions to extend that space without much trouble. So, we’re all set. utf-8 is the shit and everyone should use it.
Enter reality. The most popular open source database MySQL (this site runs on it) did not offer functional utf-8 support until version 4.1 which was only released a few years ago. Only modern browsers support utf-8 and only modern e-mail clients too.
The single largest problem however is working with data that evolved over many years, in the case of GO Magazine from november 2000. Back then, iso was the shit and thus the database was created in the iso format.
The smarter people reading will think “wel bud, just run a converter script and be done with it”. True, in theory. But there are many factors at play. Switching from one character set to another is an all-or-nothing operation. The entire web stack needs to be converted, top to bottom. Many elements in software have default character sets, the text in them often has varying character sets and, in an imperfect world such as this one, there is always nonconforming data, i.e. stuff that simply has an illegal encoding but got stored with the good stuff anyway.
There are good pointers on the web, in particular this one from the developer of cdbaby.com. And I am managing fine, but it’s a depressing job. I dumped the MySQL database and ran iconv across it, which converted the strings. I then changed default character sets on the db server and imported the whole lot. Remembered to set the ;charset=utf-8 header in Rails and things would work.
Or did they?
Upon closer examination some items were’nt converted. These turned out not to be in the iso character set (which one they were in I’m not sure). I needed to bluntly search and replace based on cold hex codes or \235 escaped bytes inside strings. Bah.
But then a particular problem dawned. I had converted the db, set the header in Rails but I had forgotten to set the character-set-server for MySQL! D’oh, that must be a problem right? So I put it in /etc/my.cnf and restarted the whole lot.
This did not improve things.
In fact everything that had been right was now displayed all wrong. A normal ä would now be displayed as two or even three characters, or question marks. Sigh. Switching the database default character set back to iso and the problems were gone.
So now I’m stuck in the middle and hesitant to go further. Clearly, many fields inside the database are utf-8. Ruby’s .is_utf8? method tells me so. The http header is set to utf-8, all browsers see the characters, inputting them works peachy too.
But shouldn’t the MySQL character-set-server be utf-8 too?
I’m not sure why my setup works this way but I know this: I come from MySQL 3.0 and have gone through many, yes MANY migrations. GO is running on it’s fifth server I believe, coming from Linux, then Solaris (twice) and then Linux again. I’ve seen three major MySQL releases and each one has shuffled charsets around. Early versions didn’t even support the stuff I have now. Then the web stuff: what used to be various J2EE servlet engines is now Ruby on Rails, but I used to run custom middleware in Java too. I know for a fact it wasn’t multibyte safe [I know Java is utf-8 internally, but this particular home brewn piece of glue used a very old mysql-j].
So here I am, more or less functioning utf-8, but with some quirkyness. Hence the saga. I am sure there will be followup posts…