Tuesday, November 10, 2009

Bangalore book fair 2009

The Bangalore Book Fair has started today at Palace grounds and I happened to visit today. With close to 330 stalls, I was awed by all the books and publications present. I had two clear priorities

  • Technical books
  • Childrens books

On the technical front, I purchased





It was really nice to see a good number of exciting books for children, I even managed to find some interesting gifts for children I know.

I'd highly recommend visiting the fair, the last day is November 15th

Sunday, November 08, 2009

Thought for the day

Happiness is when what we think, what we say and what we do are in complete harmony

Mahatma Gandhi

Arguing about OS'es

Gopal and I argued about Linux, Windows and browsing (nothing out of the ordinary though, we kill time in arguments and we've mastered that art). I thought I'd share what the stats look like for visitors on my blog. If you are worried about being profiled, don't worry, no personal information is stored by me! The data is from sitemeter and blogspot (If you are too concerned, you can start using the "Private browsing" or Incognito Windows)



Browser Share

Operating system share

FOSS.IN first shortlist

The shortlisted talks, workouts, project of the day, etc are announced. This year seems to be quite interesting with several kernel talks selected. I am looking forward to the Pulseaudio, security, S.M.A.R.T., kernel, gnome, GSM/Telecom, Haskell talks. I wish to attend them all assuming there will be no conflicts :) Link

Exponentiation

There are several well known exponentiation algorithms, but this one caught my eye, specifically due to its application in the Rabin-Miller primality test. Here is the math, the algorithm will follow later

Let the problem be rewritten as raise x to the power n. Let us convert n to binary


Where b0, b1, b2.. bk is the binary representation. Now lets rewrite x to the power n as

This in turn is equal to


The trick is to note that we need to compute even powers of x and determine b0, b1, .. bk. A simple trick is to, check if b0 is odd or even, if it is odd, multiply the current temporary value with x, if it is even, skip b0, but keep squaring the current exponent. Note we keep shifting n right, so that b1, b2,.. ,bk move to position b0 eventually.

Here is the algorithm from Sahni's textbook

def exponent(x, n):
m = n
expx = x
power = 1

while (m > 0):
while ((m % 2) == 0):
expx = expx * expx
m = m >> 1

m = m - 1
power = power * expx

return power

Monday, November 02, 2009

FOSS.IN posters are out

This is some of the best creative work I've seen (in terms of conference posters and getting the message out). All of this is released under CC. Excellent work guys! I am reproducing them below, the original post is at Posters! Posters! We need them, crave them








Friday, October 30, 2009

A consumer complains

I recently bought a new laptop and the display went bad in less than 15 days. I eventually got it back with the LCD replaced, but my experience at the customer service was horrible and I complained. Here is the letter I wrote, I am hoping that [company] will wake up and take notice. Customer service offered elsewhere (outside India) seems to be much more superior with value for customers.

My experience with [company] today was one of the worst I've had with any product support. I visited [service center] to repair my 15 day old laptop, the display had stopped working. I found that the front desk person opened my laptop without using any static protection mechanism, which I escalated all the way to [somename] (Customer Service Head). I asked for a letter of apology for not following prescribed procedure. [somename] told me it is a human error and I need to ignore it and stop interfering with how [company] service people work (I as a customer was going beyond my boundaries and interfering with their day to day work). After my complaint, the other people started doing the right thing, the local manager said that his employees were tired and just had lunch (hence the error). If [company] can void my warranty (even for opening my laptop, even though I did not (just hypothetically)), why is it OK for [company] service people to *NOT HANDLE* my laptop carefully.

Clearly I am very disappointed and want to see justice done in this matter. All I want so far is a letter of apology for not handling my product and a guarantee that their action has not damaged my laptop

Do you have any experiences to share? Consumer rights are taken for granted and I wish we could be more empowered to take stronger action.

Monday, October 26, 2009

FOSS.IN 2009 coming your way

I know this is last minute, but the CFP is due tomorrow (so please make full use of the last day to submit proposals). The event has unfortunately moved out of IISc (my favourite venue for the event and given the proximity to my house, my favourite visiting place as well). Nevertheless, the organizers are very helpful/cheerful people and I get to meet a lot of local FOSS people, apart from the regular visitors. Make sure you attend the event if you are in town or make plans to come down to attend it.





Friday, October 23, 2009

Finite Automate - solution part I

In my previous post "Finite Automata", I had posted two interesting exercises from well know texts. This post has their graphical solutions

Question 1 was

  • Given a binary stream, can we develop a finite automata to calculate the binary number modulo 5?
Here is the graphical solution of the problem, one can simulate an input stream of 0's and 1's and verify the correctness



The start state is represented using a triangle and the accept state is represented by double boundary node. In this case both the start and accept state is "1".

Question 2 was

  • Can we develop a finite automata that can validate the addition of two streams of binary numbers? Does such a finite automata exist?
There is one simplification we need to make to validate our results. For a given input of the form

0 1 1 <- Input1
0 0 1 <- Input2
1 0 0 <- Output

We need to present the string to the automata in the form [1 0 0][0 0 1][0 1 1]. We split the input and output into groups of threes, the last bit (MSB) represents the output. So for example, it says 1+1 is 0 and that is carried over and for the next input 1+0+ 1 (carry) is 0 and1 is carried over again. For the final input 0+0+1(carry) is 1. Hence this language is accepted by the finite automate.

Here is the graphical representation of the solution. In the next blog on FA, I'll discuss the techniques behind these solutions (which are probably very obvious to the reader of this blog anyway)


NOTE: states 7 and 8 are no good, but they are still shown here. Again, 3 is the start state and 3 and 4 are the accept states. The solution can be verified using two inputs and the output in the format specified above


Finite Automata (post one of many to come)

Oh! Gosh I can see it already, this is going to be a long post. Here is a brief background, I recently found my copy of Michael Sipser's Introduction to the Theory of Computation lying around. I found that is was rather nice to read (compared to some of the earlier texts I had been reading) and on finishing the first chapter stumbled upon some interesting problems posed in different forms in Sipser's, Ullman's and Papadimitriou's book.

I am going to cover some interesting aspects of Automata in this blog entry

  • The exercises in this blog entry to provoke some thought
  • Their solutions and representation in the next blog entry
  • A software to help solve/validate some of the solutions to the exercises

The exercises I am going to cover are

  1. Given a binary stream, can we develop a finite automata to calculate the binary number modulo 5?
  2. Can we develop a finite automata that can validate the addition of two streams of binary numbers? Does such a finite automata exist?
Now that you have some food for thought, come back here and check to see what I did with these problems/exercises at little later in the next blog post

Saturday, October 03, 2009

Thought for the day

I satisfy myself by saying, "My every attempt at failing to solve a problem and learning from it, is equivalent to Edison trying a new filament" :)
Balbir Singh