Rubber Ducky Debugging

Oh wow, I’ve just had my first “satori” experience of rubber ducky debugging in a very very long time. I first tweeted that I ran into a bug in Go, where upon running my code (with go run): Oh wow, ran into my first indeterminate bug in Go. Same code compiled twice produces two different results. Amazing — Chewxy (@chewxy) February 26, 2014 I had a problem where when I ran the same code multiple times, there would be occasions where the program panics. [Read More]

What Every JavaScript Developer Should Know About Floating Point Numbers

After I gave my talk on JavaScript (really, I was there trying to shamelessly plug my book - Underhanded JavaScript and its alternate title: JavasScript Technical Interview Questions), there was a Q&A session. I could answer most questions, but Khalid Hilaby asked me a very interesting and quite general question on JavaScript number types. He had simply wanted to know more about floats in JavaScript and why they act so strangely. While I could answer the question, I felt I didn’t answer it well enough. I loaded my article on Pointer Tagging in Go to explain the structure of a floating point number, explained a bit on floating point arithmetic, and how in the past they had to have special CPUs for floating points (FPUs)* Nowadays they're all integrated , and then sort of meandered from there.

Now that I am back in Sydney and well rested, I thought I’d give the question a second try. The result is the article - What Every JavaScript Developer Should Know About Floating Points on Flippin’ Awesome. This is the full unedited version before I edited down for length and appropriateness for Flippin’ Awesome.

[Read More]

You Should Roast Your Coffee In Two Stages (Now Comes With: OpenCV Tricks!)

You Should Roast Your Coffee In Two Stages (Now Comes With: OpenCV Tricks!)

If you follow me on Twitter (and you should), you will know that since about 3 months ago, I started roasting my own coffee. Yes, my coffee madness has culminated over the years to this. This was my first roast:

My first roast

Since then I have roasted 16 batches. The variables I vary are: temperature, time, pre-roast mass, and technique. I use a regular $10 popcorn popper from KMart to roast my beans (I originally wanted to purchase a Behmor, but I decided that I should stay lean while learning how to roast coffee) – and I have a thermometer to roughly gauge the temperatures of the popcorn popper. Eventually I’ll hook the thermometer up to an Arduino, but that’s a story for another day.

Despite all the controls, I had problems with my roasts. They were okay to drink – not as bad as buying supermarket coffee, but they weren’t excellent. The main problem was consistency. My roasts were not consistent – some beans were darker than the others. Here were the factors that caused the beans to be inconsistently roasted:

  • Different sized beans – Can’t do much here.
  • Uneven heating – various causes:
    • Popcorn popper too hot
    • Popcorn popper doesn’t agitate the beans fast enough (too heavy? too light?)
    • Popcorn popper doesn’t agitate the beans randomly enough
    • Location of beans in popper

I eventually narrowed it down to the fact that the popcorn popper was too hot – it burns some beans before they could be agitated out. In fact, after the first two throwaway attempts of the roasting, I realized that 7 minutes or so in a popcorn popper as recommended by amateur roasters on the Internet would just burn my beans.

I did a quick lookup, and true enough, most amateur roasters on the web are Americans (or live in America). Are American popcorn poppers different?

[Read More]

The Switchless Switch

In my previous blog post about why a kettle costs so much, the one statement that perhaps riled the most people up is where I said Tesla Model S’ touch screen control panel was a stupid idea. In fact, the link to the Model S control panel is amongst the top most clicked links out. I do think it’s a stupid idea, but I must disclaim that I have never driven a Tesla, so I may be talking out of my ass based purely on logical reasoning and not a practical experience* P/S: Tesla, come to Australia already. .

The logical reasoning goes something like this: I am driving down the road at 110 km/h. My eyes are on the road, as all safe drivers do. The radio station suddenly plays Justin Bieber* I’m only using Justin Bieber as a punching bag because everyone uses him thusly. I actually have no opinions on popular music given that the music I regularly listen to are dated to 300-400 years ago , and the car gets cold suddenly because Bieber is a witch. I want to: a) change the current radio station; b) raise the temperature of the vehicle interior. But first I have to go to the media control app. Then I need to change my media playback from a radio station to a Spotify playlist containing all my favourite Tchaikovskys. Then I need to access the climate control app to raise the temperature by a few Celcius.

The question is this: How many times have I taken my eyes off the road, and how long for each time?

[Read More]

Javascript: Wat, Again

I gave a talk on Javascript recently at Javascript.my‘s unshift() miniconf in Kuala Lumpur. After regretting giving many talks without a recording to track my performance improvements when giving talks, I decided that starting this year, I would record and transcribe my talks. Here’s the first one for 2014. The slides are embedded here as well.

I had originally planned to record my talk and use an automatic transcriber to transcribe. But the recording quality was indeed quite poor as my phone battery was running out. I had to use Audacity to clean it up quite a bit. And despite that, automatic transcription with OS X’s Dictation didn’t work as well as I expected it to.

Anyhow, here’s the transcription of my talk. A lot of bits were filled in and edited (I really have a lot of uh, and ums when I speak) as the recording got quite garbled as time went on. Towards the end it was a totally unrecognizable warble. I was scheduled to give a 30 minute talk but I ended up talking for about 50 minutes. The last 20 minutes are not transcribed.

[Read More]

Why Does A Good Kettle Cost $90+?

Yesterday morning I woke up to a house without electricity - that meant I woke up in a puddle of sweat because the fan was no longer turned on. It turned out that my housemate, while making coffee, had tripped the mains of the house. The kettle had caused the trip. It was no longer safe to use the kettle and so I had to buy a new kettle.

My Dead Kettle
The Dead Kettle
[Read More]

“I Should Get A Tablet”

“I should get an iPad”, I woke up this morning with that thought in my head. It was a strange thought to wake up to, and so I gave it some thought. If this question was asked a few years ago, I’d have said yes, and promptly acquired a tablet. But now, in 2014, I seriously questioned the need. I am no stranger to living life with a tablet. A few years ago, I had an experimental run with an Android tablet and briefly, an iPad 2. [Read More]

What I Did When Hacker News Went Down

So… Hacker News went down for about a day. I lost my main source of procrastination (reddit contained all purple links). So what did I do? I got productive. I wrote about 20% of a book on Javascript. You should register your interest for Underhanded Javascript, Or: How to be a Complete Arsehole with Bad Javascript (there’s an alternate title that I’m considering: Javascript Technical Interview Questions). Here’s a quick blurb of the book: [Read More]

First Trip, 2014

I took a trip to the beach yesterday with my housemates, my partner and Lucy. I laid there horizontally bobbing in the sea, starring into the deep blue sky. I thought about my accomplishments and failures in 2013 and see in 2014 I could find in the rough, to takeaway some diamonds. I love these trips as divorcing me from the computer allows me to think about things deeply and from different angles. [Read More]

Programming is Fun

This thought came to mind as I was working on various miscellenous devop stuff for new Pressyo projects: Programming is fun and easy. Software development and engineering is tedious as fuck. I like to think of myself as a guy who programs for a hobby. I cannot see myself doing everyday what I just spent the last 4 hours doing. Devops is schlep. Sure, things like Vagrant and Docker makes things a lot easier, but it’s still extremely time consuming and quite honestly, soul crushing. [Read More]