Those who do not know the future are doomed to repeat it

A couple of weeks ago, I attended the Open Source Developers Conference (OSDC) in Sydney where I gave the dinner keynote. I had previously given the dinner keynote at OSDC 2010 in Melbourne, where I explored a number of interesting topics “that I wasn’t really qualified to talk about.”

In writing the dinner keynote for 2010, I took the idea that people come to conferences to hear from experts in the field and decided that I should instead do the opposite of that. Talk about all the things that I think are interesting but I’m not an expert in. So in 2010 I covered: Drizzle database server (the only thing I was actually qualified to talk about), developing your own film, how much effort it takes to write a book, brewing your own beer, Bluehackers (and mental health in general), Security (it was the time of Stuxnet, oppressive border security), censorship (and how government claims that the internet is both different to and just like publishing a book at the same time), Wikileaks, how perhaps we should go after child pornographers rather than waste money on totalitarian filters, feminism, code of conducts at conferences, homophobia, a history of marriage and the notion of ‘traditional marriage’, the concept of freedom itself and a few pictures of vegetables made to look like faces. In the words of some attendees, “there was something to make everyone at least slightly uncomfortable at some point”.

My 2010 talk went really well, there was much applause and it inspired at least one person to go and brew their own beer (in itself a victory). Many thanks to Donna for spending a non-trivial amount of time helping me polish the final talk and help ensure some of my most important points were communicated properly.

So for 2012, I felt I had some big shoes to fill. Picking a topic (and writing the talk itself) for a dinner keynote is tricky. You have a captive audience with a wide variety of interests (and likely a few partners of attendees who aren’t at all technically minded). I wanted a topic that could have a good amount of humour (after all, we’re at dinner, relaxing and chatting) as well as a serious message that would speak to all the developers in the room (after all, this was the Open Source Developers Conference). Needing a title for the talk much in advance of when I would start writing the talk, I started thinking along the lines of “Those who do not know UNIX are doomed to re-implement it – poorly” and “Those who do not know the past are doomed to repeat it” – thinking that there must be some good lessons that I’ve learned over the past years that could be turned into a dinner talk. I ended up settling on “Those who do not know the future are doomed to repeat it”.

I, of course, left most of the specifics to be determined much closer to the conference itself as procrastination seems to be an integral part of writing a talk. Fast forward a while and if you were nearby you would have heard me exclaim “Who had this dumb-ass idea for a talk?” and “well, it seemed like a good idea at the time.”  Setting yourself constraints is good, and at least narrowed the search space for constructing something that’d go down well. Next came “How on earth do I construct a cohesive narrative around that?” as a whole bunch of fun anecdotes about what people in the past considered the future is great, but how do you weave a story around it? In thinking about what used to be the future (and indeed, researching it), I had the realisation that this in itself is a really good story and vehicle to talk about how to produce better software.

And so, I solidified a set of laws, and for mostly humorous purposes, I’ve called these “Stewarts Laws”. So, we started with:

Those who do not know the future are doomed to repeat it.

Stewarts 0th Law

Because in computing, we start counting from zero.

I then went on a grand tour of how we got to have the PC. Early personal computers being iterative improvements on technology that came before, and how packaging technology as an appealing product helps adoption and that no matter how good something is, if it’s too expensive, it’s never going to be mainstream. This last point was a homage to the great Hitchhiker’s Guide to the Galaxy, which was successful over the great Encyclopaedia Galactica for two reasons, one of which was “it was slightly cheaper”.

The platform which is more open will eventually succeed over ones that are more closed. (This really should have been a law… but I missed the opportunity). One example was Mozilla. The initial source release was way back in 1998 and this “quirky open source project” took a very long time to deliver a useful web browser (excluding all the internal Netscape development on this complete rewrite of the browser).

All complete rewrites of any sufficiently complex software takes at least 5 years to be remotely usable.

Stewarts 1st Law

With the insight that the more free platforms (the PC, Windows, the web, Mozilla) eventually win out and being a talk about the future, I could not possibly not cover “The Year of the Linux Desktop”. This was useful to cover the install and user experience of Debian 2.2 (potato). This was Linux in the year 2000 (with IPv6 support, and with World IPv6 day only six months ago, this is certainly the future). It was not friendly.

But there was KNOPPIX that built on what came before and this showed the way so that other distributions could end up creating a situation where there are now many distributions of Linux that make running a free desktop something that is no longer masochistic, it’s something that can be decidedly pleasant.

I (of course) had to cover the freedom in your pants. The cell phone. Specifically, how there is more free software running on a computer that fits in our pants pockets than there was storage in the computers we grew up with. It doesn’t matter if Android is better than an iPhone or not, the more open, free and cheaper platforms always win. But really, it’s just iterative improvement on what came before.

All innovation is really just iterative improvement.

Stewarts 2nd Law

Very rarely (if ever) is there a “eureka” moment that doesn’t build upon the work of others. Find your giant to stand upon so that you can see further.

We can, of course, get it wrong. I used the example of New Coke and wondered if Unity or GNOME3 are our “New Coke” or if Windows 8 is the new Vista. But really, it’s not making a mistake that is bad, it’s not realising it and correcting. What we need is CI. Not Continuous Integration (although that is part of it), I’m talking about Continuous Improvement.

Anybody who took a “Software Engineering” course at university will have read about, studied, and parroted things about “the waterfall model” and “software prototyping” and “incremental build model” and “spiral model” and maybe even “SCRUM” or XP (which seems to be jumping off cliffs and yelling at fish). You probably had to do an assignment where you wrote “We’re going to do X model” and then had to stick to it, quickly finding that it just didn’t quite work that way.

This is because all this static model of software development methodology is a bunch of dairy production byproduct – otherwise known as BOOLSHIT. There is no static way written in stone and there certainly isn’t “one true way.”

The best battle plans don’t survive first contact with the compiler

Stewarts 3rd Law

This law is obviously stolen, which leads me to:

Stealing good ideas is itself a good idea, that you should steal.

Stewarts 4th Law

Software development is evolution by natural selection. Mutations in software battle it out and the fittest survive. This is even more true in free software development, as anyone is free to fork the product, mutate it and compete. In this way, free software accelerates the free market – it forces companies to continually add value rather than vendor lock in.

Our development processes also evolve. We try new things and keep what works. There may be a “state of the art” that we think exists, but really what matters is continuing to improve your development process. You don’t have to suddenly catch up, just improve.

  • Revision Control
    We’ve had RCS, CVS, Subversion. We’ve had bzr, hg and git. Distributed is obviously the current state of the art.
  • Code review
    and improving how we do code review. Could you review code better? Could we have automated code review?
  • assert(), make the compiler do the work, defensive coding
    Write code to do some of your code review for you.
  • Explode at compile time rather than runtime (i.e. not user visible)
    Detecting problems earlier is better.
  • Extensive Unit testing
    Test each component, have components be components, not spaghetti.
  • Extensive testing
    Test the system as a whole
  • Running the test suite
    Actually run the test suite
  • Reliable test suite
    Have the test suite be reliable so that a failure really is a failure and not a false negative.
  • Continuous Integration
    Always test how things go together
  • Test before integration
    Test before pushing to trunk, ensuring even further that trunk is always releasable.
  • Merge captain
    Takes approved code, merges it. This is variants on the Linus model.
  • Automated merges
    Take the manual steps out, we can automate them (who needs to type 10 version control commands in when one will do)
  • Always releasable trunk
    “Release early, release often” refined to “release something that isn’t crap”
  • Release checklists
    There are probably different things you want to do upon release, check that you do them. For adding awesome new features, you want your marketing department to know about it. For awesome bug fixes, you want your support staff to know about it.
  • Continuous Deployment
    There is no environment like production environment.

This led me to two more laws:

Any system of sufficient size will have several versions of each component deployed simultaneously.

Stewarts 5th Law

Constructing software is itself a system of sufficient size.

Stewarts 5th Law, part B

This applies to software you both deploy yourself and release as a tarball (or however you do it). Even if we don’t like to think about it, when we release a software package we are slightly involved in deploying it. We can certainly make it easier or harder to deploy. There are always OS and library updates that will be out there, so there will always be your software running in different environments.

Not only will people using your software use it in different environments, the people developing your software will be too. No two developers have the same development environment setup. One will use a different editor, different shell, slightly different version of the compiler (maybe they haven’t applied an update yet) etc etc. We can’t program to the “one true environment” because no such thing exists.

So, What’s next?

Some of our older problems have good solutions, but many of the newer ones do not. How do we get the state of the art in software development to more people? What’s the next step to explore?

I encourage you to constantly think about your development process and what the future holds for it. After all, it is adapt or perish – the past is littered with the technological corpses of things that were “the future” but failed to innovate any further.

Delicious Bourbon Whiskey BBQ Sauce

I’ve made this wonderful Bourbon Whiskey BBQ Sauce a couple of times now and it’s been great. It’s pretty quick to make up a small batch, and you can immediately use it for whatever you have that requires BBQ sauce.

Below is a photo I took about halfway through reducing it. Unfortunately, I can’t convey the awesome smell and taste.

home made bourbon BBQ sauce

Sierra Nevada Beer Camp 2012 Oatmeal Stout

This, my friends, was good. Supremely drinkable with great flavour, colour and body. I want more of them. We have a bit of a saying around here that the Sierra Nevada brew of any style of beer is a rather good definition of that style – and this is no exception. If you feel like a good oatmeal stout, go grab one of these and you won’t be disappointed.

New libeatmydata release (65): MacOS X 10.7 fixes

This release incorporates contributions from Blair Zajac to fix issues on MacOS X 10.7.

You can get the source tarball over on the launchpad page for the release or directly from my web site:

Impact of MySQL slow query log

So, what impact does enabling the slow query log have on MySQL?

I decided to run some numbers. I’m using my laptop, as we all know the currently most-deployed database servers have mulitple cores, SSDs and many GB of RAM. For the curious: Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz

The benchmark is going to be:
mysqlslap -u root test -S var/tmp/mysqld.1.sock -q 'select 1;' --number-of-queries=1000000 --concurrency=64 --create-schema=test

Which is pretty much “run a whole bunch of nothing, excluding all the overhead of storage engines, optimizer… and focus on logging”.

My first run was going to be with the slow query log on. I’ll start the server with mysql-test-run.pl as it’s just easy:
eatmydata ./mysql-test-run.pl --start-and-exit --mysqld=--slow-query-log --mysqld=--long-query-time=0

The results? It took 18 seconds.

How long without the slow query log (starting with mysql-test-run.pl again, but this time without any of the extra mysqld options)? 13 seconds.

How does this compare to a Drizzle baseline? On a freshly build Drizzle trunk, using the same mysqlslap binary I used above, connecting via UNIX socket: 8 seconds.

Wilde Gluten Free Pale Ale

I have a number of friends who are gluten intolerant, so I’ve taken one from the team and grabbed a few gluten free beers available locally to try. The Wilde Gluten Free Pale Ale wasn’t bad, and although does have that distinctive taste of a gluten free beer, certainly wasn’t offputting. I’d put this around what’ you’d expect from a more mass produced pale ale.

ale. image

New Jenkins Bazaar plugin release

I’ve just uploaded version 1.20 of the Bazaar plugin for Jenkins. This release is based on feedback from users and our experiences at Percona.

  • Do a lightweight checkout instead of a heavyweight checkout (if “Checkout” is enabled)
  • Fix bug: lightweight checkout “update” would always fail as bzr update didn’t accept a repository argument. Switch to using bzr update followed by bzr switch. This should massively improve performance for those not doing a full branch.
  • Remove “Clean Branch” advanced option (replaced with “Clean Tree” option)
  • Add a “Clean Tree” advanced option. This will run “bzr clean-tree –quiet –ignored –unknown –detritus”, preserving the .bzr directory but doing the equivalent of wiping the workspace (starting with a fresh slate). This should massively improve performance for projects that do not have a clean build.
  • Clarify that Loggerhead is the repository browser used by Launchpad, and have a complete example of how to configure it.

Finding out What’s Next at BarCampMel 2012 with Drizzle, SQL, JavaScript and a web browser

Just for the pure insane fun of it, I accepted the challenge of “what can you do with the text format of the schedule?” for BarCampMel. I’m a database guy, so I wanted to load it into a database (which would be Drizzle), and I wanted it to be easy to keep it up to date (this is an unconference after all).

So… the text file itself isn’t in any standard format, so I’d have to parse it. I’m lazy and didn’t want to leave the comfort of the database. Luckily, inside Drizzle, we have a js plugin that lets you execute arbitrary JavaScript. Parsing solved. I needed to get the program and luckily we have the http_functions plugin that uses libcurl to allow us to perform HTTP GET requests. I also wanted it in a table so I could query it when not online, so I needed to load the data. Luckily, in Drizzle we have the built in EXECUTE functionality, so I could just use the JavaScript to parse the response from the HTTP GET request and construct SQL to load the data into a table to then query.

So, grab your Drizzle server with “plugin-add=js” and “plugin-add=http_functions” in the config file or as options to drizzled (prefixed with –) and….

This simple one liner pulls the current schedule and puts it into a table called ‘schedule’:

SELECT EXECUTE(JS("function sql_quote(s) {return s ? '\"'+ s.replace('\"', '\\\"') + '\"' : 'NULL'} function DrizzleDateString(d) { function pad(n) { return n<10 ? '0'+n : n } return d.getFullYear()+'-'+pad(d.getMonth()+1)+'-'+pad(d.getDate())+' '+pad(d.getHours())+':'+pad(d.getMinutes())+':'+pad(d.getSeconds()) } var sql = 'COMMIT;CREATE TABLE IF NOT EXISTS schedule (start_time datetime, stage varchar(1000), mr2 varchar(1000), mr1 varchar(1000), duration int); begin; delete from schedule;' ; var time= new Date;var input= arguments[0].split(\"\\n\"); var entry = new Array(); var stage, mr2, mr1; for(var i=0; i < input.length; i++) { var p= input[i].match('^(.*?) (.*)$'); if(p) {if(p[1]=='Time') { time=new Date(Date.parse(p[2]));} if(p[1]=='Duration') { sql+='INSERT INTO schedule (start_time,stage,mr2,mr1,duration) VALUES (\"' + DrizzleDateString(time) + '\", ' + sql_quote(stage) + ', ' + sql_quote(mr2) + ',' + sql_quote(mr1) + ',' + p[2] + '); '; time= new Date(time.getTime()+p[2]*60*1000); stage= mr2= mr1= ''; } if(p[1]=='stage') {stage=p[2]} if (p[1]=='mr2') {mr2=p[2]} if (p[1]=='mr1') {mr1=p[2]} }}; sql+='COMMIT;'; sql", (select http_get('https://dl.dropbox.com/s/01yh7ji7pswjwwk/live-schedule.txt?dl=1'))));

Which you can then find out “what’s on now and coming up” with this query:

select * from schedule where start_time > DATE_ADD(now(), INTERVAL 9 HOUR) ORDER BY start_time limit 2\G
But it’s totally not fun having to jump to the command line all the time, and you may want it in JSON format for consuming with some web thing…. so you can load the json_server plugin and browse to the port that it’s running on (default 8086) and type the SQL in there and get a JSON response, or just look at the pretty table there.

Photos from BarCampMel 2012

Just thought I’d post a couple of photos I took today at BarCampMel. Actually, this is technically 4 photos as I’ve used a Fuji Instax shot in each one. The first is Ben making coffee: in the morning and the afternoon. The second shot is awesome partially automated brewing setup.

image

image

Samuel Smith’s Nut Brown Ale

More Vegan beer from Samuel Smith’s! I can heartily recommend their Nut Brown Ale to anyone who’s ever had a Newcastle Brown and wanted a bit more. This isn’t overwhelming and thoroughly enjoyable. I’m finding that this seems to be a good pattern in their beers – flavourful, drinkable and not overwhelming. You could easily pair this with food too… and I’m either craving lentils or they’d go well with it. The back of bottle suggests Thai, Malaysian and Chinese food, which would also go pretty well. There is a societal bias towards matching wine with food, and beer is often supremely overlooked. This is rather sad as the range and depths of flavours of bere is wide and varied, and pretty much always supremely more affordable. You can probably easily name several wines that cost hundreds or thousands of dollars; try naming a single beer that costs more than $100 for a six pack.

Edit: it’s not this beer that costs a lot, this one is quite reasonable. The expensive one is of you can’t easily get to a Belgian monastery.

Samuel Smith’s Oatmeal Stout

Another Vegan beer from Samuel Smith with the nice Vegan symbol on the back and everything. This isn’t a heavy stout, it’s quite lite and consuming more than one pint wouldn’t be taxing at all. The oatmeal part is not overwhelming, providing a subtle flavour more than overpowering the rest of the beer. A quite nice midweek beer.

image

Vegan Lentil and Kidney Bean Shepherd’s Pie

This started with Michelle Bridges’ Lentil Shepherd’s Pie recipe: http://www.dailylife.com.au/health-and-fitness/dl-nutrition/michelle-bridges-lentil-shepherds-pie-20120704-21g7d.html and ended up with this. I’ve made some modifications, e.g. making it Vegan.

The biggest modification is in the cauliflower topping. Like the original I avoided putting mashed potato on the top. This greatly reduces the calorie content, dose low-GI something and a million other things that people try and sell you in food bar form. Basically: cauliflower is awesome, let’s see what we can do with it.

This should be gluten free too…

This serves about 4 people.

Ingredients for the filling:

  • 1/4 cup dried green lentils
  • 1/4 cup dried red kidney beans
  • 1 whole onion (small, peeled)
  • 1 chopped onion
  • 1 bay leaf (or 2, depending on size and your addiction to the awesomeness that is bay leaves)
  • 1 large carrot, diced (I used a purple carrot, because, well, how awesome looking are they?)
  • 1 zucchini, diced
  • 1 capsicum, diced
  • 1 garlic clove, crushed (I ended up using probably closer to 2.. but I like garlic)
  • 400g can diced tomatoes
  • 1tbsp oil (olive works, but Canola or similar should work fine too)

Ingredients: topping

  • 1/2 head of cauliflower chopped/broken into florets (you can double this part of the recipe to have a nice side of the topping too.. which is rather yummy)
  • 400g can of Butter beans, drained and rinsed
  • Up to 1/4 cup nutritional yeast.
Serve with: steamed broccoli and green beans

The original recipe also used mushrooms and didn’t have the zucchini or capsicum. I didn’t have mushrooms (I’d eaten them all) but I did have zucchini and capsicum, and they’re yummy. So feel free to vary.

Method

You’re going to need a saucepan. Put the dried lentlis and dried kidney beans in it with 2-3 cups of water. Add the whole onion and bay leaf, bring to the boil and simmer for 40+ minutes, until the lentils and kidney beans are tender. When done, if there is an excess of water, drain it. You’ll want to have about 1/4 cup of liquid left in there. Remove the onion and bay leaf from the pot.

Pro tip: sprinkle a small amount of salt on the onion and eat it. Deny that it ever existed and enjoy your mid-cooking snack.

The original recipe used all lentils instead of half with kidney beans. I like red kidney beans. If you don’t use red kidney beans and just use lentils, the simmering time is probably the original 40mins, while it took a bit longer for mine – maybe 50 (it’s easy to tell. attempt to eat one of the kidney beans :)

At the same time, you want to grab the cauliflower and steam it for about 15 minutes. You want it to be very soft, you’re going to be mashing it (so if it’s not done at 15, wait a little longer).

Get a bowl that’s good for mashing and put the cauliflower in it. Add the butter beans (you may want to zap them in a microwave for up to 1 minute to get them warmer and easier to mash). Mash the two together, adding the nutritional yeast and perhaps a small amount of salt. The nutritional yeast will give a cheese-like flavour without, well, being cheese. I added the nutritional yeast a bit gradually and tasted along the way to get it right. You’ll know when you start to get close, as you’ll start getting this kind of creamy cheesey cauliflower taste.

In a large frying pan, add some oil (about 1tbsp is fine) and cook the onion, carrot, zucchini and capsicum until they start to soften, stirring regularly (this could be ~10mins). Add the tomatoes, lentils and kidney beans, season with salt and black pepper to taste. Depending on how much liquid was left in your lentil and kidney bean pot, you may need to add a little. Transfer to an oven proof dish, topping with the cauliflower+butter bean mash.

If you like, sprinkle some bread crumbs (or those gluten free quinoa crumbs that Ogram sells) on the top, and bung it in a 180C oven for anywhere from 15-30 minutes to get things all warm, a bit golden and depending on how hungry you are :)

Plate it all up and you can end up with something like this (cell phone pic, with awful white balance, lighting and generally the worst photo I’ve ever taken):

We really enjoyed this, and if you’re looking for a good sized plate of food that checks in at (i think) around 400calories, there you go.

Samuel Smith’s Old Brewery Tadcaster Taddy Porter

I had this one a few days ago. When I was last in Acland Cellars I saw a bunch of Samuel Smith’s beer, and I noticed the small Vegan symbol on the back. Not one to shy away from vegan beer, I bought one of each I could see.

Beer doesn’t have to be explicitly labelled to be vegan, basically what you’re wanting to avoid is isinglass (obtained from dried swim bladders from fish) that is used as a fining agent.

Pro tip: if your beer has a bit of sediment in it (like Coopers does), it’s near 100% likely to be vegan (barring honey or somebody inventing a way to put bacon in beer).

A fining agent will accelerate the settling (clarification) of beer. If you’ve ever bottled your own homebrew, you’ll have noticed that the first 90% of bottles look a lot clearer than the last 10% (here you’re starting to stir up the sediment at the bottom of the brewing vessel). This then settles in the bottle and isn’t a problem – just don’t drink the last half mouthful. This is natural beer – “bottle conditioned”. Mass produced beers (think VB/Carlton/XXXX, not Coopers) are likely to use a fining agent such as isinglass as this enables them to pump out the beer quicker and not have to produce bottles that can withstand the pressure of secondary fermentation.

Pro tip: “bottle conditioned” likely means vegan too.

Basically, being vegan is a great excuse to not drink lots of shit beer.

Anyway, this is the beer I had the other night, and it was quite a pleasant porter. yay!

The Age (Fairfax) picks up on Telstra NextG ‘stalking’

http://www.theage.com.au/technology/technology-news/telstra-accused-of-next-g-web-stalking-20120705-21ivs.html

It took a while, but it’s there. There is a mention of Netsweeper and that they provide products and services to Yemen, Qatar and the United Arab Emirates but it misses what these products are really for.