Skip to content
accelerando

Tag Archives: Rants

Preparing for Rails 2.3.9

06-Sep-10

As much as i wish to upgrade my Rails 2.3.x application Daily Fratze to the newest tag of the Rails 2.3.x branch, i cannot.

First there was the epic fail of release 2.3.6, that broke all HTML Helpers and forced the Rails XSS protection upon us. This release was immediately followed by 2.3.7 and 2.3.8. With my tests, this version was still enforcing Rails XSS and breaking helpers like “h”.

Rails 2.3.9, released last week, puts en end to this.

I just was about to upgrade, when i read this error: Textarea input silently truncated in 2.3.8!. The input of a textarea is truncated if the text entered consists of two lines or more with one of them quoted as the Rack middleware messes with the input.

I can confirm that this behavior still applies to 2.3.9.

It’s a shame, that all the talk is about Rails 3 with bugs like this in an older branch. I understand that this is a Rack problem but as it is already fixed in newer Rack versions, i cannot understand that the Rails team doesn’t bump the required Rack version respectively has no tests for problems like these.

So i’m hoping that Rails 2.3.10 sees the light of day anytime soon.

Anyway, as Rails 2.3.9 suddenly uses a new interpolation syntax for the translation files (“Hello {{name}}” becomes ” Hello %{name}”), here is a one-liner to update i18n files to the new syntax:

find . -iname "*.yml" -exec sed 's/{{\([^\{\}]*\)}}/%{\1}/g' -i {} \;

If you like some less escapism use xargs

find . -iname "*.yml"  | xargs sed 's/{{\([^{}]*\)}}/%{\1}/g' -i;

Commands need to be executed inside your locale directory.

Wütend

25-Feb-09

Oh man, ich bin so verdammt wütend, ein Tweet reicht nicht aus.

Es ist so zum kotzen, dass es Programmiersprachen wie PHP den Leuten so leicht machen, hübsche Sachen zu programmieren, die auseinander fallen, wenn man sie mal schief anschaut.

“Hübsche Gui” und “Ich weiß, was ich da gerade in die Datenbank schreibe” sind zwei Paar Schuhe.

Wie kann man eigentlich eine Checksum Routine so implementieren, dass sie auf unterschiedlichen Architekturen unterschiedliche Ergebnisse liefert? Braucht es da mehr als einen mittelmässig begabten Affen, zu erkennen, dass das eine scheiß Idee ist? Und noch spannender ist es natürlich dann, diese Funktion auch zu nutzen.

Boah echt ey.

Leute, lasst die Finger von PHPs crc32() Implementierung oder benutzt sie richtig.

Frustration

25-Feb-09

if you want something done right, do it yourself

If you happen to use the mint tracking tool like me, be careful when migrating from a 32bit to a 64bit server or vice versa. Mint saves ip addresses and a buttload of checksums as signed long values. That bites you right in the ass when the first visitors starts arriving at your site. All from 127.255.255.255, or at last visitors with an ip starting with > 127.

If you read this post before migrating, just add the following to your migration:

ALTER TABLE mint_visit 
  MODIFY COLUMN `ip_long` BIGINT NOT NULL,
  MODIFY COLUMN `referer_checksum` BIGINT NOT NULL,
  MODIFY COLUMN `domain_checksum` BIGINT NOT NULL,
  MODIFY COLUMN `resource_checksum` BIGINT NOT NULL,
  MODIFY COLUMN `session_checksum` BIGINT NOT NULL;
 
ALTER TABLE mint_debugger   
  MODIFY COLUMN `ip_long` BIGINT NOT NULL;
 
ALTER TABLE mint_geo  
  MODIFY COLUMN `ip` BIGINT NOT NULL;
 
ALTER TABLE mint_hostnames  
  MODIFY COLUMN `ip_long` BIGINT NOT NULL;

and you’re done.

If it’s too late, change your tables as well. You then also have to delete your entire mint_visit data, as the records are already corrupted. Great fail.

However, why on earth store an ip address as a long value?!? It’s an ip address and if i want to look at it, the program needs to go the other way round. To me: It’s just stupid fucking with datatypes and problems as that is what you get if you do so. It maybe makes sense for computation of networks, but not for a statistic tool. At least, i don’t see any sense in this.

Actually, the problem is known.

Comments are evil?

23-Feb-09

What can cause this snippet to fail:

<% if !@day.user.is_rateable?  # Workaround für Darstellungsfehler mit Tabellen ohne Bodies im Safari  %>
<!-- blah -->
<% end %>

This little snippet fell apart today. I don’t know if it is passenger, a newer ruby version, RubyInline. All i know is that i am so totally pissed of this incredible amount of incompatible versions of just 3 modules that i literally feel like puking. What a hell of a day.

By the way, the thing that broke was the one-line comment right after the if.

Tired of all the powerpoint presentations…

23-Apr-08

Right now i’m in Wiesbaden, attending the JAX 2008 conference.

The mood is somewhat different compared to the DOAG i used to visit the last years. The people are more open minded, partially much younger and generally try to be much cooler. And for the sake of it, some are even more interesting and after all, there isn’t that ongoing whining about Oracle not engaging in Forms 6i Client Server any more (although, i must admit, i somewhat like Oracle Forms 6i, maybe it’s a love/hate relationship, trust me, i know both worlds, Java and Forms).

The sessions suffer from one big problem: Many of them just seem to play powerpoint karaoke: Throw in a bunch of crappy slides with a handfull code snippets and sing-a-long to that stuff which means basically: Hind behind the slides.

Let me tell you: This is so boring and pointless. In the past i tried to be polite and always stayed to the end of a session but the last 2 or 3 conferences i can’t stand it any more. I can read myself, thanks. If you haven’t got anything additionally to say, just pass me the slide and i’m fine.

The 3 most interesting sessions where the sessions spoken freely with the slides just illustrating the speech. I especially liked Brian Chans presentation of Liferay Portal, Rod Johnsons keynote on the future of J2EE and the most witty one, Ted Newards talk about the renaissance of languages. It was funny, included the audience, was well prepared and freely hold, not to forget the topic: It wasn’t about the nth framework around the corner but about the nearly philosophy topic about the “perfect programming language”.

I really wish that i’d be creative and intelligent enough to design a language that is not predestined to die an early death, but i ain’t. But i can distinguish a sharp tool from a spoon if i see one and i can adopt to it very easily. And in that sense i share Teds opinion that a discussion about abstracting things and about the tool itself is of much more value than implementing some arbitrary pattern (i.e. one be the GOF) in just another framework. For example, many implementations of some patterns in frameworks have been rendered obsolete by more powerful and more expressive languages and i’d like to see this trend go on.

Close
E-mail It