By day I mainly live in the frequency domain.
By night I often build websites, amongst other things.
One of my favorite lecturers from university was Dr Iain Lindsay, who taught 4th year Digital System Design.
Judged against most of the other lecturers, who droned along to a set of dry powerpoint slides, his teaching style must have seemed “eccentric” to most of his students. Instead of a projector he scrawled across the blackboard, full academic gown flowing behind him. Where others would stick to a script defined by their slides, Iain’s discussions would flow, and loop, and shoot off at seemingly irrelevant tangents, which later turned out to be deeply insightful.
But to me, the real gems were the course notes. Each week he would hand out what is best described as a non-fiction novella: pages and pages of witty prose complete with hand-drawn diagrams. Every point he made or figure he quoted would be referenced in the footnotes, such that on some pages the footnotes made up half the content of the page.
Typically these footnotes would be references to ancient books or datasheets, but not always. Lewis Carroll’s Alice In Wonderland was invoked to debate whether any two events can be truly synchronous; Buridan’s Ass and WWII trench warfare were used to illustrate metastability and there were countless poems and other delighters.
One footnote that has stuck with me, and I keep stumbling across examples of, discussed the concept of Zero One Infinity in system and software design. I forget the original footnote now, but it went something like this:
Systems should be built to handle exactly one instance of an entity, an infinite number, or none at all. Setting an arbitrary limit is foolish and will inevitably be wrong.
It is easy to underestimate how often we ignore the infinity part of this concept. This is because very few things in daily life would actually require an infinite limit, but that is somewhat missing the point. The problem is not that we need an infinite limit, but that whatever finite limit we choose, will inevitably not be large enough at some point. This will require either an inordinate amount of code & effort to deal with a mostly unusued case, or we can ignore the code and get mischeivous errors popping up.
Some classic examples:
I will end with a final footnote from the course notes. It is the start of a Monty Python song that was used to illustrate some chicken-egg problem with sequence design:
Horace ate himself one day. He didn’t stop to say his grace. He just sat down and ate his face…
Whenever I have a merge conflict after merging from a branch into another with git, I get confused which bits came from where:
In retrospect it’s actually pretty straightforward. HEAD always refers to your current branch in git, so from «« to ==== is what was in the branch you started in, and ==== to »» is what was in the branch you came from.
Easy. When you know how.
I just bumped into the following little “bug” in my rails app. I was getting the id of a related object to use to fill a newly added column in a migration, and suddenly far too many of the objects were linked to id=4. (Take particular note of the final line).
So what’s going on? It turns out that as well as a database “id” (if the object is stored in the database), every object has an object_id (which is also accessible through .id if the object is not an ActiveRecord model).
So when we do: jonny.parent.id we are actually getting the id of the nil object (since jonny.parent returns nil). This id is always 4, hence the confusion.
By doing: jonny.parent_id instead, we don’t try and actually retrieve the parent object, but just look at the database row to get the value.
Admittedly you will get a warning if you do nil.id : warning: Object#id will be deprecated; use Object#object_id, not that I spotted the warning.
So maybe this issue will disappear in the future, if .id gets removed from the Ruby syntax, but until then consider yourself warned.
A lot of Lib-Dem voters seem to be freaking out about the fact that Nick Clegg is in talks with the Conservatives. I am certainly no political analyst, but I think a lot of people could do with taking a step back and chilling-out a bit. Here are my thoughts
Like it or not the Conservatives received more votes, and more seats, than any other party in this election.
Nick Clegg and the rest going behind the Cons’ backs to create a coalition government hardly smacks of fairness, and puts the LibDems at risk of backlash from an expanded Conservative base many of which are clearly ex-Labour voters who are fed up with the current Labour government.
By courting the Conservatives, the LibDems can make the demands they would see fit for forming a coalition. Hopefully these include significant compromise from the Cons on Immigration, defence, and most importantly electoral reform.
If the Conservatives cave on their demands (which seems unlikely to me), then we have a significantly diluted Con-Lib government. Yes it might not be exactly what you voted for, but get over it. A LibDem majority was a (very long) shot, and it’s much better than a Conservative only government. Also with electoral reform in place, we are in a much better position for the next election.
If the Conservatives don’t give in (which seems much more likely), then Nick Clegg will be free to say “sorry, we tried, the Cons are being unreasonable”, and go to Labour and the rest and try to form a majority government.
Clearly Nick Clegg could cave on all the important issues, and form a coalition anyway. If that happens then by all means start a riot. Otherwise, just chill out: the LibDems haven’t betrayed you yet. Instead of fuming at them, why not send them a reminder of which issues are most important to you for forming a coalition: http://38degrees.org.uk/lib-dems.
Thoughts?
As is currently in vogue, thanks to the astonishing lack of democracy around the Digital Economy Bill, I “penned” an email to the Rt. Hon. Alistair Darling MP.
Feel free to use all, parts, or none of it in your own letter if you haven’t already done so.
Dear Mr Darling,
It is rare that I take a considerable interest in politics. I spend my days working at a large local electronics company; and in my spare time I am part of a startup which is building a web-application to help small businesses manage their money.
This doesn’t leave me too much time to worry about the goings on in parliament - I just work hard, pay my taxes, vote if I get round to it, and other wise leave politics to be politics.
Recently, the Digital Economy Bill that is currently being rushed through parliament, has forced me to sit-up and take notice. I cannot comprehend why legislation which is so contentious, and which has such potential for negatively affecting both the UK and the internet as a whole - is being pushed through during the wash-up.
I have many reservations about the bill itself:
The power to shut-down/block services which have been used for “file-sharing” is very worrying. The internet revolves around sharing, sometimes to infringe copyright, but also for hugely positive reasons. Clearly copyright holders must be appropriately compensated, but restricting access to great services, and holding back innovation, is not the answer.
The ramifications for businesses who wish to provide free wi-fi to customers is also extremely concerning. To people trying to build web-based startups (of which Edinburgh has hundreds), cafes with wi-fi are hugely important. They enable us to get out of our tiny flats, get together, and work on building our companies - some of which we hope will grow and make a significant impact on the UK economy.
If the bill results in cafes removing their wi-fi service, not only will they lose our business (as we will be forced to work from home); but the joy of spending most of a Saturday in a cafe, sipping a cappuccino, and building a business will be gone. As Chancellor of the Exchequer I am sure you are aware of the importance of startups to the UK economy, and wouldn’t wish to make life any harder for people trying to start web-businesses.Ultimately whether you agree with my specific concerns about the bill or not is unimportant. I am sure you would agree that the internet is the lifeblood of the 21st century, and is only going to become more important to individuals, businesses, the government and the UK economy as time goes on.
This is why I must urge you, please, to do everything in your power to stop this bill being pushed through parliament during the wash-up, and instead give it the debate it deserves under the next government.
Thank you for your time, and I would appreciate your thoughts on this matter,
Regards, Philip Roberts
P.S. I appreciate I only have a single vote, but I thought you should know that my only considerations come the 6th of May will be each parties plans for this bill, and the internet in Britain as a whole.
It has been a long time since I’ve had a television. Apart from perhaps the odd occasion at other people’s houses, I haven’t really watched television since I lived at home 6 years ago.
Partly this is because a lot of my attention has been consumed by the internet, either bouncing from blog-post to blog-post on Hacker News, or building bits of the web for fun. The other reason is that the majority of the shows trotted out are utter trite.
Sure, there are a few gems from across the pond which I can’t get enough of; and the BBC has a few gems. But they also have crap like: Snog Marry Avoid, of which the title alone makes me feel physically ill.
I am not a big fan of the phrase “the democratization of the internet”, but it’s certainly true. I have recently come across a few videos that could almost certainly not have existed in “traditional” television; yet have felt more human, and evoked more emotion in me than most of the junk on the magic box ever has.
Guy called Matt travels the world, dancing. Sounds simple, but holy crap is it powerful. Watch it, then try and tell me Big Brother has a place in this world.
On the one hand Chat Roulette is probably my mother’s worst nightmare - unmoderated, seemingly pointless, probably full of genitalia. On the other, it’s connecting total strangers in the rawest sense, and enabling cracking videos:
An intensely interesting, and rather amusing, lecture by Douglas Adams about his adventures finding endangered species. This may not quite be as “user generated” as the other two, but I can’t imagine it seeing the light of day, in full, on TV.
Well, maybe at 4am on a Sunday morning, but that doesn’t really count.
This man takes metathought to a level I can only wish for.
As well as cognitive bias (see Biases, part 1), there is also plenty of physical bias in the world.
A simple example is a weighted coin. A regular coin has a 50% chance of coming up heads, and a 50% chance of coming up tails. However, by cleverly distributing a coins mass, it is possible to make a coin that has a bias towards either heads or tails. The brilliant John von Neumann once posed a puzzle that went something like the following.
Suppose Alice and Bob want to toss a coin to decide who pays for pizza, but the only coin they can find is Bob’s trick weighted coin, which comes up heads more often than not. How can they use the coin to fairly decide who pays?
The world is full of biases. Some of my favorites are cognitive, which frequently result in people (myself included) misinterpreting information, or making poor/wrong decisions, when they believe they are being rational and logical.
Being aware of these common biases is very useful, both for finding weakness in arguments you make, as well as in those of your “opponents”.
Confirmation bias is one that seems to be very common1: the act of seeking or interpreting evidence to confirm a belief you already have; ignoring or not looking for evidence which would counter it.
A recent example pulled from Facebook is a statement such as this (and I don’t mean to make it personal, it’s just a good example):
Why do so many people get the words lose and loose mixed up? Is it a generation thing, because it only started happening visibly in the last few years. Maybe an Internet-speak issue? Curious…
Given that there is no hard evidence (that I am aware of) that this statement is true, it seems much more likely that confirmation bias is at play, playing out something like this:
I have found that simply knowing that confirmation bias is a thing, with a name, has helped me identify when I, or others, are falling prey to it.
Examples like the above are pretty harmless, but I see/suffer from it all the time in the workplace: people collecting more and more “proof” to support their hypothesis, whilst ignoring, downplaying, or not even looking for information that would disagree with it.
Cognitive biases are one place where a little meta-thought (thinking about the way you are thinking) can go a long way. Whenever you are trying to confirm a theory, try and look for counter-examples, as well as supporting evidence. Many a mathematician would tell you it’s a powerful technique.
1The irony of this statement should be clear upon finishing this post.