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

Friday, August 21, 2009

Thought for the day

Be willing to be questioned till the right thought emerges and be willing to question till the right answer emerges
Balbir Singh

Wednesday, August 19, 2009

Feeling insecure - thoughts on SELinux

I've decided to run Fedora on my main desktop and enable other distros via virtualization. Yes, too many good solutions to ignore and I paid for the hardware. Anyway, this is not an entry about virtualization, but on SELinux. Fedora enables SELinux by default and I was left to live with the consequences. To try and make sure I get the same five star security on my desktop that enterprise applications get, I decided not to add selinux=0 to the boot command prompt.

I thought I could learn it, wouldn't I be an inferior being if I could not? What does it say about my go-getter attitude? My first encounter with SELinux was when I tried to get ~user/public_html enabled via the Apache Web Server. After I had followed the documentation, I still could not get a seemingly easy feature to work. I dig the web and without knowing too much, I learn about a certain context httpd_user_context_t and use a certain tool and it worked!!!

I had a grin on my face for a few days, I was going to be able to work with SELinux. My next surprise came when I tried to install some software and setroubleshootd very gently pointed me to the cause of the security violation while installing the software and what I could do to fix it (gee, an automated tool, no more worries). My next encouter occurred when I tried to install mediawiki with math enabled (yeah.. I decided to save paper and take notes on the wiki with TeX enabled, but that is a different story). Again, no matter how well I followed the guidelines, I could not get texvc to work :(

Remember to look at /var/log/audit files as root and run audit2allow to get some useful hints with SELinux. SELinux comes with a set of rich GUI tools, be sure to use them as you walk through the seemingly friendly maze of SELinux
I found some help on the mediawiki site that gave me instructions on how to setup SELinux and mediawiki together. To my surprise, I found quite a few software vendors providing additional instructions for setup when SELinux is enabled.

The feeling of being miserable at SELinux set in, I had to now read up and understand the architecture or forgo my new found security infrastructure. Today, I came across a very interesting web page (the wikipedia entry for SELinux),

“...given the threat models and capabilities of the adversaries involved, that's probably appropriate... But that’s not necessarily appropriate for all users. SELINUX is so horrible to use, that after wasting a large amount of time enabling it and then watching all of my applications die a horrible death since they didn't have the appropriate hand-crafted security policy, caused me to swear off of it. For me, given my threat model and how much my time is worth, life is too short for SELinux.” — Theodore Ts’o
You can only imagine how relieved I was to see this quote
Life is too short for SELinux
I was not alone, others hated it and found it hard to use as well. How pathetic can such happiness be, but I was overjoyed, excited to say the least.

My path forward is to continue to use SELinux, but be less tolerant of its idiosyncrasies. I am working my way through the documentation, but very slowly. I've learnt that my new best friend is "Z". Add "Z" to existing commands in Fedora and magically it shows SELinux information that can be a life saviour at times.

Sunday, July 26, 2009

Search engine, BIOS updates and a waste of time

I am not quite sure how, but the default search engine on my Windows partition changed to "Ask". I was looking for BIOS updates as a possible workaround to some 3D graphic issues I was observing. The search showed a wrong version of the BIOS and board and I (being me) ran the .exe express update only to realize that I've managed to erase out my Intel Management Agent firmware. The BIOS worked, but I could no longer read the temperature and voltage from the motherboard sensors.

After this blunder, the regular express or ISO based mechanism of BIOS update refused to work. Thanks to the recovery BIOS mechanism on my Intel board, I removed the jumper pins (see manual for your BIOS), put in the CD with .bio file burnt on it.

NOTE:
  1. .bio is the recover BIOS. Burning
  2. .bio from Windows burner created a UDF filesystem on the CD, which the failed to work.

I had to force a iso9660 file format from my Linux partition and recover. After the recovery BIOS update, I put back the jumper pins and got back to normal work. My Intel 3D graphics problem on Linux is not yet completely gone, but I do hope to debug it more and not hear back (update BIOS) when I ask for help

In summary, stop believing your search results if you want to be productive :)

Monday, June 08, 2009

No.. I've not given up blogging

Just too busy collecting stuff to write about. Many interesting things, many learning's, mistakes and successes. Watch out, something might be coming soon.

I've got a twitter home as well, but twitter is like a light snack and blogging is like a full meal.

Thursday, December 25, 2008

Negative Binomial Coefficient

While reading through a book on probability and calculating the expectation of geometric series, I came across an interesting sum
We know that if then the sum converges to


Coming from the other side and using binomial theorem we getwhich expands to



Which leads to an interesting conclusion



I got maxima to verify this by calling the binomial function for various combinations of -1 and n. I am a little confused about the interpretation of the meaning though

Usually nC2 is used to imply from "n" objects, choose 2 at a time. nC2 gives us the number of total such combinations. What does -1Cn mean? What are the other proofs for -1Cn?

Saturday, December 20, 2008

MUST READ: The Last Lecture


I first heard of the book when I was traveling to a conference with a colleague who wanted to read the book, but wanted to find the best place to buy it. He briefly mentioned what the book was about, which I quickly forgot. I saw it again at several places, until I finally bought it from Strand bookshop in Bangalore. The most famous quote from the book is

“We cannot change the cards we are dealt, just how we play the hand.”
--Randy Pausch


This is one of the few books that I've had several people in my family read partially and love it (they are waiting to finish the full book). The book is about childhood dreams, how to achieve them and also goes a step further and talks about how to help others achieve their dreams.

The book is spectacularly well written, when you begin feel sad for Randy (the Author), there is a twist that will make you feel proud of the way Randy handled himself. The book is about positivity, about never giving up, about believing in humanity, in being true, about family values, about the good in the world, with sometimes what cannot be controlled and must be accepted.

Don't pick this book up as a pity book for Randy, you'll be left pitying yourself after reading everything that Randy did and how he lived his life, leaving us pondering if we've made the best use of our time. Randy focuses on family values, his students, his mentors, his family and there is not a single negative sentiment that he passes on to the readers.

If you are feeling depressed or need something good and small to read, something to boost your moral, to rebuild faith, to appreciate life and the people around you, you must read "The Last Lecture"

Friday, December 19, 2008

Dhoni's belief in Dravid

I like Dhoni's attitude, he said two important things

  1. Demoting him will put pressure on him, since 3 or 4 wickets would have fallen when he comes in
  2. He is a good player, who needs some time in the middle

That is again a sign of good captaincy. Dravid, wake up, shake up, cricket calls!

Tuesday, December 16, 2008

FOSS.IN (part 2)

In continuation from FOSS.IN (part I)


Photo by Sony Phil

The first keynote was from Harald Welte. The keynote was about embedded devices, manufacturers and proprietary Linux trees and their complete ignorance or lack of enthusiasm to contribute upstream. The presentation had information about how vendors were still using old obsolete Linux trees, which had several security flaws and the fixes were not being provided to users. The last keynote was from Kalyan Verma. Unlike the first keynote that lacked a single illustration, this one was full of award winning pictures, FOSS principles applied to other professions and life and also about the environment. How a cup of tea is playing its part in hurting the environment and the stress that we as humans and our requirements is putting on nature. Kalyan also spoke about his previous job as a security expert at Yahoo. He spoke about how cryptography makes no sense and there were obvious security flaws in most implementations. I disagree with Kalyan on some of the things he said about cryptography (like it makes no sense). I think what Kalyan was alluding to, but failed to say was that, security is only as good as the weakest link (a fact known to almost all programmers by now).

Kalyan mentioned that putting up his photographs under creative commons has gone a long way in helping his career. Since the pictures were free to download, they were shared under creative commons, which lead to newer opportunities and work. He went on to say, Pictures are a remarkable form of art. The more you look at them, the more you admire them, which is why sharing his pictures brought in more work and money.

Do check his photographs, they are really cool! James has a good coverage of his keynote as well.

The FOSS.IN team put out a video documentary covering their aspiration for their event and what was achieved. I'd say with FOSS.IN 2008, we've headed in the right direction, probably lost a few people along the way, but we are headed in the right direction. A technical event such as FOSS.IN should focus on contributions and try to encourage and build the mind share for it. Such a direction requires time and patience and also a lot of will power from both attendees and the organizers. We had a drastic change in sponsors this year, but we had them nevertheless, without whom such a large scale operation is hard to carry out.

The food, lunch and snacks were excellent, again James covered it well with photographs and other photographs marked foss.in on flickr. Here are some more memories from FOSS.IN 2008



Photo by Sony Phil


Photo by James Morris


From mdemon


From Sony Phil, photograph from the libcgroup workout

Sunday, December 07, 2008

Lagrange's interpretation in python

I've been reading up on Fast Fourier Transform (FFT) from several books on algorithms that I have, TCLR, Tamassia, Sahni, Numerical Recipes, a big set of DSP books. Several of these books focus on interpolation before touching upon the subject of FFT. My favourite book so far for numerical algorithms is R.W. Hamming's Numerical Methods for Scientists and Engineers, Second Edition, Dover publication. Chapter 14, touches upon this topic. I love his explanation and illustration of interpolation versus extrapolation. Thinking along that subject, I decided to do some implementation of my own for interpolation. Sahni (Computer algorithms in C++) has an understandable implementation of the algorithm. The biggest drawback was implementing my own polynomial class. This is where, I think Python scores. I found that SciPy implements a polynomial class.

Here is the code for interpolation

def lagrange(x):
tmp = scipy.poly1d([0])
result=scipy.poly1d([0])

for i in x.keys():
numerator=scipy.poly1d([1])
denom = 1.0
for j in x.keys():
if (i != j):
tmp = scipy.poly1d([1,-j])
numerator = numerator * tmp
denom = denom * (i - j)
tmp = (numerator/denom) * x.get(i)
result = result + tmp

return result

input = {0:5, 1:10, 2:21}
print lagrange(input)
NOTE: Blogger keeps messing up my indentation, I am yet to figure out why.

Sahni's input for the example is {0:1, 1:10, 2:21} and I was surprised to see my program return a different output. Fixing the input, showed the correct results. That reminds me, somebody please ask Sahni to start maintaining useful errata for his books. I searched on the web and found nothing useful.

Running the same algorithm on y = log(x) and input = {1:0, 2:0.3010, 3:0.4771, 4:0.6021}, gave me 00.0123 x^3 - 0.1362 x^2 + 0.6236 x - 0.4997, which corresponds to the cubical approximation of log x (R W Hamming, page 233).

Friday, December 05, 2008

FOSS.IN 2008 Report (Part I)

FOSS.IN was an event I usually attended, last year I co-presented and this year presented and held a workshop at. I've been meaning to display promotional content on my blog



But... I could not :(

Anyway, the story is not over, even though foss.in for 2008 is. The promos show clearly what the organizers had in mind. I must admit that the organizers make me nervous with the schedule, with selected talks being announced about three weeks before the final event, when I was on vacation. The schedule and slides can be found here. I presented on control groups and organized a workout for libcgroup. Both were well received with significant queries at the end of the talk and good workout participation. We got several patches posted during the workout and after. The workout plan and updates are here.

One of the things we did well this year, was the kernel hacker day at foss.in and followed it up with a successful workout. We had a good number of people come and talk to us about the kernel, their intention to contribute and the issues they face. We admittedly had a plan 9 fan, apart from Christoph Hellwig. There were lightening talks and I spoke about my ideas on building a threaded RB tree for Linux.



Kernel Hacker Gathering (Photo by James Morris as seen on flickr)

There are some fun photos, that several people took. Kushal from Fedora took some very nice ones. He was kind enough to photograph all women and leave me out. Needless to say Kushal, you owe me a T-shirt and I want it now! James Morris, did a good job of taking photographs as well.


(Photo by James Morris as seen on flickr)

(Photo by James Morris as seen on flickr)

One thing that did catch my attention was my T-Shirt with my name on it. I love the T-Shirt and hope it stops choking me, when I wear it, someday :)



Speaker T-Shirts (Thanks, well done guys!!)









I was caught working, I could show the code if needed!

You can find James' photo set here.

Lets step back, the event began with a video from team FOSS.IN




Atul has always been a good speaker, he began by explaining the motivation for the change this year and ate an Apple on the stage, claiming that it was only low hanging fruit in the conference and he ate it :) Unfortunately for Atul, we provided other low hanging fruits to developers and allowed people to contribute, even if the contribution was trivial. In the longer run, as foss.in proceeds year and year, I think we'll find the low hanging fruits disappear as the developers mature and our contributions mature.

I'll update on the keynotes, the other speakers and more interesting stuff in part II, stay tuned.

Tuesday, November 18, 2008

Having a bad day?

Have you ever had a feeling of a bad day. Days that you wish would either bring some good news or just end or if possible never started. We'll such days are definitely hidden in every month, every year and in our life. Believe it or not, one will strike it when you least expect it. One needs to learn to get through such days and even fight day. Fight back a day? Yes, it is possible

  1. Be nice and assertive to the most annoying people around you
  2. Don't show on your face that you are annoyed, wear a smile
  3. Remember bad days can end quickly if you are positive and will last for ever if your attitude is negative
  4. Learn from your bad days, analyze to see what you could have done differently to make them end faster
  5. Help others around you have a good day, even if you are having a bad day (of course not at your own cost)

Fight back and take bad days away from your life. Remember life is too short to have bad days in them.

Friday, November 07, 2008

Bank of San Serriffe (with branches in Blefuscu and Elbonia on the planet Pincus)

Knuth has decided to stop sending personal checks, due to his discovery of a financial fiasco. I've have one hexadecimal dollar in the bank. The list of all people who have money in the bank can be found here.

Thursday, November 06, 2008

Time out, take a break, Dravid!

(Photo from http://content-usa.cricinfo.com/indvaus2008/content/current/player/28114.html)

Dravid's dismal form continues in test cricket. He is already out of the one-day squad. When Dravid resigned as captain, he did so to focus on his batting. Unfortunately, Royal Challengers did not work for him (despite his good innings towards the end, when the challenge was already over). His test cricket form has also gone bad. I think it is time to hand Dravid the Ganguly treatment. Drop him from the squad and get him to make a comeback. This is the same thing he and Chappel did to Ganguly and it seemed to work well. I don't want to rule out Dravid for the future, but he seems to be holding up a place that he needs to deserve again. He has a lot of cricket left in him. Seeing his mates Ganguly and Anil must make him nervous, but he should look at Tendulkar for inspiration.

The best way to get back to form is to play domestic cricket and make a good comeback. I hope Dravid will realize that a break is in his favour and the selectors will hand him one.

Saturday, October 11, 2008

The world economy, history and more

Looking through the great depression in the stock market reminds me of the 2001-2002 days, when the web commerce bubble burst and a recession was on our hands. Are we looking at a recession, we'll from my point of view and many others we are already in it; in fact we are in a worse state. I usually don't talk about the economy, but this time I am very worried

1. Look at India's IIP numbers
2. There is a liquidity crunch (banks are not even lending to each other)
3. Unlike last time, we are in a state where need a huge financial bail out

My brother sent an interesting SMS, which read something like

If my bank returns my cheque quoting "Lack of Funds" as the reason. I won't know if the funds were lacking in my account or in the bank

I do believe in the principle that "Money is hardly ever destroyed", why do I say that?

  1. Wealth is usually created, as we find new resources, work harder, make new products or provide new services
  2. In general money passes hands and is never destroyed
  3. Wealth is sometimes destroyed, when we are hit by natural disasters that cause a loss in property, for example
Assuming that my principle holds, in the sub-prime crisis who made money? Where did the money change hands? Did the rich get richer and the poor get poorer? Did we boost our living standard to a higher standard than should have been?

In retrospective from the 2001 recession, web based commerce emerged back stronger and better. The technology, the pricing and the users matured (there were no more freebies for just signing up, BTW, I missed out on all of those :( ). What can expect to see as we come out of this recession? Will banks and insurance, investment companies be smarter? Will there be new regulations to make sure we don't hit such a crisis again?

Looking at the stock market, this is the third slump I've seen and been bitten by, the other two were

  1. Harshad Mehta's stock scam (I was very small/young then, but I understood what was going on)
  2. 2001 recession
History has taught me to be optimistic and know that we will come out of the bad times, the only thing to do is be patient, be positive and know that these things take a long time to recover, but they eventually do (or else we are doomed anyway, so what choice do I have, but to be optimistic :) ). Such times, test survival and like nature will choose the fittest to survive and learn from the mistakes of those who didn't survive the recession.

It is a cycle and we've hit the negative part of the cycle, the positives should be around somewhere, I hope we turn around quickly. Let's hope and pray that we quickly recover back from this situation and become stronger.

Tuesday, September 23, 2008

kernel summit 2008 photo on LWN.net

For those who have not seen it yet, it is at http://lwn.net/images/conf/lpc-ks-2008/ks-group.jpg

A thumbnail from LWN.net is included below. There were other photographers hired by Linux Foundation, waiting for them to post their photos and compare :)




Saturday, September 06, 2008

Why I have not blogged in a while

Work and family life have kept me occupied. I just returned from OLS in July and I am currently at the airport lounge waiting to board my flight to Portland to attend the Kernel Summit. After the kernel summit, I go on to attend Plumbers Conference. I expect both events to be very exciting and it is a great opportunity for me to catch up with old friends around Portland.

I am not carrying a camera this time around, I intend to buy a good cheap camera, that can obsolete itself without making me worry about spending too much money on it. Conferences are usually a great time to get a lot of work done, lets see what this trip does to my productivity :)

Monday, July 14, 2008

Quote of the day

"Genius may have its limitations, but stupidity is not thus handicapped"
Elbert Hubbard

Tuesday, May 27, 2008

Fedora 9 and packaging

I ran into a weird issue with Fedora 9 today. Just before leaving home, I shut my laptop lid and headed out. In my auto rickshaw on Bangalore roads, I found my bag heating up. To my surprise, I found that the laptop failed to suspend. When I tried again, I saw a popup that said

Hibernate request refused, the package manager prevented the hibernate operation since it was in the middle on an uninterruptible operation or something similar. I had to manually kill all the packagekit processes and yum before I got the laptop to resume.

I should start filing the BUGS I find into bugzilla soon.

Friday, May 16, 2008

Upgraded to Fedora 9

I eventually took the plunge, upgraded to Fedora 9, the day it was released. What makes my desktop very interesting is that I have an "Nvidia" video card. I upgraded from Fedora Core 8 to Fedora 9. Notice the word core is gone in 9, that's because the core and extras repositories were merged in this release.

I often ask myself, why did I upgrade so quickly - as an after thought. The answer is that I like to try new stuff, I am excited by change, new features, the possibility of getting something better quickly. I think that's the open source philosophy as well "Release early, Release often"

The new features do come at a cost though. I had to spend a few hours trying to bring up my X. Nvidia is not supported as an in kernel driver, there is a proprietary driver for it. Here's what I tried

  1. I used the VESA driver, but I was not happy about the missing graphics acceleration and open GL support
  2. I tried the nvdia driver from livna, but that had other problems - including complaints about ABI not matching. I tried the trick of starting X with -ignoreABI and setting the option in xorg.conf
  3. I wanted to try the driver directly from nvidia, but the kernel compile failed. I got patches from nvidia for 2.6.25 and ran into the same ABI issue. Ignoring ABI was not an option, since the shared library module for the nvidia driver uses a symbol that is now missing with the new X that comes bundled with Fedora 9
Disappointed, I went back to step 1 and I'll wait for the solution to come by or take a shot at a good solution myself. Downgrading X is not a good option, so I am going to hold on to that thought.

While configuring the X server, I remembered my first X install (Slackware, around 1999 or 2000). It came with a utility called xf86config, that asked a set of questions and generated a XFree86 configuration file, with a warning that getting the vertical and horizontal frequencies incorrect could fry the video card. Life is much better with Fedora 9, but not all that easy.

Although, I am beginning to like Fedora better than Ubuntu, Fedora's GUI package management sucks. Yumex is the closest thing it has for sane package management, the gnome based pirut, pacakgeit, etc all leave a user wondering what is going on in the background. I would highly recommend installing yumex and using it as the package manager

Fedora 9 comes with a bunch of kernel features - cgroups, cpu controller, cpu accounting controller and the namespace controller. I had a hand in some of these controllers, but unfortunately the memory controller has been disabled.

Fedora 9 comes bundled with FireFox 3 beta 5 (same as Ubuntu Hardy), FireFox 3 seems pretty cool in terms of user friendliness and stability. Downloading updates can be quite painful, unless you happen to know a very good and fast mirror. Most of the times I've tried to download updates, I get an error stating that the mirror is down or "no such file or directory" or "too many users". I guess that is expected since the whole Linux world is trying to get their hands on Fedora 9.

I found printing to be friendlier and more intuitive. I got errors correctly, stating that my printer was running low on ink or there was a paper jam. The print UI seemed quite robust and stable.

I tried KDE4, only to be a little disappointed. KDE4 on Fedora 9 is definitely much better than it is on kubuntu. Settings are well integrated and one has control over KDE4, unlike kubuntu where the controls are still for KDE3. The reason, I was disppointed with KDE was the interactiveness and latency in terms of response. The new UI is flashy, but most of my widgets failed to work (the comic widget and the dictionary widget, for example). The rendering of gtk based applications is quite poor. Most GUI on Linux seems to use the gtk widget library and some use Qt4. Firefox, eclipse, emacs, etc do not look very nice under KDE. These are still early days for KDE4, I hope it will mature soon into something I would want to use.

OpenOffice 2.4 was pleasantly surprising. As always, they seemed to have improved integration with documents and the generated pdf's look really nice. Usability is much nicer and so is the rendering and interactiveness. I would like to give them a thumbs up for this release. The major difference I saw with respect to Ubuntu's Hardy release was that there was no Sun Logo embedded in the splash screen of OpenOffice. I need to see why Hardy has the Sun Logo embedded.

I am glad to see (this was some time back as well) that Adobe and Google now have Fedora yum repositories, which is a very good sign. I wish nvidia would provide similar repositories.

I've just started using Fedora 9, I'll blog more on it, as I experiment and play with it.

Sunday, April 27, 2008

Knuth's recent interview

Andrew Binstock recently interviewed Knuth. I would highly recommend reading the interview. It was really sad to find out that Knuth has been diagnosed with Prostate Cancer, but here are some my favourite quotations from the interview

"The success of open source code is perhaps the only thing in the computer field that hasn’t surprised me during the past several decades. But it still hasn’t reached its full potential; I believe that open-source programs will begin to be completely dominant as the economy moves more and more from products towards services, and as more and more volunteers arise to improve the code

For example, open-source code can produce thousands of binaries, tuned perfectly to the configurations of individual users, whereas commercial software usually will exist in only a few versions. A generic binary executable file must include things like inefficient "sync" instructions that are totally inappropriate for many installations; such wastage goes away when the source code is highly configurable. This should be a huge win for open source.

Yet I think that a few programs, such as Adobe Photoshop, will always be superior to competitors like the Gimp—for some reason, I really don’t know why! I’m quite willing to pay good money for really good software, if I believe that it has been produced by the best programmers."

"I might as well flame a bit about my personal unhappiness with the current trend toward multicore architecture. To me, it looks more or less like the hardware designers have run out of ideas, and that they’re trying to pass the blame for the future demise of Moore’s Law to the software writers by giving us machines that work faster only on a few key benchmarks! I won’t be surprised at all if the whole multithreading idea turns out to be a flop, worse than the "Titanium" approach that was supposed to be so terrific—until it turned out that the wished-for compilers were basically impossible to write."

"The machine I use today has dual processors. I get to use them both only when I’m running two independent jobs at the same time; that’s nice, but it happens only a few minutes every week. If I had four processors, or eight, or more, I still wouldn’t be any better off, considering the kind of work I do—even though I’m using my computer almost every day during most of the day.

So why should I be so happy about the future that hardware vendors promise? They think a magic bullet will come along to make multicores speed up my kind of work; I think it’s a pipe dream. (No—that’s the wrong metaphor! "Pipelines" actually work for me, but threads don’t. Maybe the word I want is "bubble.") From the opposite point of view, I do grant that web browsing probably will get better with multicores"

"On a positive note, I’ve been pleased to discover that the conventions of CWEB are already standard equipment within preinstalled software such as Makefiles, when I get off-the-shelf Linux these days."

"I currently use Ubuntu Linux, on a standalone laptop—it has no Internet connection. I occasionally carry flash memory drives between this machine and the Macs that I use for network surfing and graphics; but I trust my family jewels only to Linux. Incidentally, with Linux I much prefer the keyboard focus that I can get with classic FVWM to the GNOME and KDE environments that other people seem to like better. To each his own."

"let me just say that almost everything I’ve ever heard associated with the term "extreme programming" sounds like exactly the wrong way to go...with one exception. The exception is the idea of working in teams and reading each other’s code. That idea is crucial, and it might even mask out all the terrible aspects of extreme programming that alarm me."

"I also must confess to a strong bias against the fashion for reusable code. To me, "re-editable code" is much, much better than an untouchable black box or toolkit. I could go on and on about this. If you’re totally convinced that reusable code is wonderful, I probably won’t be able to sway you anyway, but you’ll never convince me that reusable code isn’t mostly a menace."

Saturday, April 12, 2008

Atomic access

I was involved in a set of emails exchanged about per CPU data and atomic access. The argument was basically this

"If you access 64 bit data on a 32 bit machine, what part of the access is atomic?". One would assume that with per-CPU data, it is safe to read the data from a different CPU". The answer lies hidden in the processor architecture. Several RISC architectures require certain types of data to be aligned to specific boundaries (this in turn ensures that the access is atomic). Usually processor manuals suggest that data that is contained within a single cache line is likely to be fetched atomically. Ideally, it is recommended that the data be aligned to the boundary of it's size, so that access is atomic. To explain that further

16 bit data be aligned to a 16 bit boundary
32 bit data be aligned to a 32 bit boundary
64 bit data be aligned to a 64 bit boundary

So the next time you think of atomic access, data sizes, per CPU data, look at your processor manual and determine if the data needs to be protected when accessed from a different CPU.

Wednesday, April 02, 2008

RSS feed is fixed

The RSS feed has been changed to export full content instead of the earlier partial content. The blog should be easier and more fun to read with an RSS reader now.

Feeling left out of the software world

It seems to me that there is a hard barrier between the software development world and the systems programming world. I feel left out of the developments in software that have taken the world over. Agile/Lean programming, EJB, J2EE, .NET, .NET Remoting, JSP, JSTL, Web containers, EJB, MVC, Spring, OpenID, SSO, Indigo, WCF, WPF, Aspect Oriented Programming, Web services, CSS, XML, XSLT, XQuery, ADO, LINQ, AJAX, RSS, RDF, etc. are keywords I hear everyday from my other friends everyday and wonder where I've been while the world has been changing so dramatically?

In retrospect, I've been working on concepts that were quite well understood in the 60's and 70's - Virtualization, Resource Management, Processes, Threads, etc. Concurrency is very interesting, specially due to multi-core now being ubiquitous. My TODO list looks very dull - Python, Algorithms, Architecture of so and so processor, etc.

It seems like there is a hard barrier that prevents people stuck in systems from working in the layer above. I feel left and cut-out from the innovation in the application space. While, I am still finishing up on the basic design patterns, the world has already moved on to domain specific patterns. I do feel lost, but there is hope. Hope that someday, I'll take a look on the other side, where the grass seems greener; jump the fence; make sense of the new world; the world that seems to be moving at a rapid pace.

Wednesday, March 19, 2008

Doing my time outside of systems programming

I spend a lot of time doing systems programming. As humbly as possible I don't claim to be an expert at it. While there is a lot of learning to be done on the systems side, the applications side also drags me to it. I feel I should do my time with them, it's their fair due that I owe them; to understand them better and to appreciate them.



I've just started reading Web Services Essentials. I finished chapter 1, it seemed quite well written and was easily understandable. Unfortunately, the websites listed in the book are no longer accessible. That is quite understandable given that the book was written in 2002.



The other favourite book these days is "C# Precisely". It's a well written compact book. The book consists of 30 sections and you get the feeling that you are learning C# with the least possible time investment. I look forward to putting Mono through the C# precisely test

There are also some other things on my plate that I hope to finish up quickly. I suspect that going through this exercise will give me more debating power to argue for/against technology with my friends and colleagues and also help me appreciate what lies on the other side.

Saturday, March 15, 2008

Ups and Downs from India's Australian Cricket Tour

An Indian Fan's view of the ups and downs

Up

  1. India did well without their seniors in the ODIs
  2. Tendulkar helped India win two finals
  3. Dhoni led from the front
  4. Harbhajan Singh managed to dodge charges leveled against him without evidence
  5. India let Brag Hogg go, even though he used abusive words against the Indian captain
  6. Bad umpiring was penalized. Steve Bucknor got his well deserved punishment for bad umpiring (long due, he seemed biased against India)
  7. Hayden was reprimanded for denigrating an Indian player
  8. Australian public criticized the spirit of the Australian Cricket team for unfair play

Down

  1. Adam Gilchrist, a well respected cricketer retired
  2. Michael Clarke got away, even though he tackled Tendulkar in the finals
  3. Symonds seemed out of form
  4. Ricky Ponting seemed out of form
  5. Australian players got away by claiming catches that they really failed to hold on to
  6. Australian media for looking foolish after every charge they leveled against the Indian team players were waved off

Thursday, February 14, 2008

Linux 2.6.25-rc1 (new features)

I am extremely glad to see 2.6.25-rc1, specially due to some of the new features that I've added.

A list of features is mentioned in the LWN article about the merge window for 2.6.25-rc1. This includes the memory controller (now called memory resource controller). Check out http://lwn.net/Articles/268937/ as well. We also got fake NUMA nodes for PowerPC and many other small fixes.

I have a new favorite website for git changelogs http://tree.celinuxforum.org/gitstat/index.php

Check out some of the cool graphs from that website

Sunday, February 03, 2008

Bhaskara's proof of the pythagoras's theorem


Bhaskara's Proof

Bhaskara's proof (1114 AD) of the theorem follows from the figure




So simple, elegant and beautiful. I wish I was aware of this proof as a student

Wednesday, January 09, 2008

Favourite Quote for the Day

Loosely speaking we can think of automata, grammar and computability as the study of what can be done by computers in principle, while complexity addresses what can be done in practice.
Peter Linz

Monday, January 07, 2008

Crazy mathematics

As I was shifting my books from one location to another, I found a big heap of books, I had not even started reading or looked at in detail. Being me, I got distracted by them and decided to at-least give them a chance to fulfill their destiny (to be read cover to cover by their owners or the friends of the owners).

I started with Tom Apostol's Mathematical Analysis. It is a wonderfully terse book and I found myself struggling by the time I reached the topic on "Point Set Topology". I had been through a quick journey of the past - real and complex numbers, sets and cardinality, prime numbers and many more things.

I also ran into the famous Cauchy-Schwarz inequality. I remember having proved the inequality in the exercise of Don Knuth's Art of computer programming volume I, but by now I had forgotten it all -- the sum manipulation, the whole of chapter 1 as hiding somewhere in my memory and seeking it was a hard/impossible task. This time, I found myself taking the help of a symbolic computation package - maxima. My dialog was as follows

(%i2) expand((a1^2 + a2^2)*(b1^2 + b2^2));
(%o2) a2^2*b2^2+a1^2*b2^2+a2^2*b1^2+a1^2*b1^2
(%i4) expand((a1b1 + a2b2)^2);
(%o4) a2b2^2+2*a1b1*a2b2+a1b1^2

(%i31) (a1^2 + a2^2)*(b1^2 + b2^2) - ((a1b1 + a2b2)^2);
(%o31) (a2^2+a1^2)*(b2^2+b1^2)-(a2b2+a1b1)^2
(%i32) expand(%);
(%o32) a2^2*b2^2+a1^2*b2^2+a2^2*b1^2+a1^2*b1^2-a2b2^2-2*a1b1*a2b2-a1b1^2

To cut the long output short, I ended up with Lagrange's inequality.

This is just a small part of the mathematics I have to (re)learn, there is also graph theory, game theory, probability theory, Markov chains and theory of computation.

All the mathematics is very exciting, but time consuming. I have loads of other information to read and digest. Let's see where all this I need to learn this crazy math attitude takes me.

Tuesday, January 01, 2008

Have a fantastic new year 2008

It's that time again, a year has gone by, brought happiness and sad moments, but it's gone! Remember to change the year in your dates, make new year resolutions, start afresh, be more positive, thankful and happy that we have a new chance to do/make things right.

HAVE A GREAT NEW YEAR and make every day count

Saturday, December 29, 2007

Rusting Knowledge

Over a period of time, it seems like a layer of dust covers your deep understanding and knowledge of a subject matter, where in once I was considered an expert. My knowledge is rusting and it's time to re-read some old classics and books I used to learn the subject matter from.

I've been trying to learn C#, Python, etc, but I realize that I need to revisit my C skills and my C99 knowledge base again. In summary, knowledge rusts over a period of time, specially the items not practiced very often.

Get ready to clear away the dust from your rusting areas as well, as I explore well known areas and newer areas with a "I used to know, but forgot" perspective.

Monday, December 24, 2007

Digging out of history (longjmp is bad)

I had this program written out a long time back, it shows why some constructs are valid, but do not apply well today. In the evolution of C++, we've left behind some holes


 1 #include <stdio.h>
 2 #include <setjmp.h>
 3 #include <string.h>
 4
 5 class C {
 6 private:
 7         char *ptr;
 8 public:
 9         C (const char *name) {
10                 ptr = new char[strlen(name)+1];
11                 printf("constructed C\n");
12         }
13
14         ~C () {
15                 delete [] ptr;
16                 printf("destroyed C\n");
17         }
18 };
19
20 void funfunction(jmp_buf env)
21 {
22         C c("Hello");
23         /*
24          * Do something, at the end expect destructor to be
25          * called
26          */
27         longjmp(env, 1);
28 }
29
30 int main(void)
31 {
32         jmp_buf env;
33         int ret;
34
35         ret = setjmp(env);
36         if (ret) {
37                 printf("Looks like we jumped a long way\n");
38                 return ret;
39         }
40
41         funfunction(env);
42         return 0;
43 }


See if you can find the obvious problem with this code

Saturday, December 22, 2007

Sounds in my life

The gentle and shrill sounds in my everyday life, call my attention to them. In earlier days, the only sound that one would hear is of people talking to them, children playing on the street or a baby calling for Mama's attention.

Compare and contrast that with what we hear today; the sound of the TV, the microwave, radio, music player, sound of vehicles zooming on the street, vehicles blowing horns, the telephone, the cell phone trying to tell you someone wants to talk to you (even when you are in the restroom), this someone could be a pre-recorded sales call; the computer buzzing to tell you that someone is trying to reach you through instant chat, the courier person ringing the doorbell, the alarm-clock ringing on my cell phone

How am I supposed to listen to myself and others around me; with these distracting sounds calling for my attention. We have moved into a new era, where we need more sounds to tell us, that we are needed elsewhere. I need to filter these sounds, so that I can hear my heart-beat, the pin-drop and my those around me giggle and laugh.

Thursday, November 22, 2007

Guess what OS Don Knuth runs?

Check out http://www-cs-faculty.stanford.edu/~knuth/news.html

In the section "Wanted: A Name For High-Tech Grief" Knuth states and I quote

"I myself have often cried out for help to colleagues who have generously made house calls, in order to unwedge my highly customized Linux system"

We've known it for a while, looking at the customized fvwm2 configuration on Knuth's website, but it's good to see it in writing.

Some of you must be thinking, he has problems with Linux? We'll look at the keywords -- highly customized. Can't do that with other operating systems without hitting yourself in the head a few times or hitting your head against something. You don't hit yourself because your stupid, you do, because you brought the product :-)

Hmmm.... Now, if we can get everyone who has directly or in-directly been benefited from Knuth's work to run Linux, that would be a wonderful starting place. Of-course regular users are more than welcome to adopt and customize Linux.

Linux is a Trademark of Linus Torvalds

Tuesday, November 06, 2007

FOSS.IN delegate registration is open



Register at http://foss.in/2007/register/delegates/

The fee structure has changed this year. Do read the details before registering. This year we have project days and the main conference

Saturday, November 03, 2007

Talk at VTU

I gave a talk on Introduction to Operating Systems via EDUSAT. The lecture was broadcast to several universities via satellite. I had no live audience, but it was fun to speak into a camera. The video has been stored/archived for students to see later.
Here's a link to the slides

New Code in the Linux Kernel

I got some new code included into the mainline linux 2.6.24-rc1 kernel

cgroupstats - Is an infrastructure to allow sending control group statistics to user space using taskstats/genetlink
cpu_acct - CPU accounting subsystem for control groups

Worked on some other miscellaneous stuff as well. Overall, 2.6.24 was an interesting merge cycle, lots of new stuff went it. Check it out! Please do report regressions

A Quick Estimate

I was trying to estimate how long it would take for a timer, measured in nano-seconds using 64 bits would take to roll over. Here's my quick estimate

It would take 2^64/10^9 seconds = 2^64/2^9*5^9

Approximating on all calculations

= 2^55/5^9

5^3 = 125 ~= 2^7
5^9 = 2^21

= 2^55/2^21

= 2^34 seconds

2^34 seconds = 2^34/86500 days ~= 2^34/80*2^10 = 2^24/2^6 days = 2^18 days

1 year = 365 days, 3 years ~= 2^10 days

That leaves us with 2^8 years * 3 years

= 256*3 years before the timer overflows

With a machine, usually one would expect at-least one reboot in 800 years, if so, we would be fine for a long time to come.

See I need no calculator :-)

Saturday, October 27, 2007

FOSS.IN list of talks announced

Check out http://foss.in/2007/shortlist.php

The list of talks looks really good and I know a lot of people presenting at FOSS.IN. I am co-presenting on one topic. I'd say this year FOSS.IN is going to rock, so make sure your there.

Monday, October 08, 2007

India vs Australia (quick analysis)

India won the T20 world cup and became champions! The 50-50 games seem to be a different playing ground for the Indian Team. Have you been wondering why India did not fair so well, so far. Here's a quick layman analysis

  1. India have not been batting first, in all the T20 matches we won, we batted first!
  2. The team has changed and so have the rules. Instead of a powerplay for 20 overs with catch in fielders around, T20 has restrictions for just 4 overs. This makes a big difference to players like Sehwag and Gambhir, who I think are more suited to the field being well spread out (survive longer)

Here's some advice for the Indian Team (given that Dhoni reads cricinfo, you never know if he might read this blog as well :-) )

  1. Convert the 50-50 match to a 20-20 match, by keeping wickets in hand till the 30th over
  2. While batting second, get Dhoni in at #3, followed by Yuvraj at #4
  3. Get Dravid to Open the batting while chasing
  4. Tendulkar should come 4/5 down while chasing (when there is a mandatory ball change)
  5. Don't ever get Yuvraj to Bowl :-)
  6. While bowling first, attack aggressively, even if it means that more runs will be conceded

Friday, October 05, 2007

Memory Ordering (Recommended Reading)

I just finished reading this wonderful report on memory ordering. I highly recommend reading it. If you have anything to do with multi-core, multi-processor, parallel programming, you'll find the paper very insightful.

Other good to read papers/articles on memory ordering from Paul Mckenney are
  1. C++ Data-Dependency Ordering. May 2007.
  2. Overview of Linux-Kernel Reference Counting. January 2007.
  3. A simple and efficient memory model for weakly ordered architectures. Makes case for weakly ordered primitives in programming languages. Updated May 2007.

Wednesday, September 26, 2007

Doing the simple things first

I've always been lost trying to understand and do the complex things. I just realized that I miss out on doing and enjoying the simple things in life. Note to self, remember this and change.

Tuesday, September 25, 2007

India are Twenty20 champs




No one expected it, but secretly hoped for it; and it has happened. India are twenty 20 world cup champions. Boy, has this been a good time for sports. For those of you who do indeed know that hockey is our national game, spare a moment for this picture as well


Spare some time and visit http://www.bharatiyahockey.org/ and http://www.indianhockey.com/.

Now shifting back to twenty20, India beat Pakistan twice and the second win won us the cup. Both matches were close, nail biting (warning: watch your hygiene) finishes. Surprisingly, India got extremely lucky and batted first in almost all their encounters which they won. The statistics show a remarkable quality, that has been missing before, this was a true team effort. Everybody chipped in; in the batting department, we had contributions from Gautham Gambhir, Virendra Sehwag, Robin Uttapa, Yuvraj Singh, M. S. Dhoni, Rohit Sharma (who incidentally is yet to be dismissed in this form of the game). Karthik was a weak spot in the team, but boy did he keep well in the game against South Africa. In the bowling department, R. P. Singh, Irfan Pathan, Harbhajan Singh and Sreesanth were the key contributors.

India's fielding has been quite good, thanks to the absence of Saurav Ganguly, V.V.S. Laxman and Munaf Patel.

I am sure Dhoni is thinking मै तो युहीं चाला था बिना जाने मंज़िल मगर लोग आते गये और कारवाँ बंता गया |

Well done, keep up the good work boys!

Friday, September 07, 2007

Kernel Summit Photos - taken by Evgeniy Polyakov


Peter Zijlstra, Ingo Molnar, Venki Pallipadi and Balbir Singh in discussion

More photos will follow, including the group photo. Meanwhile, there are other photos at Evgeniy Polyakov's gallery.

Thursday, September 06, 2007

Kernel summit day 1 updates

Gerrit has some wonderful updates in his blog Linux and Open Source. LWN.net subscribers can read the summit update at 2007 Kernel Summit article right away or wait for a week for it to be available to public.

Friday, August 31, 2007

Off to VM and Kernel Summit

I've been invited to the VM (Virtual Memory) Summit in Cambridge, U.K. I will also be attending the Kernel Summit which is being held along side LinuxConf Europe 2007. Hopefully, I'll have interesting notes and pictures when I am back.

Algorithms dictionary online

http://www.nist.gov/dads/terms.html is a wonderful dictionary of terms and concepts in Algorithms. It's a wonderful dictionary and the references are excellent. I wish they made the content available as a book or a PDF document.

Monday, August 20, 2007

Perl module for taskstats

Way back last year, we developed the taskstats and delay accounting interface for the Linux Kernel. There is now a CPAN module to extract the same information using perl (all our example programs are in C). It's called Linux::Taskstats::Read. It can read the binary dump of taskstats information and interpret it.

Here's the module

I hope to be able to write a python interface for taskstats as well and do it quickly. I am sure someones already done the work.

Friday, August 17, 2007

Celebrating 50 years of IBM Technical Journals

" Since the first publication of the IBM Journal of Research and Development in 1957 and the IBM Systems Journal in 1962, these Journals have provided descriptions and chronicles of many important advances in information technology and related topics ranging from atoms to business solutions. To celebrate the 50th anniversary of the IBM Journals, this report highlights a selection of significant papers published in the Journals, along with brief commentaries. The Journal editors chose papers which were very highly cited in the technical literature, described technologies of historic significance, or provided an important overview of a field"

Get the articles at 50 Years of IBM Technical Journals

Thursday, August 02, 2007

An LWN.net article about my work

LWN is covering my memory controller work this week. The article is subscriber only, but I've managed to get a free link (legally of-course). Please do view the article, the work and consider subscribing to LWN.net

Here's the article Controlling memory use in containers

Thursday, July 12, 2007

This week from the Wikipedia

I've just discovered my favourite Wikipedia page for this week. It's the page on problem solving. Don't wait, go ahead and read it!

I highly recommend glancing through the external links and reading them later at leisure.

Saturday, June 30, 2007

OLS presentation

I just finished my first OLS presentation on Containers: Challenges with Memory Resource Controller and Its Performance

The presentation went well, it's all been recorded. Hopefully the proceedings will show up soon.

Friday, June 22, 2007

Wednesday, June 20, 2007

M.S. Thesis

M.S.Thesis available

I've finished my M.S. Thesis and you can find it here NOTE: The thesis might still have errors and I do not have any immediate plans of fixing the errors. The thesis was typeset using LaTeX. Hopefully, you'll enjoy reading it.

The figures require some fixing, hopefully, I'll redo them in MetaPost later.

Monday, June 18, 2007

MS (Software Systems)

I received my MS degree from BITS Pilani today. Wow! I am now qualified to do more, I feel so energized. As I am writing this blog, I look at the pile of books of my M.S. curriculum and the dissertation report of the final semester. Flashing in front of my eyes are my last minute attempts to read up a whole book in a week, my stupidity in believing that an open book examination can be passed by carrying along enough books.

Anyhow, that is the past and I learnt a lot from it. As I sit here and examine the past, I know that the process of learning never ends, but learning the same thing is rarely fun (a.k.a repeating your mistakes). But as my copy of Don Knuth's The Art of Computer Programming tells me, I'll never learn anything at once, I'll need to learn somethings during the next reading; I realize that I've just completed a small milestone in a long journey.

Thursday, May 24, 2007

TUGboat archives

I recently rediscovered the TUGboat archives

There is a really interesting article in the 2007 archives
"A beginner's guide to METAPOST for creating high-quality graphics", the article points to a metapost previewer at

http://www.tlhiv.org/cgi-bin/MetaPostPreviewer/index.cgi

Any newbie experimenting with MetaPost should use the previewer, it's fun and easy and of-course one need not worry about the installation details.

Part of the inspiration for looking up TUGboat came from Kevin Larson's article on the Technology of Text. The article is well written, but it completely ignores TeX and METAFONT. That reminds me, time for a letter to the editor.

Thursday, April 19, 2007

Blog in Hindi

अब मै हिन्दी मे भी ब्लोग कर सकता हूँ !

If you cannot see this well, check out

Wikipedia Article on Indic Fonts
and
Blogger help for Hindi

Monday, April 16, 2007

Balbir's Blog: It's prediction time!

Balbir's Blog: It's prediction time!

I am so excited and in pain to see prediction 5 of this years prediction come true! I am curious to see how the others will turn out :-)

Saturday, March 24, 2007

Reserving space for my good bye to the Indian Cricket Masters

Dravid, Ganguly, Tendulkar should go now! Dravid and Tendulkar must go for sure and so should Mr Greg C. Let's see how the Indian team responds to this defeat.

Thursday, March 01, 2007

Balbir's log 1st March 2007

  1. Read a very interesting algorithm called the Ford-Johnson method for sorting. I ended up opening Knuth's Volume 3: Sorting and Searching and reading through his quite amazing illustration and explanation of the method.
    • References - Don Knuth, vol 3, 3rd Edition, Page 184
    • Horowitz and Sahni, Fundamentals of Computer Algorithms
  2. Read through the introduction in the Algorithms book by Papadimitriou, et.al. See my post on a fun way to multiply numbers
  3. Played around with the python programming language after a big break

Follow up: A fun way to multiply numbers

Here's python code to multiply numbers as mentioned in the A fun way to multiply numbers blog entry.

NOTE: I am not a python expert, so there could be some obvious bugs in this simple piece of code. As always use at your own risk.


print "Input the first number"
a=input()
print "Input the next number to be multiplied with %d" %a
b=input()
res=0
while a:
if a & 0x1:
res = res + b
a = a >> 1
b = b << 1

print "The result is %d\n" %res

A fun way to multiply numbers



Reading through the algorithms book by Papadimitriou, et. al has been great fun. I learn a great fun way to multiply (apparently known from ancient times). Let's say we intend to multiply 13 and 23, the procedure is quite straight forward. Write down 13 and 23 besides each other
13 23
6 46
3 92
1 184

The first column is divided by two (with rounding) and the second one is multiplied by two


13 23
6 46
3 92
1 184

Strike out the numbers with even numbers in the first column

Now we just add up the numbers in the right column to obtain 299. That's quite easy right? The really cool thing about this approach is that is easy to implement using computers (hint: left shift and right shift multiply and divide the number by 2 (with rounding taken care of))

Balbir's log - 28th Feb 2007

  1. Freshly installed FC6 - 32 bit edition, still in the process of setting it up (another blog entry). I hope to get KVM and UML running
  2. Played around with Linux's Connector interface (kernel <-> user communication)
  3. Read through chapter 5 (partially) of Computer Systems Performance Evaluation and Prediction

privacy

Some of the policy from the app automation refers to https://rclone.org/privacy/ if you are a general blog reader, follow Google's polic...