git push heroku master; server sent publickey

Recently I have been having some trouble with heroku git push from my Windows PC. Whenever I run,

> git push heroku master

I an stung with this message:

PuTTY Fatal Error
No supported authentication methods available (server sent: publickey)

I have tried several things like adding keys with heroku keys:add etc.
Finally, following helped:

> heroku git:remote -a appname

Apparently, meta about remote was corrupted, and executing this command fixed it.

Oh Facebook! plz serve me with better ad

There is an ongoing wave of discussion about Facebook privacy policy update. Apparently, people are more concerned about Facebook policies than Google’s policies while they should be more worried about Google’s.
Now, a lot of so called privacy advocates tell that corporations are selling “you” to make money. Now what is the premise here? Facebook, Google, Twitter etc tech companies are giving you services, quality services and you are not paying a penny. So how do you think they would pay for the cost to run those services?Advertisement is a good source of money for services like Facebook. They provide you with quality service without a charge but in a condition that you’d let them serve you ad. Now, do you want to see your Facebook home covered with tremendous amount of ads? I prefer to see much less but useful sweet ads.

How would they know which ad will be useful to you? They somehow have to infer what you like and what you might be interested in. That is why, they want to analyze your data and usage pattern. They are not going to a different company and giving up your private information to them. Rather, they curate from millions of ads to serve a few that might be of your interest.

Still, they are not super awesome at serving personalized ads. If you searched for a product ten days ago and already bought one, they still serve ads about same type of products. That is totally bad. I am not interested about those; and yet they are charging the seller for those ad impressions. I would rather, see a different product. If I bought a Nikon camera, don’t serve me with ad about a Sony; rather tell me about a tablet may be. Or about lenses at best.
So Facebook, if you can infer what I am buying next, please serve me with best deals out there.

What is linked list and how pointers work?

Today, I was talking with one of my friends about how we studied data structures in freshmen/sophomore years and how some troubled in understanding pointers. Joel probably says that, it is an aptitude that not everyone can have. So, just then an analogy for linked list hit in my imagination and my friend told me to write about it.

Think of a treasure hunt:
– You are given an address of a house, you should start by visiting there
– In each house you will find an address to another house, you have to visit that house next
– At some point you will reach a house which do not refer to a next house; your treasure is in that house

Traversing a (singly forward) linked list works exactly the same way.

Hope this analogy helps.

Anguish of BANGLA (script) lost amongst English (alphabet)

Once, I made LikhonPad for phonetically typing Bengali (type using English keyboard and let it convert to Bengali). I never liked phonetic typing, so I ended up building Sonnivo – a very QWERTY like Bengali touch typing keyboard layout. Meanwhile, Avro (a smart phonetic typing tool) became much popular and let Bengali people write Bengali (in English, but finally rendered in Bengali). Then there came, keyboards for mobile phones too.

Yet, people tend to write Bengali, not using Bengali Script but English (subset of Roman) alphabet – which always renders horrible looking text pieces – I cannot bear reading them.

I often thought of building a JavaScript extension for Firefox (and for other browsers, for those to whom it mater) that will convert English-encoded Bengali for us.
The primary problem in building that tool is, I never freaking found time for it, and I often don’t freaking care to give a head to something written in roman letters but is Bengali.
But, naturally, the actual solvable problem will be to define a set of grammars (hence automata) for transliterating En characters to Bn. Nevertheless, everyone do not use same grammar, moreover same person would use different grammar from time to time. Thus, a solution will be to use some AI/ML/DM for this.
Sounds like, a rather much complex solution for a way to easy problem, right?



Yesterday, I needed a tool for reading files as bytes. Hexdump programs generally do some formatting and stuff. I did not want that. I wanted to have a straight forward, simple sweet tool, that simply reads a file and prints it’s bytes. Time required for searching such a tool is indeed greater than the amount of time you can simply write a tool by yourself. I wrote the following:

/* read passed file and show bytes in hex val, consicutive each byte */
/* Released in Public domain by nafSadh.khan */
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
	FILE * pFile;
	int c;
	int n = 0;
	if (argc < 2) return 0;
	if (strlen(argv[1]) < 1) return 0;

	pFile = fopen(argv[1], "r");
	if (pFile == NULL) perror("Error opening file");
	else {
		while ((c = fgetc(pFile)) != EOF){
			if (n % 32 == 0) printf("\n");
	return 0;

Next time, I am not re-writing this same program though.