Bloody Side Tracking Brain

This morning I woke up with Hungarian Dance No. 5 by Brahms stuck in my head. In my head, it’s a superiorly orchestrated, super high definition audio – much like sitting in the concert hall and being enveloped by the music of a live orchestra. I also have a very high quality copy of Hungarian Dance on my hard drive. I woke up at 5.45 am, went to gym, and returned at 7am and showered. It’s now 8.30 a.m., and I have yet to listened to the Hungarian Dance.

Reason? This was my thought pattern upon finishing up on my shower:

Hm, I should go give Hungarian Dance a good listen and get the earworm out of my head. Oh, my headphones have deteriorated in quality now. The flac quality won’t be represented well by the headphones. Better go look and buy new ones. Oh this one looks nice, I should go budget for it… oh wait, you just wanted to listen to Hungarian Dance, why are you shopping for headphones??! [rinse and repeat]

And for the last 1 hour, I’ve been shopping around for headphones. I have now a spreadsheet of headphones that are possible buys.

Ugh. I just need to get shit done. Not waste time with side tracks.

Batman v Superman – A Quick Thought

I watched BvS today. I don’t know what to think about it. Overall, I think the movie was a bit of a mess. But I can’t seem to pinpoint why. Breaking it down by the standard things that people use to judge movies, there doesn’t seem to be anything wrong.


Character-wise, I liked it quite a bit. Superman is at his Superman-est. Batman is also amongst the most Batmanest Batman I’ve encountered. For reference, I consider a lot of things to be Superman-in-character, but the epitome of it would be in Final Crisis, with the Miracle Machine and Nix Uotan. I consider the most Batman-in-Character Batman to be the tortured soul that Dr. Hurt put Batman through in Batman: Black Glove, culminating in Final Crisis and Batman RIP. The movie’s Superman and Batman are probably the most alike those two comicbook counterparts ever – though I’d argue that Batman in the movie is a hyperextreme version of the comic book version. Nonetheless, characterwise, they’re pretty much very close to the comic book representations, so I have no qualms.

Yes, even with Batman killing – he has caused the death of others in the movie, but never once directly caused the death of a person. Even KGBeast – Bats could have shot KGBeast in the head, cementing a direct kill. Instead, he shot the gas tank that KGBeast was wearing, causing it to blow up. In the mind and morality of Batman, he’s NOT killing someone – it’s the extreme version of “I’m not going to kill you, but I’m not going to save you either”. You can argue it’s a copout, but it’s a very perfectly Batman-ish character decision. It’s this Batman that I can believe shooting a radion bullet at Darkseid.

Supes isn’t a boyscout in this movie – he isn’t even a boyscout in the comics (Captain Marvel has that honour). But Supes has always been about the sacrifice to do something right. He’s the Jesus character, who is almost always conflicted about his actions and their repercussions – the guy who keeps news clippings in his Fortress of Solitude on the people whom he failed. I think Henry Cavill’s Kal El does just that. That sad shot in the Capitol scene nailed it for me. He even says it – Superman’s just a dream of a farmer from Kansas. I can really imagine this Superman being the one who assembles the Miracle Machine and wishes a happy ending for everyone.

Even Jesse Eisenberg’s Luthor, I feel, was Lex Luthor at his core. I consider the All-Star Superman Luthor and Lex Luthor: Man of Steel to be the epitome of the characterization of Lex. The Lex who would not cure his sister’s cancer because he wanted to show up Superman, and simply cannot abide being nothing but the best of Man – that’s the Lex Luthor I consider to be Lex Luthor. I mean, he was given an orange ring and became the god of Apokolips. He’ll become the Super Man (JL Rebirth spoilers). That’s the kind of person Lex is. He is a Machiavellian man who thrives in an environment of asymmetric information (though arguably you could say Bruce Wayne is more of that kind of person), and does whatever it takes to get what he wants. The surface of the mad scientist, the charming politician/businessman – that’s just the surface to who Lex Luthor is. Eisenberg, I feel, plays Lex with a different surface, but still holds the same core.

Lois and Diana were a bit of blank slates in the movie – they weren’t as central, but I felt their characterizations was decent enough for the movie. Wonder Woman was awesome – she got hit back by Doomsday and all she does is grin. Now THAT’s an Amazonian I can get behind.


And so we consider plot next – The plot of the movie was convoluted, but made quite a bit of sense given some thought. Here was Lex Luthor, a man, so torn by the fact that he’s no longer the best that he is – and he’s so used to getting what he wants, mind – plots to bring the Superman down. He does this the way a rational person does it: harm Superman’s reputation first – dishonor Superman’s reputation in the general public by making him show up to Namimia and frame KGBeast’s actions on him. Then engineer a public outcry through the use of the government process. At the same time, like any rational person, he creates a backup plan, because Junebug wouldn’t play ball. He needs access to the government’s storage of the Kryptonian facilities, to gain more knowledge, because knowledge would grant him more power. His political machinations fail, so he gets rid of the evidence (blaming Superman along the way) and goes to his second plan – to set the Bat of Gotham against Superman. His power comes from asymmetric information – he knows the identities of Batman and Superman (as befitting the smartest man in the world), and is able to use that information to get the leverage he needs.

I think the problem was that the story was told from very differing points of views. It starts as Bruce Wayne, anchoring the story with his narrative, but somehow that anchor is lost somewhere in the movie, after the chaotic scene switchings. And the piecing together of the story is told through Lois, while Superman was given a very small subplot (the Bat of Gotham and his vigilante ways).

The reveal and payoff (the scene with Lois and Swannick and the bullet) was worth it though – it immediately made the seemingly random and disconnected cut scenes in the beginning of the movie feel more like reading the beginnings of a comic book arc (especially Grant Morrison’s work).


I do feel that the editing was quite bad. It was choppy. Narratives didn’t lead from one to another. But like I mentioned in the previous section, it felt a bit like a comic book arc – having you to compartmentalize different parts of the arc before a payoff (it’s also one of the reasons why I don’t pull weeklies and rather read trades).

Against the justification that it was a bit more comic book like, I’m not so sure if the editing is genuinely bad or intentional. The only truly bad bit of editing was when Diana was reading the email – that scene just broke the tension of the Doomsday battle. Another jarring narrative transition that I didn’t quite enjoy was the lead in from Africa to the Congressional hearings.

cfgt, who watched the movie with me thought the movie was too long and the Capitol scene could have been cut. I disagree – because that scene cemented Luthor as a guy who doesn’t fuck around. I felt that there were certain scenes that were not well explained, characters not fully fleshed out. It shows Superman being upset at himself for not being vigilant enough. It doesn’t really hurt the plot though (although that may be bias given I have a fairly vast knowledge of the DC universe).

I felt like the movie was too rushed, and not enough time devoted to the development of characters. Lex for example, was noticeably a lot more deranged after emerging from the Kryptonian birthing matrix – as if Keelex told him something dark and foreboding to come, and he had decided to take matters into his own hands to have a Super Man that he can control (Doomsday).


In conclusion – I have no idea what to feel about the movie. When broken down and you think about it, each component – acting, character, general plot, etc all felt really good. It felt like the most comic-booky comic book movie I’ve ever watched, with some stellar acting. But on the whole, it was just a bummer. It felt heavy, and weighted, and joyless. There is a certain sense of doom throughout the movie – like a lead fog, weighing down upon the subconscious.

Perhaps that I have been compelled to actually write a blog post about Batman v Superman is a sign of denial – that I’m trying to actually convince myself it’s a good movie. Or perhaps, it’s a genuinely good movie that I feel is underworked. I have no idea.

p/s: Namimia? C’mon Zack, you could have used Khandaq, or Bialya, or Polokistan. Everyone’d have loved it even more.

Not Enough

Do you sometimes feel like you’re not smart enough, not strong enough… not _ enough to do your pursuits?

At what point do you give up? I am so tired. The alternative – not pursuing what I want to do… is worse.


Naming Things Poorly

computer scientists have a very unfortunate way of naming things. Take S-expressions for example. They’re pretty a fundamental notation method for functional programming. I was re-implementing a variant of it recently, and obviously I named the package sexp

Part of the implementation I wrote was that I had a “shortcut” way of representing the S-expressions internally – as slice (called List) and atoms, instead of actually making a linked-list (because child node access was faster, given that most of the trees are static). But sometimes typos happen, and when they do, they read so awfully:

func join(s sexp.Sexp) error {
    for _, child := range sList {
        childList := child.(sex.List)

On Buying A New Vacuum Cleaner

Just happened.


Ooh, Dyson is on sale!


Yeah, no. Dyson sucks.


So, we’ll buy a Dyson?


Er, I mean, Dyson doesn’t suck.


So, we’ll buy a Dyson?

We’re buying a Miele instead. Because Miele vacuum cleaners are awesome at sucking.


This morning my computer crashed. So I rebooted it. I was in the midst of a project that had a lot of git branches (as I was working on competitive ideas to see which version would work best), and I couldn’t recall which branch I was on.

I thought it would be a good time to update my .bashrc file to perhaps add a git status to my bash prompt. Afterall, there are some pretty nice prompt string hacks for git out there.

And so I started to edit my .bashrc file. I opened it, and I discovered that I have over 20 aliases and functions that I created, and I haven’t used any of them in the last 2 years. Heck, over the years, I even went from a colourful prompt to a black and white prompt!

I used to have fancy dotfiles for most of my things, but now I use mostly default stuff. It makes portability much easier – I can work on any station without having to bother much about the configs.

I think the YAGNI approach works best. You Ain’t Gonna Need It when it comes to adornments for your computer. All you need is to be able to do work without extra distraction. Of course an argument could be made that having your prompt show your git status makes it unnecessary for you to git status everytime you start afresh on a new project. It really depends on how much time you have saved. The tradeoff for me constantly knowing my git status is not worth it.

What was worth it for me? This piece of code in my .bashrc file:

function workspace_cd() {
    cd $@ && [ -f ".bashworkspace" ] && source .bashworkspace
alias cd="workspace_cd"

Other than that, nothing from the custom alert functions to the shortcuts for extracting files (turns out I just type tar -xzvf all the time anyway) were particularly used.

So I truncated my bashrc file to something like 50 lines. And… that’s enough yak shaving for the day.

An Apology

I made a mistake in posting a women-hostile picture on Twitter yesterday. This is an apology. But first, let’s start with a recap.

Yesterday I posted this tweet:

I first saw the picture on /r/funny. And I tweeted the picture after a brief view. I mainly tweeted the comic because I believe that politicking identity issues is generally a waste of time[1]. I had neglected to notice that it came from @AntiFemComics.

This morning, a shitstorm ensued. I woke up and the first notification was from Nick Coghlan:

Upon reading that, I went and re-read the comic. I realize the horror that I have in fact misread the comic. And the issue snowballed on. This blog post will stand as an official apology from me.
Continue reading

  1. [1] Politicking of any issue is generally a waste of time, in my opinion.

Go Test Files Are Part of the Same Package

Just a quick one. I was working on improving performance for a certain method of mine. I had found the hot loop [1], and I wrote a few benchmark methods to test some ideas.

I was using the testing package’s benchmark function to benchmark the methods, and for a method, I had abstracted out some code so that it can run in a goroutine. Here’s the code for the function:

func receiver(ch chan tmp, out chan []float64, wg *sync.WaitGroup) {
    Ys := make([]float64, len(x))
    for v := range ch {
        Ys[] = v.res
    out <- Ys

Spotted the problem? No? It's the second line: retVal := make([]float64, len(x)). You'll note that x wasn't declared anywhere. And yet, the benchmarks ran! I only ran into a problem when I fed the test case a weird corner case where I knew funny things would happen.

At first I was puzzled why the compiler hadn't caught it. I scoured all through both files (it was a throwaway package, written solely to test ideas, so it had only two files: throwaway.go and throwaway_test.go)

Here are the top few lines of my throwaway_test.go file:

package throwaway

import (

var x []float64 = X(784) // <-- THE DECLARATION THAT CAUSED PAIN
func init() { ... }

I had added that variable originally as part of a setup/teardown function. I had then forgotten completely about it. I had been so used to writing code in the *_test.go files as if they were part of a separate package that just imported the functions, that I forgot that they were part of the same package.

The lesson learned today, other than global variables are evil[2], is that variables declared in the test files can have an effect on the main files if you're not careful about it, because the test files are part of the same package.

Now I want my hour lost back!


As Damian kindly points out:

The above only really happened because I was running go test -bench . a lot. If I had used go build . the compiler would have thrown an error

  1. [1] pprof is an amazing godsend. The days of dicking around in valgrind or cProfile are long a memory of the past
  2. [2] but sometimes are necessary, which I would argue for this specific test case, is

Whole Fruit Espresso

I’ve been toying around with new ideas of coffee lately. Here is one that I think went particularly well. It started with red-eyes: you put a shot of espresso in filter coffee, just to boost acidity and body of the coffee whilst still keeping the basic aromatics in the coffee (making espresso kills quite a bit of those).

I then moved on to the idea of making cascara red-eyes. If red eyes were flavourful, perhaps then using the pulp of the fruit will yield a different thing all together? And indeed it did. The hibiscus-y nature of the cascara tea does accentuate the espresso. Then I wondered if I could push it further – what if the cascara “tea” was made under pressure – i.e. espresso?
Continue reading