Problem From time to time one needs to fetch a random row from a table in a db. Solution Take one The “obvious” solution is to order by RAND() and get the first: SELECT * FROM users ORDER BY RAND() LIMIT 1; /* Don’t do that */ It does the job, problem solved! Well, no, [...]
In a recent talk at QCon labeled Null References: The Billion Dollar Mistake1, Sir Charles Antony Richard Hoare himself – the inventor of Null (and QuickSort, and many other things that shaped our industry) states that Null was/is a bad idea. What is Null? Here is an explanation from wikipedia. Null is a special pointer [...]
Today is a great day for John. He has just got a job as a programmer in MegaCorp138. He is 22 years old and a whole new world opens up in front of him. He will meet a lot of new people, get good salary, and most importantly, program in The Language. John studied programming [...]
Last night I did a presentation on Scala @ initCamp. This was my first presentation I’ve ever given. And I don’t know a word to describe it. So I’ll just use this one: Awesome. A very good discussion happened, people grasped most of my talk (or at least I think so?) and the examples. It [...]
Just watched the talk by Guy Steele – Growing a language. In it, he points out that a language should be designed to grow, rather than have many features. It should have just the right amount of tools, that will help users create more tools on top of the existing ones. The interesting thing is [...]