Skip to content

Lagoa Multiphysics 1.0

This is an incredible display of a physics engine in action, more on Thiago Costa’s Vimeo site.

Lagoa Multiphysics 1.0 – Teaser from Thiago Costa on Vimeo.

UserNoise

The UserVoice logo updated for the World Cup:

Simple Rails Oauth Functional & Integration Testing

We are (UserVoice that is) about to release a new api that is based on a combination of 2-legged and 3-legged oauth. While checking the functional tests that had been written I noticed that they contained a lot of mocked methods, which while not a bad thing in itself, in this case meant a lot of functionality (specifically authorization) was not being checked.

So, I had a poke about in the gem (Oauth (0.3.6)) and wrote a couple of helper methods to allow for testing oauth based requests without mocking too much out, or in the case of integration tests, mocking nothing.

(Continued)

Outstanding in the Field, Secret Sea Cove, Half Moon Bay

Yesterday, for the second year running, I was lucky enough to attend one of Jim Denevan’s (http://www.jimdenevan.com/ – very cool art) Outstanding In The Field (http://www.outstandinginthefield.com/ events. This year the setting was a beautiful cove just outside of Half Moon Bay, California. I’ve added the menu here so you can appreciate the effort that Jim and his team put into these events. It has to rate as one of the most special dinning experiences anywhere.

* avocado cracker with lime-pickled fennel,      sesame & cumin, 2008 Luli Chardonnay (Santa Lucia Highlands)

* grilled ronde de nice zucchini, agretti & focea head lettuce salad with anchovy-caper vinaigrette and bottarga buttered slab bread, 2009 Elizabeth Spencer Sauvignon Blanc Mendocino

* aromatic spiced seafood skewers grilled ‘on the bone’, fava bean & herb salsa verde and fregola stewed with tomato & dried chilies, 2009 Lucy Rose (Santa Lucia Highlands)

* honey-rosemary glazed pork spareribs, caramelized young onions and green garlic fingerling potatoes, 2009 Luli Pinot Noir (Santa Lucia Highlands – hand bottled for this meal)

* orange blossom-scented fromage blanc, bluberries, walnut-poppy seed ‘sand’ cookies.

More photos here: facebook album

Its Been A Long Time….

Not since I rock’n'rolled (although that may also be true), but since I wrote a post on here. It hasn’t been due to lack of time, although I have told myself I’ve been too busy many times. Its been through a lose of desire to engage, a lot has happened to my family and I since 20th August 2008 and much of it has been very draining.

People have told me I should write about the passing of my father and his 22 year battle with cancer (and to some degree with arrogance and incompetence in the NHS) and I’ve thought about it. Somehow though, this doesn’t seem the correct forum. However, I did feel that to just start posting on here with no indication of what happened in the last 20 months would be a little odd. With that said, hopefully, now, normality (at least as far as blogging) can be resumed.

On with the show………

Exclude Records With UltraSphinx

So been using Sphinx with the UltraSphinx plugin and I came across the requirement to use filters to reject records. Unfortunately in the plugin the filters are hardwired to submit the ‘exclude’ parameter as ‘false’ i.e include. Time for a quick hack I think…….

Very easy to fix, just open up the ‘internals.rb’ file in the UltraSphinx plugin or include the gem using ‘rake gems:unpack GEM=ultrasphinx’ (need to have config.gem “ultrasphinx” set in envrinoment.rb) and then find that file.

Ok, so found the file? On line 97 is this loop:

Array(opts['filters']).each do |field, value|
  ....
 begin
     case value
     when Integer, Float, BigDecimal, NilClass, Array
       # XXX Hack to force floats to be floats
       value = value.to_f if type == 'float'
       # Just bomb the filter in there
       request.filters << Riddle::Client::Filter.new(field, Array(value), false)
     when Range
     ....
end

The ‘Riddle::Client::Filter.new(field, Array(value), false)’ call is the one we need to change (the ‘false’ is the exclude param).

(Continued)

Hop Toad

I’ve been using the Hop Toad web app for a while now to collect errors from my Rails apps and its been working out great. It drops in very simply and replaces the Exception Notifier plugin I was using.

Big advantages are the archive of errors and the ability to mark them as dealt with. Of course I could do that with email folders and the like, but I’m lazy and this appears to do it all. Oh and its free!!!

Linux – Just say no…….

More from the excellent xkcd





Mashup of the Day – Tweetlists

So, I got a great email about an hour ago:

To the creative genius[es] behind TweetLists,

We’d like to congratulate you on being selected as our MASHUP OF THE DAY at MashupAwards.com for July 30, 2008.

Mashup of the Day


So, not all that familiar with The Mashup Awards, but others clearly are as the resulting traffic killed the site (not that that would of been hard)! I would like to say thank you to them for the award and also take this opportunity to thank my manager, parents, producer, jesus, god, twitter!, Tim Berners Lee, Matz……..

Right then off to ‘enjoy basking in the glow of my well deserved recognition’ as suggested by ‘The Mashup Awards Judging Panel’

Parsing Rails log files with JSON

So I needed to parse the log files for SlimTimer this weekend to correct a data loss issue due to a small issue with implementing https for subscribers. The issue required looking for requests that had returned something other than “200 OK” collecting the parameters and entering any data that had got lost. After a bit of messing around it occured to me the the format of the parameters string in the Rail’s logs was not a million miles from the JSON format, so I came up with this to turn the string into a useable hash:

params =~ /.*: Parameters: (\{.*\})$/
str_hash = JSON.parse(params.gsub('=>',':'))

This provides a hash of the parameters used in the request. Of course the keys here are strings so to convert to symbols we can then use:

def create_symbol_hash(input)
  ret = input
  if input.is_a? Hash
    ret = {}
    input.each do |k, v|
      ret[k.to_sym] = create_symbol_hash(v)
    end
    ret
  else
    ret
  end
end

and simply pass in the output from the JSON library. Seemed quite neat to me anyway.