Links I’ve encountered #4

Merry Christmas!! After a family filled day, I decided to sneak in a couple of interesting articles I’ve read in the past week or so.

How the Grinch stole array.length access – It hits a very sensitive nerve. Caching array.length is one of those micro-optimizations that gets spread around like an urban legend; in that it sounds reasonable enough but very few actually go out to prove whether they actually work. Good thing to note is that the research done is purely on a V8 engine.

Big Data, Machine Learning, and the Social Sciences: Fairness, Accountability, and Transparency – A while back I watched Hanna Wallach’s talk on some text analysis and she intrigued me in the applications of ML techniques in the real world. This article goes in great (and better) detail in explaining what I was trying to convey a while back.

Links I’ve encountered #3

From Markov Chains to Technocracy.

Markov Chains explained – While it is easy to explain how Markov Chains work, it is often hard to grasp the intuition behind why they work the way they do. A couple nice visualizations won’t hurt either.

How the other half works – A polarized look into the PM vs Developer perceptions. Hard to not disagree with him however anecdotal experiences are not good judgements of an entire industry.

Why Blurring Text is a Bad Idea – I will stick to the tried and proven method of MS-Paint black boxes over images. No layers, no leaks.

Links I’ve encountered #2

This time, it’s impressive web demos using complex animation algorithms and basic browser tools. Oh, and an ML post.

Realistic Terrain in 130 JS lines – Pretty impressive demo. I’m still not sure what goes on with the code because of the all the WebGL & physics involved. However, it shows how far one can go with simple browser tools.

Creating 3D worlds with HTML & CSS – It seems like the new fad is doing nearly everything in basic CSS(3) that was done with JS before. This demo reminds me of countless hours wasted on CS:CZ.

Neural Networks, Manifolds & Topology – Good article with impressive visualizations to see what goes underneath NN’s hidden layers. It’s not uncommon to hear hidden layers referred to as black-boxes, however the article sheds some light underneath the hood.

Links I encountered

I usually try to write a post at least twice a month. However, lately I’ve been swamped with new learning materials that completely absorb me (I like telling myself so!). I think it is fair to say I’m addicted to novelty. To cut to the chase, I’ve been learning lots of machine learning and data mining techniques of late. I’m a Stats guy by education, so it’s only fair to be drawn to the fields. To mediate, I’ve decided to post insightful links I encounter when I’m not writing blog posts. I’ll try to not abuse this idea and actually write actual insightful posts when I have time.

The Passion Gospel – I’m far from experienced but this article (read: post) made me feel like a veteran. Are you a noobie programmer? Are you desperately trying to get into the industry? Do you want to know what it’s like? Please read this. Just make sure you don’t come out of it a cynic!
PS: Go read up on several of his posts. To say he’s a brilliant writer would be an understatement.

GitHub Isn’t Your Resume – GitHub has slowly massaged itself into the modern developer’s toolkit. No LinkedIn recruiter will listen to you without a GitHub account. You have a website? Better have a link to your GitHub on it (guilty!)! I love open source. As a matter of fact, I owe it most, if not all, of my programming knowledge. However, don’t make it mandatory. After all, you’re removing it’s fuel (i.e. people deriving pleasure from helping others without any strings attached).

I know the two articles are somewhat negative but I’d like to think of them as reality checks. For positive news, click here

One Year Later

Twenty-nine posts in and it has been one year since I started running this blog. To be honest I thought I would have given up on it after several weeks. However, the page views have been somewhat surprising and encouraging. The responses have been enough to push me to publicize some of my projects. Henceforth, I will try to summarize some of the projects I have been involved with in the past year.

UK Football League Stats: This is my latest project (as of Jan 8th, 2014), and surprisingly expeditious. Coming from a stats background, I have always been keen on learning d3js, and this was the perfect opportunity to infuse the library with football and statistics. A testament to my vibrant social life, I churned out the first working draft on New Year’s eve. It scraps up-to-date csv data from Football Data’s website using php, processes and displays the data using d3, and finally adds interactivity on the tables using datasorter and DataTable jQuery plugins. Despite its short turnaround time, I have learnt the most from it. I started with hosting the csv data on my server (manually uploading the files), only to realize I would need a better solution to make sure the data is always up-to-date. This prompted me to learn some basic web-scrapping and their limitations (mostly CORS related). The project alone has inspired me to learn more on web-data scrapping.

SoundBum: One of my longest running projects; it uses Soundcloud’s API to play random music from any genre. I got the idea from working on CodeAcademy’s Soundcloud API tutorial. Previously, it had a pretty basic functionality. It prompted you for a genre, and returned a random song. In the last month or so, I decided to make it slightly more interesting. It can now auto-load a new song whenever the current one ends. This was a tricky hack which led me to learn about iframe’s sandbox attribute and foreign API limitations. It is also the only app I actually use on a daily basis. Future versions might include a better UI (currently it only has an input, button and an iframe) but I am not sure of the direction yet.

GIF to Canvas: In my desperate attempt to play the JS/HTML5 game like all these hipsters, I created a simple animation with playback controls. If possible, I might include some web-scrapping to create these animations by automating the entire process.

Guess the Number: A simple game that employs Binary Search Algorithm. It uses basic jQuery and CSS. It is an UI improvement on a previous implementation.

There are many more smaller JavaScript challenges I have worked on, but they are more of 30 min challenges I use to brush up on my knowledge (and learn new interesting tid bits). These tend to inspire me to write tech related posts.

In the next year, I am hoping to become more collaborative in my coding. The other day, I had my first pull request accepted. It felt strange yet exciting directly contributing to an open-source project, despite it being a 3-line code update. Hopefully many more to come. Here’s to another year!

The XY Problem

The beauty of technology problems is that they are applicable in so many different fields, including daily tasks. Back in high-school, I used to deliberately leave some parts of assignments half-assed just so I would be asked to re-do them. I would always make sure these were sections that I was more more confident in my ability. It would always lead to instructors ignoring the parts I was less confident in their quality. Later on, I had my moment of clarity when I learnt about Parkinson’s law of triviality. It is a phenomenon that spreads as far as management, one among many. I cannot count the number of times I have abused this technique.

Of those problems that seem to persist in a cross-field basis, I have recently been guilty of one that tends to lurk under the radar. Let’s say an arcade owner has a problem with counting coins. He decides to employ ten people for $8/hour. He then struggles with the logistics of organizing the 10 people to finish the task in a timely manner. He goes out and asks his friend on the best procedures to organize 10 people in a factory line. He ends up with even more complicated situation after his friends mentions the fact that two five-person groups seem to work better than one ten-person group. He now has another problem on deciding on how to divide the group of ten into the best five-man packs.

Ignoring the terrible thought-out hypothetical scenario, the arcade owner is at fault for not realizing what problem he was solving in the first place. He needed to find the optimal way to count coins at the end of the work day. In the way he went to seek for help, he avoided to mention his primary problem. Alternatively, he needed to mention his coin-counting problem that led to his decision to hire ten people in the first place. His friend might even mention about the possibility of leasing a coin-counting machine, a much cheaper alternative used by all arcade owners.

Like any developer, I tend to scour online help forums. I cannot count the number of times when the first response to most questions is “What exactly are you trying to do?”. An old post from Usenet describes it as an XY-problem. In short, one wants to accomplish task X. He is not sure on the solution to X. So he comes up with a solution Y. He is not sure on the best way to implement Y. He asks for the solution to Y, assuming that by solving Y he will end up solving X. Those trying to help fail to understand why one would want to solve Y, usually because Y is a strange problem to solve. In the end, no one is usually happy.

I think it is a safe guess a good number of these questions were trying to obtain the file extension. Instead of directly referring to their main problem, they came up with a solution which assumes that all file extensions are three characters long (HINT: not true). The issue is so pervasive to deserve its own wiki with numerous examples.

In all this seemingly noob-bashing (and by extension self-bashing), I feel some of it is accidental. In the arcade owner example, he probably does not know that other arcade owners are faced with the same problem. Maybe he is the only arcade owner in the area. Maybe he is a new arcade owner without a clue on the best practices. While it is easier to blame the asker for their lack of knowledge, ignoring their position is equally unfair. It is too easy to forget the number of times we all assume our problems are unique. The main lesson should not be how to ask questions but rather most problems are not unique. Sometimes that lightbulb might just be a firefly.

Brave New Joker

I got this off a reddit post. It’s written as the birth of the Joker set in the novel Brave New World. One of my favourite pieces of writing.

“They kept telling me ‘everything was going to be alright'” she said as she was handed another soma. A look of expressionless tranquility ran across her face, it started in her eyes and she broke the silence once more. “I don’t know what I was so worried about,” she said. “everything is going to be alright.”

I was born an Epsilon. I trust in Ford that I am where I am because of who I am. I’ve been told I am not the brightest, or else I would be a Delta…I was told if I didn’t worry s- pause takes out a orange RX bottle …They told me that it was fine. They told me one of these will keep me perfectly efficient; like the model T. In Ford I trust.

My name is James. I am an Epsilon. I work hard so that Gammas can work harder. Everything going to be alright if I just follow Ford. Last time I went to refill my soma the Betas called out my name and asked for me to come over to them. I complied, and walked over briskly

“Epsilon 80010, you have exceeded expectations,” Said one of the Betas. “You would do well to be rehabilitated for Gamma duty”
I was worried. I checked for my soma, but it was empty. That’s when it started.
“Epsilon 80010, if you are willing to outfit yourself to the Gamma quarters we can begin transition as soon as possible”

I became anxious. I wasn’t happy. My life was changing. The model T did not change. Why should I? What’s wrong with me? Why can’t I stay here? I was lost in my thoughts. The Beta noticed me shaking and grabbed my arm. Then it happened. I couldn’t stop him.

An alpha, the greatest grandson of Ford himself stepped in. He gave me a soma- at least I think it was. It was blue and white.
“Here” He said turing to the Beta “I see you are preparing this Epsilon for his transition to the Gammas. This is highly unusual.”
“I agree sir.” The beta muttered

I put the pill in my mouth
“Why haven’t I been informed?” questioned Alpha ford.
And swallowed. My mouth was dry. I could feel it go all the way down into my stomach.
“Sir, you were not deemed necessary for the maximum efficiency of this move” explained the Beta, “He is one epsilon. You should attend to your duties as the alpha you were created to be”
“You’re right Beta.” Sneered Alpha Ford, and he walked away. He glanced at me as he was walking, smiling. I was worried.

everything is going to be alright

I followed the Beta to the Gamma quarters. Not a single Gamma spoke to me. The beta explained it was because my former Epsilon self would inhibit seamless social activities. He recommended I go to sleep and wait for the morning. I didn’t understand, but obliged him.

The next morning I woke up. I could feel the colors on the wall. I could taste the sunrise. It felt different. In a panic I went for my soma, only to find an empty bottle. This wasn’t good. Everything was going wrong.

The next morning I woke up. I could feel the colors on the wall. I could taste the sunrise. It felt different. In a panic I went for my soma, only to find an empty bottle. This wasn’t good. Everything was going wrong.
I raced to the commons to solicit any soma from any gamma. Shunned, and unfamiliar, dozens of Gammas began to open a whole for me until I was surround by 50 of my new peers.

“What is it Epsi?” taunted a faceless voice.
My heart began to race.
“Are you worried?”
my hands were growing clammy
“Do you belong here?”
I began to close my eyes and think of Ford. I began to think of his grand son. I began to think of that pill.
“SOMA” I exclaimed.
A young gamma came up to me. She was much smaller than me and asked me to bend down. She began to whisper “everything is going to be alright” and handed me her last soma. I quickly took it, but Before I could thank her I realized she was gone.
I waited for everything to calm down. I waited for everything to be okay. I knew that everything was going to be okay. The crowd around me started to disperse and go on with their day. It was a perfect day.
“You don’t belong here”
I was standing alone
“It wont work anymore”
I began to worry
“You are not a Gamma”
I covered my ears to try to block the voices. They kept coming back “James will be an Espi forever” mocking me. I closed my eyes and thought of Ford, I thought of the model T. To no avail. They began to multiply.

“You are not the same” “You have been perfected” “Smile” “You are not a gamma” “Smile”
They were mocking me: A low level Gamma. I collapsed on the ground and closed my eyes. Looking up at the ceiling I could see the girls face, the one who had given me the soma as she bent over me. I looked up at her and she said “Smile, everything will be alright”

The next few weeks are a blur to me. I was put into a room by myself for Epsilons who had graduated to Gamma level, or the “Divergent Chamber” I was kept on watch with a bottle of soma, a mirror, a bed and a television. Every morning I would wake up to Master Ford. Every night I would fall asleep dreaming of the model T. But everytime I would close my eyes a chorus of nagging voices began their awful symphony.
“Let’s put a smile on”

I took as much soma as I could to stop the voices. After the third bottle I realized that I couldn’t feel it anymore. That it wasn’t strong enough for me. I told the Beta who was watching me. She told me that this was to be expected.

“Everything will be okay/ Let’s put a smile on”

I began to stop feeling most things. I only began to feel terror. I was anticipating the voices at all moments of the day. The only tether I had to reality was the mirror.

One day. While the beta was changing my bed sheets the voices came back with a vengeance. “Smile, darling” “Everything will be alright” the beta had his mechanical instruments in the corner. “Take it james.” I looked closer at it and could see the glint of a small blade. “Smile” I stood up. The beta became confused. I started to walk over to the corner. He grabbed my arm.

I froze. I didn’t feel the terror anymore. I felt the beta. HE felt my terror. I smiled.

“Everything is going to be okay, let’s put a smile on that face”

I checked my smile in the mirror and left the room. Leaving a vacancy in both the Beta and the Gamma levels

Foucault Explained with Hipsters


A comic I made for a second year gender studies course I tutored for in 2012, to help students understand some of the themes from Foucault’s The History of Sexuality Vol.1:f1

f2All page references from Foucault, M. (1976 [2008; trans 1978]), The History of Sexuality: Volume 1., R. Hurley, [trans], Victoria: Penguin Group

Stay tuned for Judith Butler explained with cats!


View original post

Help When Needed

You should probably watch the video above. Although I’m not very fond of TEDx, this particular talk is something that resonates with my experiences. I could talk on and on about various shortcomings of development projects, especially in Africa, but I’d rather speak with anecdotal examples. Besides, who has time for data? /s.

A couple of calendars issues back I ran a project that involved several high-school kids from around the world going to a certain African country to work on a school project. It involved working with a local orphanage-run school with limited resources. If memory serves me correctly, we had to build several classes and do some overall maintenance projects. In short, a typical high school project. Except this one was someone else’s goldmine.

I had already worked with the same orphanage a year prior, but I was never involved with the organization side of things. By then, the previous leader had a house in the area where all of us could crash after a long day’s work. During my time, however, I had to organize our own lodging facilities. This involved contacting various local facilities and the orphanage founder and director who was of tremendous help. All things were sorted out, with the exception of minor unavoidable inconveniences. One can imagine my surprise when three days before my colleagues arrived I received an email from 6000 miles away, asking to prepare $3000 for each of the 13 people involved. That’s nearly $40K for a one month project. In our budget we had a rough total of $2000, not even enough for a single person. I had a mini-crisis and had to lock myself in my room for a while.

The email was from a US-based fund-raising director who was the main contact for the organization’s foreign activities. It turns out, the norm was to charge $3000 for every US college student who wanted to ‘volunteer’ in this school. For that amount they would live in special fully furbished quarters, right next door to the densely occupied dorms while never sharing the same meals. The relevance of their interactions with students were quite limited but the complaints were rarely raised. Luckily, I was a local and could spot them. And this was how our group was expected to interact with the kids. The understanding of the local culture was never brought to attention but the school was expected to revere practices from a country where none of the students and teachers had been in. The act of charging someone to volunteer is obscene, if not insulting. How could you charge me to help you?

Dan Pallotta gave an incredible talk on the perception of development NGOs and how they ought to be run. I do agree with him that such institutions should be held in the same standards as normal for-profit organizations, at least in their budget allocations. You can watch the video below on the talk:

I do have a problem however in the way wish-fulfilment runs rampant within the industry. Lots of capital is directed into projects that range from unsustainable to pure delusion. Majority of the time ideas seem to spring from outside and enforced in the societies.

We are still not sure about the optimal approach to development projects. However, we do know which ones aren’t.


I’ve been a bit lazy (surprise there!) posting my own material lately. Whether it’s because I’ve been busy or that I’ve been afraid of delivering a quality post is yet to be decided (my favourite excuse). I’ve been learning the API for Soundcloud and some jQuery. I hope to get that sorted out soon. Anyway, Lev Yilmaz is probably responsible for some interesting discussions I’ve had back in college. He’s an American animator/storyteller (or whatever we call those awesome youtubers who produce good videos) whose Dad is originally from Turkey (this is important to understand his videos). His videos come the closest to capturing the feeling of being a 20-something year old guy dealing with apathy and classic existentialism.