tag:blogger.com,1999:blog-179129432024-03-13T23:33:45.018+05:30CG's RamblingsAnonymoushttp://www.blogger.com/profile/13362716944261989667noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-17912943.post-17157571875156402562015-07-27T02:12:00.002+05:302015-07-27T02:20:12.412+05:30ICICI Bank gives unfettered access to your netbanking account to Google<div dir="ltr" style="text-align: left;" trbidi="on">
After seeing <a href="http://jacquesmattheij.com/one-million-websites">this project</a> by Jacques Mattheij on which of the top 1,000,000 websites load external resources, I decided to check whether my bank, ICICI Bank, does the same. Unfortunately, it turns out that they do load external resources, including Javascript, from Google. This seriously compromises the security and privacy of their users like me. <br />
<br />
Here's the text of an email I sent to them.<br />
<br />
<blockquote class="tr_bq">
Subject: ICICI Bank gives unfettered access to my netbanking account to Google<br />
<br />
Hi,<br />
<br />
It seems ICICI Bank is using Google Analytics to track user behaviour and Google Tag Manager to track online campaigns. To enable this your netbanking website loads Javascript sources directly from these two services. The URLs are:<br />
<br />
https://www.google-analytics.com/analytics.js<br />
https://www.googletagmanager.com/gtm.js?id=GTM-WZFKRK<br />
<br />
This unfortunately gives Google unfettered access to my netbanking account. The first script, from Google Analytics, is loaded on both the login page and on subsequent pages after login. The second script is loaded only after login. Some of the things that this allows Google to do are:<br />
<br />
* Steal my customer id and password<br />
* Read my debit card grid number (not all, but some of the pages where the grid numbers are required load these scripts)<br />
* Get info (account number, balance, etc.) about my bank account, loan account, deposits, etc.<br />
* Read my account statements<br />
* Get the list of my payees for funds transfer (including their account numbers)<br />
<br />
This list is by no means exhaustive, but even leaking this much info about your users to a third party is extremely worrying. This is serious enough that I am considering moving to another bank where my privacy is taken more seriously.<br />
<br />
For the sake of your users, please remove all references to these external scripts from your netbanking website on a priority.<br />
<br />
Chaitanya</blockquote>
Now, many websites trust Google Analytics to provide them insights about their users, and in many cases you might be able to argue that its fine if a script is provided directly by Google. However, my bank account details are too sensitive for Google or any other third party to be given unfettered access like this, no matter how much you may trust them. I hope ICICI Bank will remove Google's scripts from their netbanking website soon.<br />
<br />
Also, while its better to check for yourself, here's "proof" of what I am claiming:<br />
<br />
<a href="http://imgur.com/4k7csKk"><img src="http://i.imgur.com/4k7csKkh.png" title="source: imgur.com" /></a>
<br />
<a href="http://imgur.com/EhTIE6z"><img src="http://i.imgur.com/EhTIE6zh.png" title="source: imgur.com" /></a>
</div>
Anonymoushttp://www.blogger.com/profile/13362716944261989667noreply@blogger.com5tag:blogger.com,1999:blog-17912943.post-66456204774856069792013-10-07T22:48:00.000+05:302013-10-07T22:50:50.564+05:30Print bit representation of a signed integer in Common Lisp<p>
So, how do you print the bits of a signed integer in Common Lisp? Easy enough:
</p>
<pre><code>(defun print-bits (n)
(let ((*print-base* 2))
(print n)
(values)))
> (print-bits 10)
<i>1010</i>
</code></pre>
<p>Or</p>
<pre><code>(defun print-bits (n)
(format t "~B" n)
(values))
> (print-bits 10)
<i>1010</i>
</code></pre>
<p>
But what happens if you try to print a negative number?
</p>
<pre><code>> (print-bits -10)
<i>-1010</i>
</code></pre>
<p>
Not exactly what we were looking for -- we were looking for the bit representation of this number in two's complement form, which is how logical operations treat integers in Common Lisp. So how do we print the bits in two's complement form? The trick is to use <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ldb.htm"><code>ldb</code></a>. <code>ldb</code> returns a non-negative integer with the exact bits that were contained in the given integer, be it positive or negative.
</p>
<pre><code>(defun print-bits (n size)
(format t "~B" (ldb (byte size 0) n))
(values))
> (print-bits -10 8)
<i>11110110</i>
> (print-bits -1 16)
<i>1111111111111111</i>
</code></pre>
<p>
where <code>size</code> is the number of bits that we want to print. Note that you need to be careful about size since this will truncate the printed bits if integer can't be represented in <code>size</code> bits.
</p>
<p><i>Bonus:</i> How do you pad this binary representation to the given <code>size</code> with zeroes on the left for positive numbers? (negative numbers are already padded)
<pre><code>(defun print-bits (n size)
(format t (format nil "~~~D,'0B" size) (ldb (byte size 0) n))
(values))
> (print-bits 1 4)
<i>0001</i>
> (print-bits 1 8)
<i>00000001</i>
> (print-bits -1 16)
<i>1111111111111111</i>
</code></pre>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-79821088693675924452013-07-27T11:08:00.001+05:302013-07-27T11:44:52.454+05:30A neat reader trick for DO/DO*<div dir="ltr" style="text-align: left;" trbidi="on">
So instead of using <code>LOOP</code> every time I needed to use a general purpose looping construct, yesterday I decided to give <code>DO/DO*</code> a shot. The biggest problem that I had with <code>DO</code> was code repetition when the step-form and init-form of an iteration variable were to be the same. For example:<br />
<pre><code>
(defun alignment-octets (encryption-fn)
(let ((block-size (find-cipher-block-size encryption-fn))
(octet-1 65)
(octet-2 66))
(do* ((test-input-1 (make-octets block-size :initial-element octet-1))
(test-input-2 (make-octets block-size :initial-element octet-2))
(change-index 0 (1+ change-index))
(mismatch-start (mismatch (funcall encryption-fn test-input-1)
(funcall encryption-fn test-input-2))
(mismatch (funcall encryption-fn test-input-1)
(funcall encryption-fn test-input-2)))
(mismatch-end (mismatch (funcall encryption-fn test-input-1)
(funcall encryption-fn test-input-2)
:from-end t)
(mismatch (funcall encryption-fn test-input-1)
(funcall encryption-fn test-input-2)
:from-end t)))
((= block-size (- mismatch-end mismatch-start))
(subseq test-input-1 0 change-index))
(setf (aref test-input-2 change-index) octet-1))))</code></pre>
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
See the iteration vars <code>MISMATCH-START</code> and <code>MISMATCH-END</code> above. I spent some time thinking about how this could be avoided. It didn't seem like <code>DO</code> itself would help us much here. Maybe <code>MACROLET</code> would help, but the solution would probably not be very clean or readable. This seemed like a dead end. However, the Common Lisp reader has a trick up its sleeve -- the dispatch macro character constructs <a href="http://www.lispworks.com/documentation/HyperSpec/Body/02_dho.htm">#n=</a> and <a href="http://www.lispworks.com/documentation/HyperSpec/Body/02_dhp.htm">#n#</a>. To put it simply, if any s-expression is prefixed with <code>#n=</code> (where n is an unsigned decimal integer), then the Lisp reader will replace any corresponding <code>#n#</code> with this s-expression. To be more accurate, the reader treats <code>#n#</code> as a pointer to the same(eq) object that is labeled by <code>#n=</code>.<br />
<br />
Let's see this in action:<br />
<pre><code>
(defun alignment-octets (encryption-fn)
(let ((block-size (find-cipher-block-size encryption-fn))
(octet-1 65)
(octet-2 66))
(do* ((test-input-1 (make-octets block-size :initial-element octet-1))
(test-input-2 (make-octets block-size :initial-element octet-2))
(change-index 0 (1+ change-index))
(mismatch-start #1=(mismatch (funcall encryption-fn test-input-1)
(funcall encryption-fn test-input-2))
#1#)
(mismatch-end #2=(mismatch (funcall encryption-fn test-input-1)
(funcall encryption-fn test-input-2)
:from-end t)
#2#))
((= block-size (- mismatch-end mismatch-start))
(subseq test-input-1 0 change-index))
(setf (aref test-input-2 change-index) octet-1))))
</code></pre>
<br />
An elegant solution to a not so simple problem. Now try this in your favourite language!</div>
</div>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-2761030748236918402012-05-10T19:24:00.003+05:302012-05-11T09:42:06.309+05:30A git diff driver for core data model files<div dir="ltr" style="text-align: left;" trbidi="on">
Whenever you make a bunch of changes to core data model (xcdatamodel) files, its impossible to know with <code>git diff</code>, what exactly changed. Usually, the output looks like:<br />
<pre><code>
diff --git a/Recipes.xcdatamodel/elements b/Recipes.xcdatamodel/elements
index 35a20f3..939bc61 100644
Binary files a/Recipes.xcdatamodel/elements and b/Recipes.xcdatamodel/elements differ
diff --git a/Recipes.xcdatamodel/layout b/Recipes.xcdatamodel/layout
index 052f0e8..18906a4 100644
Binary files a/Recipes.xcdatamodel/layout and b/Recipes.xcdatamodel/layout differ
</code></pre>
<br />
Git, however, provides a way to diff binary files as if they were text. Using a diff driver and a binary to text converter[1], we can control git's diff output so that we get this:<br />
<pre><code>
diff --git a/Recipes.xcdatamodel/elements b/Recipes.xcdatamodel/elements
index 35a20f3..939bc61 100644
--- a/Recipes.xcdatamodel/elements
+++ b/Recipes.xcdatamodel/elements
@@ -2,8 +2,8 @@ Entity: Image (NSManagedObject)
Att: image Transformable O dafQGIhBFATAxE1hyQd5z5cpRg0OLP4+M+W3+xhA6jU=
Rel: recipe Recipe image Nullify I fVH2lmmkHE4j/FvzfJ2et3KsNxcA8p5BJp2d/xd4hH0=
-Entity: Ingredient (Ingredient) 5tCLlA1r9p1UWdOTr3XJ+ZzBr6bxraWAs3Vt9zCAZek=
- Att: amount String O b9/jjR2iJtm4oldVJwj25X+/hpEL6/1CM5hLhgV48Iw=
+Entity: Ingredient (Ingredient) 7nbTTDaWG1lAddHYHum4xP4IA/N90NYv9GLkGK+sueQ=
+ Att: amount Integer16 O RmH9Sk61kxsb8+GUEqlEkIuV4tDjxxhMNsHUu/tBW6I=
Att: displayOrder Integer16 kMPJ+qU+fnBipO5Ajep+KT3rKB9zeOPrav0q4rMSt7k=
Att: name String jLmWXAAxrGiROYTzEQlBrZZTlb6f2bF9575UvHrUaJA=
Rel: recipe Recipe ingredients Nullify O I GvmjTsOh76OGkr0Lmnxdh8u6FO4E+iuEYa0mRZPuKJQ=
diff --git a/Recipes.xcdatamodel/layout b/Recipes.xcdatamodel/layout
index 052f0e8..18906a4 100644
Binary files a/Recipes.xcdatamodel/layout and b/Recipes.xcdatamodel/layout differ
</code></pre>
<br />
The great thing is that, this works not only for <code>git diff</code>, but any git command which displays diff output e.g. <code>git log -p</code>, <code>git show</code>, etc.<br />
<br />
To do this for your own iOS or Mac OS X projects, try <a href="https://github.com/chaitanyagupta/XCDataModelPrinter" target="">XCDataModelPrinter</a> -- a small little project I wrote. The <a href="https://github.com/chaitanyagupta/XCDataModelPrinter/blob/master/README.md" target="">README</a> should help you get started. If you have any questions, drop me a message at mail at chaitanyagupta dot com.<br />
<br />
1. This technique is explained eloquently in the book <a href="http://git-scm.com/book/en/Customizing-Git-Git-Attributes#Binary-Files" target="">Pro Git</a>. </div>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-58230009251118285262010-04-08T03:10:00.003+05:302010-04-08T03:42:43.896+05:30Adidas miCoach Review: Week 4<p><i>This is week 4 of my four week review of Adidas miCoach. Read the whole series <a href="http://www.chaitanyagupta.com/blog/labels/micoach-review.html">here</a>.</i></p><p>After my rant last week about the inability to create custom interval workouts on miCoach, I got a nice little <a href="http://www.chaitanyagupta.com/blog/2010/03/adidas-micoach-review-week-3.html?showComment=1270059464405#c8937359026486379780">comment</a> on the post to checkout a new custom workout builder "next" week. Well well, come this week and I got this and more:</p> <ul><li>a brand new forum</li><li>add/edit routes</li><li>an "achievements" page</li></ul> <h3>Custom workout builder</h3> <p>One of the two most useful additions to the miCoach website, this one completely fixes my issues with the interval workouts from last week. Here's a quick rundown on building a custom interval workout:</p> <p><i>Select your workout type</i></p> <a href="http://imgur.com/L3MqU.png"><img src="http://imgur.com/L3MqU.png" style="width:500px;" /></a> <p><i>Then you define your interval workout.<span class="Apple-style-span" style="font-style: normal;"> You can set the warmup/cooldown sections and upto 8 different kinds of interval sections. You also need to set the number of repetitions for the interval sections.</span></i></p> <a href="http://imgur.com/ADFWC.png"><img src="http://imgur.com/ADFWC.png" style="width:500px;" /></a> <p><i>An overview of what your heart rate zones for the workout will look like, and you are done.</i></p> <a href="http://imgur.com/tMvwx.png"><img src="http://imgur.com/tMvwx.png" style="width:500px;" /></a> <p>This is almost perfect for my needs. One thing which will make it even better is that if one could also set the "duration" for the interval sections in terms of distance and not just time. But overall, its a job well done and its dead easy to define your own interval workouts.</p> <h3>Forum</h3> <p>Another welcome addition is the brand new forum. There's the "help" section and then there's the "talk" section -- the former to seek help regarding the device or the website (presumably there would be some admins there), and the latter for general discussion around running and the device (I am sure there will soon be a few bragging contests around people's running "achievements" :P )</p> <h3>Achievments</h3> <p>A novelty feature, mostly. But certainly makes you feel good!</p> <a href="http://imgur.com/NnUXL.png"><img src="http://imgur.com/NnUXL.png" style="width:500px;" /></a> <h3>Add/edit routes</h3> <p>Another new addition is that you can pin your routes on a map (via Google Maps). You can supposedly add ratings, notes, etc. This is something I haven't really used much yet, so can't say much about it. I guess I'll add some of my running routes in Gurgaon and Jalandhar at some point of time.</p> <h3>Conclusion</h3> <p>I was a little low on running mileage this week -- managed only a short interval workout on one of the weekdays and then an 18K run on Sunday. All in all, I've put in nearly 90 km worth of outdoor running (not counting treadmill runs in the gym) in the last four weeks (I know its not much -- will have to gradually increase my mileage again), and I have come away quite impressed with the product. Some of the more useful things for me have been:</p> <ul> <li>Getting an accurate idea about the distance run when running on the road</li> <li>The coaching system is really useful for interval based workouts</li> <li>Love the way running stats are presented on the site</li> </ul> <p>Another way I benefited from this device was that I picked up my running momentum again. Since I had no major upcoming events to run in since the Mumbai marathon in Jan, I had slacked off quite a bit on running in February. Thanks to the obligations placed by the miCoach contract, running is back on track :) Hopefully things will continue to get better.</p>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com4tag:blogger.com,1999:blog-17912943.post-26290964048978576992010-03-31T02:00:00.004+05:302010-04-08T03:46:33.476+05:30Adidas miCoach Review: Week 3<p><i>This is week 3 of my four week review of Adidas miCoach. Read the whole series <a href="http://www.chaitanyagupta.com/blog/labels/micoach-review.html">here</a>.</i></p><p><i><b>Update 1</b>: (7th April, 2010) One of my primary rants against the miCoach website in this post -- the inability to define any custom interval workouts -- is now taken care of after a recent upgrade. More in week 4.</i></p><p>After two weeks of miCoach usage, I have been fairly impressed by the stats and graphs that it provides. Its great fun to drool over the graphs -- especially after a good run. Not only that, the information captured by the device is quite granular -- down to once every few seconds. This is probably more than what you need, but still its good to have it.</p> <p>But what about the "coaching" part of miCoach? As I have said before, for the long runs, where I run easy for a period of 1:30-2:00 hours, I haven't really found the coaching very useful -- for those runs I just find the stats collection useful. Even for short runs which I run at a moderate pace, I don't really use the coaching function.</p> <p>However, there is one kind of workout which I still hadn't tried with miCoach (and its something that I hadn't done in months) -- the <a href="http://wiki.runnersworld.com/index.php/Intervals">interval workout</a>.</p> <h3>Interval workout</h3> <p>Essentially, in an interval workout, you run for a short period of time at a fast pace, and then slow down (could be even to a brisk walk) to recover. This cycle is repeated a certain number of times. Doing intervals brings a nice variation to an otherwise uneventful routine, plus it also helps build pace and strength.</p> <p>Now, the miCoach website does provide some interval training routines in its custom workouts. I picked one of them and went for a run. Here's the graph for the run:</p> <a href="http://imgur.com/grFQm.png"><img src="http://imgur.com/grFQm.png" style="width:500px;" /></a> <p>For this workout, the coaching function actually did turn out to be quite useful. The plan that I selected was a time based interval training workout -- run at an easy pace for a few minutes, then run hard and fast for a minute, and recover and repeat. Thanks to the attached earphone, I was getting constant feedback about when to slow down or speed up -- didn't have to worry about looking at my watch all the time. One minor annoyance has been keeping the earphone in place when running fast, but I think that is something which can be taken care of.</p> <p>As I had mentioned in the <a href="http://www.chaitanyagupta.com/blog/2010/03/adidas-micoach-review-week-1.html">week 1</a>, its a shame you can't really "customize" the custom interval workouts. The kind of routines they have provided are good, but its too limited. Too bad, 'cause miCoach really shines here.</p> <h3>Not just for running</h3> <p>I thought it would be fun to try it out while doing some physical activity other than from running. Occasionally, instead of taking the lift, I take the stairs to reach my office on 14th floor. One day, I strapped on miCoach before doing so, and here's what it says about my heart rate:</p> <a href="http://imgur.com/Qq3GN.png"><img src="http://imgur.com/Qq3GN.png" style="width:500px;" /></a> <p>The heart rate monitor atleast, could turn out to be useful for workouts other than running, if its that important to you. Maybe I'll try it in the gym someday.</p> <h3>Long Run</h3> <p>Sunday was, as usual, long run day. I had originally planned to do a 20K run this time but could only manage 15. Maybe it was the evening weather which affected my run, or maybe the oncoming summers were to blame. Maybe it was just an off-day. I was also consistently feeling very thirsty throughout the run, which was a bit baffling. Anyways, I did, again record stats for the entire run using miCoach. But I haven't been able to find the time to upload the workout details yet (thanks, again, to the fact that they have no utility for Linux).</p><a href="http://www.flickr.com/photos/chaitanyagupta/4463362910/" title="Tau Devi Lal Bio-Diversity Park, Gurgaon by chaitanyagupta, on Flickr"><img src="http://farm5.static.flickr.com/4002/4463362910_77248668b1.jpg" width="500" height="375" alt="Tau Devi Lal Bio-Diversity Park, Gurgaon" /></a><p>So conclusion from this week has been that miCoach is great for interval training workouts. Unfortunately the number of interval workouts on the website are very limited. If they were to increase that number, or, better still, allow their users to define their own workouts, it would be awesome.</p>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com4tag:blogger.com,1999:blog-17912943.post-83099319076483709092010-03-23T11:25:00.009+05:302010-04-08T03:50:02.281+05:30Adidas miCoach Review: Week 2<p><i>This is week 2 of my four week review of Adidas miCoach. Read the whole series <a href="http://www.chaitanyagupta.com/blog/labels/micoach-review.html">here</a>.</i></p><p>Continuing with my ongoing review of the miCoach, I did a couple of outdoor runs this week -- a difficult 8K in the getting-really-hot afternoon sun and then hit the road for late Sunday morning for a good 15K.</p> <p>As I mentioned last week, I would try adjusting the heart rate settings and see if I could stay in the "zone" a little more than last week. The factory HR settings seemed fine to me, so I reverted to that. And here are the results:</p> <a href="http://imgur.com/lzbP6.png"><img src="http://imgur.com/lzbP6.png" style="width:500px;" /></a> <p>So I stayed a lot above the green zone again (which was my target zone for the run), although the pace was fairly easy (maybe the HR was high due to the sun). I have decided not to focus too much on this zone business for plain and simple runs for now. I will also try to squeeze in an interval training run this week to see how my heart rate varies with it.</p> <h3>Achievements, history and training journal</h3> <p>A few other niceties I discovered on the website: </p> <h4>Achievements</h4> <p>This comes with the Dashboard view (which gives a summary of the latest workout) -- shows "lifetime" achievements for five of the parameters that it tracks: time, calories, distance, heart rate and pace. </p> <a href="http://imgur.com/V7jzo.png"><img src="http://imgur.com/V7jzo.png" style="width:500px;" /></a><br /><h4>History</h4> <p>Bar graphs showing historical running time, grouped by either year, month, week or day. </p> <a href="http://imgur.com/kIzxE.png"><img src="http://imgur.com/kIzxE.png" style="width:500px;" /></a><br /><h4>Training journal</h4> <p>A list view for the completed workouts -- loads of information in a compact view. Nice.</p> <a href="http://imgur.com/KeQsf.png"><img src="http://imgur.com/KeQsf.png" style="width:500px;" /></a><br /><h3>Workout export and backups</h3> <p>One issue that I do have with the webiste at the moment is that there doesn't seem to be anyway for me to export or backup all the workout data that I am uploading here. While Adidas has done a great job with the website, I am not too happy about not having any local backup of my workout data. And if the website doesn't remain upto the mark later on, it will be good to have an alternative (I don't see why Adidas would make this easy to happen though). </p> <h3>Linux support</h3> <p>I complained to Adidas via their feedback link about the lack of Linux support. Got a response back (the same day) that they don't support Linux for now and the "suggestion will be passed on to the responsible department". Guess that means nothing for now :( If you are a developer who works on miCoach you would have one very grateful customer if we saw Linux support soon! </p> <h3>Stride sensor battery issue</h3> <p>One issue I have encountered a few times now is that when the it is switched on, Pacer refuses to detect the stride sensor until I take out the stride sensor's battery and put it in again. This is really annoying if I have to do this everytime I need to use miCoach. I wrote to Adidas about it and they replied back that this might either be an issue with low battery or with <a href="http://www.adidas.com/us/miCoach/help/?topicid=a034#pairing">pairing</a>.</p> <h3>What's next?</h3> <p>So my training log shows that I have done about 43K worth of outdoor running in the last couple of weeks. That's a bit on the lower side -- but then again, summers are here! Still, I want to hit the 100K mark for four weeks, so I will be aiming to do about 60K worth of running in the coming two weeks. I will also try to squeeze in a couple of interval training sessions and hope that miCoach's "coaching system" will prove a little more useful here. </p>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com2tag:blogger.com,1999:blog-17912943.post-34060196985593274882010-03-16T12:44:00.012+05:302010-04-08T03:51:24.705+05:30Adidas miCoach Review: Week 1<p><i>This is week 1 of my four week review of Adidas miCoach. Read the whole series <a href="http://www.chaitanyagupta.com/blog/labels/micoach-review.html">here</a>.</i></p><p><i>(Update 1: Linked to the Drizzlin Media website upon their request)</i></p><p>About a month back I was contacted by Adidas via a <a href="http://www.drizzlin.com/">branding consultancy</a> to review the <a href="http://adidas.com/micoach">miCoach</a> Pacer -- an interactive, personal coaching system for runners (Garmin Forerunenr and Nike+ are others that come to mind). Personally, I never really gave a serious thought to using a device like this to aid my running, but now that an opportunity presented itself I didn't mind checking it out first hand.</p><p>Essentially the deal is that I review the device for four weeks (which means a blog post a week for a month), writing about my experiences with the thing, and then I get to keep the device to myself. Some PR for them in return for keeping the device for free -- fine by me, as long as they have no problems with me writing either a good, bad or an ugly review (which I have been assured is the case, and in any case it all goes up uncensored on my blog). This post forms the first of these reviews.</p><h3>How miCoach works</h3><p>So what does the device do? As a monitoring device, it measuers two things -- your heart rate and your stride rate. So there's a heart rate monitor which you strap on to the chest and a pedometer which goes into your shoe. Then there's the "Pacer" itself -- the central processing unit which (wirelessly) collects data from the sensors and gives you real-time audio feedback about various things like distance, calories, pace, etc.</p><p>You connect your headphones to the Pacer to get audio feedback (the device ships with one). You can also connect the output of your music player to the device, so you can listen to music while running. I personally don't listen to any music while running -- wearing headphones while running seems to be a hassle to me. So needing to wear a headphone all the time for feedback is a bit irritable. Wish they had attached a loud speaker to this thing ;)</p><p>In addition to monitoring your running stats, you can also plan beforehand what kind of a workout you are going to do -- like a hard short run or an easy long one. Then store the workout details in the device and let the device (in a pleasant British female voice) give you feedback on how well you are doing.</p><p><table><tbody><tr><td><a href="http://imgur.com/gzGSa.jpg"><img src="http://imgur.com/gzGSa.jpg" alt="miCoach package and gear" style="width: 500px;" /></a></td></tr><tr><td style="font-size: 0.8em;">Chest strap, heart rate monitor, stride sensor and pacer</td></tr></tbody></table></p><p>To better understand this, its important to know that the one thing that is central to training with miCoach is that they have this concept of heart rate (HR) "zones":</p><ul><li>Blue zone: Easy effort (lowest HR)</li><li>Green zone: Medium effort</li><li>Yellow zone: Hard effort</li><li>Red zone: Maximum effort (highest HR)</li></ul><p>So I could, say, schedule a workout beforehand to do a relatively easy run in the green zone for a few kms. When I am actually running, the device would tell me to slow down or speed up if my heart rate deviates from the normal range for this zone (more on this later).</p><p>Ultimately, you sync all this data to your account on the miCoach website where you get nice looking graphs and stats for your run (that is where you schedule custom workouts too). AFAIK, there's no desktop software to do the same -- as they say, its all in the cloud. So, the miCoach website becomes an important part of your experience with the device. I will discuss the website itself in a bit more detail.</p><p>Syncing the device is easy enough -- you plugin a USB cable into your PC (provided with the device) and download a desktop utility to sync the device to your miCoach account. As expected, while the utility is available for Windows and OS X, there's nothing for us Linux users :( Which is a shame, since I think the utility itself is written in Java -- they shouldn't have much trouble porting it to Linux. Hope someone from Adidas reads this, and puts out a binary for Linux too; till then, its booting into Windows everytime I need to sync the device, which is a royal PITA.</p><h3>Website review</h3><p>Alright, enough ranting about OS compatibility -- its not as if a lot of Tux users are interested in running anyways :P Time to get down to reviewing the website (<a href="http://adidas.com/micoach">http://adidas.com/micoach</a>) itself a bit.</p><p>The website (warning: Flash alert), although it does have its shortcomings, is surprisingly quite usable. Adidas seems to understand the importance of the website w.r.t the overall miCoach experience, and has put in a good bit of effort to make it easy and enjoyable to use.</p><h4>Sign up and settings</h4><p>Sign up is not much of a hassle except for the need to confirm your email address.</p><p>As far as settings go, you can control units of measure (imperial or SI), adjust your designated heart rate zones, select what information kind of information you want to be fed back to you via audio while running, etc. Probably a good idea to give your bio stats like gender, height and weight to get a better idea about your calorie count (atleast that's what the website says).</p><p><a href="http://imgur.com/Ad24j.png"><img src="http://imgur.com/Ad24j.png" alt="Heart rate adjustment settings" style="width: 500px;" /></a></p><h4>Plans and Schedule</h4><p>A few pre-defined training plans are provided, each of which consists of a few weeks worth of workouts for you. That's not my kind of thing, so I define my own custom workouts and run accordingly.</p><p>There's a nice calendar which displays past and upcoming workouts.</p><p><a href="http://imgur.com/ytV9p.png"><img src="http://imgur.com/ytV9p.png" alt="Workout calendar" style="width: 500px;" /></a></p><p>Creating custom workouts is a bit disappointing though. You can define time based workouts and distance based workouts -- and you can set one intensity level at which you want to complete this time or distance based workout. That's about it though -- you don't get much more flexibility than that. What if I want to define a 10K workout wherein I want to run the first 5K in green zone, and the next 5K in yellow? Fat chance; you can't do that. What if I want to schedule a <a href="http://en.wikipedia.org/wiki/Fartlek">fartlek</a> (which I think would go very well with miCoach's concept of heart rate zones)? Don't see any option for that either.</p><p>Its a shame because this severely limits the custom workouts feature -- without that flexibility I don't think I'll get to use this much. And while there's an "Interval" workout, its just another set of pre-defined workouts which might or might not suit me -- I have no way of modifying them.</p><h4>Workout stats</h4><p>This is the most fun part. After you've completed a workout, sync up your workout stats on the cloud and then you get to gaze over some nice looking graphs. Summary includes your total time taken, calories consumed and distance covered. There's also average heart rate, pace and stride rate.</p><p>And then of course, you can see detailed graphs about your heart rate, pace or stride rate as a function of time or distance. There's also a nice overlay view in to compare two quantities together. e.g. my HR and pace graphs for Sunday's 12K run overlaid over each other (HR -- dark line, pace -- light line):</p><a href="http://imgur.com/iWH4U.png"><img src="http://imgur.com/iWH4U.png" alt="HR and pace graphs for 12K run" style="width: 500px;" /></a><p></p><p>One interesting fact I discovered was that my stride rate remains quite consistent over a good range of running speed, averaging 162-164 strides per minute.</p><p>As far as accuracy of measurements go, I can't say much about the heart rate as I've never used a heart rate meter while running before. I think the pedometer should be fairly accurate while computing the stride rate. One thing that I did have my doubts on, but which turns out to be quite accurate is the distance calculated by the pedometer (also called Stride sensor by Adidas). For example, the run that I've shown the graph for above was done on a standard 400m athletic track -- at a place where I go regularly for running (Guru Gobind Singh stadium, Jalandhar) -- and Pacer calculated my total distance to be 11.92K while the actual was 12K. Not bad at all; given that the device doesn't use any GPS or anything (and my "run" turned out to be a mixture of brisk walking and running), I am quite impressed with the accuracy of distance measurement.</p><h3>Running with miCoach</h3><p>Getting the device setup was not that hard -- although it did take me a bit of time to figure out where the battery for the stride sensor was (hidden in a corner of the packaging, hard to get), and a bit of time figuring out how to take the stride sensor out of the lace clip without damaging either the sensor or the clip. Once that was done, the rest was pretty easy -- strap on the HR monitor onto the chest, clip the Pacer onto shorts (which is most convenient for me), the stride sensor on the shoe, connect headphones to the Pacer and we're ready to go!</p><p>One can run the Pacer in "free mode", where it just collects stats for the run, or in "miCoach mode", where you can select a custom workout to work with. There are buttons to pause/resume workout and control the volume. Finally, there's a big button in the center which gives current summary about the run whenever you press it.</p><p>All in all, pretty useful except for the fact that I need to have a headphone in my ear all the time (unless I am using it in free mode), which, as I said before, is a bit irritating.</p><h3>Heart rate zones</h3><p>As I mentioned earlier, the division of heart rate into zones seems to be one of the more important aspects of miCoach. However, callibrating the zones correctly has been a bit of a challenge for me. I did a 12-minute assessment workout (provided on the website) to callibrate my heart rate zones correctly the first time I took miCoach out for a run. Basically, the workout was like -- run at effort level 5 on a scale of 10, run at level 6 on a scale of 10, etc. I mean, WTF? How much effort you are putting in a run is a difficult thing to quantify. I could probably tell whether I am running easy, hard or very hard. But its a little harder to figure whether I am running at level 6 or 7. Hopefully they will come up with a better assessment workout than this.</p><p>So basically, this assessment workout comes up with a completely screwed up callibration of my heart rate zones -- as the graph above for my long run shows. I was struggling really hard to stay in the green zone (which is meant to be an easy run zone); doing a brisk walk meant I was hovering just above the blue zone, while breaking out into an easy run would put me into the yellow zone. Then I decided to just forget it after covering half the distance and do what I really considered to be an easy run. Seems like my average HR for an easy run itself seems to be around 150 beats per min -- so I will adjust the device settings accordingly.</p><p>I should get a better idea in the coming weeks about how useful the zones thing really is. Still, I think the device is useful, if for nothing else than to measure distance and pace while running on routes where there's no easy way to judge the distance. And if the HR meter turns out to be accurate, even better.</p><p>That's it for now. Next week I'll see if I am able to correctly callibrate the HR zones, and write more about my running experiences with this new toy.</p>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com7tag:blogger.com,1999:blog-17912943.post-13930174822777773942010-01-07T20:13:00.000+05:302010-01-07T20:13:35.275+05:30An unplanned but pleasant barefoot runJust as I started my run at the Tau Devi Lal Biodiversity Park in Gurgaon today morning, I felt a slight pain from my left knee down to the foot. It got worse as the run continued. After 2 kms, I was putting a lot more pressure on my right foot than my left. By the time I completed the 3rd km, there was a good bit of limping in my running.<br /><br />That's when I decided to call off the run (was planning to do 8K today). Before leaving though, I thought I would go around the park's 1K loop once more -- and this time just walk and not run. A few metres of walking, and I got a silly idea -- why not walk barefoot?<br /><br />I had been thinking about trying out barefoot/minimalist footwear running for sometime now. Christopher McDougall more or less indicts Nike and their heel-cushioning shoes in his book <a href="http://www.amazon.com/Born-Run-Christopher-McDougall/dp/0739383728">Born to Run</a> for the injuries that plague long distance runners today. Plus, <a href="http://discovermagazine.com/2006/may/tramps-like-us">recent studies</a> seem to suggest that our bodies are designed to run (with natural cushioning provided by the balls of the feet -- and they don't need any shoes for help). Only, I hadn't planned on doing this before the Mumbai marathon.<br /><br />Still, here I was, unable to run, and with an inkling to walk barefoot. So, I removed my shoes and socks, held them in my hands, and started walking. And the ground was... ouch! Those damn pebbles on the track were hurting the delicate soles of my feet. I moved on to the grass to save myself from this pain. A few hundred metres later, another idea -- run! But what about those damn pebbles? And what about the pain that made me abort the original run?<br /><br />I was near a part of the track where pebbles were not any problem. And I decided to take a risk with the run -- but with the running shoes in my hands instead of over my feet! I completed the loop, felt good. Completed another, and another. There was just a hint of the pain I was feeling earlier, but it wasn't even annoying anymore. I didn't have such high hopes, but this was turning out better than expected. I couldn't run barefoot all this time though, because, well, there were spots where there were just too many pebbles and not much grass to run on. And damn they do hurt the feet!<br /><br />Still, in the end, I ended up doing a total of 3K with this mixture of barefoot run/walk [wanted to do more, but it was getting a little late for office ;-)]. It felt good. So what's next? As far as the Mumbai marathon goes -- take a bit of rest to nurture my aching (while running with shoes) left leg, and do some light training next week before D-Day on 17th. Once that is done with, I will dump my Adidas running shoes (for sometime atleast) and buy a pair of Nike Free's, or, maybe buy those thin green-soled sneakers we used to wear on Saturdays (white-uniform mornings, if you went to that sort of school). Going completely barefoot on the roads is not a very exciting prospect -- just think about the pebbles!<br /><br />It will be interesting to see how that experience turns out to be -- if the advocates of barefoot running (and detractors of modern running shoes) are right, most of the pains or injuries I've had in the last one year are because of my shoes. If they are right, I will be seeing even more exciting running times ahead!Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com3tag:blogger.com,1999:blog-17912943.post-65853510517149844452009-11-14T02:13:00.004+05:302009-11-14T03:27:20.810+05:30Delhi half-marathon: 2:19:02<div style="text-align: left;">Its been a few days since the race, and I have been procrastinating over writing about it ever since. Here it is finally -- I finished the 21K in 2:19:02, nearly 10 minutes faster than what I did in Mumbai earlier in the year, something I had not at all expected before the start -- I was only hoping to finish it under 2:30 hours, just as I had done in Mumbai!</div><div style="text-align: left;"><br /></div><div style="text-align: left;"><a style="float: left; padding: 0px 10px 0px 0px;" href="http://www.flickr.com/photos/chaitanyagupta/4071448500/" title="Getting tired? by chaitanyagupta, on Flickr"><img src="http://farm3.static.flickr.com/2430/4071448500_eb917e8b98_m.jpg" width="180" height="240" alt="Getting tired?" /></a></div><div><br /></div><div><div>As it turned out, I had a pretty terrific start by my standards. And the morning weather was perfect for running. Saw the frontrunners (Merga et al) coming back as I was nearing the 6K mark -- and those folks were on their 14th K! 10K was done in 1:03:05 -- the fastest 10K I've done till date. Once I realized that, I knew that a sub-2:20 was always on the cards. Who knew, maybe even a 2:15! (but that was not to be this time) Reckon I was able to keep up this pace right uptil the 16K mark. I probably did slow down a bit during the next two kms, but then I really hit the wall on 18K. Start feeling very exhausted, and it was tempting to just walk the last 3K. But, thankfully, I was able to give it my all and keep running -- albeit a little slowly -- in the last leg too :) As I neared the finish line, saw the clock ticking at 2:19 and counting -- I had managed to do it! Crossed the finish in just under 2:20 (my gross time was 2:19:56).</div><div><br /></div><div>Here's a breakdown of my split and total times for the race:</div><div><br /></div><div>Split@7.5K -- 47:13</div><div>Split@10K -- 1:03:05</div><div>Split@19.35K -- 2:05:35</div><div>Split@20K -- 2:10:47</div><div>Net time (21.097K) -- 2:19:02 (individual start till finish time)</div><div>Gross time -- 2:19:56 (race start time till finish time)</div><div>Overall rank -- 1695</div><br /><div><a style="float: right; padding: 0px 0px 0px 10px;" href="http://www.flickr.com/photos/chaitanyagupta/4071448510/" title="A pose for the cameras by chaitanyagupta, on Flickr"><img src="http://farm3.static.flickr.com/2655/4071448510_5917abdb82_m.jpg" width="180" height="240" alt="A pose for the cameras" /></a></div><br /><div>I had never realized I could do this time -- in fact all my training runs were pointing to a 2:30+ 21K run! Felt a bit giddy after the race, but it was only for a few minutes. A nice Iodex massage (that was a great thing to do -- have volunteers massage your feet and legs after the race -- Mumbai are you listening?) and a banana and an apple later, I was feeling as good as ever.</div><div><br /></div><div>Next up is Running and Living marathon and a half in Gurgaon on December 6th, where I'll be running the 21K again, and then the half in Mumbai in January. Hope that fitness and timings keep improving, over the next couple of months, at least.</div></div>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com2tag:blogger.com,1999:blog-17912943.post-86482844745866899952009-10-30T14:27:00.003+05:302009-10-30T14:41:34.287+05:30#40284028 -- that's my running number for the Delhi half-marathon, to be held this Sunday. Second ever half-marathon I'll run in. Due to lack of sufficient training, a <a href="http://chaitanyagupta.com/blog/2009/07/running-goal-delhi-half-marathon-under.html">sub 2 hour</a> time is not even remotely possible, but I should be able to run within 2 hours 30 minutes again. Weather during mornings is great for running (thanks to the onset of winter), and the route -- through the heart of Delhi -- also seems darn good. Looking forward to a great day of running.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-51596919002077608522009-08-22T00:36:00.011+05:302009-08-22T01:31:07.431+05:30An easier way to compose Thunderbird mail from the command lineFor sometime, I had wished for an easier way to attach the output of diff to a new Thunderbird mail than the following:<br /><ol><li><code>diff -u file1 file2 >/tmp/mypatch</code></li><li>Switch to Thunderbird</li><li>Click the "Write" icon</li><li>Click the "Attach" icon in the compose mail window</li><li>Browse to the file</li><li>Click the "Open" button to finally attach the file</li></ol>Turns out, TB's compose mail window <a href="http://kb.mozillazine.org/Command_line_arguments_%28Thunderbird%29">can be created from the command-line</a> by passing the -compose option to <code>thunderbird</code>. However, passing the mail parameters like "to", "subject", "attachment", etc. via this command is quite ugly:<pre><code>thunderbird -compose "to='john@example.com',subject='dinner',body='How about dinner tonight?',attachment='file:///tmp/food.doc'"</code></pre><br />To get over this mess, and sort out my original problem with the attachments, I wrote a small script called <span style="font-style: italic;">tb-compose</span>:<br /><blockquote><a href="http://github.com/chaitanyagupta/misc-utils/blob/master/tb-compose">http://github.com/chaitanyagupta/misc-utils/blob/master/tb-compose</a></blockquote>Example usage:<pre><code>tb-compose --to john@example.com --subject dinner --body "How about dinner tonight?" --attachment /tmp/food.doc</code></pre><br />Moreover, if <code>-</code> is passed as a value for <code>--attachment</code>, the contents of standard input are attached to the mail.<pre><code>diff -u file1 file2 | tb-compose --attachment -</code></pre><br />And if <code>--attachment-name</code> is used when stdin is being attached, the given name is used as the name for the attached file.<pre><code>diff -u file1 file2 | tb-compose --attachment - --attachment-name mypatch</code></pre><br />Makes my life a little easier :-)Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-67050600749735808802009-08-21T23:54:00.005+05:302009-08-22T00:34:13.267+05:30A couple of hooks to make life easy with git submodulesWhile using git at work for the last few weeks, I noticed a couple of issues with the usage of git-submodules.<ol><li>Submodules updated in commits when not intended to be -- more or less due to over-enthusiastic usage of <code>git commit -a</code>.</li><li>Failure to run git-submodule update after a git-merge (git-pull) or git-checkout.</li></ol>To help with these issues, I wrote a couple of git hooks. They can be pulled from my <span style="font-style: italic;">gitutils</span> repository on github:<br /><blockquote><a href="http://github.com/chaitanyagupta/gitutils/tree">http://github.com/chaitanyagupta/gitutils/tree</a></blockquote>Three git-hooks can be found in the submodule-hooks/ directory: <code>pre-commit</code>, <code>post-merge</code> and <code>post-checkout</code> (<code>post-merge-checkout</code> provides the latter two).<br /><br /><code>pre-commit</code> checks if any submodules have been updated in the index and are about to be committed. If so, it asks user for confirmation to go ahead with the commit.<br /><br /><code>post-merge-checkout</code> checks if any submodules have been modified in the working tree (i.e. their git-status is "modified" under "Changed but not updated") after a branch checkout or merge. If that is the case, it asks the user if they want to run <code>git submodule update</code>.<br /><br />Hope someone will find them useful.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com2tag:blogger.com,1999:blog-17912943.post-40627617586039508472009-07-25T09:45:00.005+05:302009-07-25T10:13:06.175+05:30Dispatches -- Terror in Mumbai (must watch)See the video <a href="http://www.liveleak.com/view?i=1e4_1246490858">here</a>.<br /><br />The story of 26/11 is told in the words of the victims and the terrorists (contains footage of police interviewing Kasab and terrorists' conversations over the phone). Apparently this was shown for the first time only a few weeks ago, on British TV -- Channel 4. I think everyone of us needs to see it.<br /><br />Somehow, the fact that the terrorists (and their handlers) spoke the same languages as we do made it all the more scary. They were not just words anymore - they were talking about killing people, as if it was just another day job. You realized how well the controllers had brainwashed the gunmen.<br /><br />I jumped up after I heard the gunshots from Nariman house (when the controller got annoyed with his gunman for hesitating to kill the hostages). That bastard held the line -- he wanted to hear the gunshots that would kill the hostages -- those terrorists were effectively being remote controlled from Pakistan.<br /><br />Just like any poor young boy would be, one terrorist was in awe of his surroundings at the Taj. He hesitated from setting the hotel on fire -- but he had no problems killing those innocent people.<br /><br />So sad, and infuriating.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-80680910979383731562009-07-16T00:16:00.003+05:302009-07-16T00:45:51.639+05:30Running goal: Delhi half-marathon under two hoursAlmost immediately after the Mumbai marathon in January, running lay abandoned. It had become too difficult to go out running, and thanks to lack of any exercise, the paunch has come back to its glorious heights.<br /><br />Well, time to pick up the running shoes again, 'cause its just three and a half months left to the Delhi half-marathon, which, apparently <a href="http://www.tanvirkazmi.com/2009/07/airtel-delhi-half-marathon-2009-coming.html">will be held on 1st of November</a> (info thanks to Tanvir Kazmi, who's been doing awesome work on promoting running online). So what's the target? As the title says, under two hours. Given that I ran my first ever half-marathon this year itself, and that too <a href="http://www.chaitanyagupta.com/blog/2009/01/mumbai-marathon-2009-results.html">just under two and a half hours</a>, its a nearly impossible task. But I will give it my best shot -- atleast I should be able to shed some pounds. By the way, I did get around to running a couple of times a few days back, but have relapsed into laziness since then. Hopefully, this post will give me some impetus to start again.<br /><br />After the Delhi half-marathon, I'll be running the half in Mumbai again next year (registrations for the Mumbai marathon are <a href="http://mumbaimarathon.indiatimes.com/">already open</a>, btw, and the places fill out very quick; so if you are planning to run, register now!). This year was great fun, hopefully next year will be too.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com7tag:blogger.com,1999:blog-17912943.post-61375881417829554742009-05-16T18:13:00.004+05:302009-05-16T18:36:32.340+05:30SawStop put to the ultimate testThree years back I <a href="http://www.chaitanyagupta.com/blog/2006/02/what-stopped-sawstop.html">blogged about SawStop</a>, and wondered what was preventing it from gaining mass market adoption. I don't know how well it is doing commercially today, but I came across another video which demonstrates just how good this product is — and also highlights how much faith the designer has in his invention. See for yourself, he's willing to put his finger through a table saw to prove his point!<br /><br /><center><object height="340" width="560"><param name="movie" value="http://www.youtube.com/v/E3mzhvMgrLE&hl=en&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/E3mzhvMgrLE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="340" width="560"></embed></object></center><br /><br />Makes me think about that perennial question for programmers: How willing will you be to fly in a plane you wrote the software for?Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-44384584143043732382009-04-30T15:01:00.001+05:302009-04-30T15:03:28.512+05:30Second inningsStarted a new job this Monday. At <a href="http://www.directi.com">Directi</a>, Gurgaon.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com2tag:blogger.com,1999:blog-17912943.post-79391659730744035712009-04-25T17:08:00.002+05:302009-04-25T17:09:57.041+05:30Lisp news: cl-twit, chronicity and a window manager I discovered recentlyI released a couple of CL libraries/apps in the last two months:<br /><ol><li><a href="/lisp/cl-twit/">cl-twit</a> — A twitter client for Common Lisp, and</li><li><a href="/lisp/chronicity/">chronicity</a> — A natural language date and time parser for CL</li></ol>Hopefully someone will find these useful.<br /><br />Another thing I chanced upon in the last few weeks is <a href="http://www.nongnu.org/stumpwm/">Stumpwm</a>; a tiling, keyboard driven X11 window manager written entirely in <gasp>Common Lisp</gasp>. From the Stumpwm website:<br /><blockquote>Stumpwm attempts to be customizable yet visually minimal. There are no window decorations, no icons, and no buttons. It does have various hooks to attach your personal customizations, and variables to tweak.</blockquote>Intended as a successor to <a href="http://www.nongnu.org/ratpoison/">Ratpoison</a>, one of the key ideas behind Stumpwm is to control everything from the keyboard i.e. mouseless window management (<em>Rat Poison</em> — get it?). Its radically different from what I am used to up till now, but its an intriguing way of doing things, and I will give it a shot (after all, I wasn't an Emacs fan to begin with, either). There's a Stumpwm <a href="http://ia341212.us.archive.org/2/items/TheStumpWMExperience/TheStumpWMExperience.ogg">screencast</a>, if you are interested. Also, Bill Clementson <a href="http://bc.tech.coop/blog/080429.html">shows</a> why Stumpwm is to window managers as Emacs is to editors (hint: Lisp!).Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-73857660957860913162009-01-20T18:07:00.006+05:302009-01-27T14:35:47.222+05:30Mumbai Marathon 2009: Results<span style="font-style: italic;"><span style="font-weight: bold;">Update:</span></span> Updated the links to ChampionChip site. The old links don't work anymore. Also updated my net finish time and rank.<br /><br />Chip timer results for the Mumbai marathon 2009 are out. See yours at ChampionChip UAE:<br /><ul><li><a href="http://www.championchipuae.com/results/results.php?id=26">Half marathon</a></li><li><a href="http://www.championchipuae.com/results/results.php?id=27">Full marathon</a></li></ul>As for me, I finished on rank <strike>967</strike> 961 for the half-marathon, with a gross time* of 2:37:32. Since I started the race around <strike>7</strike> 9 minutes after the official start time, the net time** <strike>should be around 2:30</strike> was 2:28:35. That's what the <span style="font-style: italic;">soft</span> target for my first race was (the real, <span style="font-style: italic;">hard</span> target being just to finish the damn race). So I am satisfied with the result. (But, as I would cover in another blog post, things could have been better...)<br /><br /><span style="font-style: italic;">Notes<span style="font-style: italic;">:</span></span><br />* Gross time: the time period beginning from the start of the race (i.e. when the elite runners cross the start line) till the time you cross the finish line. This is considered your "official" time for a race.<br />** Net time: the time period beginning from the instant you cross the starting line till you cross the finish line. This is your actual time for the race.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-16288657356299035062009-01-12T02:18:00.004+05:302009-01-12T02:52:17.167+05:30A good tutorial on epollFor the last few days, I have been toying around with the idea of using <a href="http://linux.die.net/man/4/epoll">epoll</a> to write "high-performance" TCP-based servers. While the man pages are helpful, they aren't exactly very useful to get you started. And "tutorials" have been hard to find. Not having any prior knowledge of select() or poll(), it has been tough to grok epoll.<br /><br />Today, though, I stumbled upon a tutorial (or rather, a section from the book <span style="font-style: italic;">Linux System Programming</span> by Robert Love) which I think is very useful for epoll newbies:<br /><blockquote><a href="http://www.devshed.com/c/a/BrainDump/Linux-Files-and-the-Event-Poll-Interface/">The Event Poll Interface</a><br /></blockquote><a href="http://www.amazon.com/Linux-System-Programming-Talking-Directly/dp/0596009585/ref=sr_1_1?ie=UTF8&s=books&qid=1231708028&sr=1-1">Here</a>'s an Amazon link to the book.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com4tag:blogger.com,1999:blog-17912943.post-20636991877061690622009-01-09T02:46:00.004+05:302009-01-09T02:57:05.225+05:30InvestmentsSo I bought a pair of Adidas running shoes worth Rs 4899 earlier this week. Add to this Rs 4000 worth of non-refundable air fare to travel to Mumbai, and I have already invested nearly 9000 bucks on the upcoming half-marathon. Such big investments make it impossible for the <span style="font-style: italic;">baniya</span> in me to back out of the race now. (Plus, after nearly three months of training, I am fairly confident of finishing the race. How quickly I finish though, is a different matter altogether...)<br /><br />Talking of investments, one kind of investment you will need to start thinking about soon is the one you will need to make under section 80C to reduce your tax liability. Although, in these troubled times, I don't know how many people will go with <acronym title="Equity Linked Savings Scheme">ELSS</acronym>s, here's a small piece of advice if you are thinking about ICICI Prudential: be sure to find out whether you are investing in a one-time payment scheme or a recurring payment scheme.<br /><br />In the latter case, you will have to <span style="font-style: italic;">repay</span> the amount for at least the next two years (three years in total, which is the lock-in period for an ELSS). I was burnt badly by this issue last year — I had made a huge investment with ICICI Prudential the year before, and then invested in different mutual funds (including ICICI Pru) last year too. Only later on did I realize that I had bought recurring payment policies both the times (the concerned managers never informed me that this was the case). So this year I will have to invest more than Rs 1 lakh in ELSS (which is the maximum amount on which you can save tax under 80C).<br /><br />Remember, ICICI Prudential is an insurance company first and then an investment house. Their managers sneakily made me buy two insurance policies with huge premiums, zero sum assured on maturity and completely subject to market risks. It is much better to invest with real mutual funds (like SBI or HDFC MF), which have a one-time payment policy <span style="font-style: italic;">as default</span> and where there's no attempt to sell you insurance.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-86457102241075620422009-01-06T15:05:00.005+05:302009-01-06T15:50:32.978+05:30Re: When you need IEIn my last post today, I asked:<br /><blockquote>How do you get rid of Windows when important websites (for you) work only with IE?</blockquote>Here's the answer, if you are using Linux: <a href="http://www.codeweavers.com/products/cxlinux/">CrossOver</a> from CodeWeavers (there's an OS X version too). I just installed IE on Ubuntu and tried a couple of websites which I knew didn't work well with Firefox. Preliminary conclusion is that they work perfectly fine on the newly-installed IE. Hurray! So I don't need to install Windows, yet.<br /><br />Note that CrossOver Linux is not free software; it is a proprietary version of <a href="http://www.winehq.org/">Wine</a>, the well-known Windows Emulator (not!) for Linux, BSD and OS X. So you have to shell out a few bucks (around 40 USD) to buy the "Standard" version ("Professional" one costs more). Although it can run a lot of Windows apps on Linux, even if it was only for this reason (ability to run IE), I think its worth the cost.<br /><br />I didn't have to buy CrossOver, however. :) I downloaded it for free in late October when CodeWeavers gave it away with their <a href="http://lameduck.codeweavers.com/">Lame Duck Presidential Challenge</a>. Then I forgot all about it, until now. (I also downloaded CrossOver Games that day — Steam works well with it, so I've heard. Maybe I'll play some real games again.)<br /><br />If you really don't want to spend the money, you could try Wine itself. But I haven't used it, so I can't say whether it works as well as CrossOver.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com1tag:blogger.com,1999:blog-17912943.post-67642673559470001902009-01-06T12:08:00.003+05:302009-01-06T12:18:19.363+05:30When you need IESo now that I hardly ever play games, I believed I would never need to install Windows again. Silly me.<br /><br />How do you get rid of Windows when important websites (for you) work only with IE?Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-58001881599674008022009-01-01T05:01:00.003+05:302009-01-01T09:58:11.909+05:30So what happened to the Zune?This new (or rather, end of) year story just made my day: <em>every</em> first generation 30 GB Zune reportedly freezing after midnight of 30th December or, starting 31st December, 2008. (See one forum thread <a href="http://www.zuneboards.com/forums/static/zunefail-reddit.html?vbseourl=gen-1/38132-help-frozen-zune-30s.html">here</a>, or a Google trends graph for "zune freeze" <a href="http://www.google.com/trends/hottrends?q=zune+freeze&date=2008-12-31&sa=X">here</a>)<br /><br />So, what was the issue? Apparently, <a href="http://www.pcworld.com/article/156240/microsoft_says_leap_year_bug_caused_zune_failures.html">someone forgot to take care of leap years</a> in their code. I would _hate_ to be that someone right now.<br /><br />This reminds me of my first new year at <acronym title="Cleartrip">CT</acronym>: more than one date handling bug in our code caused weird things to happen around the turn of the year. Thankfully, our failures were nowhere as epic as this one.<sup><a href="#fn1">1</a></sup><br /><br />I wonder how long us programmers will keeping tripping at each happy new year's.<br /><br /><div id="fn1"><sup>1</sup> The most any business guy reported was that some flight/fare was not showing up correctly, and no one apart from a couple of devs even knew what had happened (that was before we became heavy on processes, and JIRA was no longer a joke).</div><br /><br /><em>Update:</em> Apparently the piece of source code that caused this problem has been identified and is out on the internets. So what did it? Well, seems like a date routine from Freescale was the culprit. See <a href="http://www.zuneboards.com/forums/zune-news/38143-cause-zune-30-leapyear-problem-isolated.html">this</a> forum post for the gory details.Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0tag:blogger.com,1999:blog-17912943.post-25309523068086890012008-12-25T10:24:00.008+05:302008-12-27T12:01:41.378+05:30Kullu Manali: A photostorySomething new for the diminshingly small population of readers of this blog: a collection of pictures and short anecdotes from my recent trip to Kullu-Manali. Head over to the flickr set to view and read:<br /><br /><a href="http://flickr.com/photos/chaitanyagupta/sets/72157611251346012/">http://flickr.com/photos/chaitanyagupta/sets/72157611251346012/</a>Chaitanya Guptahttp://www.blogger.com/profile/00387714191982678224noreply@blogger.com0