talkingCode

Archive for the rant category

Open Rights Group

posted by codders in rant

Dear reader… (maybe it’s readers plural),

This weekend I was at Open Tech 2008, which was fun. I got to hear about how cool OpenStreetMap is, about the inspiring work that the Open Knowledge Foundation are doing, and finally got to see Roo give a talk.

I won’t pretend that the talk from the Open Rights Group was the coolest talk I saw all day, but it might have been the most important. I’ve been following their work for a while but had resisted becoming a member on account of their not being a registered UK charity. On Saturday, I discovered that at least part of the reason they’re not is that becoming a charity would reduce the extent to which they can act as a political pressure group, which would in many ways defeat the object.

So here’s the deal. I’m breaking the unwritten rule of talkingCode and writing about something political that I believe in. If you live in the UK you should be supporting the work of the Open Rights Group however you can. They are a small, bright, committed bunch and are thoroughly deserving of your donations.

Go here to find out about more about them:
http://www.openrightsgroup.org/2008/07/07/growing-the-org-community-and-having-fun-doing-it/

Then donate some money.

Do this now.

They’re busy fighting some really important battles on our behalf. It’s difficult to convince people that these battles are worth fighting or that the issues are really that important when people are having trouble affording petrol or food, but it’ll be too late to unmake the laws in 20 years time when we realise what we’ve lost. By then, the very tools with which we would have fought the battle will have been taken from us.

Coding style, Haskell

posted by codders in haskell, rant

I finished chapter five of the Haskell book I’m reading last night, and the bits of it are starting to make sense. I was doing some of the exercises and managing to write functions that compiled first time - I’m all about the small victories.

What I’m enjoying most about the book, though, is that as well as teaching the language it does a good job of teaching some of the culture. A lot of writing good software is about making the most effective use of the tools a language provides and that usually only comes with time and experience. The book helps, though, providing gentle prods in the right direction:

Many tail recursive functions are better expressed using list manipulation functions like map, take, and filter. Without a doubt, it takes some practice to get used to using these. What we get in return for our initial investment in learning to use these functions is the ability to skim more easily over code that uses them.

The reason for this is simple. A tail recursive function definition has the same problem as a loop in an imperative language: it’s completely general, so we have to look at the exact details of every loop, and every tail recursive function, to see what it’s really doing. In contrast, map and most other list manipulation functions do only one thing; we can take for granted what these simple building blocks do, and focus on the idea the code is trying to express, not the minute details of how it’s manipulating its inputs.

In the middle ground between tail recursive functions (with complete generality) and our toolbox of list manipulation functions (each of which does one thing) lie the folds. A fold takes more effort to understand than, say, a composition of map and filter that does the same thing, but at the same time it behaves more regularly and predictably than a tail recursive function. As a general rule, don’t use a fold if you don’t need one, but think about using one instead of a tail recursive loop if you can.

As for anonymous functions, they tend to interrupt the “flow” of reading a piece of code. It is very often as easy to write a local function definition in a let or where clause, and use that, as it is to put an anonymous function into place. The relative advantages of a named function are twofold: we’re not confronted with the need to understand the function’s definition when we’re reading the code that uses it; and a well chosen function name acts as a tiny piece of local documentation.

… and they’ve not once suggested I write any comments yet. Woot :)

The Book:
http://book.realworldhaskell.org/beta/

Chapter 5:
http://book.realworldhaskell.org/beta/fp.html

Long time no see

posted by codders in rant

As is my wont, I took the last half of December as holiday (having carefully saved it up during the year) and got back in to work today, hence the slight drop in post frequency.

Of Blogging
If my first month of blogging taught me anything, it’s that it’s remarkably time consuming to write technical articles for a technical audience. Turning ‘that thing that I did at work today’ into an informative, accurate, and non-trivial (not to mention non-criminal) article takes more time than expected. For that reason I think I’m going to be dropping to two posts a week (if that) instead of three.
That’s the downside. The upside is that my digital log-book has actually served most / all of its intended purposes. I’ve used it for my own personal reference on more than one occasion and others have used it to help them get things done. Not only that, but I am now more intimately familiar with the seedy underbelly of the blogosphere - the SEO and the carefully selected topics titles and stubs. Analytics tells me I’ve had 540 unique visitors (which is more than I was expecting), the vast majority of whom are referred by Google search results (75%).
All in all, a successful little experiment and one I plan to continue for a while yet.

Of Holiday
I use the word ‘Holiday’ in the loosest possible sense. I mostly stayed in Cambridge pretending that Internet Radio didn’t exist, which was indescribably refreshing. I also, naturally, played a little with my computer. I have discovered that:

  • Compiz now works in Sid (on Intel cards)
  • If you do use Compiz, you can really only play videos with the GL renderers, and they play really badly with … err…. everything else on screen (which is obviously also GL). Also, don’t get too attached to being able to switch to console without crashing X.
  • Debian has handy tools for building pendrive linux images (on which topic an article shortly)
  • Xen won’t easily boot XP as an HVM guest from your pre-installed XP partition (on the same disk as your root partition). Steve said it would be fine, until I disclosed where the XP install was. Then he laughed. Then he said it was unsupported. Then, when pushed, said it was possible but ‘a really dumb idea’. He repeated that a couple of times. Then I did it anyway. Then he spent the best part of an afternoon helping me make it work. Then we gave up. I should listen to Steve.
  • VMWare won’t boot XP from your pre-installed XP partition (or at least not without a Windows MBR, which I’ve not yet had a chance to copy from somewhere).
  • `xset -dpms; xset s off` will turn off your screensaver, no matter how obtuse KDE is being.
  • Epigenetics is fascinating. So is genetics, but I’d already heard of that. Props, as ever, to Radio 4 (and its fans)
  • You really need a Raven login to access the University’s teaching materials
  • Steve has a Raven login (mine’s apparently still ‘in the post’)
  • If you want to play chess over the internet, you probably want to sign up at FreeChess and install pychess
  • You can write your own BBC iPlayer (not sure if I’ll write an article about this), but you still can’t save the files
  • I’ve forgotten how to play chess
  • Sake is good

All in all a successful, relaxing and informative holiday.

Of the future
This year, apart from my New Year’s resolution to ‘Give people a break. They’re really not as bad as you make out’, I will be doing my best to sabotage the following organisations:

  • Big Media - They seem to be doing a pretty good job on their own, to be fair. I was at home briefly this Christmas and for the first time in ages I saw an anti-piracy advert when I put a DVD in my parents’ player. Now don’t get me wrong, I have quite a lot of DVDs, I just don’t see the ad’s because playback software in Linux isn’t hideously crippled. If I had to watch those things, I’d certainly steal more films and buy fewer.
    I also had, as a result, to try to convince my father than in spite of what’s written in 36-point block caps on the screen, piracy is not theft. Piracy is copyright infringement; theft is theft. (Apparently the law disagrees).
  • Apple - A lot of the cleverest people I know buy Apple. They don’t see that Apple is doing anything worse than your run-of-the-mill tech company and like the innovative products the company creates. If Apple are so nice, show me the offical documentation for DAAP. In fact, show me the docs for the Apple Accessory Protocol so that I can plug my iPod (I don’t own an iPod) into something that Apple didn’t make (I know such devices are available, but they all had to use the reverse engineered protocol). Apple are creating an ecosystem of devices with which you have no guarantees of interoperation, and just because the devices work and are shiny doesn’t make it good.
  • The ISPs - ISPs are a necessary evil. That’s pretty much all I have to say on that.
  • Adobe - When I tried to write my own BBC iPlayer, I discovered that there’s not a single place in the free world that you can find an implementation of RTMP (the Flash video streaming protocol). I found it hard to believe that there were still protocols that were secure by their obscurity, but there it is. It’s everywhere, streaming almost everything, and the only way you can view the streams is using an officially-sanctioned Flash player. Something must be done.

That’s part of the future. I’ll obviously be doing the turncoat thing of going to work everyday for what is effectively a media company, implementing existing DRM schemes, creating new ones of my own, buying DVDs, watching Flash videos and using the internet. But deep in my soul, I’ll be hating every minute of it :)

Playing the organ is odd

posted by codders in music, organ, rant

I was planning to post something this morning - another thrilling technical article, no doubt - but it’s Advent this coming Sunday (at least, in college it is) and preparations for that have sucked up all my free time. Fortunately, while writing detailed technical articles requires research and effort, ranting mindlessly doesn’t. Yay.


The thing with playing the organ is that if you’ve done it right, nobody should notice you’ve done anything at all. Now, that’s true of quite a lot of things in life - flying a plane, removing an appendix, baking a soufflé, packing a parachute, preventing a terror attack (don’t even get me started) - but playing the organ is different in that it’s something I do every other week so, you know, I care about it n’that. You’ve got two or three keyboards, a board of pedals which, for the uninitiated, act as another keyboard for the feet, and a whole pile of buttons, and for up to five minutes at a time all you have to do is put both hands, both feet, and all ten digits in the right place at the right time (to within, say, 5mm and 0.25 seconds).


So this week, I’ll mostly be practising. I’ll be playing the same few difficult bars over and over again knowing full well that the chances of them being right on the night are slim to nil, and that even if they’re right nobody will notice. I’m really not sure what the appeal is except to say that there’s something so much more fun about making music than listening to it and that all the practising and rehearsing is … err … fun, I guess. Personally, I prefer it when nobody’s listening, but I’m a lazy man and if it weren’t for the fact that I’ll have to play in front of 50-100 people on Sunday I’d probably never learn the pieces of music that I have. That and I don’t think I could justify the 10 hours a week of practise if it was every week and just for my own enjoyment.


Anyway. That’s why I’m not posting anything useful this week. Mr. SEO will no doubt berate me, complaining that the audience of Debian-using software-writing web-developing MySQL-administering geeks was niche enough before I made it about organ-playing as well, not to mention the fact that I’m (heaven forfend) writing about myself. He can bite me.

ftw?

posted by codders in meta, rant

Right. So. Here’s the thing. I work in ‘internet stuff’, software, digital media, etc.. Actually doing that for a day job does two things for you - it keeps you looking for The Next Big Thing for the purposes of exploiting it, and makes you feel anxious about your own obsolescence. The only way you’re going to keep up is to give things a go and find out what, if anything, you’re missing.

Take blogging. Please, somebody, take blogging. There’s an argument that says that the only people actually sitting down and reading blogs are the people who also happen to write them. A little community of mutual back-patting and reassurance. There’s a counter argument that looks at the number of blogs that show up in the top 10 search results and concludes that bloggers, with their series of niche contributions to human knowledge are actually making us better informed as a race. I no longer have to look for the website of some guy who spends his life installing Linux for help on installing Linux. I just find a blog post of somebody who happens once to have done that and maintains a blog.

So here am I. Looking for the next big thing, avoiding my own obsolescence and, where possible, contributing to human knowledge by reporting my niche experiences. I’m pretty sure there’ll be an initial flurry of posts and it’ll die, but you can’t say I didn’t try. Well, I mean, you could. You’d be wrong. It’d me more accurate to say I should have tried harder…

Recent Posts
Recent Comments
About Us
Franta: and Step 7: Become frustrated again...
Dave: hey, just wondering if there is a working demo somewhere. The above demo does not se...
Flemming Frandsen: Hi, I'd just like to thank you for posting this, it was an imeasureable help to me, s...
qbJim: Doing it with C++ iostreams would have saved remembering the parameter list to read a...
C-rat: I better put the Prelude on my reading list too. I might use init as a good example o...

This is the personal blog of a professional software engineer. This site and the views expressed on it are in no way endorsed by the RIAA.