Sybill Trelawney

Sybill Trelawney, the Divination teacher at Hogwarts, was poorly received by her fellow staff, her students and the fans of her universe for reasons that all translate to “She was a fraud. She wasn’t a true seer and therefore not an eligible candidate for the job.” I however have always had a very different opinion about her. I believe that not only was she not a fraud but also a perfect candidate for the job, not to mention the fact that she did actually possess a gift.

We know that she was the great-granddaughter of some celebrated seer named “Cassandra Trelawney” and that Dumbledore went to meet her at the “Hog’s Head” and that no sooner than he met her, he realized that she didn’t possess her great-grandmother’s gift. Then she went into a trance and made the prophecy about Harry defeating The Dark Lord, and Dumbledore decided to hire her because he could tell that she was gonna make more of these prophecies and wanted her to be close to himself when that happened.

Now I want you to think. You are the headmaster of a school, and you want to hire a teacher for a karate class. You have to choose between a guy who is incredibly strong and can pick up and throw around the room just about anyone who picks a quarrel with him regardless of how good their karate is and a guy who spent years learning and mastering the sport and is a great fighter. Who will you choose? True that the first guy has the gift of strength and therefore has a good chance of winning most fights but he may not know anything about the sport, whereas the second guy has nothing except for a thorough knowledge of exactly what you want him to teach to your students. I don’t know about you, but if I was you I would probably hire the second guy, unless of course the first one demonstrated better karate skills than the second one.

Let’s try a different situation. You are the headmaster of Hogwarts and you want to hire a divination teacher. You have to choose between a woman who is well-versed in all the practices and techniques of divination (e.g. reading tea-leaves and making predictions from a pack of cards or dreams) or a centaur who, like all centaurs, was born with inexplicable knowledge of the cosmos and unfathomable divination skills that only require for him to look up at the sky. The woman doesn’t possess any magical powers that allow her to tap into the spirit world but she knows all that is known to man about the art of divination whereas the centaur who doesn’t have any need for those human methods probably doesn’t even know them. In fact, in the potterverse, the centaurs mainly, if not only, use the skies to predict the future and that too with seemingly minimal calculation or effort. It may be safe to assume that they aren’t even aware of the other methods used by humans. So, if it was for me to decide, I’d hire the woman, because she knows her stuff and so should be able to teach it whereas the centaur may not even know shit about the subject and is just naturally gifted at predicting the future by looking at skies.

We saw enough proof in the book of the fact that Sybill actually did know a lot about divination. She was accustomed to using all the techniques that she taught in class, and a whole lot of her predictions came true. She predicted the death of Dumbledore a few hours before it happened, predicted the order of death of certain groups of people. There are better posts about her predictions coming true so I’m not gonna list all of them here. So we know that Sybill certainly did have the knowledge, and that makes her a good candidate for the job. And we are also aware of the fact that she actually did possess a gift. That makes her a perfect candidate for the job.

One thing to note is that she herself was totally unaware of her gift. Clearly she had no control over it but given time and practice, it could be possible for her to get a handle on it. If Dumbledore wasn’t such a jerk, he’d have told her and tried to help her but he chose to not only keep her in the dark but to also make sure that she was one of the least respected members of the staff. Dumbledore and the Teachers routinely spoke ill of her and didn’t shy away from telling their students that she was a fraud and that her predictions weren’t to be taken seriously.

Let’s address the “fraud” question now. She did, at times, make predictions that sound way too ridiculous and didn’t even come true. Why? The answer is very simple. Entertainment. When you have a job like hers and everyone expects you to make cool predictions every once in a while, you have to have a mysterious air around you and you have to make predictions and you have to say stuff to make sure you have the required amount of attention. Come to think of it, she once predicted that Harry will have 12 children. Everyone knows that sounds made up including herself and so the whole point of saying it was to entertain students with some mildly humorous predictions which was a good change from the darker predictions she used to make, two of which she made in her first class and went on to become popular gossip topics.

Sybill Trelawney is underrated an underappreciated and she deserves better than to be called a fraud and better than to be insulted by her staff members.


The Final Sentence

I’ve been reading books, more than I’ve been reading lately, lately. Very often, I read them onscreen. A while back, I was starting with H.G. Wells’ “The Time Machine” and the PDF I found had about somewhere slightly above a hundred pages in it and it made me wonder if that was actually the whole book and not a truncated version and so I googled for the last sentence of the book to see if it matched the one in the PDF.

I ended up finding this tumblr blog called “The Final Sentence” that exists solely to serve as an archive of the final sentences of all books. I think it’s pretty cool actually and every once in a while, it makes me feel better about a crappy PDF.


Rewriting Legacy Code

I once wrote an answer on Quora about the improbability of a programming language to completely die out once it has gained popularity. The idea, not so original, was that there are two factors preventing a language from dying:

  1. A significant amount of code is written in it and a significant amount of people or other code depend strongly on it. An example is Linux. Now Linux has always been C and always will be. As long as Linux exists, it would be impossible for C to die out.
  2. Everyone knows about it. The problem with a programming language being popular enough for it’s existence to be common knowledge is that there will always be people who’ll be fond of it and would want it to never die out. The best example would be Richard Eng, the smalltalk evangelist who has grown more popular than the language itself and likes to call himself Mr. Smalltalk.

This post is about the first reason. C, PHP and JavaScript are three of the most popular and most hated languages that are getting closer and closer to being about as old as time itself. For my own reasons, I both like and dislike the 3 and also rely a lot on them. Let’s assume everyone agrees to killing all 3 of them. Now the problem is that C is:

  1. The language Linux is written in.
  2. The language most programmers start with. (Often this is because universities prefer to teach it in the earlier semesters.)
  3. More or less the only mature language that has the least amount of abstraction that one could ask for except for C++, which is a mess and an offspring of C itself and therefore not worth talking about in this post.



Comparing strings with “==” operator vs “.equals” method [Java]

During lunch, I was reflecting on that day when my programming teacher asked me to come forward and teach “bitwise” operations to the whole class, and I remembered how, in my attempt to explain to them the basic difference between a regular “OR” and a bitwise “OR”, I had talked about value comparison being different from a bitwise comparison. Then I began to wonder. A bitwise operation on machine level is fairly simple to understand, but what about value comparison? What is it that happens at machine level when you check if two integer values are equal?

As I began my search for the answer, I pinged Vladislav Zorov, my mentor and friend, and asked him. He said that compilers mostly just subtract the memory addresses of the two objects being compared and returns true if the difference is zero i.e. if they are literally the same object. I couldn’t agree with this so I argued against it. I said that it is possible for two variables to point to identical objects without pointing to the same object and so I set out to prove it.

I wrote a very simple program:

import java.util.Scanner;
public class HelloWorld {
public static void main(String []args){
// Created two strings using the same literal and an array with the second index set using that literal.
String x = “abcd”;
String y = “abcd”;
String[] z = {“asafaf”,”abcd”};

// Printing addresses of all 3.

// Checking to see if the equality symbol works on these
if(x == z[1] && x==y && y==z[1])
System.out.println(“== works on the 3”);

// Comparing the 3 using the equals method which will, obviously, work.
if(x.equals(z[1]) && x.equals(y) && y.equals(z[1]))
System.out.println(“equals method works on the 3”);

// Creating Scanner object to read from stdin.
Scanner input = new Scanner(;

// Taking two strings as input. Will test with
// 1. Two different strings
// 2. Identical strings
// 3. “abcd” for both
String j =;
String k =;

//printing their addresses

// Testing both comparisons
System.out.println(“== working on input strings”);
System.out.println(“equals working on input strings”);

// Initializing a string identical to x,y,z[1] but with the new keyword
String a = new String(“abcd”);
// Printing its address
if(a==x || a==y || a== z[1])
System.out.println(“== working with new keyword”);
System.out.println(“equals method working with new keyword”);

If you run it, you’ll see that its output shows that all strings that have the same value point to the same address regardless of how they’re initialized. But the equality symbol only works when two strings have been created with the same literal. The fact that we’ve now proven that identical strings in Java do have the same memory address does perhaps imply that comparison is done simply by comparing addresses but then what about the equality symbol? Well, I’ll update this post when I find out.


Messing around in the Pottermore group



David Carson on JS

The dirty little secret is that most “modern JavaScript development” is nothing to do with actually building websites – it’s building packages that can be used by people who build libraries that can be used by people who build frameworks that people who write tutorials and teach courses can teach.

I’m not sure anyone is actually building anything for actual users to interact with. – David Carson


Die Verwandlung

I just finished reading Franz Kafka’s “Die Verwandlung,” translated into “The Metamorphosis” by Stanley Corngold. Before I even started reading it, I’d told my classmate about how it seemed like a weird one — something I’d deduced from its synopsis — and he’d responded with “Franz Kafka’s works tend to be.”

Now that I’m done with it, I’m not quite sure how I feel about it. For one, it was incredibly short. Like I knew it was a short story but I’d still been expecting it to be longer. Then there comes the fact that (SPOILER ALERT) 


What if logic isn’t actually all that logical?

Logic, science, reason, all of it is what? Rules that always hold true for everything that they are defined for. But who really defines them? We do. Who comes up with them? We do. And what are they based on? Observation.

I remember, as a kid, reading an article in my native language, titled “What if there was no Sun?” and it, as you can guess, was full of stupid stuff like “pitch black, ice cold, nobody would survive for any more than … e.t.c.” While I was reading it, I couldn’t help but wonder why a world without our Sun would ever have any life-forms that need the sun to survive? Or why the humans on such a world would not be used to not having a sun and thus be optimized for survival in such harsh conditions.

My point? We believe logic is absolute. Maybe it is, but only for our world. We know that if we pull at a free movable object, it would move towards us. But for all we know, there could be a world out there in which doing so would result in that very object moving away from us. That sounds illogical, stupid, and inconceivable but if it happened all the time in our world, it wouldn’t be.

We believe that we can make deductions using reasoning, but how reasonable would that be when that very art of reasoning itself is a set of deductions based on observation. What about observation? Do we even really see our world as it is? We don’t even know if we all see the world the same way. A really narrow range of the electromagnetic spectrum is sensed by our eyes and is used by the brain to form an image. This is literally akin to reading a detailed book and imagining the events and the characters. Using this analogy, we can tell that while the image can be extremely detailed, it will still be limited by the amount of information it is based on. Imagine if our ears were so trained that we could, in the absence of light, form images and see using sound. Is that inconceivable? But what really is the difference between the ear and the eyes? Both sense and interpret waves with the help of the brain. If we could see the rest of the electromagnetic spectrum, we would have a much smaller list of opaque materials than we currently do.

This does of course suggest that it doesn’t matter if the science and logic we so rely on is limited by our observation as long as it holds true for our observable world, but the idea was the very fact that it would be just limited to our observable world. This is kind of like how we wouldn’t be able to tell if there were any more-than-3-dimensional-beings out there observing us right now because we can’t perceive or observe more than 3 dimensions.



Linus on C++

C++ is a horrible language. It's made more horrible by the fact that a lot 
of substandard programmers use it...
In other words, the only way to do good, efficient, and system-level and 
portable C++ ends up to limit yourself to all the things that are 
basically available in C.
In general, I'd say that anybody who designs his kernel modules for C++ is 
 (a) looking for problems
 (b) a C++ bigot that can't see what he is writing is really just C anyway
 (c) was given an assignment in CS class to do so.

Feel free to make up (d).

You can read the emails here.


How GoDaddy robbed me.

Humble request to all readers: Share this post.

I really want to keep this as short as I can and address only the primary issue. For those who don’t know, GoDaddy is one of the most popular domain registrar’s in the market and I started using it a couple of years back as a means for getting rid of my local registrar who had been screwing up routinely in a most inefficient way.

Abstract: Lately, they have not only made a few irrational and immoral decisions, but they also robbed me of a rather large sum of money and then messed up my order completely. In short, I paid thrice for the same order and I didn’t even get what I ordered. Furthermore, somehow the same domain was purchased twice using my account and I have absolutely no idea how it’s even possible. … 


What the hell?

So I was minding my own business in my humble abode when I receive an email. A quick look at my phone’s notification bar tells me that it was from the admissions counselor (, let’s call her Daisy,) of a college that had accepted me. I wasn’t at all surprised because the decision day for that college had just passed and I hadn’t shared mine at all.

The email said “Daisy has shared a document with you.” And had a button that said:Open in Docs.

Like a dumbass, I clicked on it. I did wonder why she’d share a document with me and I did, kinda, wonder why it didn’t look like the average Google Doc invitation, but I was on my phone and I chose to overlook it.

Then I land on a page that asks me if I want Google Drive to have access to my email account. It asked for permissions like “Edit, delete and create emails.” I was certain, by this point, that something was not right. And I just allowed it. You know why? Cause the goddamned address bar clearly showed that I was still on Google and still on https. I was redirected and then it appeared to be completing a request and loading something and after waiting for a few minutes, I realized what I had done.

Now I noticed another weird email, and it said “Anas Khan has shared a document with you.” That was it. Now I realized what those permissions were for. I checked the sent mail and realized that this shit had forwarded itself to “[email protected]” and that email was BCC’d to virtually every email address that I had ever communicated with.

Well, kinda screwed up. But I have to say this: It was a clever scam.


Let there be light

The tendency of modern physics is to resolve the whole material universe into waves, and nothing but waves. These waves are of two kinds: bottled-up waves, which we call matter, and unbottled waves, which we call radiation or light. If annihilation of matter occurs, the process is merely that of unbottling imprisoned wave-energy and setting it free to travel through space. These concepts reduce the whole universe to a world of light, potential or existent, so that the whole story of its creation can be told with perfect accuracy and completeness in the six words: ‘God said, Let there be light’. – James Jeans


Did Nokia really not do anything wrong? They did.

“We didn’t do anything wrong but somehow we still lost.”

Those were the words of the CEO. Do I agree with them? No.

Let’s go back to, say, 2006. Every average person had a Nokia. The Motorollas? Those were what people bought between two successive Nokias. Sony Errison? Well, that one had its own cult. There was a wide variety of different lines of phones in the market, each aimed at a different class of users. The basic featured for those looking for a cheap calling device, the multimedia enabled for those that wanted more, the communicators for those that afforded them.

That wasn’t all. That was the time when Nokia did some strange experiments resulting in the production of some really weird and unique phones. And guess what? A large percentage of those took off as well. Examples of such models could be the NGage and the Ngage QD – Gamepad shaped devices aimed at gaming. I happen to have owned both models. Nokia was also infamous for coming up with some really weird designs, which, surprisingly, sold just as well.

Why? Cause Nokia owned the market. They were among the pioneers and they had almost monopolized the mobile market. What they produced was good and was pretty regardless of how shitty it might actually be.

All the awesome devices that Nokia ever made were … 


What Coulumb said to Newton.

Charles Augustin de Coulomb: Can I copy your work?
Isaac Newton: Sure. but change it up a bit so that it doesn’t look obvious.
Charles Augustin de Coulomb: Sure.


Spoiler song lyrics in “Amazing Spiderman 2”

I was watching this video, and below it I found this comment:

irishdancingchicken: (Possible spoilers) Listen to the lyrics: “I’ll shut down the city lights,” like Electro did. “When enemies are at your door, I’ll carry you away from war” – he tried to. “Your hope dangling by a string” = her life literally dangling by a string/web. “I’ll love you long after your gone” – he does. Doesn’t matter if you don’t like the song or artist, the filmmakers knew what they were doing when they put it in there.


Richard Parker owned an Ericsson Chatboard CHA-01

I was doing some math when I, for reasons I can’t recall, remembered that scene from “The Amazing Spider-man 2” in which, among a number of other things, there was a scientific calculator on the floor of Peter’s room. Interested to know what model it was, I googled it and landed on this post . The author identifies it as the “HP-48GX or a closely related model.” 

When I looked at the pictures again, however, I realized that the calculator wasn’t the only interesting artifact among Parker’s possessions. My eyes fell on this thing here and with a jolt I realized that I happen to own one of them.


This thing, which Lucas Allen — the author of that post —  took to be a Palm PDA, is actually an Ericsson Chatboard CHA-01, a small portable QWERTY keyboard that allowed for some decent and fast typing in the old days. Back then, everyone wanted to have one of these. Richard Parker, being a scientist and doing some really sick work probably had to type long emails and messages and this would have been one of his essentials while travelling.

It also makes sense because it’s a Sony movie and they would of course focus more on showing the characters using a bunch of their products instead of focusing on producing a good movie that fans can appreciate.


What are Sum, Product, and Pi types

Click me!


Monolingual Autism

You can google that if you like and realize that it may not really be a real thing. It’s something that I have been observing for a long time and I’m sure you’ve seen or felt it at different points in your life.

A while back, LifeHack posted about people having different personalities when speaking in different languages. So I thought: Is it possible for a person to be autistic in a particular language and enthusiastic and energetic in another? Sounds stupid, eh? Well, here’s an example that might make it sound slightly less stupid and slightly more relatable:

Think of a kid from India or Sri Lanka or even Russia — or any other place where English isn’t really the first language. If that kid goes to a decent school, he’s probably learning English and his teacher probably encourage him to converse in it when possible. Let’s name that kid Connor.
Connor is 14 years old, he goes to a decent school and converses in English with his teachers simply because it’s a school rule. Connor speaks his native language at home and when among friends and he’s pretty talkative. Connor has no trouble reading or writing in English. But sometimes, e.g. in a group of several people, that he doesn’t know very well, who are confidently speaking to each other in English (although they also know Connor’s language), Connor gets tongue-tied. Connor has to put too much effort into forming every sentence that he then speaks. Connor, therefore, chooses to speak in his own language. The greater the number of such occurrences, the stronger Connor’s belief that he can’t converse effectively in English and the harder it will be for him to do so the next time he is faced with the prospect. At times like this, Connor get’s mildly autistic.

I have a theory. If Connor were to speak to someone that doesn’t know any other language besides English, he probably won’t have this much trouble. I personally believe that all this happens because it feels stupid and illogical to converse with people in a secondary language when you don’t need to. If someone knows Connor’s language then he would prefer for them to speak it instead of English.

This makes it sound like just as much a matter of choice as a question of confidence. So what is the issue? And that, is exactly why I chose to compare it with autism. The thing with disorders is that you can’t just choose to not have them. Sometimes you know you have them and that they are stupid but you can’t just think your way out of it. I believe that this is something like a disorder where the brain just doesn’t accept the idea of doing something as illogical as conversing in a secondary language when you can choose not to. Secondly, every time it kicks in, it is accompanied by nervousness and hesitation and makes you look like this quiet, timid, shy personality and occasionally raising questions like “You don’t say much, do you?” or perhaps even “Is he autistic?”

Can it be overcome? No idea. Does it need to be overcome? Logically? No.


Albus Dumbledore’s sacrifices

Let’s get to it. We all know about Dumbledore’s past, and his friendship with Grindelwald and the whole “For the greater good” thing. Not all of us, however, realized the fact that he never stopped living his life by that motto. Albus Dumbledore always did everything for the greater good.

“You’ve been raising him like a pig for slaughter.” – Severus Snape.

Yes, remember that big reveal to Snape? Dumbledore making clear his belief that in order for the Dark Lord to perish Harry had to die? Remember how he didn’t even try to deny the fact that he was, in fact, just keeping Harry alive so that he could die at the right moment?

But that wasn’t it.  … 


If programmers aren’t engineers,

Then neither are bio-engineers.