# Pointer Tagging in Go

Let’s say you’re an idiot. You didn’t know about the interface{} type in Go. You didn’t know about switch foo.(type) {} in Go. Now you want to do something really fancy, like interpreting integers as floats (why would anyone do that?). Maybe you just want to circumvent the very excellent type system in Go. Or maybe you want a much faster type switching/assertion in Go. Or maybe you’re just a bit nuts. Continue reading

# A Tour of Coca Cola Amatil’s Distribution Centre

The smell of cheese and sweaty shoes wafted in the air as I disembarked from the car. Ahead of me, a large sign that says COCA-COLA AMATIL. Walking past the three safety signs that lead to the office, the tour was about to begin. As part of a hackathon sponsored by Coca-Cola Amatil, I recently got the opportunity to learn more about logistics and operations. A tour of the CCA distribution centre was included in the hackathon and did I have a fun time!

A fridge full of Coca-Cola Amatil products greeted us as we entered the office. We were issued high visibility vests and were required to sit through 10 minutes of safety briefing, coupled with some safety tests. I sipped on a juice box as we took the safety briefing test. After that, our tour began. Our tour guide was Mark Hopkins, One Logistics Project Manager of CCA. He started off by rattling off interesting facts about the distribution centre while I furiously typed away my notes on Google Keep.

He explained that the distribution centre is entirely covered in 500kW solar panels. It was an investment that only recently paid off with the building of the new preform plant. Prior to the preform plant’s construction, the solar panels were generating excess electricity during down times, but now that the preform plant – capable of making 750 bottles per minute; and runs 24/7 – has been built and is running constantly, they now use their energies efficiently enough. Then time came for us to actually enter the warehouse.

I own a Canon 40D with a couple of large constant-aperture lenses. I also own a number of coffee making equipment, from the Aeropress to a nice Rancilio Silvia V2. I have a computer with a fairly nice processor and a fairly decent graphics card, with a large amount of RAM and 3 SSDs. While these things are slightly older now, I acquired them when them when they were rather new. And the reason why I am telling this? Because this makes me sound like a gearhead.

Earlier today a friend asked me about coffee making – a hobby that I indulge in quite heavily. He asked me if I had any resources for quickly learning what coffee and equipment to buy. Naturally, I was curious and I probed a bit further. He hadn’t much experience in coffee, other than your bog standard instant coffee and store bought coffee. So my advice to him was to start by trying the coffee first – cut the sugar and milk, and learn to appreciate the original taste of coffee. Like tea or wine, coffee does contain many subtle flavours and aroma, and a keen attention to detail on the tongue and nose is required in appreciating coffee.

He very quickly brushed off that suggestion and then pressed on about equipment, claiming that only with equipment he could learn to taste coffee. I was not very approving of that attitude because it’s clear that the equipment were more important than having good coffee. This is what I call gearhead attitude, or being a gearhead – people who are more interested in the tools than the results the tools bring.

Now obviously there is nothing wrong with being a gearhead. The difference between good tools and bad tools are often very huge, and it’s common to geek out over the tools one uses. However, when excessive geeking out over the tools happen, there won’t be much result. It’s common to want to use the best tool for the job, but when the best tool for the job requires some basic knowledge that you don’t have, then it’s no longer the best tool for the job.

I’ve known many people who claims they’re interested in photography, and then promptly purchase a SLR. The resulting photos are usually poorly composed and poorly lit. They had essentially paid for an upgrade in sensor size, and that’s all. But while a larger sensor size will improve some photoss, good photos don’t only rely on a larger sensor size. The majority of good photography is a result of good composition and great lighting. These are things that can be learned using a normal digital camera or even a cellphone camera. Would learning the simple rule of thirds be so painful on a large screen iPhone? Wouldn’t “needing a SLR to learn photography” anything more than merely an excuse?

People put on gearhead attitudes for a number of reasons that I shan’t speculate on. However, I suspect a component of ego and possession of material wealth is at play. It was in my case. For a fleeting moment after I acquire new gear, I feel proud and that everyone else who didn’t have the same equipment were mere peasants and plebians. I could make any number of post-facto rationalizations after acquiring said equipment. I too suspect that there is also an element that one cannot learn a skill without the best equipment – as in, “I cannot make good coffee without an espresso machine”. Which in my opinion, is patent bullshit.

In my experience however, it doesn’t pay to be a gearhead. It’s better to learn the basics, and when your skills push the limit of your current available tools, then it’s time to change tools. The purpose of a tool is to be used and used well. It’s no point buying a La Marzocco Strada[1] if you have no basic skills in making an espresso. What use is a pressure profiler if you do not know how the basics, like temperature affect your espresso? You still wouldn’t be able to appreciate good coffee if you don’t develop the palette for it.

This goes for software development as well. How often have we geeked out over the latest software development methodologies, or the latest machine learning algorithms, only to test it out and realize it’s not a good solution for the problem? This doesn’t mean that we shouldn’t be aware of the latest and best techniques. This simply means that better judgment needs to take place before switching tools.

Here’s a humblebrag: I’m glad to say for myself at least with physical equipment, that I bought all the things I mentioned above after I had learned quite a lot to the point where my then-current equipment was becoming a limiting factor. I had learned the relationship between ISO, aperture and shutter speed; and learned to a certain degree the basics of compositing a photograph before I made the jump to a SLR. By then the limiting factor had been the sensor size and the limited range of apertures my small digital camera could afford me, and I wanted to explore greater ranges. Similarly with coffee making. I had explored the different methods of making coffee, each with their own variables like grind size and temperature. I started with a blade grinder, moved to a manual burr grinder for over two and a half years before finally acquiring an electric burr grinder because grind consistency was becoming a limitation. I learned to write programs to run on my GPU before realizing I needed a better, more powerful computer to do what I want it to do.

All in all, I still think it’s quite prudent to push one’s skill to the limits of the current available tool before switching. Don’t be a gearhead. Don’t lose aim of your goal: to use the tool to do things.

1. [1] My favourite machine amongst the machines I’ve had the opportunity with playing with, but I don’t necessarily have the skill or time to master it. It’s one of those easy-to-use-but-hard-to-master tools

# Thor: The Dark World

I never thought I’d blog about another comic book movie since my post on Man of Steel. But I actually found another movie that far surpasses Man of Steel in terms of enjoyability. Perhaps not as deep in subject matter as Man of Steel but far more enjoyable. I’m talking of course, of Thor: The Dark World.

There are many things to talk about Thor: The Dark World, but mainly it’s the feeling I get from watching it. I never got into Thor comics, but as a kid, I loved Norse mythology a lot. I read many times over, simplified versions of the Prose Edda. While the first movie did depict Asgard for a bit, it was too brief. In this movie, we get a much larger picture of the mythology. The Yggdrasil was depicted!!!! I could hardly contain my excitement when I saw those little nods to Norse myth (in the first movie it was Sleipnir that caught my attention). It brought me back to when I first read the Prose Edda as a child. The visuals brought me back to when I was 4 – I saw Star Wars for the first time.

In fact, Thor: The Dark World is very much a space opera akin to Star Wars. I was well and truly entertained. It was light, it was fun. It was really really fun. It’s one of those movies like The Avengers or Star Wars where you can just play over and over again.

I walked away from the theatre thinking of two things:

• I want a movie about Norse myth. Make it a bit heavy. No good Norse mythology films have ever been made (no you will NOT mention that shitty Beowulf movie starring Angelina Jolie). Technically Thor and Thor: The Dark World counts, but it’s quite tied to the comic book universe and indeed (“shall I talk about truth, justice, patriotism? God bless America”), quite tied to Earth. No, I want to see Loki releasing Fenrir and letting the ragnarok happen. I want to see humans being puny humans, and nothing more than small side issues to the gods. I want to see full on Viking gods with magic and majesty.
• Jamie Alexander as Wonder Woman. Stat. That scene in Vanaheim sold me that she is Wonder Woman.

If you ever only watch one movie this year, make it Thor: The Dark World.

# Latte Art As Signalling

I had this thought the other day: latte art is signalling. To pour a rosetta in a cappuccino, you would need perfectly brewed espresso, and perfectly steamed and textured milk. If you do not pull enough crema in your espresso shot, or if the crema dissipates too quickly, you cannot pour a rosetta. If the milk isn’t properly textured, and there is too much air in the milk (or too little), you won’t be able to pour a rosetta because the milk wouldn’t drag across the surface of the crema easily. Free-pouring latte art signals that you have the skills to make good coffee.

I was thinking this upon reading a thread in reddit about latte art. It turns out we have generally great baristas in Australia – I’ve rarely bought a cappuccino that does not come with some form of tulip, heart or rosetta. Latte art is rare in America though.

Coffee quality in Sydney is well above average (coffee quality in Melbourne is even better) compared to coffee from around the world. It’s also one reason why Starbucks cannot survive in Australia. Baristas signal their skill in making coffee by pouring latte art. But it’s so common that the act of signalling is diluted. It took an external anchor (a realization that Americans don’t commonly get good espresso based drinks) to make me re-realize the act of signalling.

I think this raises a lot of interesting things to think about: Signaling is only useful if it’s novel enough. When everyone signals by using the same signals, it fails to become a signal any further. If after Michael Spence’s paper [1] was published, most students went to study philosophy to signal that they’re potentially good employees, the signal will fail.

Of course the big underlying assumption of Spence’s paper is that there will always be good and bad employees – and only good employees will take the effort to signal that. I don’t know if I can say the same for cafes and baristas in Sydney/Melbourne. It would appear that even the small cafe at the corner has fantastic machines and baristas who can pull great shots.

Just some food for thought. Now here’s a picture of me pondering a vacuum pot coffee at a Kopi Luwak farm in Bali.

No, for the record, I do not think Kopi Luwak is a good thing. The animals we saw were caged but in quite humane conditions. The coffee itself was not really spectacular. Firstly, the roast was uneven. And it was bland. It lacks features, unlike a good Ethiopian Yirgacheffe (my current coffee at home), which can taste like blueberries and candied oranges, Kopi Luwak was just flat. I merely drank it out of novelty. Wouldn’t want it again.

1. [1] Michael Spence (1973). “Job Market Signaling“. Quarterly Journal of Economics (The Quarterly Journal of Economics, Vol. 87, No. 3) 87 (3): 355–374.