movie rental

spammers go 2.0

Filed under: Blogroll, funny, penis, ruby, rubyonrails, spam, techhumour — Wrote by Otu on Sunday, January 27th, 2008 @ 4:19 am

What happens when spammers decide to move to the 36th century (sic) and run their code on ruby on rails?

http://dev.rubyonrails.org/ticket/10919

slow projects loading in textmate

Filed under: macosx, memory, slow, textmate — Wrote by Otu on Wednesday, January 9th, 2008 @ 10:24 am

The Problem

On OS X, when I open a project, switching focus to another application and returning to TextMate.app causes the pizza wheel to appear and TextMate.app takes 10-20 seconds before it responds.

Why

On coming back to work last week, I thought it’d be a good idea to update my local database copy and image farm. As it’s a dev copy there is no need to update this regularly and so I don’t, but it seemed like a good thing to do at the begining of a new year.

It however transpired that between my previous update a month ago and last week, we ‘d quadrupled our userbase (which beggars the question - “was I sleeping while this was happening?”). Anyhoo, 30k more users added a minimum of 60k more files to the project directory - image files in this case.

Shortly after this update, the problem stated above appeared and no amount of tinkering and google searches would prove to be of any help. This was until 1am last night when I sat up with jolt - why do epiphanic moments happen when you are trying to fall asleep.

When TextMate loads a project, it loads every file into memory and when focus is returned to the app it tries to refresh the project. Once I realised what the problem was, it was fairly easy to fix.

The solution

Exclude all media files (swf | mp3 | jpeg | gif | png ) from TextMate. See image below …

TextMate

You can also exclude whole directories which is what I did and not surprisingly, TextMate went back to running at lightening speeds. Having the option to exclude certain directories and file types from loading is very helpful but loading files into memory isn’t such a good idea particularly in OS X where memory allocation is completely dynamic. Another peev for another day.

Perhaps the guys and gals over at macromates can take a look at this problem.

Formation SAGE © il maestro ignoto