Christmas drinkers are rubbish

For Steph.

The Curse of the Amateur Drinker

The seasoned, year-long drinker ought to know the warning signs by now, yet each year we always seem unprepared. Suddenly, it’s the second Friday of December and an apocalypse clad in Marks & Spencer is about to engulf you. There are about a dozen of them and they always ask the bartender the same question as they sway through the door: “Is this the Horseshoe?”

Very soon afterwards a lady in the company will ask for “one of those Metropolitans”. Immediately upon entering the licensed premises they will accost the bar staff over the heads of other drinkers. Then loudly they will profess their irritation at how slow the service is, as if they are all Doc Holliday.

Starting up with Riak 1.0.2

Warning: installing Riak 1.0.2 was painful.

Basho no longer provides a package or any support for such an old version. The docs go back no further than version 1.1.0.

So why bother?

Seven Databases in Seven Weeks uses version 1.0.2 for its examples. I wanted to play along at home.

In the end, here’s what worked for me.

Install Git

This bit just worked.

sudo apt-get install git

Install Erlang

This was the hardest part to get right.

Apparently, Erlang has “slight nuances” between even minor versions.

Don’t install the latest version; it’s too new. Don’t install R14 either; it’s too old.

In the end, the exact version R14B02 worked for me.

The Basho docs recommend something called kerl for installing specific Erlang versions.

sudo apt-get install curl
sudo apt-get install libncurses5-dev
curl -O https://raw.github.com/spawngrid/kerl/master/kerl; chmod a+x kerl
./kerl build R14B01 r14b02
./kerl install r14b02 ~/erlang/r14b02
. ~/erlang/r14b02/activate

You have to run that last line every time you want to use Erlang in a new shell.

Getting Erlang right was made harder by a little quirk of the Riak complation process. Each component does its own version check. It can take a while for compilation to fail. Couldn’t that be checked up-front?

Before I read the manual more carefully, I saw lots of variants of this message.

ERROR: OTP release R14B does not match required regex R14B0[23]

So what’s the simplest way to check your Erlang version?

$ erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
"R14B02"

That’s just obtuse. So obtuse that at some point I’ll have to read Seven Languages in Seven Weeks to find out why.

Install Riak

To be fair, this part was mostly difficult because other components were either buggy or unfamiliar.

Once I sorted out my envioronment, the Basho stuff did exactly what it said on the tin.

Use these commands to fetch version 1.0.2 from Github:

git clone https://github.com/basho/riak.git
cd riak
git checkout tags/riak-1.0.2

Cloning the whole repo to ‘checkout’ one tag doesn’t really make sense to me, but I don’t know Git very well. I was just following the winning answer on Stack Overflow.

Git warned me that I was in ‘detached HEAD’ state. Amusing and baffling in equal measure.

One more thing: there’s a crap bug in the default compiler tools on 64-bit Xubuntu 13.04. It might affect other distributions too.

To avoid an error like this:

ERROR: cc c_src/skein.o c_src/skein_api.o c_src/skein_block.o c_src/skein_debug.o c_src/skerl_nifs.o -lstdc++ -shared -L/home/sandport/erlang/r14b02/lib/erl_interface-3.7.3/lib -lerl_interface -lei -o priv/skerl_nifs.so failed with error: 1 and output:
/usr/bin/ld: cannot find -lstdc++

Do this:

sudo apt-get install g++-multilib

Now, finally, the good stuff.

make rel

Sit back, sip a beer, and wait about 15 minutes for Riak to compile.

Next, fire it up…

cd rel/riak
bin/riak start

…and kick the tyres.

$ bin/riak-admin test
Successfully completed 1 read/write cycle to 'riak@127.0.0.1'

It works!

Now for Day 1: CRUD, Links, and MIMEs.

Lessons

Data technology is changing fast. The literature can hardly keep up. It’s an exciting time to be a database engineer!

Avoid installing from source if possible. Packages exist to let you get on with your life.

Be skeptical when someone says “building my project from source is quite easy.” They don’t know your environment.

Lach’s Superhoot

Thanks to Lach and Henry’s Cellar Bar for putting on such a good show at Lach’s Superhoot last night! Well impressed by the quality of the local talent.

This is a list of as much of my favorite stuff as I can remember. I’ll add to it as I find the links.

Mike Brown

A virtuoso tapper and slapper of all parts of the guitar. A ridiculously coordinated pair of hands.

See Mike’s bedroom on Youtube and listen on Soundcloud.

Swing Time

Like a one-man Caravan Palace.

Lake Montgomery

Lake spent two weeks in a French jail for not carrying a passport. France sounds like a very racist place. Can you help me remember the name of the song she sung about it?

Like Lake on Facebook, hear newer stuff on Reverbnation, and check out older stuff on Myspace.

Lonely

Loud Poets

A collective bringing back spoken word to the masses.

In their own right they’re great, but deserve extra credit for competing in this scene with something other than music.

Lach’s night is open to all. It’s usually saturated with singer-songwriters.

Tongue Tied

Love got your tongue? Stop saying dumb things and listen.

[youtube_sc url=http://www.youtube.com/watch?v=UNaKnZ8SOf8]

Beatbox Harmonica

They did this with more words.

I can only beatbox badly, so I really enjoy when others do it well.

[youtube_sc url=http://www.youtube.com/watch?v=GQYXv7oNaT8]

Billy Liar

The Forest crew showed their well-deserved support for this dude. Not only does he make a mean bean pizza, but he sings too!

Billy has his own website.

All I’ve Got

It’s not all as singalong as this, but when you’re drunk with your mates, this goes down well.

What’s that object?

Good article from Thomas LaRock on why he tibbles. Read the comments, especially from Gail Shaw.

If you do everything through the SSMS GUI, then maybe you won’t think of it. But this works just fine.

SELECT [name], [type_desc]
 FROM sys.objects
 WHERE [object_id] = OBJECT_ID(N'dbo.WhatTheObject');

Is that what Karen Lopez means by ‘try harder’? It’s not even hard, just tedious.

It’s not pleasant, but sys.objects works for me.

Anything else is a bonus. I think we all agree we need better tools.

Calling tables or views Dim or Fact is applying Hungarian notation to make up for a deficient type system.

The database engine doesn’t have Dimension types or Fact types, just tables. The objects have the same interface, but the semantics are different.

Making them look different is the best you can do without a tool to leverage extended properties.

Phil Factor blames migrations from Visual Basic for its popularity in the SQL Server world, but I think he may be confusing Hungarian notation with plain old tibbling.

I’m too young to know, but thanks for the legacy all the same!