Fear the singularity

I found several interesting things this month. Super fast SSD hard disks 21GB pirate bay indexSingularity in thirty years Ok, the last one is really out there, but it points the way. Imagine the whole sum of human creative endeavor (at least the popular ones) indexed in just 21GB. All we need is just some sort of instant hash expansion for that 21GB (and 20 more years of PC power advancement).

   technology, left-field, random

Trying to do the impossible

Someone always asks this question -  how do you check types in Ruby? (*Hint: Ruby use dynamic typing) This typical newbie question would ask this and be answered with various levels of helpfulness - typically none - sadly. However this thread is just beautiful in its helpfulness. http://groups.google.com/group/comp.lang.ruby/msg/eb4b49a511e44be6?hl=en What happended snarkiness, or Slashdot / Youtube style comments? All this helpfulness must come from somewhere. I blame Twitter.

   technology, left-field, ruby, discussion, random

Hackfest at the OpenGovtDataNZ

Hacking for the greater good : the good being helping to free up important government information. A Barcamp and Hackfest was held just this weekend, in the last days of August. I participated in the Hackfest, which was held at the amazing Southern Cross Bar. Great food and nice private room made for a good environment for coding. The Hackfest was a bit more structured than previous events I have been to, but I’ll say this had a positive effect of helping people choose what and who they wanted to work with.

   technology, open source, hackfest, opengovt

Solr, and Sunspot

Update: I have found a nicer way of doing autocomplete. Basically, use the string type with the “starting_with” method. See this ticket comment. Solr is really nice search engine which has the added advantage of being able to return items that you put into the search engine, unlike say, sphinx (which is really fast but only returns the document id). However, Solr is very complex. Thankfully, there is a very neat ruby abstraction for Solr, called Sunspot.

   sunspot, autocomplete, rails, ruby, full-text search, solr

Throw away code

Let’s start simple. Here is a situation I have encountered more than once. We have this big long class or method, and embedded in it are several blocks of code, all commented out. def some_method(a) do_something(a) calc_another # wow # do_do # calc_calc # zcalc(z) end What should I do? Given the code is version controlled, I would happily throw it away. The code is commented out and will have no effect whatsoever on any program or user.

   programming, technique, project

Riding Rails: Community Highlights: IronRuby

Consider this question from Riding Rails: Community Highlights: IronRuby (emphasis mine). Matt: Are there any limitations that our readers should be aware of before starting to develop on IronRuby? Jimmy: The main limitation is that IronRuby does not support any of the C-based Ruby libraries, and only after 1.0 will we consider building an interop layer between the Ruby C API and IronRuby. In the meantime, people have been porting their favorite C-based Ruby libraries over to C# so it can be used from IronRuby, like Hpricot.

   technology, ruby

Git Workshop

I did a Git workshop for Summer of Code NZ students. Here it is: Code Management View more documents from kuahyeow. Full details at the Summer of Code blog: http://blog.summerofcode.co.nz/2009/07/31/code-management-git-workshop/

   technology, summer of code, git, presentation

Rails 3 updates

(Cross-posted from http://blog.projectxtech.com/2009/08/06/rails-3-updates/) Rails 3 is a rewrite / merger with Merb, and includes Yehuda Katz, Merb lead developer working on it full-time. Here are some posts which were published recently: http://yehudakatz.com/2008/12/23/rails-and-merb-merge/ http://weblog.rubyonrails.org/2009/7/30/community-highlights-yehuda-katz http://yehudakatz.com/2009/03/06/alias_method_chain-in-models/ http://www.engineyard.com/blog/2009/6-steps-to-refactoring-rails-for-mere-mortals/ There are lots of lessons and techniques in ruby, rails and general programming to be learnt from these posts. Enjoy!

   ruby, updates. technology, rails3

Jaunty, Twitter and 'Growl' type notifications (notify-osd)

It’s been a long, two-stepped journey to get to Jaunty from Hardy, all so that I can experience notify-osd with Twitter updates. The upgrade has been long and slow (NZ internet!) but I found the end result strangely unsatisfying. Yes, notifications work, and there’s a new “Computer Janitor”, but that’s it. A bit let down. Then I found out about Gwibber, the new twitter client on Ubuntu. It is by far superior to other clients on Linux.

   technology, twitter client, ubuntu, growl, gwibber, notify-osd

'View as single page'

Just wanted to rant about how news websites have the annoying feature of splitting up articles into ‘pages’ - of just two or so paragraphs. There’ll be three or four of these ‘pages’. But once you click on the ‘view as single page’, you realise how ridiculously short the article is, to even split to any page. I wish there’s a magic unpage! bookmarklet out there.

   rant, rambling, unpage, short