Posts

Blogs mature over time

Image
It's interesting to look at how my blog has grown over the years. It shows how lopsided the internet is in terms of traffic. The data speaks for itself:

Recurrences in Computational Complexity

Image
Manish Sharma asked me an interesting question over chat regarding recurrences and computational complexity estimation. The question was interesting enough that I thought that the answer would be of use to many more people in general so I'm posting it to my blog. In any case, a post to my blog was long overdue. So, here it is: The original question was: How do you find the computational complexity of the recurrence: T(n) = a.T(n . r) + b.T(n (1 - r)) + O(n) or, when pretty printed: Well, technically speaking, this question is phrased slightly ambiguously, so I'm phrasing it as below: T(n) = a T(n r) + b T(n (1-r)) + cn + d a > 0, b > 0, c > 0, d belonging to R Pretty print: and while I'm at it, I'll point out to you that without loss of generality, I can impose the additional restriction that r is in the range of 0.5 to 1.0. Pretty print: This is possible because I can simply take a recurrence equation where this isn't true and ...

The Case Against GM Foods: Putting our food security at the hands of an American Corporation

Image
I've always looked at Genetically Modified foods with a wary eye. Also, the fact that the US GM seed market is dominated by a single company - Monsanto - makes me even more suspicious (the obligatory Wiki Link -  http://en.wikipedia.org/wiki/Monsanto ). It is well known that Monsanto spends tons of money lobbying the US Food and Drug Administration (US-FDA) to ensure legal status for GM foods and to guide American legislation such that GM foods remain legal and no adverse regulatory laws are passed against GM foods. Source: http://www.panacea-bocaf.org Nowadays, every supermarket I've been to in the US keeps GM foods next to non-GM foods. There are no clear label markings mandated by law that would allow a consumer to distinguish between GM and non-GM foods at a glance. Consumers are forced to read fine print on labels to determine if GM products have been used in the food chain of the product they're buying. Then too, things are hampered by the fact that there i...

Facebook Goes the Google+ way - tries out Google+ style comment formats

Image
I was just browsing on Facebook and I was surprised to see a link to a video posted in the comments being shown inline. Here's how the new interface looks: Suprisingly, the video player also seemed to be updated. See the new style controls? Hmm... It seems okay... Though the whole site could do with a big makeover... 

The FBI Chargesheet for ISI Lobbying via Americans

I just came to know of the FBI chargesheet against Americans for channeling funds from the ISI for lobbying purposes. Read the entire chargesheet below. Fai Ahmad Complaint Affidavit

Solved? LaTeX Error: pdf file is damaged - attempting to reconstruct xref table

Update : Greater experience with this issue has given me greater clarity. The issue is not related to LaTeX. Getting this error message simply means that evince tried to access the PDF file while it was being written to by pdflatex or latex and found it in a damaged state. This happens if you have a large pdf file being generated with lots of text or a number of figures. There's nothing to worry about if you get this error message. You can safely ignore it. ---- Original Post Below --- This is just a short note for anyone coming across this problem while doing LaTeX work. Google doesn't have a decent explanation for why this message occurs. I don't have one either but I have isolated the cause for my particular issue and I hopefully have a fix. The error under discussion is: Error: PDF file is damaged - attempting to reconstruct xref table... Error: Couldn't find trailer dictionary Error: Couldn't read xref table Error: PDF file is damaged - attempting to ...

What is the difference between a mutex and a semaphore?

Okay. This is another common interview question. The one line answer to this question is: "A mutex is a binary semaphore that can only be unlocked by the thread that locked it. It's primary purpose is to ensure single threaded access to a piece of code called the critical section. A semaphore, in contrast, is often used for cooperative signalling across threads, a feature that is explicitly disallowed by the construction of the mutex as a binary semaphore owned by the thread that locked it." Here are a few of the points you should keep in mind: Q1: What is a semaphore? * A semaphore is a mechanism to convey events between two or more cooperating processes. Now what does this mean exactly? In a typical multiprocessing machine, many processes are being timeshared on a single CPU. The degree to which computation will proceed in one process depends on how big a time slice it has been given by the OS CPU Scheduler. Thus, different processes will be at different stag...