Posts filed under 'Water cooler'

Ubuntu on EeePC is fairly slick

The instructions were pretty easy to follow (admittedly, after 10 years, you learn where the awkward spots are in linux installations) and the result is a tiny, snappy, fully-working Ubuntu machine, complete with webcam and wifi. The only bit I haven’t got working yet is microphone input to Skype; my bet is that it’s a simple mixer setting.

1 comment May 7th, 2008 tonyg

iPlayer: needs RSS

The BBC’s new iPlayer service is great. The only thing that I’ve missed so far is RSS or Atom feeds: it’d be nice to be notified when a new episode of Favourite TV Show X turns up (and when it’s due to expire, too).

Add comment December 31st, 2007 tonyg

XML CDATA and escaping

XML’s syntax for CDATA looks like this:

  <![CDATA[some text]]>

Tag syntax within a CDATA section is suspended, so this is well-formed XML:

  <![CDATA[some <more> text]]>

even though it looks like the “<more>” tag is unclosed.

There’s only one thing you can’t say in a CDATA section: “]]>”. But there’s a trick to save us, even here. To print an arbitrary string in a CDATA enclosure, replace each instance of “]]>” with “]]]]><![CDATA[>”, and then put the normal “<![CDATA[”/”]]>” brackets around it:

  my ]]> text

becomes

  <![CDATA[my ]]]]><![CDATA[> text]]>

1 comment October 25th, 2007 tonyg

Your very own 32-way SIMD machine

What’s a good way of counting the number of bits set in a word? The obvious answer, adding the low bit to an accumulator, shifting right, and repeating, is O(n) in the number of bits in the word. This is a sequential approach - and we can do better, complexity-wise, by using a parallel algorithm. Let’s assume we are using 32-bit words, and that Xn is just such a 32-bit word:

X0 = input word
X1 = (X0 & 0x55555555) + ((X0 >>  1) & 0x55555555)
X2 = (X1 & 0x33333333) + ((X1 >>  2) & 0x33333333)
X3 = (X2 & 0x0F0F0F0F) + ((X2 >>  4) & 0x0F0F0F0F)
X4 = (X3 & 0x00FF00FF) + ((X3 >>  8) & 0x00FF00FF)
X5 = (X4 & 0x0000FFFF) + ((X4 >> 16) & 0x0000FFFF)
total number of set bits = X5

This algorithm is O(log2 n) in the number of bits in a word.

Every ordinary N-bit-word based sequential machine is a disguised N-way, 1-bit SIMD machine with a slightly odd instruction set. Lots more on data-parallel algorithms here.

What about finding which is the highest bit set in a word?

X0 = input word
X1 = X0 or (X0 >> 1)
X2 = X1 or (X1 >> 2)
X3 = X2 or (X2 >> 4)
X4 = X3 or (X3 >> 8)
X5 = X4 or (X4 >> 16)

… and feed X5 through the parallel counter-of-set-bits algorithm above. The resulting number is the index of the highest set bit in the original word, starting from zero.

7 comments October 15th, 2007 tonyg

kill daemon from Planet -9

Someone has put programmers’ fridge magnet poetry on our fridge. I suspect it was a well-targetted marketing freebie, like the beanbag penguin that sits looking out onto Old Street. In any case, it has already attracted the attention of several clearly very talented individuals:

gorgeous dangling cyberspace

      whisper foo
and this ironic gem
   greasy hacker @ deprecated network

         tiny bucket

             spawn bandwidth

     controller
Fridge poetry

My favourite, though, is the person that has arranged some magnets into a pair of parens, with the single atom TRUE enclosed.

Up close, it is a subtle play on self-description, a visual pun on syntactic abstraction; but macroscopically, the seemingly trivially-evaluated expression brings recursion into the fold – its position and spelling suggests that there is more yet to be unravelled, and poses the question “How do we define truth?”.

1 comment September 28th, 2007 mikeb

Pub quiz triumph

We started attending the Tuesday night pub quiz at the Reliance a while back, and won a few bar tabs and jackpots. Most weeks someone-or-other has something on and can’t come along, and we end up either half-strength or giving it a miss; so, we’ve struggled to continue our winning ways, even to the low point of coming last by about ten points (the night it was just TonyG and I and all the questions were about, well, not New Zealand).

Last night, however, it all came together, and with Alexis helping out, the Gerontocratic Republic of Stu’s Heroes skipped home to victory — not only first place, but the jackpot as well.

It’s fairly certain that we’ll be there next week.

3 comments March 21st, 2007 mikeb

An Alphabetical Google Zeitgeist

I’ve installed Firefox 2.0 on most of the machines I work on daily now. Its use of google suggestions surprised me when I first saw it, but I’ve grown to find it somewhat useful on occasion now. It suggested the following experiment (not in so many words, of course): assuming that the suggestions it supplies are based on popularity of search terms (presumably filtered by google’s safe-search feature!), then the suggestions ought to reflect the zeitgeist to a certain extent - what does it suggest for each letter of the alphabet? The results weren’t exactly surprising. No philosophy, very little science, technology, literature or art; nothing but wall-to-wall Britney, Ebay and “U tube” (!). The A-to-Z follows below.

This list was taken from the top results from the google search suggestion box in Firefox 2.0 on 30 Jan 2007:

  • A is for Amazon
  • B is for Britney Spears, Best-Buy
  • C is for Circuit City, Craigslist
  • D is for Dictionary, Dell
  • E is for Ebay
  • F is for Facebook
  • G is for Google, Gmail, Google Earth, Google Maps, …
  • H is for Hotmail
  • I is for IMDB, iPod
  • J is for John Lewis, JCPenney and Jobs
  • K is for Kohls, K-Mart
  • L is for Lyrics, Limewire
  • M is for Myspace
  • N is for Nintendo Wii
  • O is for Office Depot
  • P is for Paypal
  • Q is for Quotes
  • R is for Runescape
  • S is for Sears, Staples, Skype
  • T is for Target, Toys-R-Us, Tesco
  • U is for U Tube (sic), UPS
  • V is for Video, Verizon Vodafone and Virgin
  • W is for Wikipedia, Walmart
  • X is for Xbox 360
  • Y is for Yahoo, Youtube
  • Z is for Zip Codes (and after a few places, oddly, Zilog)

1 comment February 17th, 2007 tonyg

Busy busy

There’s been nothin’ doin’ blog-wise at LShift for the past week or so; we all seem to be wrapped up in projects.

Briefly though, collectively we’re

  • Tickling Erlang
  • Thinking about what direction to lead Icing in
  • Finding all the best documentation the Web has to offer on ASP.NET 2.0
  • Getting intimate with Director
  • Staging shoot-outs between Ruby-on-Rails, Django, and cohorts

… so we’re not bored.

Add comment September 22nd, 2006 mikeb

London 2.0

I went to London 2.0 last night, a short bus ride and walk away in Fleet Street. It’s a gathering of the kind becoming more popular — there was XP enthusiasts on the other side of the pub — involving techy chat and a few pints.

The main event was Jason Huggins demonstrating some work-in-progress involving Selenium. He’s intending to show it at the Google Automated Testing conference later this week. If he achieves his ambition, it’ll be impressive as well as very useful.

The nominal topic of the evening was Web 2.0, but the general chat was pretty eclectic:

  • Functional programming (lots of “I’ve been wanting to try ..”), and especially functional programming for the Web (I was able to mention our efforts with Icing and AJAXy Haskell)
  • Languages on the CLR: SML.NET, IronPython, F#
  • Experiences with virtualisation software
  • Books: “Freedom Evolves”, by Dan C. Dennett, and those perennial favourites, “Goedel Escher Bach”, and “The Emperor’s New Mind”

If you’re inclined to geekery and optionally beer, it’s a great way to spend a weekday evening.

Add comment September 6th, 2006 mikeb

Coming to an Interweb near you

Schmoogle, the search engine for finding industry events.

Really, this is imminent, if not already extant …

1 comment September 1st, 2006 mikeb

Previous Posts

Calendar

May 2008
M T W T F S S
« Apr    
 1234
567891011
12131415161718
19202122232425
262728293031  

Posts by Month

Posts by Category