• Repeatable read and deadlocks in SQL Server

    This week we had a bug report of one of our products regarding some strange deadlocks in our database access. For those of you who don't know what a deadlock is, I'll try to summarize here what a transaction is in a relational database environment and why those transactions might lead to those nasty errors, and try to explain what was causing this deadlock in our SQL Server 2005 engine.

    Read on →

  • Killing all rails logs with one Ctrl+C?

    Well, this is my first post after holidays and it won't be very long.

    Imagine you are developing a rails application. Usually you have:

    • a terminal with the server to see what petitions are received.
    • a terminal with a tail of development.log to see what happens with the database.
    • a terminal with a tail of test.log if you are testing something.

    This are a lot of windows... And the other day one friends was very happy and after asking for a while I discovered that the reason was the simple line showed above... With only one Ctrl+C you can kill all this processes :-)

    script/server & tail -f log/development.log & tail -f log/test.log & tail -f ; jobs -p | awk '{print "kill -2 " $0}' | sh
  • The Double Check Design Pattern

    One of the deficiencies of actual programming languages, specially those ones still widely used that are old, such as C or C++, is that they were designed having in mind the sequential programming paradigm. This usually means that those languages don't have standard ways to work with multithreading features, and you usually have to rely on third party libraries to develop thread safe software.

    Today I'll be discussing a design pattern called Double Check, which can be widely used to manage the resource access, elimination and initialization in a safe thread way.

    Read on →

  • Ruby Quiz

    Maybe one of the best ways to learn a new programming language is playing with it. Nowadays if you don't code in Ruby you aren't cool. I have to recognize that programming in Ruby is funnier than in other language and for the moment I don't have anything bad to say about it.

    Well, I want to introduce Ruby Quiz. It is a collection of minigames prepared to learn Ruby (or to improve your skills). Every week they publish one game, and if you are brave you can send your solution to them and it will be public. I think it's one of the best ways to learn because you can compare solutions and find were you are weak in Ruby and redo your solution doing it smarter.

  • The madness of captchas

    Nowadays computers still can't pass the Turing Test (but some researches show that they will pass it at 2029) , well, there are still some humans that can't. But they have achieved to pass some captcha images.

    Captchas

    BitDefender and SoftScan articles show that in the last days some spam bots have registered email accounts at Hotmail, Gmail or Yahoo mail. This is a big step for spammers that produce on me two side feelings. On the one hand I'm so sad because my mail filter has to work a lot to deal with this nasty plague, but on the other hand this has to wake on us encouraging feelings of a near future where computer can pass the Turing Test. This is like in my Science Fiction books.