March 9th, 2010

Fix Textmate's Shoulda bundle broken shortcutes for deeply nested files

When you’re using Shoulda — and you should :) — on a Mac, you’re probably addicted to ⌘⇧R and ⌥⇧R shortcuts for running currently focused should/context.

That works rather well until your testfile is deeply nested (like in test/unit/my_module/something/complicated_test.rb) — then it falls on it’s face with Load Error: no such file to load — test_helper.

There is only one solution, and that is to tell Ruby to really, really include the test directory in $LOAD_PATH when running the script. One of the possible implementations of this solutions — and I am quite sure you’d come with much better one any moment — is this one.

Go to Bundles > Bundle Editor > Show Bundle Editor menu in TextMate and find the Ruby Shoulda bundle. Locate the Run Focused Should and Run Context entries and place the following snippet strategically at the bottom of the displayed shell script.

Notice how we drop to Ruby for massaging the TM_FILEPATH, a clear sign we’re no Unix geeks, no, mister.

One thing that’s become clear is that the film industry feels no confidence about the cultural significance of its own products. Hollywood’s self-appointed division of self-importance, the Academy of Motion Picture Arts and Sciences, passed up the chance to honor one of the most ambitious and successful films the American movie factories have ever made in order to hand out hardware to a mid-budget, semi-independent production made in Jordan without movie stars.
March 5th, 2010

Data structure for Salvatore's Twitter clone in Redis

If you’re interested in Redis, you should definitely check real-world scenario, @antirez’s tutorial on building a Twitter clone in Redis and PHP. It’s worth to pay close attention how all the information is modeled in Redis, so I have put the overview of the architecture in the following gist:

You’ll notice the need for a really heavy de-normalization. It’s a useful reminder that you just can’t query anything by the value — as we are used to do in relational databases or CouchDB, MongoDB and such. In Redis and similar databases, the querying is done only by the key.

Note the same pattern again and again, in theory with a relational database the list of following and followers is a single table with fields like following_id and follower_id. With queries you can extract the followers or following of every user. With a key-value DB that’s a bit different as we need to set both the 1000 is following 1001 and 1001 is followed by 1000 relations. This is the price to pay, but on the other side accessing the data is simpler and ultra-fast.
February 17th, 2010
I myself don’t feel it is stealing, because I put all the material into a completely different and unique context and from the outset consistently promoted the fact that none of that is actually by me.
February 16th, 2010
Také samotné IT profese se mění – IT odborníci se transformují do kombinace IT specialisty a byznys konzultanta. Například systémový specialista se stává spíše IT architektem. Programátor se transformuje do analytika, který umí programovat. Případně musí odborníci zvládat více technologií najednou, takže jsou schopni nabídnout balíček řešení. Firmy očekávají, že za své peníze získají všestranného a velmi užitečného zaměstnance.
— Petr Krčmář, Root.cz
February 12th, 2010
CS is not like an English paper where you can just turn it in and there’s not a way to say if it’s a good paper or not,” [a computer science major and a teaching assistant] said.
“At 3 a.m, you can be looking at a program and definitively say that it’s not going to work.
February 3rd, 2010
This is really good stuff. But why did someone mute the laugh track?
January 31st, 2010
January 19th, 2010
Rohmer’s work had a clarity, a simplicity and an emotional transparency that made it stand apart from contemporary cinema and made it feel more like live theater, or overheard café conversation, or one’s own life.
January 16th, 2010
One thing we really like about GitHub is that it’s focused on the source code. The source is not tucked away in some corner, it’s the central thing of the project.
January 14th, 2010
I understand the need for security,” [Mrs. Hicks] added. “But this is ridiculous. It’s quite clear that he is 8 years old, and while he may have terroristic tendencies at home, he does not have those on a plane.
December 14th, 2009
I feel that by moving to CouchDB, we will not only be able to re-activate those features that we had to disable due to database performance, but also add more features and gather more statistics that would have otherwise been impossible with our previous infrastructure.
— John P. Wood, CouchDB: A Case Study
December 1st, 2009
People overestimate secret sauce in general. There’s very little secret sauce out there in terms of software that’s just so brilliant that you have to keep it for yourself.
November 27th, 2009