tag:blogger.com,1999:blog-174829432024-03-13T09:15:45.118+05:30rmathewInane ramblings of a wandering mind.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.comBlogger378125tag:blogger.com,1999:blog-17482943.post-55604463787772328332011-09-05T19:01:00.000+05:302011-09-12T22:20:11.083+05:30MauritiusA couple of holidays declared in the middle of last week afforded one of those rare opportunities where you apply for just three days' leave and end up with a nine-day vacation. We spent most of this vacation on the beautiful island of <a href="http://en.wikipedia.org/wiki/Mauritius">Mauritius</a>. Clean beaches with white sand next to a turquoise-blue sea - what more does one need for a perfect vacation? Nothing much, it turns out.
<br />
<a name='more'></a><br />
We took a 6-nights/7-days tour-package from <a href="http://www.travelguru.com/">TravelGuru</a> for this trip, which included airfare, hotel stay with breakfast and dinner ("half-board"), airport pick-up and drop-off and a basic set of tours. We had to travel via Delhi (at an extra cost) since the direct flights from Bangalore connect with Mauritius during the <i>middle</i> of the week, instead of the weekends, for some weird reason. We stayed at the <a href="http://www.jalsabeach.com/">Jalsa Beach Resort</a>. The tours were organized by <a href="http://www.seasideholidaysltd.com/">Seaside Holidays</a>.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJDgZ6JGZlpytAzZm69s53D9NZ0R9F_DE6fYv9oV6itzpoCbQ1sNb1kSZ2LI_vq4JUDl5hO2CEEMW1AIcWVRUsn_go1ZGrq5wTmWtgZ_AayJWE1nnnLjfSNJdQV-5tqfu5Fmfsjw/s1600/Maur_Jalsa.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJDgZ6JGZlpytAzZm69s53D9NZ0R9F_DE6fYv9oV6itzpoCbQ1sNb1kSZ2LI_vq4JUDl5hO2CEEMW1AIcWVRUsn_go1ZGrq5wTmWtgZ_AayJWE1nnnLjfSNJdQV-5tqfu5Fmfsjw/s400/Maur_Jalsa.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The View From Our Resort</td></tr>
</tbody></table>
The first shocker for us when we landed in Mauritius was to discover that the Indian Rupee sells for quite a bit less than what is indicated by the official exchange-rate of about 1.66 Indian Rupees for every Mauritian Rupee - the best rate we could actually get was 2 Indian Rupees for a Mauritian Rupee. If you carry US dollars or Euros, you can get rates much closer to the official exchange-rate. Fortunately for us, our credit-cards worked pretty much everywhere, so we didn't have to carry around much cash (even with the slightly higher retail exchange-rate and the 3% service-fee, using a credit-card works out to be cheaper than transacting in cash in this case).<br />
<br />
The second, and bigger, shocker for us was to discover how expensive everything was in Mauritius, especially food and drinking water. The rate for a bottle of drinking water was particularly bad at the hotel (75 Mauritian Rupees for a liter of water), so we got a couple of crates of water from a super-market at the first available opportunity. Anoop, one of our drivers, explained it to us once by pointing out that tourism and sugarcane-cultivation were the main sources of income in Mauritius - almost everything else was imported from elsewhere.<br />
<br />
Two things we quickly noticed in Mauritius were the ubiquity of sugarcane-fields and the preponderance of people of Indian descent.<br />
<br />
It seems as if every square-meter of land that is not covered by a building or a road is devoted to cultivating sugarcane. (Oddly enough, they seem to export almost all of it and then <i>import</i> sugar from South Africa, the one thing you would expect them to not have to import. Even odder was that we could find sugarcane juice to drink at only one place, that too at the exorbitant rate of 100 Mauritian Rupees for a small glass of the stuff.)<br />
<br />
Roughly 70-75% of the population seems to be of an Indian origin, descended from the indentured Indian laborers brought over to the country during its occupation by the British.<br />
<br />
The people in the country mostly speak <a href="http://en.wikipedia.org/wiki/Mauritian_Creole">Creole</a> and can converse in a heavily-accented English with you (they can also easily talk in French, if you know the language; one of the reasons why it is so popular with French tourists). All the people we met were almost always very polite and courteous. This was especially visible on the roads (which were mostly very well-maintained, if a little narrow in places).<br />
<br />
The tours included in our package were the North Tour, the South Tour and the Island Tour. Apart from these, we also opted for an Under-sea Walk, a Blue Submarine Dive and a Catamaran Cruise.<br />
<br />
The North Tour comprised visits to places in and around Port Louis, including a big super-market (a surprising stop for a tour, but very useful for buying water, wine, etc.), <a href="http://en.wikipedia.org/wiki/Aapravasi_Ghat">Aapravasi Ghat</a>, Fort Adelaide (La Citadelle), Marie Reine de la Paix and finally the <a href="http://www.caudan.com/">Le Caudan</a> waterfront. Of these, I found only the Le Caudan waterfront exciting. It was very lively, very clean and quite beautiful.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4_u6rw9EWzQ-zu12ggbZXs4ELEiBru8moY-crWM97xaQ5eWcTAVFYs2xYAS3U4igqzbPeRPXT2a5CGbWJq79yLQy6GoaSlxn4vJFjxtl_wzmpJTzdGH61zwjMigZA_oeviBnAVA/s1600/Maur_LeCaudan.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4_u6rw9EWzQ-zu12ggbZXs4ELEiBru8moY-crWM97xaQ5eWcTAVFYs2xYAS3U4igqzbPeRPXT2a5CGbWJq79yLQy6GoaSlxn4vJFjxtl_wzmpJTzdGH61zwjMigZA_oeviBnAVA/s400/Maur_LeCaudan.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Le Caudan Waterfront</td></tr>
</tbody></table>
The South Tour comprised long journeys to mostly "meh" places, except for the beautiful Chamarel Falls. The particularly irritating part of this tour was the stopover for lunch at a restaurant that charged exorbitantly for its passable food, even going by Mauritian standards.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTjUjOvqMolbFEnqn2ippzdJA5pTljUkaNSqtFTw8ko0liL9qLg_TNsducwGYNXnbtmidcH1006O8Wn9sepkrKo12JsH5qZxla-oXEgLiwJCv7rSauVHOqt0oZzNRPaJQr2bn5lA/s1600/Maur_Chamarel.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTjUjOvqMolbFEnqn2ippzdJA5pTljUkaNSqtFTw8ko0liL9qLg_TNsducwGYNXnbtmidcH1006O8Wn9sepkrKo12JsH5qZxla-oXEgLiwJCv7rSauVHOqt0oZzNRPaJQr2bn5lA/s400/Maur_Chamarel.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Chamarel Falls</td></tr>
</tbody></table>
The Island Tour was the best of the included lot. It took us to the beautiful island of <a href="http://en.wikipedia.org/wiki/%C3%8Ele_aux_Cerfs">Ile aux Cerfs</a>, where you can indulge in a wide range of water-sports or just relax on the beautiful beaches (I found it somewhat amusing that most of us Indians opted for the former, while most of the white folks opted for the latter). This tour was marred a little by intermittent bad weather and by repeated break-downs of a boat that was to be used for some of the water-sports, causing us to waste a lot of time that could otherwise have been spent enjoying this beautiful island.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqZqThlwZJ9su8LeDKu9jxBgheMJcrUABD0wNvXBf9RxB22oyoeNL_oHOdIX46nDkRQhjoV0yMEC7ky5_ndFwsTiPJZt7PfWvECCxgG8BbNLJx5PwSLVfHs9dib89YePo98igp_Q/s1600/Maur_IleAuxCerfs.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqZqThlwZJ9su8LeDKu9jxBgheMJcrUABD0wNvXBf9RxB22oyoeNL_oHOdIX46nDkRQhjoV0yMEC7ky5_ndFwsTiPJZt7PfWvECCxgG8BbNLJx5PwSLVfHs9dib89YePo98igp_Q/s400/Maur_IleAuxCerfs.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Beautiful Water</td></tr>
</tbody></table>
The Under-sea Walk was a unique experience - we actually got to walk on the sea-bed, admire the coral and sea-life there and feed the fish off our hands. The Blue Submarine Dive was promising, but a little underwhelming since we didn't get to see much under-sea life on our visit.<br />
<br />
The Catamaran Cruise to Ile aux Gabriel was amazing. It was made thrilling by some high waves on the sea that rocked the boat and several sightings of flying fish. The island itself was beautiful, surrounded by shallow seas where you could wade in quite a bit. I tried snorkeling for the first time in my life and was very excited to find out how long I could remain underwater in this manner and how many intrepid fish I could spot, and almost touch, this way.<br />
<br />
On the whole, it was quite a memorable vacation.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com3tag:blogger.com,1999:blog-17482943.post-89522482479898736152011-08-15T22:16:00.000+05:302011-08-15T22:16:00.967+05:30Just BooksA few years ago, I had complained about <a href="http://rmathew.blogspot.com/2006/06/libraries.html">the lack of a well-stocked and accessible library in Bangalore</a>. To a certain extent this complaint has been addressed since by the quick rise of <a href="http://www.justbooksclc.com/">Just Books</a> in the city. Just Books has a rapidly-growing chain of lending libraries here in Bangalore (and in some other cities in India). The collection of books is decent enough and the lending-rates fair enough for this to be an attractive option for most book-lovers in the city.<br />
<a name='more'></a><br />
There are over 20 branches of the library in Bangalore city alone, making it extremely accessible wherever in the city you happen to be, the infamous traffic-congestion in the city notwithstanding. It's open over the weekend from morning to night, making it quite convenient for working folks like yours truly. There are different plans to suit different needs - for example, on the basic plan you pay a fixed amount per month and can then borrow two books at a time, keeping them as long as you want; on the highest plan you can keep four books and two magazines at a time. Instead of being limited by the collection of a single branch, you can request books from any of the other branches in the city (they claim to have over 300,000 books across these branches). You can borrow a book from any of the branches in a city; ditto for returning it. There is also a regular newsletter published by the library and distributed freely among members that features, among other things, book-reviews and letters by members, some coverage of literary events in the city, interviews with authors, etc.<br />
<br />
I have been a satisfied member for a little over a year (and have no affiliations with them otherwise). I have certainly started to read more books and more regularly as a result of my membership. (Since the monthly-rates are fixed, the longer you keep a book with you, the more expensive it becomes for you - you therefore tend to finish a book as soon as it is convenient for you and move on to the next one.) Most importantly it has saved me quite a bit of money and shelf-space that would otherwise have been spent on stocking these books.<br />
<br />
The collection of books is heavily loaded in favor of popular and classic fiction and non-fiction. You will not find academic or technical books here, nor are you likely to find books on eclectic or esoteric subjects - for these, you will have to either visit a well-funded university library or the British Council Library. It is still quite a useful collection to have access to, since it is precisely such books that you usually want to read once but not necessarily keep after reading.<br />
<br />
There was some alarming talk of <a href="http://blog.justbooksclc.com/2010/09/24/different-folks-different-stokes/">weeding out unpopular books</a> from the library, though better sense seems to have prevailed in the end. This was no doubt to "optimize" the return on their inventory, but what they don't seem to realize is that for a lot of people there is a list of "must-read" books that they try to finish first upon joining a library. This would make popular books seem even more popular and worthwhile to keep in a young library. After you have plowed through all or most of your must-read books, you tend to look for other interesting, possibly not-so-popular books - this is where a well-stocked library offers the chance of a serendipitous find and thus maximal value to the reader.<br />
<br />
Unlike books, borrowed magazines have to be returned within a week - if you don't return it within this period, they will actually send you a reminder and/or call you, especially if it is a recent issue. Since it is not always possible for me to finish reading a magazine within a week, this has been a continuing albeit minor irritant. On the flip side, I have also seen the effect of not strictly enforcing this rule - for most magazines, you'd be hard-pressed to find a single recent issue - just increasing the number of copies of each issue is not that viable a solution as they tend to have very short shelf-lives.<br />
<br />
In short, Just Books is for you if you are in Bangalore and you want to read books that are perennial classics or recent best-sellers in fiction and non-fiction, without having to shell out the money to buy them all and provide the space to stock them. In theory, it is also good for reading through a bunch of different magazines, though not quite so in practice. All in all, a very good thing to have around for book-lovers in the city.<br />
Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-40457877392945658232011-02-07T20:55:00.128+05:302011-02-07T22:52:08.839+05:30Monitor WoesI decided to finally replace the ageing CRT monitor of my desktop PC, after having repeatedly put it off over the last few years. This CRT monitor, a 17" Samsung Samtron 75E, had served me remarkably well for over 11 years. When its display started to blur and intermittently turn yellow (cured by a hard whack on its side), despite a couple of repairs that seemed to initially fix the issues, I knew it was time to say good-bye to it. Since it is nearly impossible to buy a CRT monitor these days, I set out to buy an LCD monitor. Unfortunately there doesn't seem to be an <i>affordable</i> LCD monitor good enough to replace my old CRT monitor and I had to ultimately settle for a less-than-perfect replacement LCD monitor.<br />
<a name='more'></a><br />
LCD monitors are an instance of technological progress giving us something that isn't better than what it replaces (CRT monitors) in <i>all</i> aspects and yet that has won because most people just don't care. (Solid-state drives seem to be doing the same to hard-disc drives.) They will no doubt eventually improve and the improvements will surely become affordable over time, but in the interim we are left with something that isn't a perfect replacement and that is a disappointment for those of us who do care.<br />
<br />
I like LCD monitors for their slim profiles and light weight compared to CRT monitors. I like them for their pixel-perfect displays, greater viewing-area for the same diagonal-size and generally lower power-consumption. Their DVI-D and other digital input ports allow for more accurate display of images compared to analogue VGA input ports in CRT monitors. However I don't like the bad colour-reproduction capabilities of the affordable LCD monitors based on <a href="http://en.wikipedia.org/wiki/TFT_LCD#Twisted_nematic_.28TN.29">Twisted Nematic (TN)</a> panels and the quite noticeable degradation in display-quality as you look at them from a little to the side or above (i.e. not perfectly orthogonal to the plane of the panel). LCD monitors based on <a href="http://en.wikipedia.org/wiki/TFT_LCD#In-plane_switching_.28IPS.29">In Plane Switching (IPS)</a> panels seem to be much better at colour-reproduction, but are not quite affordable yet. (If you want to know more about the technology behind LCD panels, read <a href="http://www.tftcentral.co.uk/articles.htm">the excellent articles on this topic available from TFT Central</a>.) I particularly do not like the red-blue colour-bleeding that I see when <a href="http://en.wikipedia.org/wiki/Subpixel_rendering">sub-pixel hinting</a> of text (known as ClearType in the Windows world) is enabled with LCD monitors, whether it is Windows or Linux.<br />
<br />
Another disturbing development is the near-universal trend towards bigger wide-screen monitors, that too with a 16:9 aspect-ratio and a "Full HD" resolution of 1920x1080, coupled with decreasing pixels-per-inch (PPI) as the same or lower resolution is spread over a greater display-area. This trend truly baffles me - it is as if all that people do (or seem to care about) on their computers is watch films. A 16:9 aspect-ratio is too narrow for almost every other purpose, be it browsing the web or writing document or reading e-mails. For a given diagonal-size, this aspect-ratio provides the least viewable area among the commonly-seen aspect-ratios (calculate it yourself if you don't believe me). Seen another way it provides the least vertical space for a given horizontal size of the display area. For example, given a horizontal resolution of 1280 pixels, you get a vertical resolution of 1024 with 5:4, 960 with 4:3, 800 with 16:10, 768 with 5:3 and 720 with 16:9. I personally prefer 4:3, though I admit that 16:10 is useful in some coding and system-administration scenarios. The decreased PPI makes text less sharp and therefore more tedious to read.<br />
<br />
I set out to buy an affordable 17" LCD monitor with a 4:3 or 5:4 aspect-ratio (known among the vendors here as a "square" monitor), a DVI-D port for video-input and a decent PPI. This turned out to be surprisingly difficult and a frustrating exercise spread over three weeks. Despite the claims on vendors' web-sites, when it comes to affordable LCD monitors the vendors in Bangalore seem to only have 16:9 aspect-ratio monitors, that too with only VGA input ports. 17" seems to be a thing of the past. Only Dell India seems to still sell a 5:4 aspect-ratio 19" LCD monitor (the <a href="http://www1.ap.dell.com/in/en/business/professional_monitors/monitor-dell-p190s-blk/pd.aspx?refid=monitor-dell-p190s-blk&cs=inbsd1&s=bsd">Dell P190S</a>) that meets my criteria, though I would have preferred its now-discontinued 17" brother, the Dell P170S, which provides the same resolution in a smaller display-area and therefore a slightly higher PPI.<br />
<br />
So this is the monitor that I ended up buying. It claims to be able to show 16.7 million colours, though I find the colour-reproduction less than satisfactory (but not very bad) when compared to my Samsung Samtron 75E. The picture is as sharp as I expected and the monitor frees up a lot of space on my desk. I was able to find a vendor willing to buy my old CRT monitor for a small price, freeing me from the worry of disposing it off.<br />
<br />
This LCD monitor would do until the time technology makes better monitors more affordable.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-82349275300462349192011-01-05T22:13:00.000+05:302011-01-05T22:13:53.325+05:30Year-End BreaksTowards the end of the year 2010, Anusha and I went for a couple of day-trips to places near Bangalore. The first trip was to Balmuri and Yedmuri falls, along with a visit to <a href="http://en.wikipedia.org/wiki/Brindavan_Gardens">Brindavan Gardens</a>. The second trip was to <a href="http://en.wikipedia.org/wiki/Belur">Belur</a> and <a href="http://en.wikipedia.org/wiki/Halebidu">Haalebidu</a> along with <a href="http://en.wikipedia.org/wiki/Shravanabelagola">Shravanabelagola</a>. While we drove to the former set of destinations ourselves, we opted for a <a href="http://www.karnatakaholidays.net/">KSTDC</a> bus-tour for the latter.<br />
<a name='more'></a><br />
Balmuri and Yedmuri falls are near Mysore and are formed by check-dams on the river Kaveri. For some reason, Balmuri falls is more popular with tourists and has comparatively better facilities than Yedmuri falls.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM74D6OZbI/AAAAAAAAA9A/MBaSy0tk3nE/s1600/IMG_1799.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM74D6OZbI/AAAAAAAAA9A/MBaSy0tk3nE/s320/IMG_1799.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Balmuri Falls</td></tr>
</tbody></table>Yedmuri falls is around a kilometre or so from Balmuri falls, down an uneven mud-path. There are far fewer tourists here and no shops or boat-rides. The rocks are also a little more uneven and slippery. That said, it seemed like the more interesting of the two falls to me.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM744QHX9I/AAAAAAAAA9E/Sy0xbqNFKBc/s1600/IMG_1802.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM744QHX9I/AAAAAAAAA9E/Sy0xbqNFKBc/s320/IMG_1802.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yedmuri Falls</td></tr>
</tbody></table>On the way to these falls, we went to see the <a href="http://en.wikipedia.org/wiki/Krishna_Raja_Sagara">KRS dam</a> and Brindavan gardens located nearby. The dam seems to be closed to tourists now, which was a let-down. The gardens are beautiful, though not very well-maintained.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM73kj26iI/AAAAAAAAA88/_G64JqCYp0s/s1600/IMG_1787.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM73kj26iI/AAAAAAAAA88/_G64JqCYp0s/s320/IMG_1787.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Brindavan Gardens</td></tr>
</tbody></table>One of the pleasant experiences of this trip was driving down the obstruction-free <a href="http://en.wikipedia.org/wiki/Bangalore%E2%80%93Mysore_Infrastructure_Corridor">NICE road</a>, the closest thing to a US-style freeway that I've seen here, though our speed was hampered from time to time by slow-moving trucks.<br />
<br />
For the trip to Belur, Haalebidu and Shravanabelagola, we decided to take a KSTDC bus-tour instead of driving all the way ourselves. This tour starts at 6:30 AM in the morning and drops you back in Bangalore at 10 PM in the night. The bus was a comfortable, air-conditioned Volvo and was fully-booked. As with all the KSTDC tours I have been on, we got very little time at the actual destinations and had to eat bad food at places without any alternatives nearby.<br />
<br />
The first destination was Shravanabelagola, where we were given one hour to explore the place. To see the famous statue of <a href="http://en.wikipedia.org/wiki/Bahubali">Bahubali</a> atop a rocky hill here, we had to climb over 600 steps. Perhaps because of this, several people returned much later than the assigned time. This delayed the rest of our trip by at least one hour.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/_glrEiI4xsDc/TSM76FBknOI/AAAAAAAAA9M/izORG0pJq3A/s1600/IMG_1817.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="http://2.bp.blogspot.com/_glrEiI4xsDc/TSM76FBknOI/AAAAAAAAA9M/izORG0pJq3A/s320/IMG_1817.JPG" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Statue of Bahubali at Shravanabelagola</td></tr>
</tbody></table>The next destination was the famous <a href="http://en.wikipedia.org/wiki/Chennakesava_Temple">Chennakeshava temple</a> at Belur. This temple, along with the <a href="http://en.wikipedia.org/wiki/Hoysaleswara_Temple">Hoysaleswara temple</a> at Haalebidu and the Chennakeshava temple at <a href="http://en.wikipedia.org/wiki/Somanathapura">Somanathapura</a> (<a href="http://rmathew.com/2005/shivanasamudram.html">which we saw in 2005</a>), is a magnificent example of the architectural heights reached by the <a href="http://en.wikipedia.org/wiki/Hoysala_Empire">Hoysala empire</a> in the 12<sup>th</sup> century. These temples are built using interlocking blocks of <a href="http://en.wikipedia.org/wiki/Soapstone">soapstone</a> and without any mortar to bind them. Soapstone is apparently soft when quarried and hardens over time with exposure to air, making it ideally suited for making sculptures with very fine and delicate carvings.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM78u5Un_I/AAAAAAAAA9Y/atfjDDlvDwg/s1600/IMG_1848.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="http://3.bp.blogspot.com/_glrEiI4xsDc/TSM78u5Un_I/AAAAAAAAA9Y/atfjDDlvDwg/s320/IMG_1848.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Vishnu's Dasavatar Depicted on the Chennakeshava Temple</td></tr>
</tbody></table>The Chennakeshava temple seems to have been built over more than a 100 years, with a <i>prototype</i> temple built first over 20 years. A curiously-recurring sculpture in these temples is that of the mythical creature <a href="http://en.wikipedia.org/wiki/Makara_%28Hindu_mythology%29">Makara</a>. There are also a lot of statues dedicated to Shantala, the wife of king <a href="http://en.wikipedia.org/wiki/Vishnuvardhana">Vishnuvardhana</a> and an accomplished dancer.<br />
<br />
Our final destination was the Hoysaleswara temple at Haalebidu. This temple was also built over more than a 100 years, but was sadly left unfinished. This temple is only open from sunrise to sunset.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/_glrEiI4xsDc/TSM8CR3O-iI/AAAAAAAAA94/wHqfMYFBSyQ/s1600/IMG_1883.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="http://4.bp.blogspot.com/_glrEiI4xsDc/TSM8CR3O-iI/AAAAAAAAA94/wHqfMYFBSyQ/s320/IMG_1883.JPG" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Statue of a Doorkeeper at the Hoysaleswara Temple</td></tr>
</tbody></table>There is no entrance-fee for seeing either of these temples. The lighting inside these temples is <i>far</i> from satisfactory and makes it very difficult to properly view the sculptures. We were given only one hour each at these temples and this made for a very rushed tour of the temples by the respective guides. Treating this trip as merely an appetiser, we plan to some day go back to these temples and making certain that we have enough time on our hands to admire them at leisure.<br />
<br />
I have uploaded <a href="http://picasaweb.google.com/rmathew/YearEndBreak2010">some more pictures from these trips</a> to a Picasa web-album.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com5tag:blogger.com,1999:blog-17482943.post-61852861689014406712010-10-17T17:19:00.000+05:302010-10-17T17:19:40.895+05:30On The 2010 Commonwealth Games in DelhiThe <a href="http://www.cwgdelhi2010.org/">2010 Commonwealth Games in Delhi</a> (CWG) has thankfully ended, that too on a high note - the games went fairly well on the whole and India came second in <a href="http://cwg.ndtv.com/commonwealth/medaltally/cwg/2010/medalstally.html">the overall medals tally</a> thanks to a gold-medal-winning match on the last day by <a href="http://en.wikipedia.org/wiki/Saina_Nehwal">Saina Nehwal</a>. It was a big relief, coming as it did after revelations of shocking mismanagement, massive corruption and utter callousness of the concerned officials, which were threatening to derail the games and bring shame to India.<br />
<a name='more'></a><br />
Saina's match against Malaysia's Mee Chew Wong for the women's singles final in badminton, in which she pulled back from a match-point <i>against</i> her in the second set and <a href="http://www.hindustantimes.com/specials/sports/cwg-2010/Saina-Nehwal-s-best-makes-India-second-best-on-medal-s-tally/othersports/SP-Article10-612874.aspx">went on to win the match</a> (19-21, 23-21, 21-13), was like an image of the whole CWG experience for India - we managed to pull through at the last minute despite all of the odds against that happening.<br />
<br />
<div style="text-align: center;"><object height="385" width="480"><param name="movie" value="http://www.youtube.com/v/BNG27NhD4ps?fs=1&hl=en_GB"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BNG27NhD4ps?fs=1&hl=en_GB" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></div><br />
(If you can ignore the awful commentary, the video above shows the last few points in final set of the match.)<br />
<br />
It was hard to remain unaffected by the CWG. The months leading to the games were filled with one revelation after another in the media about corruption and mismanagement. A shocking <a href="http://timesofindia.indiatimes.com/cwgarticleshow/6652157.cms">70,000 crore rupees</a> (more than 15 billion US dollars) were apparently spent in total on organising the event. There were <i>so many</i> controversies around the event that Wikipedia has <a href="http://en.wikipedia.org/wiki/Concerns_and_controversies_over_the_2010_Commonwealth_Games">an entire page devoted to the subject</a>.<br />
<br />
To add insult to injury, the officials involved appeared completely unconcerned and dismissive of criticism. Sheila Dikshit, the chief minister of Delhi, dismissed the problems with the games as "<a href="http://www.expressindia.com/latest-news/Commonwealth-Games-not-collapsing-says-Sheila-Dikshit/686081/5/">minor glitches and hitches</a>" and asked people to have a positive attitude in the interest of "national pride". When asked about <a href="http://news.bbc.co.uk/sport2/hi/commonwealth_games/delhi_2010/9025907.stm">the abysmal state of the games village</a>, Lalit Bhanot, the general secretary of the organising committee for the games, gave an appalling justification for the state of affairs by claiming that <a href="http://blogs.telegraph.co.uk/news/deannelson/100055085/indians-have-different-standards-of-personal-hygiene-to-westerners-says-commonwealth-games-official/">Indians have different standards of hygiene compared to westerners</a>. M. S. Gill, the minister of sports, termed the preparations for the games "<a href="http://www.ndtv.com/article/commonwealth%20games/cwg-preparations-satisfactory-gill-50957">satisfactory</a>" when it was apparent to everyone that it was anything but. He also <a href="http://sports.rediff.com/report/2010/aug/29/ms-gill-attacks-premji-for-his-comments-on-cwg.htm">attacked people like Azim Premji</a> who <a href="http://timesofindia.indiatimes.com/india/Rs-28000cr-Games-expense-sounds-like-wrong-priority-Premji/articleshow/6435358.cms">claimed</a> that the CWG was a massive waste of money that should have been spent elsewhere in a poor country like India. As for <a href="http://en.wikipedia.org/wiki/Suresh_Kalmadi#Controversies">Suresh Kalmadi</a>, the chairman of the organising committee, <a href="http://en.wikipedia.org/wiki/Concerns_and_controversies_over_the_2010_Commonwealth_Games#Spectators_response_at_opening_ceremony">the less said</a>, <a href="http://en.wikipedia.org/wiki/Concerns_and_controversies_over_the_2010_Commonwealth_Games#Criticism_by_Mani_Shankar_Aiyar">the better</a>.<br />
<br />
There were thankfully no terror attacks during the games, especially considering <a href="http://en.wikipedia.org/wiki/2010_Jama_Masjid_attack">the apparent warning attack by extremists</a> a couple of weeks before the games were about to begin. There is still some debate in certain quarters whether this was due to tightened security and surveillance on part of the government or the extremists giving up on derailing the games considering the excellent job being done by the organising committee itself towards this end. They are probably furious now after being hoodwinked like this. In software engineering parlance, the utter chaos before the games was therefore a feature, not a bug, in the interests of national security.<br />
<br />
<a href="http://timesofindia.indiatimes.com/india/CWG-Probe-panel-to-report-in-3-months/articleshow/6756414.cms">An investigation has been launched</a> into this whole mess by the prime minister's office, but I remain sceptical that all the offenders will be brought to justice. This could just be a ploy to placate the people and buy some time. We, the people, have a notoriously short memory of scandals and politicians everywhere make good use of this shortcoming to line their pockets and get re-elected. We truly deserve the governments we get.<br />
<br />
We were going to bid for the <a href="http://en.wikipedia.org/wiki/2020_Summer_Olympics">2020 Summer Olympics</a>, but hopefully better sense prevails. I agree <a href="http://timesofindia.indiatimes.com/india/Rs-28000cr-Games-expense-sounds-like-wrong-priority-Premji/articleshow/6435358.cms">with Azim Premji</a>, the founder of <a href="http://www.wipro.com/">Wipro</a>, and <a href="http://economictimes.indiatimes.com/news/politics/nation/Rs-35000-cr-for-Games-waste-shouldve-gone-to-poor-kids-Mani-Shankar-Aiyar/articleshow/6225608.cms">with Mani Shankar Aiyar</a>, the former minister for sports, that organising huge sports events like this is a waste of money, especially in a country like India with a large population that is poor and has inadequate access to affordable food, shelter, healthcare and education. It <a href="http://www.economist.com/node/16647704">doesn't make sense</a> even for <a href="http://www.economist.com/node/16647677">a rich country</a> for that matter. Such events <a href="http://www.newsweek.com/2010/02/04/fool-s-gold.print.html">don't promote international friendship</a> despite what the organisers would have you believe. In India, people <a href="http://en.wikipedia.org/wiki/Concerns_and_controversies_over_the_2010_Commonwealth_Games#Poor_ticket_sales_and_attendance">aren't even that interested in watching them</a>. City administrators use such events to fast-track civic and sports infrastructure, which would otherwise get stuck in long bureaucratic and judicial hurdles - only Delhi reaps all the benefits from the CWG while the whole nation gets to share the shame.<br />
<br />
The callousness, mismanagement and corruption at events like the CWG tarnish our country's image and affect each one of us, directly and indirectly. They reinforce racial stereotypes and prejudices about Indians that many of us have been trying very hard to overcome. In "<a href="http://virsanghvi.com/CounterPoint-ArticleDetail.aspx?ID=552">Old India vs New India</a>", Vir Sanghvi says:<br />
<blockquote><div style="text-align: justify;">The people in charge of the Games typify old India: corrupt, slothful, incompetent, chaotic, unconcerned with the pursuit of excellence, unwilling to benchmark against global standards and convinced that in India, <i>sab chalta hai</i>.<br />
<br />
The people who are most angered and horrified by the CWG mess are those who believe that we are creating a new India: one that can do things to global standards, whose competence and intelligence are highly regarded all over the world, an India where people work hard, where there are high levels of accountability and where commitments are treated as sacred.<br />
<br />
[...]<br />
<br />
As hard as we try to build a new India, this fiasco reminds us that old India still has the power to humiliate and embarrass our country.</div></blockquote>Pankaj Mishra makes <a href="http://www.nytimes.com/2010/10/03/opinion/03mishra.html">a similar point in the New York Times</a>.<br />
<br />
We can hope for progress in India <i>only</i> if the new India continues to remain ascendant and supplants the old India.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com2tag:blogger.com,1999:blog-17482943.post-54669181798554052402010-09-07T00:44:00.002+05:302010-09-10T10:42:00.697+05:30Protecting Your Privacy on LinuxSome times you need to protect your documents containing sensitive information from prying eyes. Simply enforcing access-control on a document (e.g. "<code>chmod 600 foobar</code>") is not enough in such cases as it can still be read by those with super-user access or with physical access to your storage media (e.g. when your laptop gets stolen or you misplace your backup media). It is also ineffective when you use on-line back-up solutions like <a href="http://skydrive.live.com/">SkyDrive</a>, <a href="http://docs.google.com/">Google Docs</a> or <a href="http://www.dropbox.com/">Dropbox</a>. Fortunately Linux provides several tools to help you here depending on your needs.<br />
<a name='more'></a><br />
<p>(<b>DISCLAIMER:</b> I am <i>not</i> a cryptographer. Consult one if you need to be sure of the security of these methods.)<br />
<p>If you use the text-editor <a href="http://www.vim.org/">Vim</a>, you can encrypt your files by invoking Vim with the "<code>-x</code>" command-line option (e.g. "<code>vim -x diary.txt</code>"). You can alternatively encrypt a file while editing it by typing "<code>:X</code>" in command-mode. Vim will ask you (twice) to enter a password that will be used to encrypt the file. When you open such an encrypted file for editing, Vim will prompt you to enter a password to unlock it. You can find more details about this feature <a href="http://vimdoc.sourceforge.net/htmldoc/editing.html#encryption">here</a>.<br />
<p>Note that the default encryption-method used by Vim is not very secure and <a href="http://zeus.phys.uconn.edu/refs/crackers/">can be broken by a determined person</a>. With Vim 7.3, you have the option of choosing a stronger method based on <a href="http://en.wikipedia.org/wiki/Blowfish_%28cipher%29">the Blowfish cipher</a> using "<code>:set cryptmethod=1</code>" in command-mode (or by setting it in your "<code>.vimrc</code>" file).<br />
<p>If you use <a href="http://www.openoffice.org/">OpenOffice.org</a>, securing your document is as simple as choosing the "Save with password" option in the save dialogue-box. More details of the method used by OpenOffice.org to encrypt the document can be found <a href="http://wiki.services.openoffice.org/wiki/Security/Encryption#Enhancing_the_Encryption_Specification_for_ODF_1.2">here</a>.<br />
<p>If you prefer a stronger method or if your documents have been created by an application that doesn't natively support encryption, you can use the "<code>openssl</code>" command-line tool. For example, to encrypt a file named "<code>foo</code>" using <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES-256</a> and store the result in a file named "<code>foo.enc</code>", you can use:<br />
<pre> openssl enc -aes-256-cbc -e -salt -in foo -out foo.enc
</pre>To decrypt the encrypted file and store the result in a file named "<code>bar</code>", you can use:<br />
<pre> openssl enc -aes-256-cbc -d -in foo.enc -out bar
</pre>(<b>Quick Tips:</b> Compress your files before encrypting them; never omit a <a href="http://en.wikipedia.org/wiki/Salt_%28cryptography%29">salt</a>; do not use <a href="http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29">ECB</a>. See also: "<a href="http://www.bsdcan.org/2010/schedule/events/183.en.html">Everything You Need To Know About Cryptography in One Hour</a>".)<br />
<p>You can alternatively use <a href="http://www.gnupg.org/">GNU Privacy Guard</a> and <a href="http://mcrypt.sourceforge.net/">mcrypt</a>, but they are not significantly better than "<code>openssl</code>" for this purpose, except perhaps in usability. <a href="http://bcrypt.sourceforge.net/">bcrypt</a> and <a href="http://www.tarsnap.com/scrypt.html">scrypt</a> are stronger file-encryption tools, though the latter is relatively new and has not been vetted thoroughly by experts yet.<br />
<p>If you are paranoid, you can hide your sensitive information among innocuous data in such a way that a malicious person would not even know of its existence. This is known as <a href="http://en.wikipedia.org/wiki/Steganography">steganography</a>. For example, this image of <a href="http://en.wikipedia.org/wiki/The_Milkmaid_%28Vermeer%29">The Milkmaid</a>:<br />
<p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb1Mfflfn4naMKAXlK_FFT7ysCmb3FJP1wVupNud8bxjbapsVXoUhZUHu1PDJMkIKcfvPOZatUN0tpJg8NN0xB1t5Gk37SObgZf3qdksFrTOOhlXMh5vbPtzDHLXpm4pala5RE9g/s1600/verm_mm.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb1Mfflfn4naMKAXlK_FFT7ysCmb3FJP1wVupNud8bxjbapsVXoUhZUHu1PDJMkIKcfvPOZatUN0tpJg8NN0xB1t5Gk37SObgZf3qdksFrTOOhlXMh5vbPtzDHLXpm4pala5RE9g/s320/verm_mm.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"The Milkmaid" by Johannes Vermeer</td></tr>
</tbody></table>looks visually-indistinguishable from this image:<br />
<p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgySJSu2ZULlD4Rzxv8nKRXK_lMyQfTuof5CNfNMkZIhBRW7mH1vv68IiWv-c79vG2-cZekoOvAx_iDMqBPmA2iWU8cjHsbMfZh7CxeHpOGyxDhAqXTkEtbChePqg3XT_qEDOAHDw/s1600/mmenc.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgySJSu2ZULlD4Rzxv8nKRXK_lMyQfTuof5CNfNMkZIhBRW7mH1vv68IiWv-c79vG2-cZekoOvAx_iDMqBPmA2iWU8cjHsbMfZh7CxeHpOGyxDhAqXTkEtbChePqg3XT_qEDOAHDw/s320/mmenc.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The Same Painting, Now With a Message</td></tr>
</tbody></table>and yet the latter contains the complete (compressed and encrypted) text of the <a href="http://en.wikipedia.org/wiki/Declaration_of_the_Rights_of_Man_and_of_the_Citizen">Declaration of the Rights of Man and of the Citizen</a>. It was created using <a href="http://steghide.sourceforge.net/">steghide</a> like this:<br />
<pre> steghide embed -z 9 -e twofish cbc -ef rights.txt \
-cf verm_mm.jpg -sf mmenc.jpg
</pre>The password is "<a href="http://translate.google.com/#fr%7Cen%7CLe%20Roi%20Est%20Mort">leroiestmort</a>" should you wish to extract the document like this:<br />
<pre> steghide extract -sf mmenc.jpg
</pre>"<code>steghide</code>" is a tool that works very well for its intended purpose. Other such tools include <a href="http://www.outguess.org/">OutGuess</a> and <a href="http://linux01.gwdg.de/%7Ealatham/stego.html">JPHIDE</a>, though they require modifications to <a href="http://en.wikipedia.org/wiki/Libjpeg">libjpeg</a> unlike "<code>steghide</code>". Unfortunately "<code>steghide</code>" has not been under active development for over five years now and the other tools don't fare any better in this regard either. (Note that if you <i>do</i> intend to compile "<code>steghide</code>" yourself on a modern Linux system, you would need to apply <a href="http://pastebin.com/me89rxzY">a patch like this</a> for the 0.5.1 release to be able to compile it.)<br />
<p>If you are even more paranoid, you can use <a href="http://en.wikipedia.org/wiki/TrueCrypt">TrueCrypt</a> for encrypting a partition on a disc or for creating an encrypted virtual disc within a file. Alternatively you can use <a href="http://en.wikipedia.org/wiki/Dm-crypt">dm-crypt</a> with <a href="http://en.wikipedia.org/wiki/Linux_Unified_Key_Setup">LUKS</a> on a modern Linux system to encrypt a partition on a disc. Markus Gattol has published "<a href="http://www.markus-gattol.name/ws/dm-crypt_luks.html">Full-disk Encryption</a>" as a guide to implementing this option. You can use <a href="http://en.wikipedia.org/wiki/FreeOTFE">FreeOTFE</a> to access such disc-partitions from Windows. Note that even with full-disc encryption, you still have to use the other tools when storing sensitive data on on-line backup sites or on unsupported off-line backup media.<br />
<p>Finally, after all is said and done, don't forget <a href="http://xkcd.com/538/">xkcd-538</a>. <tt>;-)</tt><br />
<p><b>Update (2010-09-10):</b> Pointed to dm-crypt/LUKS based on feedback from <a href="http://www.reddit.com/r/linux/comments/dbhvs/protecting_your_privacy_on_linux/">the corresponding reddit post</a>.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com2tag:blogger.com,1999:blog-17482943.post-2867393982635309452010-06-22T22:22:00.001+05:302010-08-08T11:14:19.041+05:30ICFP Programming Contest 2010As has become customary for me, I participated in the annual <a href="http://icfpcontest.org/">ICFP programming contest</a> this weekend. I participated as a lone coder this time with the team name "rmathew". The contest this year was irritating and frustrating, not to mention quite humbling (as usual).<br />
<a name='more'></a><br />
The <a href="http://icfpcontest.org/2010/task/">task description</a> was obtuse and it took me at least a couple of readings to even understand what we were supposed to do. Even after understanding it, I didn't feel motivated to solve it as it seemed to have been devised simply to frustrate people. I still went ahead with it as I had already set aside some time for this year's contest.<br />
<br />
The overall task was to create cars and fuel for such cars. You had to create cars for which it would be difficult for others to supply fuel and you had to supply fuel to as many other cars as possible. The engines of the cars were provided as streams of "trits" (ternary, or base-3, digits) for which you had to figure out the encoding. Fuel had to be created using circuits that used ternary logic gates for which you had to figure out the encoding of the circuits, the logic used by the gates, the input stream provided to the circuits by the server and the validating key in the output stream without which your circuits were rejected.<br />
<br />
The worst part was that you had figure all this out by using educated guesses and by looking at the error messages spewed by the server hosted by the organisers. Needless to say, the server didn't stay up for long and had issues throughout the contest.<br />
<br />
The gates took two input trits (left and right) and produced two output trits (left and right). My guess about the format used for encoding the circuits turned out to be right and after a couple of trials it became apparent that there was only one type of gate. I could not figure out a programmatic way of determining the logic used by the gates, so I used pen and paper with a few simple circuits to figure out the logic using the error messages from the server as a guide. The truth-tables (left-input varies by rows, right-input by columns) turned out to be:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi98k43MVX5wBv7qzByyujRWXgexXRl_opQTZygdP7gYEwTIe4lXqTowmxG51W7uxHM4Hq6zq1jUmzHQrZ-t83ZGOmGMcE6lPW8nE1aNmER_x8mO7oGBqF-maTF19H6pl1roB9iBQ/s1600/logic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi98k43MVX5wBv7qzByyujRWXgexXRl_opQTZygdP7gYEwTIe4lXqTowmxG51W7uxHM4Hq6zq1jUmzHQrZ-t83ZGOmGMcE6lPW8nE1aNmER_x8mO7oGBqF-maTF19H6pl1roB9iBQ/s320/logic.png" /></a></div>Which boils down to:<br />
<tt><br />
LO = (LI - RI + 3) mod 3<br />
RO = (LI * RI + 2) mod 3<br />
</tt><br />
The nice structure of the left-output table also allows you to then determine the input stream used by the server. Using this information, I coded a simple circuit simulator that I then used on the key circuit given in the task description to find out the key sequence desired in every output stream.<br />
<br />
To proceed further, I needed to figure out how to create a circuit that can convert a given input stream into a given output stream. This is where I hit a dead-end - I just could not work out how to approach this problem without using brute force and that seemed quite prohibitive considering the possibilities. To distract myself I created a simple circuit visualisation tool that converted a description like this:<br />
<tt><br />
0L:<br />
X3R0#1R2L,<br />
1L0L0#1L3L,<br />
0R2R0#3R2R,<br />
1R2L0#X0R:<br />
3L<br />
</tt><br />
into a file that could then be converted by <a href="http://www.graphviz.org/">Graphviz</a> into this image:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3voM7C4UPleHmns3LM7mk4KIGbluDiHYGbCpYF6lO6tDQPl2vl8v8mktOaoy5tjDCOIPnmFPo70uhy4L1Xpv2T3SFMBVrMTc9qtIVdpz3-PMwf_xgujylk3TF0pO2in1dOQe7Lw/s1600/l2l_4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3voM7C4UPleHmns3LM7mk4KIGbluDiHYGbCpYF6lO6tDQPl2vl8v8mktOaoy5tjDCOIPnmFPo70uhy4L1Xpv2T3SFMBVrMTc9qtIVdpz3-PMwf_xgujylk3TF0pO2in1dOQe7Lw/s320/l2l_4.png" /></a></div>Coming back to the circuit-construction problem, I noticed that because of the structure of the left-output truth-table, you can work out the right-input and right-output streams for a gate for fixed left-input and left-output (LILO) streams. I toyed with the idea of stitching such "Lilo" nodes together to construct a solution using a solver programme named "Stitch" (<a href="http://en.wikipedia.org/wiki/Lilo_%26_Stitch">Ha!</a>), but that didn't get me anywhere.<br />
<br />
I then decided to give up on this year's contest. I hope next year's contest is better. (I still fondly remember the contests for <a href="http://www.boundvariable.org/">2006</a> and <a href="http://save-endo.cs.uu.nl/">2007</a>.)<br />
<br />
If you're interested, you can see the <a href="http://bitbucket.org/rmathew/icfpc">source-code on Bitbucket</a>.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com2tag:blogger.com,1999:blog-17482943.post-52071902901584937402010-03-17T22:30:00.000+05:302010-03-17T22:30:07.082+05:30On Watching FilmsLike many people, I like watching films for entertainment. Unfortunately for me, it seems that the film industry is hell-bent on making this as difficult as possible. They have succeeded to a large extent - I now watch far fewer films than I used to a little over a decade ago.<br />
<a name='more'></a><br />
Look at the ticket prices: at the beginning of 1997, a "balcony ticket" for a weekend show in one of the theatres located in central Bangalore cost Rs 40; at the beginning of 2010, the same ticket now costs Rs 170. That corresponds to roughly 12% year-on-year increase in ticket prices over the 13-year period, far more than what could be justified by general inflation or better amenities. In the multiplexes, the ticket prices many a time go even higher - it seems that one of them was even charging Rs 1,000 for Avatar 3D in its premium class. When you factor in the charges for parking your vehicle and captive consumption of over-priced snacks and beverages, watching a film in a theatre becomes quite an expensive deal. What is worse is that so many people are apparently willing to pay these prices.<br />
<p>In many ways, I find watching a film in a theatre an irritating experience. Watching a bright screen in a dark room for a couple of hours or more gives me a headache. For some weird reason, either Indian films have a very loud soundtrack or theatres like to increase the volume unnecessarily high for such films - it is even more mystifying when you notice that the actors in such films generally shout to each other instead of talking like ordinary humans. I don't like having to sit through several advertisements before I can see a film nor do I like the forced patriotism in one of the multiplexes here that plays the national anthem before every show. Fellow viewers constantly remind you of their presence by chattering on their mobiles, talking to each other, yelling out during songs or scenes, taking their smelly feet out of their shoes and by blocking your view as they look for their seat, having walked in well past the show-time.<br />
<p>I therefore like to watch a film on DVD. To their credit, the film industry now releases a DVD for a film closer to its theatrical release than before and the discs are fairly affordable (especially those released by <a href="http://www.moserbaer.com/">Moser Baer</a>). Of course, their hand has been forced in this matter by the ready availability of unauthorised copies of films on almost every street corner. But even here they try to irritate viewers as much as possible. They try to limit the availability of DVDs by putting in a <a href="http://en.wikipedia.org/wiki/DVD_region_code">region code</a> and forcing manufacturers of DVD players to honour it. Many DVDs are stuffed with advertisements and trailers that cannot generally be skipped due to a mis-feature that is arrogantly named "<a href="http://en.wikipedia.org/wiki/User_operation_prohibition">user operation prohibition</a>". These can get really irritating really quickly - I once was forced to watch the entire set of advertisements and trailers in the DVD for <a href="http://en.wikipedia.org/wiki/The_Blue_Umbrella_%28film%29">The Blue Umbrella</a> <i>six times</i> as there were three power-cuts during the time I was trying to watch it (and the back-up power-supply kicked in and shut off each time); I would not have bothered were it not such a good film.<br />
<p>Buying the DVD of every film I want to watch is quite wasteful in my opinion, so I try to rent as many of them as possible (via <a href="http://mothaydvd.com/">Mothay DVD</a>, who provide free delivery and pick-up of discs). Even this option has several problems though. The DVDs for many of the popular films are quite difficult to get hold of and when you do get them they are scratched so badly that you wonder if people confuse them with vinyl records or tea coasters. Both the film industry and the Indian government conspire to severely limit the number of DVDs that can legally be rented here in India. The Motion Pictures Association (MPA) of India wants every rental shop to get a licence and the Censor Board wants only certified films to be rented out. The film studios release very few films here from outside India, generally citing poor demand that does not justify the trouble of applying for a censor-certificate.<br />
<p>Watching films on television might have been a viable alternative, but for the irritatingly large number of long commercial breaks. The broadcasters are also extremely coy about even the slightest hint of sex and aggressively edit out potentially offensive scenes, having been threatened by the over-zealous Information and Broadcasting Ministry (which has a warped view of morality quite out of touch with the times). This leads to some crucial scenes being cut from many a film, making it a frustrating experience.<br />
<p>It should not then be surprising that a large number of people resort to getting unauthorised copies of films from street-corners or from the Internet (so-called "pirated" copies), even putting up with reduced audio and video quality. Instead of trying to understand the reasons for this behaviour and tapping into this obvious demand, the film industry has responded by increasing ticket prices even further and putting even greater restrictions on films.<br />
<p>I find it surprising and sad that the entertainment industries in general treat their customers like idiots and criminals, and manage to get away with it.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com2tag:blogger.com,1999:blog-17482943.post-17980261114568405292010-01-23T17:51:00.000+05:302010-01-23T17:54:28.548+05:30Spawner in the WorksI have started using <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> 3.6 and it <i>does</i> feel a little faster than its predecessor, though it's definitely not as snappy as <a href="http://www.google.com/chrome/">Chrome</a>. I should note that this is how Firefox 3.0 and 3.5 also felt at the time of their release, only to not feel that fast as time wore on and we received successive security and stability updates. I wonder why.<br />
<a name='more'></a><br />
For Firefox 3.5, one of the reasons could be that my perception was altered by <a href="http://rmathew.blogspot.com/2009/11/google-chrome-on-slackware.html">having used Chrome and then having gone back to using Firefox</a>. Another reason could be that the <a href="http://www.sqlite.org/">SQLite</a> databases used by Firefox bloat up over time and need to be "<a href="http://www.sqlite.org/lang_vacuum.html">vacuumed</a>" periodically - I use <a href="http://cid-65b7c3a02dd61662.skydrive.live.com/self.aspx/.Public/compff">a simple script</a> to do this for me, though it doesn't seem to have that much of an effect on Firefox (except on the disc-usage of my profile).<br />
<br />
Firefox also consumes a lot of memory after several hours of browsing, thus slowing it further. This is not that bad a problem for me since I close my browser and log off when I'm done at the end of the day, but some people apparently like to keep their browsers running for days on end while keeping tens of tabs open. For such people, the problem is exacerbated and using Firefox can be frustrating. They seem to have a much better experience with Chrome.<br />
<br />
The Firefox developers have been relentlessly plugging memory leaks and improving its <a href="http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage/">memory usage</a>. It is sobering to note that even if they have absolutely no memory leaks, they will still have to contend with <a href="http://blog.pavlov.net/2007/11/10/memory-fragmentation/">memory fragmentation</a>. They have been using a better memory allocator (<a href="http://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf">jemalloc</a>) since Firefox 3.0 that reduces fragmentation but does not eliminate it entirely. Short of using a compacting <a href="http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29">garbage collector</a>, the only way out seems to be to use <a href="http://www.chromium.org/developers/design-documents/multi-process-architecture">a multi-process architecture like that in Chrome</a>.<br />
<br />
While a multi-process model might seem good for UI responsiveness and shielding against misbehaving add-ons and plug-ins, its benefit in reining in memory usage seems to be under-appreciated. The benefit of such a model was first pointed out to me by my friend Kingshuk who noted it in the architecture of the <a href="http://httpd.apache.org/">Apache HTTP server</a>. The <a href="http://httpd.apache.org/docs/trunk/mod/mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a> directive in the server configuration file controls how many requests a child server process can handle before it is killed. This limits the amount of memory such a process can consume due to memory leakage. Once the process dies, the operating system will reclaim all the memory that was allocated to it.<br />
<br />
It seems that the Firefox developers are already moving in that direction with a project code-named <a href="https://wiki.mozilla.org/Electrolysis">Electrolysis</a>. I hope that this results in a better browser for those of us who have decided to stick with Firefox.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-80044858785182445442010-01-11T00:34:00.000+05:302010-01-11T00:34:25.837+05:30Underwater BluesThe New York Times now encourages you to <a href="http://www.nytimes.com/2010/01/10/magazine/10FOB-wwln-t.html">walk away</a> if you have an "underwater mortgage" on a house, that is, you owe more money on the mortgage for the house than its value in the current housing market. I find such analysis based on the <a href="http://en.wikipedia.org/wiki/Negative_equity">negative equity</a> of a house somewhat puzzling. It might make sense if you have bought a house purely for investment, but not if you call it a home that provides you protection against the elements. If you give up your house, you still have to find an alternative accommodation and very likely pay rent for it.<br />
<a name='more'></a><br />
So how <i>do</i> you value a house in which you plan to stay? A method that I have found useful is to consider the alternative cost of renting an accommodation. Suppose an equivalent house has an annual rental cost of <b>R</b> and you expect the rent to increase every year at the rate of <b>i</b> due to inflation. So <b>k</b> years from now, you can expect the rent to be:<br />
<br />
<div style="text-align: center;">R × (1 + i)<sup>k</sup><br />
</div><br />
This future sum however is worth <i>less</i> today because you can obtain the same amount of money in the future by putting a lesser amount today into risk-free investments. The <a href="http://en.wikipedia.org/wiki/Present_value">present value</a> of that inflated rent is therefore:<br />
<br />
<div style="text-align: center;">R<sub>k</sub> = R × (1 + i)<sup>k</sup> / (1 + d)<sup>k</sup><br />
</div><br />
where <b>d</b> is the applicable discount rate. Over the course of <b>n</b> years, the total cost of the house in today's money can be obtained by summing up the terms R<sub>k</sub> for values of k from 1 to n. This sum is equal to:<br />
<br />
<div style="text-align: center;">R × t × (1 - t<sup>n</sup>) / (1 - t)<br />
</div><br />
where <b>t</b>, the common ratio for the corresponding <a href="http://en.wikipedia.org/wiki/Geometric_series">geometric series</a>, is equal to "(1 + i) / (1 + d)". (This ratio would be less than 1 if we assume that i < d.)<br />
<br />
As an example, suppose you are wondering whether to buy a house when an equivalent house would cost Rs 15,000 per month in rent (so R = 12 × 15,000 = 180,000). Suppose further that you are looking forward to staying in the house for 20 years (n = 20), the average rate of inflation during this period is 5% (i = 0.05) and the discount rate is 8% (d = 0.08) based on interest rates available on risk-free investments like fixed-deposits. Then t is roughly equal to 0.9722 and the total cost of the rented house comes out to about Rs 2,713,660.32 or about Rs 27 lakhs. So the house under consideration is worth at least Rs 27 lakhs today <i>plus</i> the present value of the amount you can get by selling it off at the end of the 20-year period.<br />
<br />
Of course, our calculation is rather simplistic. It doesn't take into account the property taxes that you have to pay on your house, the security-deposit that you have to typically provide before taking a house on rent, etc. Rents do not necessarily keep increasing over such long periods. We cannot put a definite price on things like freedom from the whims of a landlord who might ask you to vacate your rented house at a short notice or potential lack of mobility to pursue better career prospects due to owning a house. Despite these flaws, our calculation is still a useful approximation of the net worth of a house.<br />
<br />
The point is that negative equity does not apply in a straightforward manner to a house in which you plan to stay for a while. It might not always be prudent to walk away from such a house.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-52338026714357237612009-12-27T23:38:00.001+05:302010-01-09T22:44:02.224+05:30Hard LinesI find myself agreeing with the author of the article "<a href="http://online.wsj.com/article/SB10001424052970203706604574377163804387216.html">Good Novels Don't Have to Be Hard</a>": a lot of "good" fiction in modern times is just too much work. It should not be too surprising to find many people giving up on it and moving on to simpler and more entertaining stuff. A struggle is <i>not</i> what I usually look forward to when I take up a novel during my precious free time.<br />
<a name='more'></a><br />
A recent case in point for me is the novel "<a href="http://www.amazon.com/gp/product/0312428596?ie=UTF8&tag=rmathew-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0312428596">Sea of Poppies</a><img src="http://www.assoc-amazon.com/e/ir?t=rmathew-20&l=as2&o=1&a=0312428596" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />" by Amitav Ghosh, which I abandoned after reading a little over half of the 550-plus pages. It might be "good" literature, but it was difficult to read and I couldn't bring myself to care about the characters or the direction the story was headed. It didn't seem worthwhile to struggle through the book only to end up with the prospect of having to read the other two books in the <a href="http://www.ibistrilogy.com/">Ibis trilogy</a> for closure, which would probably be as long and as hard as the first book.<br />
<br />
A major irritant for me was the medley of tongues used by the characters in the book. For example, here is the lascar Serang Ali with his pidgin English:<br />
<blockquote>"Malum Zikri! Captin-bugger blongi poo-shoo-foo. He hab got plenty sick! Need one piece dokto. No can chow-chow tiffin. Allo tim do chhee-chhee, pee-pee. Plenty smelly in Captin cabin."</blockquote><br />
And here is Englishman James Doughty with a "zubben" that is a mixture of English and Hindustani straight from <a href="http://en.wikipedia.org/wiki/Hobson-Jobson">Hobson-Jobson</a>:<br />
<blockquote>"Now there was a chuckmuck sight for you. Rows of cursies for the sahibs and mems to sit on. Sittringies and tuckiers for the natives. The baboos puffing at their hubble bubbles and the Sahibs lighting their Sumatra buncuses. Cunchunees whirling and tickytaw boys beating their tobblers. Oh, that old loocher knew how to put on a nautch all right."</blockquote><br />
These are just two of the at least four or five different tongues used by the characters in the book. Getting used to one or two different tongues in a book is manageable, but rapidly switching between four or five of them becomes very irritating very fast. After a point, it seems that the author introduces a character with yet another tongue just to weed out the weaklings among his readers.<br />
<br />
To be fair, the book seems very well-researched and sheds light on the less well-known role played by Indian seafarers in the <a href="http://en.wikipedia.org/wiki/Opium_Wars">Opium Wars</a>. I would prefer a well-written non-fiction book on the topic to a difficult novel though. Such novels are simply not my cup of tea.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-32977183764162500392009-11-25T22:46:00.002+05:302010-01-09T22:44:31.805+05:30"Terror In Mumbai"<a href="http://en.wikipedia.org/wiki/2008_Mumbai_attacks">Mumbai was attacked</a> by ten terrorists a year ago in an incident that has since become known in India as "26/11". The attacks were accompanied by hysterical, and at times quite misleading, media coverage here in India. The subsequent media coverage didn't get any better and was more often than not filled with pointless analyses. This was especially noticeable on television where the news channels would feature endless rounds of debates among the usual bunch of bickering "guests", none of whom would ever get to complete a point before being interrupted by another guest or the anchor. Thankfully there is now a documentary film titled "<a href="http://www.hbo.com/docs/programs/terrorinmumbai/">Terror in Mumbai</a>", made by Dan Reed, that rectifies this situation. This film is a must-watch, but we don't know if/when it will be shown here in India.<br />
<a name='more'></a><br />
Fortunately you can watch <a href="http://mobmag.in/seriously/dispatches-terror-in-mumbai/">the entire film</a> as hosted by <a href="http://mobmag.in/">MOB magazine</a>, accompanied by an interview with the film-maker. That interview as well as <a href="http://www.hbo.com/docs/programs/terrorinmumbai/interview.html">the interview on HBO's web-site</a> are a must-read after you've watched the film.<br />
<br />
<b>WARNING:</b> Before you watch the film, please note:<br />
<ul><li>The film will probably be quite disturbing to watch.</li>
<li>It is a little over 48 minutes in duration.</li>
<li>It is a little over 91 MB in size.</li>
</ul>The film-maker has managed to get hold of intercepted phone conversations between the attackers and their coordinators, CCTV footage from the hotels and the film of the interrogation of the only surviving terrorist from that attack by the police. This material is accompanied by some of the survivors of the attacks and police personnel recalling the events. All these are used to create a narrative of the attacks from the perspective of the attackers (using the intercepted phone conversations) as well as of their victims. The film thankfully does not venture into an analysis of the attacks.<br />
<br />
The most remarkable thing about the film was the utterly casual attitude of the attackers as well as their commanders towards the killing of so many innocent people. The other remarkable thing was the repeated goading of the attackers towards certain death by their commanders, no doubt ensconced in a safe-haven somewhere, luring them on with the promise of certain entry into heaven. How gullible do you have to be to believe that killing hundreds of innocent people would get you into heaven? Isn't it convenient for the commanders (and religions in general) that no one ever returns from the dead to affirm or deny the existence of either heaven or hell?<br />
<br />
The Indian intelligence agencies were amazingly able to intercept and record the conversations between the attackers and their commanders, but were unable or unwilling to jam the communication link. The commanders were apparently watching television to monitor the progress of the attacks, leading one to wonder whether it was sensible for television news channels to continue to show a live telecast of such an attack in progress even after being asked not to do so by the government. To be fair to the channels though, the commanders could have achieved the same thing by having one of their men present in the vicinity to monitor the attacks.<br />
<br />
This was the most audacious (and at 60 hours, the longest) of the several such attacks on India by terrorists. Sadly for us it doesn't seem like such attacks are going to stop any time in the near future.<br />
<br />
<b>Update (2009-11-27):</b> Also read "<a href="http://www.vqronline.org/webexclusive/2009/11/19/motlagh-mumbai-attacks/">Sixty Hours of Terror</a>".Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-10396209385617873432009-11-23T00:33:00.005+05:302010-01-23T17:54:28.549+05:30Google Chrome on Slackware<a href="http://www.google.com/chrome">Google Chrome</a> has been out for a while now, but only on Windows. There are pre-release <a href="http://dev.chromium.org/getting-involved/dev-channel">Linux builds of Chrome</a>, but they work out-of-the-box only on <a href="http://www.ubuntu.com/">Ubuntu</a> or <a href="http://www.debian.com/">Debian</a>. As a <a href="http://www.slackware.com/">Slackware</a> 12.1 user, I couldn't therefore check out this browser and I was too lazy to <a href="http://code.google.com/p/chromium/wiki/LinuxBuildInstructions">build</a> it myself. Fortunately for me, it turns out that the available builds can be made to work on Slackware with a little effort. Chrome turns out to be surprisingly usable and fast on Linux. That said, I'm not shifting from <a href="http://www.mozilla.com/firefox/">Firefox</a> to Chrome yet, at least not right away.<br />
<a name='more'></a><br />
The Chrome for Linux package from Google is currently available as a Debian package (a "<tt>.deb</tt>" file). You can extract the contents of this file using the standard <tt>ar</tt> (not <tt>tar</tt>) utility. One of the extracted files will be <tt>data.tar.lzma</tt> - you can decompress this file using the <a href="http://p7zip.sourceforge.net/">p7zip</a> utility to get <tt>data.tar</tt>. Use <tt>tar</tt> to expand <tt>data.tar</tt> - the essential Chrome files will be extracted into the sub-folder <tt>opt/google/chrome</tt>. Copy this folder to a location of your choice.<br />
<br />
Ironically, some of the libraries needed by Chrome are provided by Firefox (the version I have is 3.5.5). To get started, I had to create the following symbolic links within the Chrome installation folder to libraries in my Firefox installation folder (<tt>/usr/local/firefox</tt>):<br />
<pre> libnspr4.so.0d -> /usr/local/firefox/libnspr4.so
libnss3.so.1d -> /usr/local/firefox/libnss3.so
libnssutil3.so.1d -> /usr/local/firefox/libnssutil3.so
libplc4.so.0d -> /usr/local/firefox/libplc4.so
libplds4.so.0d -> /usr/local/firefox/libplds4.so
libsmime3.so.1d -> /usr/local/firefox/libsmime3.so
libssl3.so.1d -> /usr/local/firefox/libssl3.so
</pre>The Firefox installation folder also needs to be known to the dynamic loader while running Chrome - the easiest way to achieve this is to add the path to this folder to the <tt>LD_LIBRARY_PATH</tt> environment variable set in the <tt>google-chrome</tt> wrapper script in the Chrome installation folder. (This part is important - without this you'd get crashes in the NSS library while running Chrome.)<br />
<br />
The next thing I had to do to get Chrome working on this machine was to install <tt>gconf</tt> and <tt>ORBit</tt> from <a href="http://www.slacky.eu/">Slacky</a>, as these aren't installed with Slackware. Finally I had to update <a href="http://www.cairographics.org/">Cairo</a> along with <tt>pixman</tt> to the latest respectively stable releases.<br />
<br />
I could finally run the <tt>google-chrome</tt> wrapper script from Chrome to start the browser and play around with it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZRV2ja-rPYLWwO9Mrdn2VfEOB5FLiSjASDtiJP9lqeUVfzZukq-xR9OGl48v38CmaiWXtzS7aFuGNcY2kVv88vuJgywWvre-WTT2kAkxvRq8-Zh3J0muYOmqRXVilUIIJC90yoQ/s1600/chrsnap.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZRV2ja-rPYLWwO9Mrdn2VfEOB5FLiSjASDtiJP9lqeUVfzZukq-xR9OGl48v38CmaiWXtzS7aFuGNcY2kVv88vuJgywWvre-WTT2kAkxvRq8-Zh3J0muYOmqRXVilUIIJC90yoQ/s320/chrsnap.png" /></a><br />
</div>It works fairly well and is quite <i>fast</i>, especially when starting up (unlike Firefox). Ports of both <a href="http://www.chromeextensions.org/appearance-functioning/adblock/">AdBlock Plus</a> and <a href="http://www.chromeextensions.org/appearance-functioning/adblock/">FlashBlock</a> are available for Chrome as extensions now, so you can drastically reduce the clutter on most web pages. Unfortunately they don't seem to work as well on Chrome as they do on Firefox. The web-sites for some Indian banks also don't work very well with Chrome, though they work quite well with Firefox - this seems more due to browser-identity-based behaviour modification on their part than due to some inherent flaw with Chrome.<br />
<br />
I was quite fascinated by the detailed memory-usage statistics provided by the special "<tt>about:memory</tt>" URL in Chrome and how it managed to keep memory-usage in check during an extended browsing session. This is most likely due to its <a href="http://www.chromium.org/developers/design-documents/process-models">multiple-processes-based architecture</a>. It definitely scores over Firefox in this area, which suffers from <a href="http://blog.pavlov.net/2007/11/10/memory-fragmentation/">memory fragmentation</a> in a single process after several memory allocations and releases.<br />
<br />
Poking around the Chrome installation package, we find that the base URL for the package repository is <tt>http://dl.google.com/linux/deb/</tt> - this being <a href="http://www.debian.org/doc/manuals/repository-howto/repository-howto.en.html">a standard Debian package repository</a>, the meta-data for updated packages can therefore be obtained from <a href="http://dl.google.com/linux/deb/dists/stable/main/binary-i386/Packages.gz">http://dl.google.com/linux/deb/dists/stable/main/binary-i386/Packages.gz</a>. Uncompress this file using <tt>gunzip</tt> and find the appropriate section for Chrome by looking for the line "<tt>Package: google-chrome-unstable</tt>" - the subsequent "<tt>Version:</tt>" line gives the latest available version of Chrome. If you wish to update your Chrome installation to this version, look for the subsequent "<tt>Filename:</tt>" line that provides the path to the installation package relative to the base URL of the package repository. For example, the URL of the package for the latest version of Chrome currently available is "<a href="http://dl.google.com/linux/deb/pool/main/g/google-chrome-unstable/google-chrome-unstable_4.0.249.4-r32475_i386.deb">http://dl.google.com/linux/deb/pool/main/g/google-chrome-unstable/google-chrome-unstable_4.0.249.4-r32475_i386.deb</a>".<br />
<br />
Hopefully there will soon be more generic builds of the browser that can run on most Linux distributions and automatically update themselves (just like Firefox). The workarounds given above, though not too complicated, are somewhat cumbersome. They are however enough to get you started with Chrome on a Slackware Linux PC so that you can play around with it and get a feel for it.<br />
<br />
Impressive as Chrome is, I'm not yet shifting to it and am sticking with Firefox for regular browsing. The Firefox extensions that I depend on either do not work properly in Chrome or are not available for it. All the web-sites that I care for work properly in Firefox, while some do not work well in Chrome. I use a lot of keyboard short-cuts in Firefox - some of these work in Chrome while others don't (e.g. Ctrl+Shift+Enter to convert "foo" to "http://www.foo.org/" in the location bar). I tweak Firefox a lot using "<tt>about:config</tt>", which seems to be missing in Chrome. While Firefox seems slower and more bloated than Chrome, I hope that some day it becomes as good as, or even better than, Chrome.<br />
<br />
<b>Update (2009-11-23):</b> I hadn't noticed it earlier, but Slacky seems to provide ready-made builds of Chrome for Slackware. For example, <a href="http://repository.slacky.eu/slackware-12.2/network/google-chrome/">for 12.2</a> and <a href="http://repository.slacky.eu/slackware-13.0/network/google-chrome/">for 13.0</a> (but not for 12.1).<br />
<br />
<b>Update (2009-12-02):</b> Follow the <a href="http://googlechromereleases.blogspot.com/">Google Chrome Releases blog</a> to know about the latest Chrome releases, including those in the developer channel.<br />
<br />
I use a small shell script called "<a href="http://cid-65b7c3a02dd61662.skydrive.live.com/self.aspx/.Public/chkchrome.sh">chkchrome.sh</a>" to download and extract such releases using the method described in this post. I also have a small TAR archive that stores the symbolic links and overriding shared libraries needed to run Chrome and keep it in "<tt>$HOME/tmp/chrome-libs.tar.bz2</tt>" - the <tt>chkchrome.sh</tt> script automatically extracts this archive into the installation folder so that Chrome is ready to use once the script finishes executing successfully.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-44641731957821195332009-11-02T23:08:00.001+05:302010-01-09T22:45:08.584+05:30The Landmark Quiz 2009I participated in the <a href="http://www.landmarkonthenet.com/Events/EventDetails.aspx?Code=EVNT21">Landmark Quiz 2009 (Bangalore)</a> yesterday on a lark along with a colleague and a remote acquaintance of his. Our team was appropriately named "Last Minute Line-up". We only managed to get 19 correct answers in the preliminaries for the 40 questions that were asked. We didn't make it to the finals, but it was fun watching the quiz.<br />
<a name='more'></a><br />
I hadn't participated in an open quiz in quite a while (the better part of a decade, if I remember correctly). My friend Ananth used to take me to various quizzes organised by the <a href="http://kqaquizzes.org/">KQA</a> while he was here in Bangalore. It was fairly intimidating, to say the least - questions that would stump me would turn out to be "sitters" for everyone else. Teams like "We Are Like This Wonly" and "Metaquizziks" would be leagues ahead of the rest and almost all finals would be a contest among these top teams - it is amazing that even after all these years, they <i>still</i> seem to reign supreme - "We Are Like This Wonly" won the finals yesterday.<br />
<br />
The quizzes seem to be much bigger now - there's a fair amount of money involved these days and a much larger participation from people. There were about 370 three-person teams taking part yesterday while the Chennai edition of the quiz apparently had more than 700 such teams (which was actually a step down from <a href="http://www.hinduonnet.com/thehindu/mp/2004/08/17/stories/2004081700020200.htm">the 916 that took part in 2004</a>). The quiz was conducted by Navin Jayakumar and was fairly slick. There was no entry fee and snacks were free courtesy the sponsors. The auditorium (St John's Auditorium, Koramangala) was large enough for the teams as well as the audience.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com2tag:blogger.com,1999:blog-17482943.post-85996920949607914102009-09-24T22:38:00.001+05:302010-01-09T22:46:17.214+05:30A Good Reader IndeedI was looking for an application for the iPhone which could display PDF files on this device, especially those containing images, in a way better than that provided by the built-in support for PDF files on the iPhone. I stumbled upon an application imaginatively named "<a href="http://www.goodiware.com/goodreader.html">GoodReader</a>" that does this job very well. It is not free, but at the current price of 99 cents (versus the usual USD 4.99), it's a bargain.<br />
<a name='more'></a><br />
GoodReader displays PDF files almost as well as a desktop application. It has very good zooming facilities ("50x") that let you read text and look at images without much loss of fidelity. Its "tap zones" make navigating through PDF files easier than what I expected within the constraints of the iPhone form-factor. The best feature is its decent ability to extract text out of such files and "reflow" them in order to make most PDF documents very easy to read on the iPhone.<br />
<br />
GoodReader also makes it very easy to transfer documents to the iPhone. For example, in the Wi-Fi transfer mode you start a built-in web-server and then connect to the displayed URL via an ordinary browser on a desktop machine within the same network - you can then easily upload documents from the machine into your iPhone using a simple web-based interface. There is also a built-in web-browser that lets you download files directly from the Internet.<br />
<br />
This application is a must-have if you want to read PDF files on the iPhone. Before using this application, I tried to convert PDF files to the <a href="http://en.wikipedia.org/wiki/EPUB">EPUB</a> format using <a href="http://calibre.kovidgoyal.net/">Calibre</a> and then reading them using <a href="http://www.lexcycle.com/">Stanza</a>. This method is outlined <a href="http://www.mobileread.com/forums/showthread.php?p=391919">here</a>. I had problems using the built-in content server of Calibre and the text was mangled when viewed in Stanza. The GoodReader approach was much simpler and produced far superior results.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-89000690639263759822009-09-23T21:43:00.003+05:302010-01-09T22:48:10.074+05:30PDF Manipulation ToolsI wanted to manipulate a few PDF files recently and was on the lookout for suitable tools. More specifically, I wanted to convert a few double-page PDF files (containing two pages of text on a single page) into single-page PDF files. I also wanted to drop some of the pages in order to have the files contain just the text that I was interested in. Fortunately for me, there are several freely-available tools that do the job well.<br />
<a name='more'></a><br />
The Perl <a href="http://pdfapi2.sourceforge.net/">PDF::API2</a> CPAN module is fairly versatile and quite handy if you know a bit of programming. For example, <a href="http://snipplr.com/view/18924/split-crop-double-page-pdfs-in-two/">this script</a> by "iblis" converts a double-page PDF into a single-page PDF. (There is a slight bug in that script - you should remove the quotes on line #28 or your output files will always literally be named "$newfilename".) According to its web-site the PDF::API2 is unfortunately no longer being maintained, though that certainly does not diminish its utility.<br />
<br />
The <a href="http://www.pdftk.com/">pdftk</a> command-line tool is quite useful for a number of tasks on PDF files. For example, to extract pages 2 to 10 and 15 to 23 from a PDF file named "foo.pdf" and create a PDF file named "bar.pdf", you can execute:<br />
<br />
<code>pdftk A=foo.pdf cat A2-10 A15-23 output bar.pdf</code><br />
<br />
See its web-site for a number of other examples that show its power. Its command-line syntax takes a little while to get used to, but that's worth the effort. Note that the author of the tool uses <a href="http://gcc.gnu.org/java/">GCJ</a> to create standalone executables, especially on Windows - it is gratifying to realise that yours truly had a part to play, however small, in making this happen.<br />
<br />
I also looked at some other tools, notably <a href="http://www.pdfsam.org/">PDF Split and Merge</a> (PDFsam) and <a href="http://www.pdfill.com/">PDFill</a>. PDFsam is written in Java and looks promising; unfortunately for me, a warning tone was all that I could get out of it as I tried out its different plug-ins. I didn't get around to trying PDFill as pdftk and PDF::API2 were more than enough for my purpose.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-9543961340319659062009-09-01T20:58:00.010+05:302010-01-09T22:48:38.237+05:30"Capital Gains"The latest issue of <a href="http://www.granta.com/">Granta</a> has an article by Rana Dasgupta titled "<a href="http://www.granta.com/Magazine/107/Capital-Gains/1">Capital Gains</a>". It talks about the <i>huge</i> wealth and power recently accumulated by a few in Delhi, their unabashed flaunting of this new-found wealth and power, their displacement of the previous elite who are now disgusted and the resulting class divisions in the society. It is a long article, but well worth the read.<br />
<a name='more'></a><br />
Bangalore too has its share of the newly-created ultra-rich class (mainly through real-estate, mining, politics and I.T.) - just take a walk around B.T.M. Layout or J.P. Nagar to see the evidence - but they are apparently far fewer in number and thankfully far less ostentatious.<br />
<br />
(<a href="http://www.business-standard.com/india/news/endless-freedom/368406/">Via Business Standard</a>.)Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com1tag:blogger.com,1999:blog-17482943.post-84944856437662296932009-06-30T22:18:00.008+05:302010-01-09T22:49:16.855+05:30ICFPC 2009I spent this weekend participating in the <a href="http://www.icfpcontest.org/">ICFP contest</a>. This year the task was a series of problems of increasing difficulty in which we had to steer a satellite orbiting the Earth in order to accomplish various objectives. Like the task <a href="http://rmathew.blogspot.com/2008/07/icfpc-2008.html">last year</a>, it depended heavily on physics, mathematics, your knowledge of a particular domain and the stability of your numerical calculations, not to mention the need for the occasional compensating manoeuvre. It was fairly tedious and I didn't quite enjoy it as much as I did the tasks from some of the previous years.<br />
<a name='more'></a><br />
Like the tasks in <a href="http://rmathew.blogspot.com/2006/07/icfpc-2006.html">2006</a> and <a href="http://rmathew.blogspot.com/2007/07/icfpc-2007.html">2007</a>, the task this year involved implementing a virtual machine so that the teams could use whichever language and environment they felt comfortable with, while relieving the organisers of the onerous task of having to support myriad languages and libraries that nevertheless left many a team grumbling in dissatisfaction.<br />
<br />
The organisers supplied binaries for simulating the different problems. These binaries had to be interpreted in a virtual machine implemented by the teams and represented the controller of the satellite. The teams had to feed inputs to this controller in order to solve the associated problem. They then had to submit the execution traces of these simulations as their solutions. They would typically also implement a visualisation tool to see what is happening. The little-endian 4-byte unsigned integers and 8-byte IEEE-754 floating-point numbers used by the virtual machine input and output formats were a perfect match for programmes running on x86-32. <br />
<br />
<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNO2cDeL-5dIfCLo21GtRdrRMUVaNgQrQYg_6L9QaMdHFx9MekSetwU6GYx-TrYDGncrctY8UBfVfswxH8qduLN4BNE4lzidW96as8zuW5upg8MvD43SW2j9QZuFONxu5sdp_1eg/s1600-h/mng.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 251px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNO2cDeL-5dIfCLo21GtRdrRMUVaNgQrQYg_6L9QaMdHFx9MekSetwU6GYx-TrYDGncrctY8UBfVfswxH8qduLN4BNE4lzidW96as8zuW5upg8MvD43SW2j9QZuFONxu5sdp_1eg/s320/mng.png" alt="" id="BLOGGER_PHOTO_ID_5353165431601309602" border="0" /></a><span style="font-size:85%;">Catching a Target Satellite (in Red) Using a Hohmann Transfer Orbit</span> </div><br />
The simplest problem was to put the satellite into another orbit using a <a href="http://en.wikipedia.org/wiki/Hohmann_transfer_orbit">Hohmann transfer orbit</a> while burning the least amount of fuel. This is a neat two-burn manoeuvre that transfers a satellite in one circular orbit into another circular orbit using an interim elliptical half-orbit. The next couple of problems were to attempt a rendezvous with a passive target satellite orbiting in circular and elliptical orbits respectively. The hardest problem ("Operation Clear Skies") was to make the satellite rendezvous with various other passive satellites in different orbits around the Earth, with the Moon also exerting its gravitational pull, while stopping by every now and then at an orbiting fuel station to replenish burnt fuel. Each problem had four different configurations representing various test scenarios. <br />
<br />
<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRc_pC4CGGR_zU5F6BHbkxNzVfIn_IU9Jzm4Sw1cQmd2Cs4oA25wAz0Y2_ykk0PM046VNLNxt8mr_phyd-Fv7qG4zxVN08JucnDI_0sQOl2BPYuuU_FCExXGLfu-uCgMFH64nHwA/s1600-h/ocs.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 251px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRc_pC4CGGR_zU5F6BHbkxNzVfIn_IU9Jzm4Sw1cQmd2Cs4oA25wAz0Y2_ykk0PM046VNLNxt8mr_phyd-Fv7qG4zxVN08JucnDI_0sQOl2BPYuuU_FCExXGLfu-uCgMFH64nHwA/s320/ocs.png" alt="" id="BLOGGER_PHOTO_ID_5353165756107981954" border="0" /></a><span style="font-size:85%;">The Final "Operation Clear Skies" Problem (Without the Moon) </span></div><br />
I chose C99 for my implementation and used <a href="http://www.libsdl.org/">SDL</a> for the graphics. I spent the first day learning about <a href="http://www.braeunig.us/space/orbmech.htm">the basics of orbital mechanics</a>, implementing the virtual machine, creating a basic visualisation tool and solving the first problem. I spent the second and third days improving the visualisation tool and trying to solve the second problem with an acceptable margin of error (staying within 1 km of the target satellite for at least 900 seconds). I gave up on the third day since it became somewhat irritating to continue with the task. I ended up having submitted solutions only to the four configurations from the first problem.<br />
<br />
A lot of my time on the first day was spent in trying to figure out why my satellite was not moving in the direction I intended for it, until I finally realised that I had to fire its thrusters in the direction <i>opposite</i> to the target direction. For the rendezvous in the second problem, my satellite would get somewhat close to the target satellite, but not close enough to term it a success. This was partly because the discrete per-second simulation allowed manoeuvres only every one second and partly because of compounding numerical errors. I tried a lot of compensating manoeuvres to overcome their effects, but still couldn't solve it satisfactorily.<br />
<br />
I am now filled with immense respect for rocket scientists who manage to successfully dock space shuttles, space stations and satellites under much more complicated conditions than the ones simulated by the task for this year's contest. Last year, I was similarly in awe of designers of autonomous rovers for harsh alien terrains like that on Mars.<br />
<br />
<b>Update (2009-07-07):</b> There is now an <a href="http://www.reddit.com/r/icfpcontest/">ICFP contest sub-reddit</a> where you can find links to write-ups from other teams.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com4tag:blogger.com,1999:blog-17482943.post-39099109793895588872009-06-21T22:28:00.007+05:302010-01-09T22:49:52.438+05:30Up and DownAre you better off if your investment first gains 10% of its value and then loses 10% or if it first loses 10% in value and then gains 10%? Many of us immediately tend to think that we're back to where we started in both the cases, but a little thought would reveal that we have <i>lost</i> money in both the cases.<br />
<a name='more'></a><br />
Suppose you put in Rs 10,000 into an investment vehicle. When it gains 10% in value, it becomes worth Rs 11,000; a loss of 10% after that makes it worth Rs 9,900. If it instead starts by losing 10% in value, it becomes worth Rs 9,000; a gain of 10% after that makes it worth Rs 9,900. Its worth is the same (lower) value in both the cases. In fact, you can easily calculate that a sum "S" becomes "S×(1 - x<sup>2</sup>)" if it first increases/decreases "x" times (0 ≤ x ≤ 1) and then decreases/increases "x" times. Note that if your investment loses 50% of its value, you subsequently need a gain of 100% just to get your original investment back. A gain of 100% "merely" doubles your investment, while a loss of 100% completely wipes it out.<br />
<br />
In other words, decreases usually have a disproportionate effect on us compared to the corresponding increases. This applies to their emotional impact on us as well. For example, compare your feeling on finding a 100 rupees note on the road to your feeling on discovering that a 100 rupees note has slipped through a hole in your pocket. You generally feel a lot worse on losing money than on gaining the same amount of money.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-39966503840455271072009-05-31T20:02:00.006+05:302010-01-09T22:50:24.626+05:30ReadabilityI get to read a lot of articles on-line thanks to feeder web-sites like <a href="http://slashdot.org/">Slashdot</a>, <a href="http://www.reddit.com/">Reddit</a>, <a href="http://news.ycombinator.com/">Hacker News</a> and <a href="http://www.aldaily.com/">Arts & Letters Daily</a>. Many of these articles have web-pages that are very "noisy" in that they have advertisements, logos, unrelated links, snippets of arbitrary text, etc. In addition they often have uncomfortably small fonts and are broken into several short web-pages. These make it quite difficult to read such articles. Fortunately there is now a magic wand I can wave over them to make them more readable.<br />
<a name='more'></a><br />
Switching to a "printer-friendly" or "single-page" view helps, as does using <a href="http://adblockplus.org/">Adblock Plus</a> to suppress obnoxious advertisements. The biggest benefit however comes from using <a href="http://lab.arc90.com/experiments/readability/">Readability</a>, a customisable <a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklet</a> from the fine folks at <a href="http://www.arc90.com/">arc90</a>. It works surprisingly well on a <i>lot</i> (though not all) of web-pages. It was inspired by <a href="http://www.instapaper.com/">Instapaper</a>, a similar tool that you can use to queue readable versions of articles to read later at leisure. It works by showing only the "main" portion of a web-page, in a large font and with wide margins.<br />
<br />
Incidentally Arts & Letters Daily is a fantastic resource for finding thought-provoking and well-written articles on society, culture, literature, etc. (thanks Ananth). <a href="http://www.scitechdaily.com/">SciTech Daily</a> is a similar web-site focussing on science and technology. <a href="http://arstechnica.com/">Ars Technica</a> is another web-site that provides well-written and well-researched original articles on technology. These are web-sites that have maintained their quality over the years, unlike Slashdot, Reddit and Hacker News that have steadily been going downhill as they have become more and more popular.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-36743146999639029212009-05-20T11:00:00.007+05:302011-01-05T20:18:01.396+05:30Reynolds LiquifloIt seems silly to gush about a pen on a blog, but I can't help it: the <a href="http://reynolds-india.com/reynolds/products/Liquiflo/Liquiflo">Reynolds Liquiflo</a> pen seems to actually live up to its claim of having an "ink that glides on paper" and it's a delight to write with this pen. At just Rs 10, it's surprisingly affordable as well. It's the kind of pen that makes you want to write on paper simply for the pleasure of writing with it. I am tempted to keep an old-fashioned diary just to have an excuse for using this pen every day.<br />
<a name='more'></a><br />
I tend to ignore advertisements for pens since the promoted pens almost never live up to the hype and often offer marginal improvements at best over existing pens. It was therefore by pure accident that I stumbled upon this pen. As it happened, Anusha and I were eating at "The French Quarter Bistro" on 100 ft road in Indiranagar the other day (fairly good food served in a nicely spacious place, by the way) and the usual feedback form at the end was accompanied by this pen. We were wondering later whether it was a conscious decision on their part to provide this particular pen so that people are encouraged to write detailed comments.<br />
<br />
<b>Update (2011-01-05):</b> It turns out that the pen starts leaking towards the end, making writing with it a messy affair (as Tushar also warns in the comments). It's not quite the perfect pen after all. By the way, the French Quarter Bistro seems to have shut down.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com7tag:blogger.com,1999:blog-17482943.post-19576485627075702232009-05-10T12:26:00.004+05:302010-01-13T15:12:53.565+05:30Extreme DemosOne of the goals in creating a <a href="http://en.wikipedia.org/wiki/Demo_(computer_programming)">demo</a> is to push hardware to its limits. With PC hardware getting more and more powerful, watching a demo on a PC is getting more and more underwhelming. Some demo coders seem to have decided to go back to minimal platforms where you can readily appreciate the effort and skills needed to produce the respective demo.<br />
<a name='more'></a><br />
For example, <a href="http://www.linusakesson.net/scene/craft/">Craft</a> is a demo by Linus Akesson running on a minimal custom board based on the <a href="http://en.wikipedia.org/wiki/ATmega88">ATmega88</a> micro-controller. <p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/sNCqrylNY-0&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/sNCqrylNY-0&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object> <p>As another example, Youscope is a demo by "<a href="http://koodaa.mine.nu/tvt/">TVT</a>" that uses the <a href="http://en.wikipedia.org/wiki/Oscilloscope#X-Y_mode">X-Y mode of an oscilloscope</a> to show the demo - use a PC to play the corresponding soundtrack and you see the demo on the oscilloscope when you connect the right channel to the X input and the left channel to the Y input. <p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/s1eNjUgaB-g&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/s1eNjUgaB-g&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object> <p>Very impressive.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com0tag:blogger.com,1999:blog-17482943.post-866144864920851082009-05-05T18:13:00.008+05:302010-01-13T15:13:16.641+05:30Driving Directions for BangaloreSome time back I noticed that <a href="http://maps.google.com/">Google Maps</a> has now started provided driving directions for Bangalore (and some other Indian cities). This is a very useful feature if you live in Bangalore and wish to avoid its awful traffic as much as possible. It's invaluable if you are new to the city and trying to figure your way around it.<br />
<a name='more'></a><br />
For example, here is the route it suggests you take if you wish to go directly upon arrival at the Bangalore central railway station to Brigade Road: <p><iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=d&source=s_d&saddr=Gubbi+Thotadappa+Rd&daddr=12.975127,77.607851&hl=en&geocode=FXQJxgAdJKOfBA%3B&mra=mi&mrsp=1&sz=15&sll=12.977,77.606263&sspn=0.019948,0.024548&ie=UTF8&ll=12.979468,77.591972&spn=0.058546,0.072956&z=13&output=embed"></iframe><br />
<small><a href="http://maps.google.com/maps?f=d&source=embed&saddr=Gubbi+Thotadappa+Rd&daddr=12.975127,77.607851&hl=en&geocode=FXQJxgAdJKOfBA%3B&mra=mi&mrsp=1&sz=15&sll=12.977,77.606263&sspn=0.019948,0.024548&ie=UTF8&ll=12.979468,77.591972&spn=0.058546,0.072956&z=13" style="color:#0000FF;text-align:left">View Larger Map</a></small> <p>The route calculator does seem to take one-way roads into account, though not the usual traffic-density or the condition of the roads involved. For example, even though J. C. Road is a wide arterial road, it should be avoided around office hours on a weekday if you do not fancy being stuck in a jam or crawling traffic. As another example, the work for building the Metro rail network has severely disrupted the traffic on many a road in Bangalore. To be fair, these parameters are quite variable and perhaps difficult to keep up-to-date. <p>It's fun to discover that some of your pet routes for going to different places in the city can be improved upon by making them shorter, some times in surprising ways. It does not <i>always</i> suggest the shortest path though - you can drag the suggested route around a bit to see if there's a slightly shorter path available. <p>It would be nice if Google provided this feature for GPS-enabled smart-phones connected via GPRS and then collaborate with cellular network providers to use the density of mobile phones in a cell as a decent approximation to the traffic congestion in that area in order to dynamically suggest alternate routes to you.<br />
<p><b>Update (2009-12-18):</b> They now provide <a href="http://googleblog.blogspot.com/2009/12/go-thataway-google-maps-india-learns-to.html">landmark-based navigation for Bangalore</a>. This is pretty cool and quite useful.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com1tag:blogger.com,1999:blog-17482943.post-24140925215893158612009-03-01T18:25:00.004+05:302010-01-13T15:14:00.697+05:30The TormentorAbout ten years ago, I was assigned as a mentor for the "Data Structures and Algorithms" course in a boot camp for freshers who had joined the company that I was working for at the time. My task was to answer any queries that the students might have had about the concepts taught in the course and then to test their understanding by giving them a related assignment. Looking back at one of these assignments, I can understand why I was nicknamed the "tor-mentor".<br />
<a name='more'></a><br />
For some reason, <a href="http://ommh.blogspot.com/">Manju</a> has preserved one of these assignments that I am now reproducing below. The students were expected to finish this assignment in the post-lunch half of the day and were divided into groups of three to four for this task. At least two groups chose the problem in Section B (Manju was in one of them, as was <a href="http://sriki77.blogspot.com/">Sriki</a>) and demonstrated a working implementation within the assigned time. <pre> Data Structures and Algorithms
==============================
Instructions:
-------------
1) Solve either the three problems in Section A or the
single problem in Section B. You must implement your
algorithms as working programs in the C language.
2) Try to keep your programs as simple as possible.
Take care of proper program layout and embellish it
with useful comments at the appropriate places.
3) Make your programs as robust as possible. All borderline
cases should be handled properly and the program should
exit gracefully under all circumstances.
Section A
=========
Problem A1: Prime Number Generation
-----------------------------------
Given a positive number N, generate all the prime numbers
from 2 to N. The primary emphasis in the solution to this
problem should be on speed. In addition, you must not consume
an inordinate amount of memory.
Problem A2: Arbitrary Precision Arithmetic
------------------------------------------
Implement an arbitrary precision arithmetic calculator.
You should implement addition, subtraction, multiplication
and division in the respective order. Try to make your
program as fast as possible and keep memory usage to the
bare minimum.
Problem A3: Sub-string Search
-----------------------------
Given two strings S1 and S2, determine whether S2 occurs
as a substring in S1 and if so, find the first occurrence
of S2 in S1. Your program should be extremely fast. Try
to come up with a linear solution to the problem.
Section B
=========
Problem B1: Simple File-system Implementation
---------------------------------------------
Implement a simple filesystem within a normal file on the
hard disk, i.e. treat the file as a virtual disk and
implement the filesystem by manipulating records within the
file.
You are free to devise your own scheme for the file system
but it should minimally support the following operations:
1) Create - Create a virtual hard disk on a file of the
specified size and "format" it. Formatting would
essentially involve initialising disk allocation
structures and whatever else you need to do before
you can have a valid filesystem.
2) Open, Read, Write, Close - All the normal file operations
to use the files.
3) Delete, Rename - Remove unwanted files or rename existing
files.
Do not place artificial restrictions on file names, sizes, etc.
In addition, if you can, provide support for folders (also known
as directories) which can be arbitrarily nested. Provide all
the common operations for folders.
You should implement this as a library of routines that can be
used by anyone wanting to treat a file as a filesystem.
Demonstrate the correctness of your routines by writing a demo
program that lets one manipulate files interactively.
--- X ---
</pre>Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com4tag:blogger.com,1999:blog-17482943.post-79423599946217030842009-02-21T20:00:00.005+05:302010-01-13T15:14:22.044+05:30Color JunctionI came across an interesting and addictive puzzle game recently called <a href="http://www.google.com/ig/directory?url=www.google.com/ig/modules/colorjunction.xml">Color Junction</a>. It was created by <a href="http://www.persistent.info/">Mihai Parparita</a> of Google and is based on <a href="http://en.wikipedia.org/wiki/SameGame">SameGame</a> (formerly <a href="http://www.asahi-net.or.jp/~ky6k-mrb/chainsht.htm">Chain Shot!</a>) by <a href="http://www.asahi-net.or.jp/~ky6k-mrb/">Kuniaki Moribe</a>.<br />
<a name='more'></a><br />
The objective of the game is quite simple: clear as many coloured tiles as possible from the board. You can clear tiles by clicking on them, but only when two or more tiles of the same colour are connected. The tiles are attracted to the bottom left corner of the board - when a tile is cleared, the tiles above it fall down; if there are no tiles above it then the tiles to its right move to the left to fill in the space. <div style="text-align: center;"><script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/colorjunction.xml&up_difficulty=4&up_size=15&up_bestScores=00%3A20%7C00%3A35%7C01%3A00%7C00%3A35%7C01%3A15%7C02%3A00%7C01%3A00%7C02%3A00%7C03%3A15&up_boardStyle=1&up_lastScores=00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00&synd=open&w=320&h=300&title=Color+Junction+by+Mihai+Parparita&lang=all&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script></div>You can control the difficulty level and the board size in this version of the game. There is also a version of Color Junction <a href="http://tibulle.com/colorjunction/">in Flash</a> and as a standalone programme <a href="http://www.svidersky.net/colorjunction/">for Windows</a>, in case you like additional control over the game. I have not been able to come up with a strategy that consistently clears the board. Quite embarrassingly, none of my strategies perform significantly better than random clearing of tiles.Ranjit Mathewhttp://www.blogger.com/profile/04429610992943896537noreply@blogger.com2