Grand Theft Auto: Lego City
posted by Duncan at 11:24 pm on July 27th, 2006Someone’s re-made the intro to Grand Theft Auto…. in Lego. Brilliant.
Here’s a direct link to the LEGO movie.

The website of Duncan Robertson. I compute for kyan.com
Someone’s re-made the intro to Grand Theft Auto…. in Lego. Brilliant.
Here’s a direct link to the LEGO movie.
David P Thomas has been collecting Ruby one-liners and sticking them in a single text file for us all to enjoy. The list looks like it hasn’t been touched in a while but has has proven to be very useful for me.
Shame it’s in a .txt file as finding the ones that would be helpful requires memorising them all, or searching through and hoping to find the one you’re after. Great stuff all the same though.
Metaskills have created a new Omnigraffle stencil for Ruby on Rails. Omnigraffle is a great OSX tool for creating visulisations of any kind. If you use OSX then its a must for this type of thing.
It says it’s semi-complete but it seems to have the basics you’ll need to create a rails project model schema.
I’ve just had the pleasure of watching the final series of Arrested Development (I don’t have SKY). I’ve mentioned the previous series of this fantastic sitcom before and the third series doesn’t disappoint. It picks up where the last one left with Michael Bluth (Jason Bateman) searching for his runaway father, George Sr. (Jeffrey Tambor) and GOB (George Oscar Bluth II; pronounced “Jobe”) played by Will Arnett gets an invitation to a father/son reunion outing, and believes it to be George Sr. trying to contact him.
![]()
There are new characters, Julia Louis-Dreyfus, Charlize Theron, and Amy Poehler play recurring characters, but my favourite purely for his character name is Scott Baio as attorney Bob Loblaw (pronounced, “Ba blah blah”), a replacement for Barry Zuckerkorn (Henry Winkler), in part, because he “skews younger” (an allusion to Baio’s “Happy Days” character “Chachi,” who was brought in to inject youth into the aging Winkler’s “Fonzie”). There is also a strange James Bondy type flavour in the early episodes.
For the best experience you really should watch these shows in batches as one show rolls straight into the next. Boo Hoo that this is the last series.
UPDATE: Do you also need those special Nike Trainers? NO, see below.
I got the latest product from Apple and Nike yesterday on the way home from work. I do a bit of running and use a Heart rate monitor but the having a pedometer is much easier for pace setting. I did a quick 2.5 mile run this morning and I love this thing already. Just plug it into your ipod and press go, and you’re off!
You can choose your distance or run free and once you start your run you get feedback straight away from either a male or female voice. Once I had finished my run I just plugged in the ipod and itunes asked if I wanted to sync with the Nike site. The photo you see above is the result. As you can see I overcooked my run a bit and petered off at the end. As time goes on it will be intersting to see if my running improves.

UPDATE One thing I forgot to say was that I don’t own and did not want a pair of those special Nike trainers that have the hole in the sole for you to stick your pedometer in. I just used my normal running shoes and manged to fit the pedemeter to them with a bit of persuading
I’ve just come back from another great 4 days riding the glacier in Tignes. This trip is becoming a yearly event between me and a few friends and this years ruled as much as the last.

We had the best weather, and the snow although not awesome, was as good as expected considering it was 22deg at the top. About 10.00am you get for me the absolute best conditions as the snow is hard enough to play and soft enough not to hurt yourself (oops, tempting fate). We even hired Downhill Bikes this year and gave them a blast from the top ( we had helmets but the armour hadn’t arrived ) which made it a exciting. These bikes ( Big Hits ) have 8 inches of front/rear travel and just sucked up the bumps.
I’ve stuck all the photos up on Flickr as has Martyn. Go view them and make yoursekf feel very jealous.
Or any other Ruby program really. I know there are attempts already out there but none that really suited my purposes. I needed a simple way of creating that tag-cloud-look for many situations. I needed a tag cloud by size or by colour and I didn’t want it to do everything, just provide me with the style attributes I needed to get the job done. Below is an example of what gets returned by default:
font-size:16px;color:rgb(70,70,70);
Here’s the code; it comes with no warranty.
With all these tags cloud scripts you really only need 3 parameters:
Below is the actual script and then below that I have stuck a quick example of how you could use it.
def font_size_for_tag_cloud( total, lowest, highest, options={} ) return nil if total.nil? or highest.nil? or lowest.nil? # # options maxf = options.delete( :max_font_size ) || 14 minf = options.delete( :min_font_size ) || 11 maxc = options.delete( :max_color ) || [ 0, 0, 0 ] minc = options.delete( :min_color ) || [ 156, 156, 156 ] hide_sizes = options.delete( :hide_sizes ) hide_colours = options.delete( :hide_colours ) # # function to work out rgb values def rgb_color( a, b, i, x) return nil if i <= 1 or x <= 1 if a & b a-(Math.log(i)*(a-b)/Math.log(x)).floor else (Math.log(i)*(b-a)/Math.log(x)+a).floor end end # # work out colours c = [] (0..2).each { |i| c && rgb_color( minc[i], maxc[i], total, highest ) || nil } colors = c.compact.empty? ? minc.join(',') : c.join(',') # # work out the font size spread = highest.to_f - lowest.to_f spread = 1.to_f if spread <= 0 fontspread = maxf.to_f - minf.to_f fontstep = spread / fontspread size = ( minf + ( total.to_f / fontstep ) ).to_i size = maxf if size > maxf # # display the results size_txt = "font-size:#{ size.to_s }px;" unless hide_sizes color_txt = "color:rgb(#{ colors });" unless hide_colours return [ size_txt, color_txt ].join end
and now a quick example of it’s use in a rails view. This code assumes the db find call looks something like this:
@foo = Foo.find( :all, :select => '*, COUNT(DISTINCT(i.id)) AS item_cnt', :joins => 'AS f INNER JOIN bars AS b ON f.id=b.foo_id', :group => 'b.id', :order => 'item_cnt DESC', :limit => 50 )
Below just loop through your db results and calls font_size_for_tag_cloud for each item, passing in the required parameters. There are a few options available but if you leave them out you should still see something useful.
<ul> <% for f in @foo -%> <%= content_tag( 'li', f.some_label, :style => font_size_for_tag_cloud( f.bars.size, f.first.count_items, f.last.count_items, ) ) %> <% end -%> </ul>
That’s it! I guess I should turn it into a plugin but hey, there’s to much reading to be done on ActiveResource at the moment heyhey!