Skip to main content

Posts

Showing posts from April, 2012

Back To Rails: Sorting a Rails log by SQL Duration

This is something I just stumbled upon. And here's what I did to it. Rails’ ActiveRecord logger writes log files like: Post Load (735.8ms) SELECT  posts .* FROM  posts  where post.title = 'rkship' You may want to know the longest SQL queries for performance optimsation purposes, and general troubleshooting(my case). To list recent queries in order of duration, with longest queries shown last, I used this: head -10000 development.log | grep '([0-9.]+ms)' | sed 's/. (([[:digit:].]+)ms. /\1ms &/g' | sort -n (The sed expression was a little more work than I’d bargained for as sed regular expressions are always lazy; even with GNU/Posix extensions, non-lazy just doesn’t exist.)

April Fool and Google Part 2: A Round Up of ALL of Google’s April Fools Jokes

Ok....this post I think will contain all of the pranks I could find  for today. After my last post here http://rkrants.blogspot.com/2012/04/april-fool-and-google-my-favorite.html Last Time I reported Only a handful of the pranks.. Understandable, as it was only the morning. After that I stumbled upon more of them Which I am gonna round up here. Now staring with the list. The very first one is obviously our favourite Google Maps Quest The above is their official video. In a post in Google Plus they say about it as follows  Today  + Google Maps  announced Google Maps 8-bit for NES. With #8bitmaps , you can do everything you'd normally do in Maps—search for famous landmarks and sites around the world, get directions and even use Street View. Just in time for April Fool's Day, Google has introduced Google Maps Quest, a retro 8-bit version of its mapping tool that is... totally awesome. In a characteristically whimsical video, available above, Google emplo