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?

Then, WHY CAN’T YOU PEOPLE WRITE BENGALI IN BENGALI SCRIPT?

Read_file_bytes

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){
			printf("%02x",c);
			n++;
			if (n % 32 == 0) printf("\n");
		};
		fclose(pFile);
		printf("\n");
	}
	return 0;
}

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

Just another comment on Tablets

Today one of my friends was asking on Facebook, what are the utilities of Tablets? I commented what I thought about it, and here it follow:

Until Surface came, tablet was immature. Now, it is getting a shape and user base too. Here, at US, I see a lot of people using tablets. They have a certain, limited, but handy use case. First of all, tablet is light, weighs light and performance is low too. It is designed to be single app threaded (user will focus on one app at a time). You can use tablets while you are on the move, say attending a seminar, waiting somewhere or just not on our desk. Laptops are portable, but those ones which you can carry around with offer too small a view port (13″). They are relatively useless compared to their price range and weight.
If for only reading ebooks kindle (ink based) are best. But, tablets let you browse too.

With all these limited use cases, you can always be happy by having one tablet as your tertiary device, after your computer and phone. For tablets, I prefer Surface, probably Pro. Android tablets are still crappy (you need a great touch screen on tablets if you don’t get a real keyboard). Apple’s tablets are on per and could be best for most users.

I am currently settled with a mid weight, high performance laptop – which gives me most of the computation power I need, yet allowing me to carry it around if I have too.

Next, when I am going to change my setup, I’d like to have a full fledged desktop as primary device and a Surface Pro as on the fly device and probably a Nexus or something light as phone and no laptop.