technology from back to front

Archive for the ‘Water cooler’ Category

Two weeks at LShift

On a welcome break from studying for my GCSEs at school I spent two weeks doing ‘work experience’ at LShift. At the end of the two week placement I was interrogated by Keith Fisher. Here’s a transcript:

1. Did you have a choice in where to do your work experience placement?

Yes I had complete control over what I wanted to do for my work experience. If I didn’t, I would be working in an old people’s home or a school. Also, I think if you don’t find a work placement before the deadline, you have to work for a teacher.

2. Why did you pick LShift?

I picked LShift because it seemed like a fun place to work, LShift also works with software development which is something that I am doing at school and it’s something I enjoy. A relative suggested LShift as a place to do my work experience so I did some research. The website really said it all, software design, computers and free cola. That was all I needed.

3. What was it like?

When I arrived, I was actually surprised. I was imagining the place to be a huge company with hundreds of employees. Instead it was quite a small sized company with friendly people! ¬†LShift must be an anomaly in the industry. It’s a place where stress isn’t even a problem, everyone is relaxed and calm. It was actually relaxing to be there.

4. What did you do while you were there?

While I worked at LShift I had the chance to sit in on a training course for a project management method called “DSDM” which will help me in later life. I learnt how to make programs using .net. I learnt how software development companies run and work. Lastly, I learnt what it’s like to work for a fantastic company.

5. Is two weeks enough time to get a sense of what work is like?

No, I could learn so much more from LShift so leaving so quickly is a shame.

6. Would you do it again?

No I would never come here again… just kidding. I would definitely consider working at LShift again. In the future I would hope I could work somewhere like this.


Three years on…

It’s nearly exactly three years since I started at LShift. I’d like to take a moment and look back at what I’ve done.

Read more…

Frank Shearar

Programming as a social activity

I realised tonight something that I’d forgotten. We’re usually so busy knocking out code to fulfil our timebox coomitments that it’s perhaps easy to forget something very important: to have fun.

I went to the local Smalltalk user group tonight where Jason Ayers gave a talk on simplicity: do our tools help us make simple code? For a change, there was a relative dearth of laptops in the room (and it was a rather full room – nice!) so we “triple programmed”, tasked with implementing Conway’s Game of Life.


I think I’d forgotten that programming can be fun, and not just fun in an amuse-yourself-in-a-corner-on-your-lonesome kind of way, but fun in a way where you meet new people under the guise of performing some shared task. So if there’s a local programming group near you, why not swing by. You might meet some interesting folk. And if there isn’t such a group, maybe start one? It might be fun!

Frank Shearar

Emacs versus Vim

Here at LShift we take our programming pretty seriously. Which is why we now warm up properly before discussing important topics like static versus dynamic typing, tabs versus spaces and other such crucial aspects of our craft.

An Emacs operator preparing for a discussion with a vim user about text editors.

Frank Shearar

Profiting from Agile

In September we sponsored the Agile Conference
and while it was held prior to the global meltdown, the turn-out was not great. Certainly attendance at the event does not seem
to be growing at anything like the pace that Agile is being adopted. Is this because it’s now ubiquitous amongst the type of organisations that send people to conferences?

In general the most entertaining conference speakers were the most informative, with too many “case studies” turning into hard pitches. Rob Thomsett made a compelling case for the need to adopt an agile mindset at board level to make successful agile programmes.

Peter Merrick was interesting on the subject of working with new
clients in an Agile context and while our approach has always been to
help clients discover their requirements through the early planning
phases, he advocates taking a more hands-on approach to requirements
analysis. Our approach to new business seemed to resonate with him too.

While there were a fair few of the familiar faces there hawking their enterprise wares, it’s refreshing to meet the smaller practitioners who have adopted an agile approach through a will to “do the right thing and do it right”, rather than just jump on the latest bandwagon.


Toy raytracer in Python

I spent a few days in Wellington recently with my 12-year-old brother. We somehow got to talking about ray tracing, and so we ran through a bit of linear algebra (vectors, normals, and dot products, basically) and built ourselves a raytracer in Python as a lark. We collaborated on the Vector and Point classes, and I filled in the rest of the program. There’s still a bug in the checkerboard code (see the odd horizontal lines in the reflection of the checkerboard in the yellow sphere?) but it’s not too awful for an afternoon’s idle hacking.

The code is contained within, and here’s the output it generates:

Raytracer output

Wouldn’t it be nice to have classes like Vector and Point as part of the standard distribution of Python? Even better, though, and perhaps less subject to bike-shed debates, would be the inclusion of a simple, small PNG-writing module like this one as part of standalone base Python!


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.

Update: This page has instructions on how to get the microphone working. The key piece of information is the “Capture Switch” settings.


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).


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


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

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.




You are currently browsing the archives for the Water cooler category.



2000-14 LShift Ltd, 1st Floor, Hoxton Point, 6 Rufus Street, London, N1 6PE, UK+44 (0)20 7729 7060   Contact us