Monday, March 24, 2014

Shashank Ramaprasad's new blog

Shashank Ramaprasad's blog is now hosted on Github, and I use a custom domain:

I will try to post more often there, and in particular, post more on technical topics that are on my mind.

Tuesday, August 04, 2009

Wanted: A Wireless Keyboard That Does Not Suck

Unicomp Customizer 104 Windows keyboard
Wireless keyboards (and mice) for PC's are obviously a convenient piece of technology, but I have two problems with the current line of available consumer models of wireless keyboards:

  1. Dome-switch keyboards: unless you are a graybeard hacker, it is likely that the PC keyboard you are currently using is a dome-switch keyboard. This is the type that makes a mushy, almost quiet sound when you press a key. In my opinion, this technology robs all joy out of the act of typing. I prefer the buckling switch technology — perfected by the IBM Model M keyboards — which produces a loud and satisfying click every time you hit a key.

  2. Superfluous "Function" keys: I swear to you, the Microsoft wireless keyboard that I am using has this ominous looking button on top, which I am afraid to press, for I fear it may launch a nuclear attack on Tehran. Seriously, who needs all these extra keys that waste keyboard real estate? The only non-standard key I can tolerate on my keyboard is the Windows key.
Fortunately, Unicomp actually still makes some keyboards with the buckling switch technology, but their only wireless keyboard, the SK-7500 wireless, doesn't seem to have buckling switch keys. Also, its wireless receiver uses a PS/2 connector to attach to the PC.

Does anyone know where I can get a wireless keyboard that does not have the aforementioned shortcomings? I will pay good money for it, too.

Thursday, April 23, 2009

Help My Friends Get to Mongolia!

This is easily the coolest thing that anyone I've known has ever been involved in. Arun, my college buddy, has signed up for Mongol Rally 2009. That means he and his team are going to drive from London to Eastern Mongolia. That is one hell of a road trip. Thousands of miles, 15 countries and, I am pretty sure, some incredible adventures, over a two month period. You can find out more at the Mongol Rally Rustics Blog.

Arun and his team are looking for support to help them get to Mongolia. They are donating all proceeds to charities. In fact, they will even donate their vehicle in Mongolia, and figure out how to get back once they get there. Gnarly!

Donate to the Mongol Rally Rustics' effort
So, help out for a worthy cause, if you can. Donate to the Mongol Rally Rustics' effort (you can also click the image link above).

Monday, February 16, 2009

Merging lists (or any sequences) in Python

When writing Python programs, I often need to merge a list of lists into a single list. For example:

[[1, 2, 3], [4, 5], [6, 7]] -> [1, 2, 3, 4, 5, 6, 7]

Looking around on the Internet, I have not come across any solution better than the one I always use:

>>> def mergeseq( *lists ):
... return reduce( lambda x, y: x + y, lists )
>>> mergeseq( [1, 2, 3], [4, 5], [6, 7] )
[1, 2, 3, 4, 5, 6, 7]
>>> mergeseq( *[['a', 'b'], ['c'], ['d', 'e']] )
['a', 'b', 'c', 'd', 'e']

If you know of any better solutions, let me know. The idea behind my solution is to use the reduce builtin, and the fact that the addition ('+') operator in Python works as expected for lists.

Note that really, all that mergeseq is doing is to apply the addition operator to the current result and the next element in the input. So, this will work too:

>>> mergeseq( 1, 2, 3, 4 )

Wednesday, August 13, 2008

The Auto-podal Tow and Other Phenomena on Indian Roads

Updated 7 Dec 2008: Ashutosh Mehra, my friend from back in college, also blogged about autorickshaw antics in India, and you can see an actual picture of the autopodal tow in action.

After a week on Indian roads, I wonder:
  1. That people are actually able to get anywhere at all, and
  2. That I actually drove on these roads when I lived here.
Many Indian cities now have three lane roads — the right lane meant for use by two-wheelers like motorbikes, the middle lane for cars, and the left lane for trucks. Such traffic rules, of course, are blissfully ignored. In fact, two-wheelers occupy all three lanes of the road, drive on the sidewalks when possible, and squeeze in between larger vehicles at every opportunity. Cars and trucks, on the other hand, tend to straddle the line dividing two lanes.

Two-wheelers always make their way to the front of the traffic light at every intersection, like the vanguard of some randomly assembled army. Somehow, they always know when the light is going to turn green. Ironically, though, two seconds before the light turns green, these modern day cavaliers dash through the intersection, thereby making it a fatal strategy to try and rush through a yellow light in India.

Autorickshaw crushed in between two buses Auto rickshaws, which are, as far as I know, a uniquely Indian mode of transportation, commit so many transgressions on Indian roads that the subject deserves its own library of work. But among the more entertaining of these is what I call the auto-podal tow, wherein the driver of one auto-rickshaw gets behind the rickshaw that needs a tow. He then sticks out his foot and pushes the other rickshaw forward, while driving his own. Significant distances are thus covered. This feat of supreme agility is performed with much nonchalance, while taking up as much width of the road as possible. Often, the drivers of the two auto rickshaws can be found engaged in conversation, oblivious to the honking of the other riders stuck behind their coupled vehicles.

In Chennai, the auto-rickshaws are equipped with fare meters, but not a one of the meters is actually used. Fares are agreed upon by the driver and the passengers beforehand. I read somewhere that auto-rickshaws have less power than a high-end lawnmower. That, by itself, may not seem significant, until you also know that a single auto-rickshaw is regularly used to transport up to five grown men, or a dozen schoolchildren, or the entire livestock of a small village.

Saturday, July 12, 2008

Sending Shorts in Action

Sending Shorts in Action
Originally uploaded by Nizz0
That's me climbing in my American flag-themed shorts. This was at Castle Rock, about a month ago. Good times.

Friday, January 25, 2008

Can I Haz Ur Internetz?

A friend asked me to appraise all the hoopla surrounding Web 2.0 for an article for the BITS alumni magazine. Here is my contribution:

Web 2.0. The very mention of these words make my skin crawl, like when you see that creepy older relative from your childhood, who was a little too fond of having you sit on his lap. Its funny how very few people actually define Web 2.0, but every two-bit scumbag company in Silicon Valley is ready to jump on the bandwagon.

So, what exactly is Web 2.0? Whence did it come to haunt the "Internets"? Around 2004, a company called Google introduced two web-based applications: GMail and Google Maps. These applications felt "richer" and more responsive than most web applications before. Google resurrected a long-forgotten browser/HTTP feature (the infamous "xmlHttpdRequest") that allowed websites to fetch data asynchronously from a Web Server. GMail and Google Maps were truly novel, useful web applications. But we can't say the same for the efforts of the inevitable shit-stream of me-too companies that followed.

Today, the Internet is littered with retarded-sounding Web 2.0 efforts like Wishlistr, twittr, tumblr, etc., which have no real revenue source, serve no real purpose, and make no underlying engineering advancements, but simply rely on what appropriately calls "loser-generated content" (you create the content, we will make the money), tagging, and "social networks" (more on these later). It reminds one of the three-phase business plan of the Underpants Gnomes in that South Park episode:
  1. Build AJAX-y/Flash-y website,
  2. ???,
  3. Profit!!!
Web 2.0 applications are supposed to share a few common properties: making the browser richer in functionality and more responsive ("pages load faster!"), using tags to add a semantic layer, and encouraging user-collaboration, etc. Never mind that the HTTP hack used to provide these "features" breaks the most basic rule of web-browsing (unless carefully worked around): the Back button on your browser. The HTTP protocol is fundamentally unsuited for the kind of flashy jugglery these Web 2.0 ass-clowns are trying to pull off. The whole effort is akin to putting lipstick on a pig. But it hasn't stopped these Webtards from trying anyway. A search for AJAX libraries on Google yields way more results than it should.

The biggest me-too Web 2.0 offenders have to be the dime-a-dozen attempts to create websites for managing TO DO lists. I mean, come on, the ultimate solution for managing todo lists has already been created: its called a Sticky note. I don't need to login to a fricking computer to remember to get milk from the grocery store.

A discussion on Web 2.0 can't be complete without mention of the 800-pound gorilla of Web 2.0 efforts, the one site to rule them all: Facebook. Admit it, you have an account, and you have wasted at least an hour a day Poking friends and stalking that girl from that party. There is now an ecosystem of parasitic companies whose raison d'etre is to build "Applications" for Facebook. Lets look at one of the more popular Applications: "Superpoke". What, pray, does this application allow you to do? You can "throw a virtual sheep at", "grope", "spoon", or even "dry hump" that special someone. If that doesn't woo her, nothing will. Then, there is the Facebook Gifts application. Let me break this one down for you. You pay Facebook a dollar to send someone a fricking image file of such things as cakes, monkeys, and champagne glasses. To be honest, I am miffed that I didn't think of this one first. I would be rolling in so much cash I wouldn't be writing this shitty blog. Apparently, this Application is very popular with my friends. 48 out of my 50 friends have sent Facebook Gifts to each other. I feel like an outcast.

And then there are blogs. Blogs, per se, need not be Web 2.0, but the inevitable march of Web 2.0 progress is slowly taking over the "blogosphere" (great word, by the way). I went to a database conference recently. There were real companies like eBay, Powerset, etc., which were talking about ways they were solving real problems with their huge data sets, when someone from a company called Bloglines (I vomited a little in my mouth when I heard that name) took to the podium and said, without a hint of sarcasm, "Our mission is to index every blog post ever written". Oh great. They want to index every badly written, narcissistic and ultimately meaningless outpouring of thought on the internet. Someone didn't get the memo: It takes an infinite number of monkeys typing on an infinite number of typewriters to produce anything worth reading. Of course, the irony of it hasn't escaped me — I am one of them.

Tuesday, September 04, 2007

Bouldering at Castle Rock (Labor Day 2007)

Deepak and I went bouldering at Castle Rock State Park near Los Gatos, CA. We were supposed to fly to the Grand Canyon this long weekend, but we canceled our flight tickets at the last minute, because we couldn't get a campsite at the bottom of the canyon. Bouldering turned out to be fun in itself, though. Here's the video I made:

Tuesday, July 17, 2007

Mt Adams, WA: Trip Report

Date:14 July - 15 July, 2007
Attendees:Shashank, Manjunath and Sunder
Trail:South Climb (starting at Cold Springs campground)
Elevation reached:11,500 ft. out of 12,276 ft.

First, the pictures:

Next, the report:

We first stopped at the Mt Adams Ranger Station at about 2pm. There, we bought Cascades Volcano Passes, which also served as our Wilderness Permit to go above 7,000 ft. on Mt. Adams. We next drove to the Cold Springs campground (5,000 ft.) at 3:15pm on Friday. The campsite is in the Mt. Adams recreation area, just off Hwy 141 in Trout Lake, Washington. We parked right next to the South Climb trailhead. It took us about 1.5 hours to get our packs set up, after which we set off (5pm).

Sunder took off ahead on the trail, like a mountain goat. Carrying heavier packs, Manjunath and I were slower. I was practically walking on all fours, stooped by the pack-mule sized load on my back. I felt thankful I had my hiking poles. The trail is well-marked up to an elevation of about 7,000 ft. after which the mountain slope gets mostly rocky. We climbed for about 2.5 hours, and gained an elevation of about 2,500 ft. At this point, I called a stop, since there wasn't much daylight left, and I know its not a pleasant experience setting up camp at night. I was a bit worried, since we were mostly above the tree line, and it was real windy. We set up our tent anyway, next to a clump of rocks and brush.

We decided to cook dinner inside our tent: a potentially dangerous thing to do, when dinner involves burning propane inside a tent made of inflammable material. But, we were exhausted and starved. And, as I mentioned earlier, it was too windy outside to light a fire, let alone keep it going. Dinner was a rather sorry affair, involving some chicken noodle soup, and spring vegetable mix. Note to self: next time, spend more than two minutes at the grocery store to pick up food for the hike.

We tried to get some sleep after dinner, but the wind kept up all night, rocking our tent. It made me wonder if it might have been a better idea to camp at a lower elevation, below the tree line. On our way up, we met people who did so. But, as we found out later, we probably camped at the best possible altitude.

We set an alarm for 4am the next morning. We woke up on time, made breakfast (oatmeal and hot cocoa) and broke camp. We left our tent standing after placing rocks inside. We packed light daypacks, and left the rest of our stuff in the tent. We headed out at about 6am (late!). Within an hour, we reached the snow line. We put on our crampons and trudged up the snow. We hit Lunch Counter at about 9am. Lunch counter is a flat expanse of land at about 9,000 ft. I was surprised by the number of people who had camped here -- it was way windier up here.

At this point, Pike's Peak, the false summit of Mt Adams was becoming prominently visible at the top of a huge, steep glacier. Our task now was to trudge up this face of the mountain for an elevation gain of 2,500 ft. Climbing up a steep incline of snow and ice at a high altitude is a very exhausting, yet unique, experience. At an elevation of 10,000 ft., there really aren't too many obstacles in your line of sight. Every time I stopped to take a breath, I could see the green valleys of the Pacific Northwest stretch out as far as the eye could see, punctuated by Mounts Hood and St. Helens in the distance. Shafts of sunlight pierced the clouds, selectively lighting the valley floor below.

I was afraid we might have problems with the high altitude. But even at 10,000 ft., the worst I experienced was being a bit out of breath, which could simply be exhaustion. And exhausted we were. I focused on settling into a rhythm with my breathing, and climbing. I decided to take 50 steps and then pause for a breath for about 10 seconds. This strategy really helped, and soon, I was feeling energetic. I was also helped by the fact that I was literally walking in the footsteps of others. The hardened ice made stepping easier.

By about 11am, I reached Pike's Peak, the false summit of Mt Adams, at 11,500 ft. Sunder had made it to the top about 10 minutes earlier. But he was completely exhausted, since he went off course, and used up a lot of energy to get back on trail. Moral: Follow the crowds up the glacier. I was raring to go on. The real summit was in plain sight from where I stood, just another steep incline about 800 ft. tall. Manjunath too reached the false summit. But just then, out of nowhere, clouds moved in, reducing visibility substantially. There was also the possibility that they could be storm clouds. At this time, we decided to turn back. We did see others who continued on to the summit.

Going down Mt Adams is a tricky affair. There were those who hiked up with their skis and snowboards. They just skied or snowboarded down gracefully. The rest of us had to either walk down the steep icy face of the mountain, or slide down it ('glissading'). We chose to do the latter, since that would be faster. But boy, was that a bad idea. I did not realize how much speed you can gain sliding down the snow, even using the ice-ax to break my slide. At one point, I was sliding too close to the rocks on one side of the glacier, and I ended rushing straight into them. I was lucky I ended up hurting only my elbow and not my head. After that, I decided I would walk down the whole slope, no matter how long it took.

Going down Mt Adams is tricky also because there are many snowy slopes down and they all look the same. I took the right path all the way back to our camp. But Manjunath and Sunder were not so lucky. They arrived at our tent almost a hour after me, after making a few wrong turns. Tip: as you go up the mountain, keep looking back occasionally, so you know which way you came. We broke up our tent and headed down the mountain by about 3pm. We reached the trailhead by about 5pm, completely sore and exhausted.

In summary, it was a really good first high-altitude mountaineering experience. We went at pretty much the best time. The weather was agreeable mostly. There was a crowd on the mountain, and that was actually a good thing, since I learned from watching others.

Friday, June 15, 2007

Summer of Hikes

I am going to Portland, OR next month, with Manjunath, where the plan is to hike Mt Hood. Manjunath and I go way back. He and I went to school together since first grade. In preparation for the hike, we are hiking various peaks in the bay area, using the invaluable Bay Area Hiker website for guidance. Last weekend, I hiked up to Eagle's Peak at Mt Diablo State Park. Tomorrow, we are going to hike Mt. St. Helena in Robert Louis Stevenson State Park, a couple hours North of San Francisco.

Pictures from last weekend's hike: