<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

                <channel>
                  <title>Krishna Bharadwaj's blog</title>
                  <link>http://www.krishnabharadwaj.info</link>
                  <description>semi-geek, programmer, foss enthusiast, artist..</description>
                
                <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/krishnabharadwaj" /><feedburner:info uri="krishnabharadwaj" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
                <title>Solving the performance bottleneck</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/DlzYkz5QNZg/solving-performance-bottleneck</link>
                <description>&lt;p&gt;Often, we come across problems which need better and faster solutions. It may seem like we have tried out everything and we do not have anything else for the given scenario. But some solutions seem to be just amazing, I have come across some of them where these performance bottlenecks have been solved using very simple design.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;1. HTTP reverse proxying&lt;/strong&gt;&lt;/div&gt; 
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; Apache is the most common web server used by many websites. Apache is very good for serving dynamic content, but it has some limitations. As load increases on the server, performance of apache starts going down, whereas some lightweight servers like nginx perform really well for static content. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;An instance of apache thread is tied to a client and it is busy as long as the data transfer between the client and server is going on. This can be problematic if many clients are accessing the site from a slow connection. Slower the connection, more is the time needed to serve the data and free up the thread. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;Client  &lt;-----&gt; Server(Apache) &lt;/div&gt; 
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; On the other hand, nginx uses a single thread to manage all the connections. Like apache, slower connections will not tie up the server. How do we take advantage of this? By placing an instance of nginx between the client and server, we can get some amazing performance boost and this technique is called as reverse proxying&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;Client &lt;-----&gt; Nginx on port 80(Reverse proxy) &lt;-----&gt; Server(Apache on some other port) &lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; Whenever we make a request to the server, Nginx listens to our request on port 80 and forwards it to apache which is listening on another port, which processes the request and returns the http response. Since both Nginx and Apache are running on the same machine, the data transfer is really fast between apache and nginx. Apache processes are released in no time. We are taking the best of the two servers, apache for serving the dynamic content and nginx for static content. More information about reverse proxying can be found &lt;a href="http://markmaunder.com/2009/12/01/how-to-handle-1000s-of-concurrent-users-on-a-360mb-vps/" target="_blank"&gt; Mark Maunders' blog&lt;/a&gt;.  &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;2. Compression in MS SQL Database&lt;/strong&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; When I attended one of the boot camps as a part of Microsoft Student Partner programme, &lt;a href="http://blogs.extremeexperts.com/about/"&gt;Vinod Kumar&lt;/a&gt; spoke about MS SQL server, where he mentioned that data is compressed before saving it on disk and it has resulted in better performance. One may be surprised how doing something extra can speed up operations? It so happens that disk IO is far more time consuming that processor operations. So, transferring of compressed data is reducing a lot of time.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt; Transfer time of Compressed data + Decompression &lt; Transfer time of Uncompressed data &lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;This is analogous to us sending a zipped file to some of our friends via email. Internet speed is a bottle neck and we rely on the processing speed of our computers to compress and decompress the files which result in faster sending and receiving of data.
&lt;br \&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;3. AWS Data transfers&lt;/strong&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; This one was least expected but it truly happens. I attended the Hadoop summit last year and attended a talk by &lt;a href="http://www.brunozzi.com/" target="_blank"&gt;Simone Brunozzi&lt;/a&gt;. where he was talking about how one can perform map reduce on Amazon map reduce platform. During the QnA session, one of the delegates asked the following question:
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;Since map reduce deals with humongous amount of data, to even take advantage of the platform, we have to upload all the data to Amazon servers, which is very troublesome since it may take several weeks to transfer all the data.&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; And this was the answer &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt; You can courier us your hard drives, we will plug them in our high speed data centers and you will have access to your data on our map reduce platform within 2 to 3 days. &lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt; Many were surprised, and some asked. What?! do you really do that?? and the answer was yes. Simone went on to quote an example where tanenbaum was asked to devise a backup solution for storing huge volumes of bank transaction details. Considering the connectivity available at that time, tanenbaum said:&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;"Never underestimate the power of bullock carts carrying hard drives on a highway!"&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;So, before we devise complex solutions, it is important to see if there is something simple and more elegant :-)&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/DlzYkz5QNZg" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/solving-performance-bottleneck</feedburner:origLink></item>
                
                <item>
                <title>MVC in client side javascript using Backbone.js</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/-RRyO3YJ3fM/backbone-js</link>
                <description>&lt;p&gt;As internet applications are getting more rich, designing user interfaces for the same gets complicated. Designing an application like GMail can be very complex since it is feature rich and one action is directly or indirectly related to several sections of the user interface.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;I came across this javascript framework called "backbone.js" few months back, I could not appreciate it much till I wrote an application myself using backbone.js. I wanted to see the benefits of using backbone and I must say I am impressed with it. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;Some background about how websites/applications function:&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;What we see in our browser consists of the following:
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;1. Data&lt;/strong&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;All the information that we are interested in accessing. For example our mails. What we consume at the end of the day is the content of the email and the metadata associated with it, like sender, date and time when it was sent, people who are cc'd etc..&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;2. Display&lt;/strong&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Browser uses a markup language called as HTML to dispaly all the data. HTML controls the layout of a webpage. This can be thought of as a blue print of a building. We know where exactly a room is going to come.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;3. Style&lt;/strong&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;It would be boring to see all the above data without any styles applied, it is these small things which make a user actually choose some services. How many times have we moved away from websites saying, "the UI is really a turn off". If display is our blueprint, styling can be thought of as the work of an Interior decorator who makes buildings beautiful by applying some creativity w.r.t colors, images etc.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;strong&gt;4. Events&lt;/strong&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;In the initial days of interet, there used to be just pages linked between each other using hyperlinks. clicking on one link will take us to another page, along with some forms for entering data and posting it to the site. Nowadays, we are seeing more and more features on the browser which were only possible in desktop applications previously. This opens a whole range of possibilities, for example, facebook lets us view all photos in an album without actually moving away from the page. All these events are handeled by Javascript for us.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;h3 class="oldenburg"&gt;MVC&lt;/h3&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;MVC stands for Model View Controller. It is a design pattern where we separate the data from the way it is defined, manipulated and displayed. One of the main reason why we use this design pattern is to ensure clean and organized code which makes maintaining a software comparatively easy.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="oldenburg"&gt;&lt;h4&gt;MVC on server side&lt;/h4&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;To understand how MVC has helped us organize the code better, lets take a look at this PHP script which reads a bunch of rows from the database and displays it on the screen.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1686782.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;If we notice clearly, this single script does it all, right from opening a connection to the database, to retrieving the records, then rendering the html for the respective records. As our program grows, it becomes extremely difficult for us to manage it, since making a change to some database queries will be on the same file and some minor changes to styling will also go to the same file. We are tying everything together. This way there is a lot of dependency between developers, designers and other stake holders. For a project to progress without bottlenecks like these, it is very important for us to decouple different segments and have a well defined interface for interaction between these blocks. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;This is how we can remodel the design using MVC.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1686842.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;1. models.py file consists of code which deals with data only.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;2. views.py consists of code which is used to fetch the records from the model and render it to the template.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;3. template.html consists of the markup with variables embedded in it. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;There by structuring the code to a great extent. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p class="oldenburg"&gt;&lt;strong&gt;MVC on client side&lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Lets look at this &lt;a href="http://dl.dropbox.com/u/17629670/gmailinterface/inbox.html" target="_blank"&gt;application&lt;/a&gt;:&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;a href="http://dl.dropbox.com/u/17629670/gmailinterface/inbox.html" target="_blank"&gt;
&lt;br \&gt;  &lt;img src="http://dl.dropbox.com/u/17629670/serve/gmail-app.png" alt="GMail like interface using backbone.js"/&gt;
&lt;br \&gt;&lt;/a&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Model - Mail data represented in the &lt;a href="http://dl.dropbox.com/u/17629670/gmailinterface/data.js" target="_blank"&gt; data.js &lt;/a&gt; file.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;View - the html display of each of the mail and the side menu.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Some advantages of using MVC design on the client side:&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p class="oldenburg"&gt;&lt;strong&gt;1. Streamlined Event handling&lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;All our operations are on the models, we manipulate the data directly and we add hooks such that, whenever there is a change in the data, the view automatically renders the html which contains the latest data. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;In this application, the moment we 'star' any mail, the 'star' field in the model gets modified which triggers the callback 'render' method. Similarly, we add hooks to reflect the change in models for the inbox details, like number of unread mails, number of starred mails etc. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p class="oldenburg"&gt;&lt;strong&gt;2. Reduced data transfer&lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;The possibilities are vast when we are delegating some processing to the browser. Lets take this example. We have a table which consists of 10 records and we are interested in sorting the records based on different fields in the table. We can get a sorted table using the SQL Query &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;SELECT * from persons ORDER BY '&amp;lt;somefield&amp;gt;'" &lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;but it would mean, more interaction with the server, one more hit to the database, the complexity of sorting the records adds up. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;We know that javascript can be used to manipulate data in the browser, we can just use the clients computing power to sort the table. Isn't it reducing a lot of delay for the user (Request -&gt; Database -&gt; Rendering -&gt; Response )? From the infrastructure perspective, we need less processing power on the server side.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Lets take the example of rendering a template on the server:&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1694284.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Length of this template syntax: 258 Characters&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;players = [ {'name': 'A' , 'games' : [10, 20, 30]} , { 'name': 'B', 'games': [30, 50,60] } ]&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;Length of the data: 82 Characters
&lt;br \&gt;
&lt;br \&gt;after rendering the template using the data provided above, we get the following hypertext:
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1694286.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Length of the rendered HTML : 426 characters.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Length(Our initial template + Data) = 258 + 82 = 340 characters!&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;We are including a lot of markup in between the data when we are rendering the template. All the words &amp;lt;li&amp;gt;, &amp;lt;div&amp;gt;, scored, runs, Satistics is adding up to the amount of html which will be sent to the client from server. &lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Is embedding of data in between the html elements something that cannot be done by the browser?? Definitely not, it can be done. and we get a lot of improvement in terms of speed.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p class="oldenburg"&gt;&lt;strong&gt;3. Caching templates&lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;Some websites load amazingly fast, don't they? Like facebook. The header, the side bar and few other segments load in no time, which is followed by all the posts. One great advantage of separating data from markup is caching. We can cache templates, scripts, stylesheets and they can be served from a CDN which will make loading of websites amazingly fast.&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;Looking forward to use backbone.js in some of my future projects. 
&lt;br \&gt;&lt;a href="http://dl.dropbox.com/u/17629670/gmailinterface/inbox.html" target="_blank"&gt;Demo&lt;/a&gt; and &lt;A href="https://github.com/krisys/backbone-gmail-example" target="_blank"&gt;Source&lt;/a&gt;
&lt;br \&gt;&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/-RRyO3YJ3fM" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/backbone-js</feedburner:origLink></item>
                
                <item>
                <title>Porting to Django</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/uyTRW9vj33o/porting-django</link>
                <description>I recently came across a &lt;a href="http://www.djangohire.com/a/jbb/job-details/612877" target="_blank"&gt;job posting&lt;/a&gt; by Kyle of &lt;a href="http://www.justin.tv" target="_blank"&gt;Justin.tv&lt;/a&gt;. In the second line, it read 
&lt;br \&gt;
&lt;br \&gt;"We are porting the justin.tv website from RoR to Django"
&lt;br \&gt;
&lt;br \&gt;what?! That is probably the first time someone is actually porting their application from RoR to Django. at least the first one I am coming across. I really don't know the reason why justin.tv is doing that. But I am happy to know that Django is being taken seriously by a lot of companies which are serving heavy traffic. 
&lt;br \&gt;
&lt;br \&gt;Justin.tv is a YCombinator funded startup and it is doing a fantastic job w.r.t streaming Videos. Some other companies which are serving humongous amount of traffic using Django include Disqus (A commenting framework), Spotify( Music sharing on social networks) etc..
&lt;br \&gt;
&lt;br \&gt;Not just this, an Indian company which is doing great in the recent times, inMobi is porting a bunch of its Java applications to Python. One of the architect there talks about it. I am quoting it from his &lt;a href="http://www.linkedin.com/in/becomingguru" target="_blank"&gt;linkedin profile&lt;/a&gt; :
&lt;br \&gt;
&lt;br \&gt;&lt;div class="note"&gt;Movement into Python from incumbent technology platform - Java, is the company's strategic initiative with foresight to enable better maintainability of software, faster turn around time for new requirements and most of all, to keep developers happy.&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;I would be interested to know if anyone else has migrated to Python/Django recently from other frameworks. and also what made them chose Django over other options available.&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/uyTRW9vj33o" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/porting-django</feedburner:origLink></item>
                
                <item>
                <title>Who implemented strtok?</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/xWtgOp-e34g/who-implemented-strtok</link>
                <description>Recently, I stumbled upon this method "strtok" in C which is used to split a string based on a delimiter. This is how it is used: 
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1367859.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;1. If str is a string, start from the beginning of the new string.
&lt;br \&gt;2. If str is NULL, start from the place where it had left in the last call.
&lt;br \&gt;
&lt;br \&gt;What this implies is, you simply cannot split two strings in parallel. Imagine the following scenario. Two threads executing simultaneously, one of them is splitting the string str1 and another one is splitting the string str2.
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1367941.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;let us consider the following order for execution: 
&lt;br \&gt;
&lt;br \&gt;strtok(str1, ",") // thread 1
&lt;br \&gt;strtok(str2, ",") // thread 2
&lt;br \&gt;
&lt;br \&gt;token = strtok(NULL, delim);  // thread 1
&lt;br \&gt;token = strtok(NULL, delim);  // thread 2
&lt;br \&gt;
&lt;br \&gt;We will get only the first token from str1 since the buffer of strtok is overwritten the moment we call strtok(str2, ",") in the second thread.  What's worse is, strtok alters the input string in order to keep track of the position of the next token. I don't know why this was so horribly designed, anyone? 
&lt;br \&gt;
&lt;br \&gt;&lt;strong&gt;Update:&lt;/strong&gt; Thanks to Vijay and Debarshi for pointing out strtok_r which is thread safe. I wasn't aware of this.. Thanks guys..&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/xWtgOp-e34g" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/who-implemented-strtok</feedburner:origLink></item>
                
                <item>
                <title>Deploying Django with Fabric</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/SUBK8boeS5A/deploying-django-with-fabric</link>
                <description>I have been using &lt;a href="www.djangoproject.com" target="_blank"&gt;Django&lt;/a&gt; for quite sometime now.  Deploying the application on a production server is a lot of effort, right from installing all the required packages, configuring mysql, apache, syncing the application from the repository etc. Doing this the first time may not be irritating but subsequent installations are very frustrating. 
&lt;br \&gt;
&lt;br \&gt;Writing a shell script is something many would think of, but that is old! &lt;a href="http://docs.fabfile.org/en/1.2.2/index.html" target="_blank"&gt;Fabric&lt;/a&gt; lets us write a lot of code in python for automating the boring tasks. I got started with it, as and when I installed the packages on my server , I was compiling the script needed for fabric. Once I was done with the setup, even my fabric script was ready! Ran that on a clean machine by changing the ip, worked like a charm. The best part about fabric is you don't have to leave your machine at all, no ssh.. just $fab command from your shell.
&lt;br \&gt;
&lt;br \&gt;I found this awesome video by &lt;a href="http://jacobian.org/" target="_blank"&gt;Jacob Kaplan Moss&lt;/a&gt;. He starts off with deploying on a single instance, then using a separate instance for database and finally adds a fail over application server. Its pretty long ( 3 hours ) but contains a lot of useful information. Do watch it.
&lt;br \&gt;
&lt;br \&gt;&lt;iframe src="http://blip.tv/play/g4Vigd7wawI.html" width="480" height="350" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#g4Vigd7wawI" style="display:none"&gt;&lt;/embed&gt;
&lt;br \&gt;
&lt;br \&gt;If you use it once, I am pretty sure. you will never look back :-)&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/SUBK8boeS5A" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/deploying-django-with-fabric</feedburner:origLink></item>
                
                <item>
                <title>How to track visitors?</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/hFHgw8dEcUE/how-to-track-visitors</link>
                <description>There is a lot of &lt;a href="http://nikcub.appspot.com/logging-out-of-facebook-is-not-enough" target="_blank"&gt;noise&lt;/a&gt; about companies like facebook, google tracking users across websites. It is critical for them to know more about users and their taste.
&lt;br \&gt;
&lt;br \&gt;It is even more important for startups to track their users. If they learn something is wrong in their workflow. It can be corrected immediately. One such example is, users leaving the site at step number 2 of their registration process. The earlier it is figured out, better it is. since you can save a lot of other people from committing the same mistake. There are several services which let you track users.
&lt;br \&gt;
&lt;br \&gt;I found &lt;a href="http://www.mixpanel.com/" target="_blank"&gt;mixpanel&lt;/a&gt; very good. They believe that tracking webpage is useless and its no longer useful in this world of ajax/single_page applications. They provide us hooks which could be attached with events on our page and the report is beautifully shown in the admin console. Here is a screenshot of one of my application. 
&lt;br \&gt;
&lt;br \&gt;&lt;div align="center"&gt;&lt;img src="http://dl.dropbox.com/u/17629670/mixpanel.png" alt="mixpanel"/&gt; &lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;It assigns random names for Guest visitors and if the user is logged in, we can push users name or some other unique identifier. Tools like &lt;a href="http://www.mixpanel.com/" target="_blank"&gt;mixpanel&lt;/a&gt; is taking analytics to the next level.&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/hFHgw8dEcUE" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/how-to-track-visitors</feedburner:origLink></item>
                
                <item>
                <title>How swype works?</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/TBZd55o2g3U/how-swype-works</link>
                <description>Swype is an awesome software which makes typing in mobile phones using the qwerty keyboard very easy. This is how it looks: 
&lt;br \&gt;
&lt;br \&gt;&lt;div align="center"&gt;&lt;img src="http://dl.dropbox.com/u/17629670/serve/swype.jpg" alt="swype"/&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;I was just thinking how this could be implemented. It boils down to a string sub-sequence problem. The path traced by the user consists of all the characters in a word. This is an ideal situation, but many a times, we do not take care of all the characters in between and miss many of them.
&lt;br \&gt;
&lt;br \&gt;Some of the characteristics i have considered:
&lt;br \&gt;
&lt;br \&gt;&lt;div class="code"&gt;1. Filtering of words based on the first and last character.
&lt;br \&gt;2. Characters which are buried among other characters in the path traversed by the user.
&lt;br \&gt;3. The number of traversals between different rows of the keyboard gives us a fair idea about the length of the word.
&lt;br \&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;We can use a number of such characteristics and increase the chances of suggesting the right word. One such hint i can think of is:
&lt;br \&gt;&lt;div class="code"&gt;Split the words in sets of three characters:
&lt;br \&gt;Lets take the case of the word "English" here. The actual trace may be like "edfgbnbghjkliugfdsdfgh"
&lt;br \&gt;
&lt;br \&gt;Groups like &lt;strong&gt;bnb, bgh, kli, dsd &lt;/strong&gt; strongly suggest that there is a turn which signifies a character which has a higher probability of being present in the word.
&lt;br \&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;I wrote a &lt;a href="https://gist.github.com/1059818" target="_blank"&gt;basic version&lt;/a&gt; of this using python and &lt;a href="http://dl.dropbox.com/u/17629670/serve/wordlist.txt"&gt;this wordlist&lt;/a&gt;. Some basic introduction to some of the functional programming used here is discussed in &lt;a href="http://krishnabharadwaj.info/python-and-projecteuler/" target="_blank"&gt;&lt;strong&gt;this link&lt;/strong&gt;&lt;/a&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;script src="https://gist.github.com/1059818.js"&gt; &lt;/script&gt;
&lt;br \&gt;
&lt;br \&gt;The results for the same were pretty good. 
&lt;br \&gt;&lt;div class="code"&gt;['hello', 'hero', 'ho']
&lt;br \&gt;['quick']
&lt;br \&gt;['wed', 'weird', 'weld', 'wild', 'wold', 'word', 'world', 'would']
&lt;br \&gt;['doctor', 'door', 'dour']
&lt;br \&gt;['architecture']
&lt;br \&gt;['adjure', 'agriculture', 'article', 'astute']
&lt;br \&gt;['music', 'mystic']
&lt;br \&gt;['vocabulary']
&lt;br \&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;The basic version was working within an hour. I must say that the string split method in python is very well thought of. split( delimiter, 1) returns a the string before and after the first match.&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/TBZd55o2g3U" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/how-swype-works</feedburner:origLink></item>
                
                <item>
                <title>Startup(ing) Problems</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/9sD7aSXcvYE/startuping-problems</link>
                <description>Today evening, I was having a chat with one of my friend. We landed on this topic of how side projects help us learn better etc.. and within no time we were talking about how commercialization of the same takes a back seat when we are working for some xyz corporation. Some of the points that we discussed are listed here.
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;
&lt;br \&gt;&amp;rarr; The technically smart guys are always upto something, its difficult for them to sit idle. So they indulge in side projects. Some contribute to open source software, some write software just for the sake of learning. But they have something to show to the world at the end of the day.
&lt;br \&gt;
&lt;br \&gt;&amp;rarr; After significant amount of work and with several iterations, lets say, they have a brilliant product which they think could be helpful to a much larger audience. 
&lt;br \&gt;
&lt;br \&gt;&amp;rarr; If it is a non-commercial application, some companies may not object. But there are several other companies which are quite strict about side projects - &lt;a href="http://answers.onstartups.com/questions/19422/if-im-working-at-a-company-do-they-have-intellectual-property-rights-to-the-stu/20136#20136" target="_blank"&gt; This question on stackexchange talks about it.&lt;/a&gt;
&lt;br \&gt;
&lt;br \&gt;On the contrary some companies encourage employees to work on their area of interest for 20% of their work hours, but the end product belongs to the employer - a good deal if you are not very keen on starting your own company.
&lt;br \&gt;
&lt;br \&gt;&amp;rarr; For someone who is a wannabe entrepreneur, It is very difficult to dive into it full time without having a significant traction with users (customers). But it is difficult to get users without some dedicated effort on your product. This is a chicken and the egg problem. This is where taking risk comes into picture. Hesitation can kill a company even before it is started. 
&lt;br \&gt;
&lt;br \&gt;&amp;rarr; Some superstars resign from their companies to work full time on their ideas. In order to earn their daily living, they end up free lancing. This is not bad, but not everyone will have the guts to resign from their day job.
&lt;br \&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;&lt;strong&gt;&lt;h3&gt; Let's look at how an employer is affected by the same.&lt;/h3&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;&amp;rarr; The vacancy created by the superstar will be filled in by another candidate who may or may not be a superstar. If he is one, the same cycle repeats. But if he is not one, then the employer is at loss. They just lost a very good employee.
&lt;br \&gt;
&lt;br \&gt;&amp;rarr; The new guy takes significant amount of time to ramp up and start contributing to the project. 
&lt;br \&gt;
&lt;br \&gt;&amp;rarr; If the startup founded by our superstar succeeds, great! but what if it fails? he/she spent a lot of time on the idea, sacrificed a well paying job and a lot of other perks. After all this, they start looking for another job!
&lt;br \&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;&lt;strong&gt; &lt;h3&gt;Lets see what amazing things can happen if your employer supports you in the following ways!&lt;/h3&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;&amp;rarr; One can make money from their side projects - provided they are not competing directly/indirectly with employers' product/service.
&lt;br \&gt;&amp;rarr; The company will help you with some of the initial marketing by providing leads, introductions to potential Customers/VCs.
&lt;br \&gt;&amp;rarr; All the company cares for is the timely completion of any office related work.
&lt;br \&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;&lt;strong&gt; &lt;h3&gt;How employee benefits from this?&lt;/h3&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;&lt;p&gt;&amp;rarr; One need not think of resigning from the company.
&lt;br \&gt;&amp;rarr; One need not worry about other sources of money as long as they have a day job. They can continue to work on their side projects and more importantly, be the face of the product/startup.
&lt;br \&gt;&amp;rarr; Provides the opportunity to test the water. Is it really worth jumping into it full time?
&lt;br \&gt;&amp;rarr; Brings in a good bonding between the employee and employer. employee will be happy for all the support he is getting from his employer. Could that increase productivity of the employee? 
&lt;br \&gt;&lt;/p&gt;
&lt;br \&gt;
&lt;br \&gt;Is this something which was tried/tested earlier? and then discarded? How many of you would love to work in such a company? I see this as a win win situation. I would like to know what you think about the same.&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/9sD7aSXcvYE" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/startuping-problems</feedburner:origLink></item>
                
                <item>
                <title>Facebook can hurt you!</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/KSACepQcyAA/facebook-can-hurt-you</link>
                <description>Everytime we see a new feature popping up on Facebook, some xyz company is getting hurt. It is very uncommon these days to see some really unique feature from the main players. They are upto copying a lot of features from other proven products, I am pretty sure you are with me on that. The main advantage with facebook is its HUGE userbase. It makes it very easy for facebook to kill any existing product within no time (provided the implementations are really awesome). 
&lt;br \&gt;
&lt;br \&gt;Facebook lets you list your relatives in your profile, linking of family members was first started by Geni. Not many would have heard of Geni, but I am pretty sure many more users would have listed their relatives on facebook. 
&lt;br \&gt;
&lt;br \&gt;
&lt;br \&gt;Next up, facebook places. Location based social networking is not something new, there are a number of players in this front: foursquare, gowalla, loopt etc. &lt;a href="http://www.dmolsen.com/mobile-in-higher-ed/2011/06/16/more-numbers-foursquare-vs-facebook-places-vs-gowalla-at-wvu/" target="_blank"&gt;Here are some statistics on a small data set&lt;/a&gt;. Its quite clear that facebook is giving a stiff competition to foursquare in-spite of coming late into the market.
&lt;br \&gt;
&lt;br \&gt;
&lt;br \&gt;Another startup which was all over the news &amp;rarr; &lt;a href="http://www.groupon.com"&gt;Groupon&lt;/a&gt; which offered great deals on group buying. Google tried hard to buy groupon, but they couldn't so they ended up building google offers. Similarly facebook started deals.
&lt;br \&gt;
&lt;br \&gt;&lt;div align="center"&gt;&lt;img src="http://dl.dropbox.com/u/17629670/serve/facebook-can-hurt-you.jpg" /&gt;&lt;/div&gt;
&lt;br \&gt;
&lt;br \&gt;Anyone using Facebook mail?!  at least I don't know anyone using it. With all the &lt;a href="http://techcrunch.com/2010/11/11/facebook-gmail-titan/"&gt;hype&lt;/a&gt; given to the facebook mail. I expected it to be great, unfortunately I have never sent out single email from my facebook email id. I just don't feel like using it. GMail is rock solid! Additionally, I feel that employees at facebook lost some exclusivity by giving out the @facebook.com mail id to every tom dick and harry ;).
&lt;br \&gt;
&lt;br \&gt;
&lt;br \&gt;Facebook lets you add your workplace, projects worked on, people you have worked with, the time period and finally the description. This is a whole lot of information and that's pretty much what &lt;a href="http://www.linkedin.com" target="_blank"&gt;LinkedIn&lt;/a&gt; has been doing from the past few years. In a few days, facebook will suggest you jobs, just like how it suggests friends now :)
&lt;br \&gt;
&lt;br \&gt;I wonder how startups will survive when someone as big as facebook enters their territory!&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/KSACepQcyAA" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/facebook-can-hurt-you</feedburner:origLink></item>
                
                <item>
                <title>A great journey at NI comes to an end!</title>
                <link>http://feedproxy.google.com/~r/krishnabharadwaj/~3/4TrpigOLZnY/last-day-at-ni</link>
                <description>Today was my last day at NI. I will miss all the amazing friends i made at NI. The journey at NI was really fun filled. Games on the network, Wii, Football next to our workarea, treks, cycling, marathons and what not! I hope to cross paths with many of them in the future. 
&lt;br \&gt;
&lt;br \&gt;&lt;iframe width="425" height="349" src="http://www.youtube.com/embed/p9YObiSJa-E" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;
&lt;br \&gt;&lt;img src="http://feeds.feedburner.com/~r/krishnabharadwaj/~4/4TrpigOLZnY" height="1" width="1"/&gt;</description>
                <feedburner:origLink>http://www.krishnabharadwaj.info/last-day-at-ni</feedburner:origLink></item>
                
                </channel>
                </rss>

