Posts

The BIllion Dollar Mistake | NPE

Image
TL;DR: null pointers will ruin your life. If you've used Java on a large scale project, you're lying if you haven't faced this dreaded million dollar mistake, first introduced to the world of programming in 1965. It's uglier than a Windows backslash, odder than a ===, far more common than the latest release of a JS library, more confusing than understanding a GC, ever so slightly harder to debug than interger overflows - I'm talking about a programmer's guilty temptation, the horrid null pointer exception. Homer, and computer programmers all around the globe. Tony Hoare, the creator of null very casually says  "I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement . This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. " Very true, Mr. Hoare. Last week, I (finally) re-released Lifehack

The Art of Summarization

At Google I/O, the CEO conveys an entire years worth of work of over 50,000 employees, and also hints at future developments. All in less than half an hour. At a TED talk, the speaker conveys years, if not decades worth of research, their journey and enlightenments. An entire summary keeping the audience as engaged and as attentive as possible in a span of under 20 minutes. - An entire semester is dedicated to doing a project in our University - most students do internships during this period. At the end of the project  we go back to college to present what we did in the 4 months. Every year students complain professors shamelessly thrash students, especially those who do their internships outside of University. They do so rightly. Having sat through 15 such presentations of my batchmates, students just don't know how to put their point through! Presenting what you've done for 4 months in 10 minutes is an art. You have to give them a background of where you're w

C'est La Vie

I learnt a funny lesson recently. This is not a rant, but really something anyone should note for the future! TL;DR: Put Sunday as your last working day - even though it isn't a working day . I sent an email during my last week of internship stating Friday, 28th April would be my last working day at the company. Accustomed to receiving the same amount every month over the past 5 months, I noticed a 2 days cut this time. I was surprised - I didn't take an ungranted leave, and I swiped every day of the month - I even worked on a couple of Saturdays. Why'd they cut? So I did what anyone else would do - I wrote an email to the woman who handles finances and asked her quite politely as to why this was done. "Rishabh, you notified us that 28th April would be your last working day. Hence, you have not been paid for 29th and 30th April." "Whaaa! But that's extremely silly! Those two days were weekend days, they aren't even official working days! And the

A Sophomore's Guide to the Summer

I can't stress enough how important it is to work on self projects when you're in college. Everything you learn and do then goes a long way. You have all the time in the world, and have the chance to explore as many things as you'd like. Here's a list of simple projects that I did / wish I did in my 4 years at college. [OS, OpenGL] Use opengl to make a city of your file system. Basically, something like nautilus (Ubuntu's file manager GUI) but a 3D model where buildings represent folders and trees represent files. You'll learn a lot of opengl in this which is a really handy tool in the graphics stack, and you'll understand basic file operations. View an implementation by Nikhil Marathe here . [OS, FAT] This was something we had to do for the OS course in colg but was a weekend project and it was so much fun. A FAT table visualizer - ie, a visual guide as to how the FAT table changes over course of thousand iterations of rename, creation and deletion

Organization Skills 101

I've wanted to write this down for a long time. Here's how I use my laptop. All folder names are lower cased. This helps when traversing folders using your terminal - it's unnecessary having to press Shift every time you want to go to ~/ D ocuments, for example. (Except it doesn't matter anymore, now that I use ZSH as my default terminal). Plus, to me, lowercase on the terminal is aesthetically pleasing, for reasons unknown. All my written code resides in one folder - the ~/code folder . The code folder is then divided into multiple directories - all named on programming languages, which contain workspaces/project names within (remember, they're all lower case). Larger projects that grow over time, or span over different languages, or become my primary projects are sent into ~/code/primary. Oh my zsh . It's awesome. The thing about using IntelliJ all the time is, you expect autocomplete everywhere you type/code. ZSH has an amazing context based tab autocom

Concentrate on the yellow wall, mind.

TL;DR. Food for thought. Can a monk's true ability to control his mind be tested under the influence of recreational drugs? Our mind is an ever-wanderer. The minute you think, hold on, I'm just going to sit here and think about one thing, and one thing only, say the yellow wall in front of you, your mind just won't let you.  For the first minute or so, you think of just the yellow wall, you see, you start to immerse yourself into it. Except then, suddenly your mind remembers a tune from Coldplay's track and you start humming.  No. Brain. Shut up. We're concentrating here. Not the yellow song. Yellow wall, that's it. You go back to just the yellow wall, except this time you're sure nothing can distract you. You're trying to discard all triggers from sensory events that remind you of yellow. But then! The fridge starts it cooling cycle and it suddenly becomes louder than usual.  Yellow. Mind yellow wall. Fridge? Agh. Yellow. Oh wait! I have a m

The Font Maker

I'm jealous of this particular man. He's 40 something, and from the outside he seems to have has his life all sorted out. You'd think I'm talking about a man that founded a technology business at the age of 15, and is now a multi billionaire. Or a hotelier with scores of chains under his name, living life in luxurious suites each night. No, this man, he isn't doing rocket science. He isn't an extraordinary mathematician. He hasn't pursued the pleasures most of us are taught to look upto as children. He's a font maker. He makes brilliant fonts and gives them kickass names. He's a marathon running hobbyist. And his real job ; he's a kindergarten teacher guiding kids aged 3-6. http://pizzadude.dk/about/ - Why can't we all be content with a life like this?

Always Online

One thing I've learnt about social media and instant messaging is that you are only as important to people as the time you spend on it, putting in effort to show people your presence. The less you text, the less people are going to bother texting you. If you text at night, you are bound to receive replies in the morning, and that's the cycle of always having new chats on your chat list. You text now, and you will receive replies later, keeping you hooked all the time. I recently reduced my whatsapp usage by moving the app to a secondary phone that I don't carry around with me all the time. Especially at work, I carry a phone that only has the bare minimum utilities installed, and nothing more. During the initial week when I started this, I'd leave my phone at home at around 9 in the morning, and by the time I reached home from work, I'd have received about 20 messages from different people/groups. It was mighty difficult to reply to everyone. I then actively infor

DA in 100 words.

With emails about graduation and yearbooks hitting our beloved Zimbra email, I realize I'm graduating soon. The  presswaale of our batch have taken up the responsibility to publish a yearbook with our photos and 50-100 word notes of how the experience was for each one of us. Here's mine! I spent hours trying to think up a way of coming up with something unique, something that didn't sound like what  any other graduate from just another university would say, but that's impossible. So I decided to simply let the words flow. One downside is, that makes my note very generic. Oh well. There's not a thing I would change if I could relive these years. DA really gave us the experience everyone says you'll have at college - the hostel that never let us sleep before 3am, lectures that demanded minimal work, a huge lecture theatre that allowed us to sleep unnoticed, a football team and a ground I'll remember for life, and friends that I would love to grow old wit

Thousands of generations to learn anything | Evolution

Image
AI, in the form of neural networks today takes hundreds of thousands of iterations to learn from scratch. Given a set of defined goals and a basic know-how of the limited set of controls it has, it repetitively performs a sequence of operations to understand what helps it reach its goal and what doesn't. At times it takes the same path with a slight detour to see if that made any difference. Take for example the following brilliant demonstration of a neural network learning to play Mario.  Easter egg - MarI/O is open source. The entire process of the neural network learning to play the game is based on biological evolution. During its initial generations with almost no idea of what to do, MarI/O simply stood there, or kept jumping in place. It then learnt that pressing the right button helped it reach closer to its goal - to reach as far right as possible. So over the next hundreds of generations, it just kept pressing right, and then jumping in place. Later, it realized p