Lee Packham

Software Engineer, UX Designer, Opinionated, Husband

FOSDEM 2014

Just spent the weekend at FOSDEM 2014. It’s the first time I have been to FOSDEM and checked out more of the Open Source world.

Seven of us went from Green Man Gaming and the only thing I will remember for the future is that I need to turn up to talks I want to go to very much in advance.

Rooms were always very quickly packed out. Managed to meet lots of cool and awesome people though.

Go was the language of the conference

There’s no way you could avoid this. Go is mainstream now. It’s been heading this way for a while - but it’s very clear that this language that people wondered the point of is now relevant to the point of obsession. The room was constantly ram packed and people staying for talk after talk.

I’m not the only one that laughs at MongoDB

Yep, turns out lots of people find the stability amusing.

There tons of PostgreSQL I don’t know

This was always going to be a given. The RDBMS is still relevant and still attracting a lot of attention. There was a definite lack of MySQL and MariaDB however. Maybe that swings it a bit.

There’s loads of stuff coming in 9.4.x for JSON and the like. The main thing I got from the talks though was an understanding of TOAST.

I need to do more here

Next year… I need to make more of an effort to plan and attend more talks.

I will be here next year!

Making HTTP Client Calls With Finagle

I was trying to make HTTP calls using Finagle today and all I would get was this traceback from my logs:

1
2
3
4
5
6
7
8
9
10
11
12
13
FAT [20121215-15:49:46.803] HttpServer: A server service client threw an exception
FAT [20121215-15:49:46.803] HttpServer: com.twitter.finagle.WriteException$$anon$1: java.net.ConnectException: connection timed out
FAT [20121215-15:49:46.803] HttpServer:     at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:391)
FAT [20121215-15:49:46.803] HttpServer:     at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:289)
FAT [20121215-15:49:46.803] HttpServer:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
FAT [20121215-15:49:46.803] HttpServer:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
FAT [20121215-15:49:46.803] HttpServer:     at java.lang.Thread.run(Thread.java:722)
FAT [20121215-15:49:46.803] HttpServer: Caused by java.net.ConnectException: connection timed out
FAT [20121215-15:49:46.803] HttpServer:     at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:391)
FAT [20121215-15:49:46.803] HttpServer:     at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:289)
FAT [20121215-15:49:46.803] HttpServer:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
FAT [20121215-15:49:46.803] HttpServer:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
FAT [20121215-15:49:46.803] HttpServer:     at java.lang.Thread.run(Thread.java:722)

It turns out I needed to set up my ClientBuilder a little differently:

1
2
3
4
5
6
7
  val client = ClientBuilder()
    .codec(Http())
    .hosts("localhost:80")
    .tcpConnectTimeout(2.seconds)
    .requestTimeout(55.seconds)
    .hostConnectionLimit(5)
    .build()

The important bits, that don’t appear well documented are tcpConnectTimeout and requestTimeout. The normal ‘timeout’ usually used on the ClientBuilder is not what you want.

This was more a note for me - but figured people Googling might find it useful also.

Write Code Like You Mean It

Recently I was catching up on talks from DjangoCon EU 2012. Wish I could have been there. This talk on Flasky Goodness (or, why Django sucks) sort of rang a bell with me.

Why? Well, for me the point of writing everything like it’s going to be open source seems like a great way of doing things. It’s a great philosophy to have. Seriously.

Don’t Bother With That Degree, Say IT Pros

Interesting tidbit posted by The Register last week. It’s a topic fairly close to my heart as I don’t have a degree. I do, weirdly, get asked about this quite a bit - “should I get a degree?”. If you think you should, you should. Don’t let any “IT pro” sway your decision.

This is especially important now that degrees are just so damned expensive. According El’Reg, you’re looking at £27k for your degree. Wow!

Personally, when I look at people’s CVs, the first thing I’ll do is Google them. Then, I’ll take a look at their Github profile. Then I look at their education. It’s important that if they did a degree, they did well - but it doesn’t matter if they didn’t do one at all.

Git: Squashing Commits Without Merging a Thing

This trick has saved me today and I’ve had to use it before… so I’m going to demonstrate how to do this here in my own words to save me Googling for every time!

So imagine the scenario. You’ve done a load of commits and you’re not ready to merge them back into master (or, even worse you’re in master) and you realise you made a massive mistake a few commits back and you need to just squash all the correction commits into it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
commit 6e0fa1b21e760aee2391f73c4905244a229abe8b Author: Lee Packham
<xxx> Date: Sat Jul 2 12:47:31 2011 +0100

More tidy up (I'm a muppet)

commit abe08fd948f81f3366bc9a647e0d0c24ffe5fdc6 Author: Lee Packham <xxx>
Date: Sat Jul 2 12:46:14 2011 +0100

Tidy up

commit caefc1c0a8903009af2be8cd37df1ac40366fcce Author: Lee Packham <xxx>
Date: Sun Jun 19 08:21:03 2011 -0700

Initial commit

Well that’s crap really isn’t it? So how do we go about sorting this? Well, we make a good use of rebase and tags to achieve this. There’s a nice answer to this on Stack Overflow - but I’ll replay it here. Props to Charles Bailey for this process.

So, here’s how we fix this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Checkout the top commit in a detached branch git checkout
6e0fa1b21e760aee2391f73c4905244a229abe8b

# Now, do a soft reset back to the original commit git reset --soft
caefc1c0a8903009af2be8cd37df1ac40366fcce

# Now commit --amend it to squash it all git commit --amend

# Then, tag this new detached commit git tag tmp

# Now go back onto master git checkout master

# Awesome now do a quick rebase and it'll replace the upstream with tmp git
rebase --onto tmp 6e0fa1b21e760aee2391f73c4905244a229abe8b

# No need for tmp now git tag -d tmp

Not overly simple - but brings, in this case, master to where I wanted it to be!

Making Qt Webkit and Macdeployqt Work

When making a Webkit app with Qt, bundling a .app will not work. Ok, so that’s not quite true - but it won’t run. This is a build bug on the Qt side - fixable with a small post-bundle step:

This will mean your app will no longer crash - so fairly useful.

Moved Domains for the Blog

I got bored of leenux.org.uk as a domain name. So I’ve moved everything to leecutsco.de - I think it looks cooler - and also leenux was only bought as a joke. I’m a sucker for domain names… I actually own over 20. The annual bill for that is redonkulous (grr @helenmoyes has me addicted to that word now).

I’ve kept my e-mails the same, for now, however - leenux.org.uk has been my primary domain for nearly a decade (10 years this November), so I’ll have to keep it running regardless. This’ll just be the blog for now.

TweetDeck Joins the Twitter Flock

The last week has been, as I’m sure you can imagine, hectic. It’s all out the bag now - TweetDeck has been acquired by Twitter. It’s absolutely amazing news and I’m really proud to be a part of it. As part of the deal, my employment, along with the entire team, has transferred over to Twitter.

I came along fairly late in the day in all this having only joined in January of this year. I never guessed that by now I’d be working for Twitter as a Software Engineer. I’m totally stoked.

I’ll still be working on mobile clients - and hopefully I’ll get more time to work on Chrome hacks.

So, congratulations everyone! Special congratulations to Iain… it proves that scratching an itch really can lead you down paths you never expect. Let this be a lesson to Software Engineers / Programmers everywhere.

Be Careful What You Throwaway…

This is why you should always be careful what you throw in the trash. ALWAYS SHRED YOUR STUFF. This guy, and a guy on the other side of the road, systematically working their way up said road scavenging.