20 Jul 2015

My first fall off a bicycle in years

I take Stevens Creek Trail while cycling to work. Taking the trail is safer and easier than riding on the roads because motorcycles and cars are not allowed on the trail. But there’s one part where the trail is significantly less safe: when getting off of it near Google office. The trail is elevated and is about 10 feet above the ground around it. To get off the trail, I have to climb down this steep, irregular descent.
Usually this is fine; I am used to rough trails like this from my childhood. But today was different. I waited about 15 seconds at the top yielding to another cyclist on the ground. By this time, there was another cyclist behind me, waiting for me to move. I became nervous about blocking someone else’s way. As soon as the cyclist on the ground was out of my way, I hurried down the descent and ended up falling off.

This is my first fall in California. I’m a bit embarrassed because I know how to take this descent correctly. Should be more careful in the future. :)

15 Jul 2015

Cycling to work

I started cycling to work sometime in 2014. July 2014, I think. The commute is approximately 10km (about 6 miles) one way. After the initial enthusiasm faded away, riding 10km was not really easy. By the time I arrive at work, I’d be short on breath. I’d run to the pantry (micro-kitchen as we call it) and grab anything that looks edible.
There have been times when I wanted to give up cycling altogether. Sitting inside the car is so comfortable, after all. But somehow I kept it going. One or two days every week, I was cycling to work.

A year later, I continue to cycle to work once or twice a week. It’ll be nice to cycle more often, but I am happy with how far I have come. When I arrived at work today after cycling for 10km, I wasn’t even thirsty. I didn’t want snacks, nor did I want coffee. I just put my bag down and started to work. I know things will improve further as time goes by, but I am satisfied with the progress so far.

19 Jun 2015

When I feel grim at work

... I fix a bug or two, and that usually makes me happier.

8 May 2015

Finding blog posts with broken links

How frequently do you end up with erratic HTML in your blog posts?  Not very frequently.  But if you do find your blog in such a state, how do you fix it?  I was playing around with my Picasa settings and in the process I managed to break all my album URLs.  All my albums now returned a 404.

I wanted to find all my blog posts that link to one of my Picasa Web albums and fix the broken links.  Unfortunately Blogger's search will only search the text of the posts, not the HTML.  What this means is that a post containing HTML like "<a href="http://picasaweb.google.com/mankis.pics/Pilgrimage2010>photos</a>" can be found by searching for "photos", but not by searching for "picasaweb" or "mankis.pics".  Like any self-respecting programmer, I decided I'd whip up a script that would do the searching for me.

To access my posts from a script I have two choices: use Blogger's API or get a dump of my blog by exporting it to a file.  API would be a good choice if I have to edit a great number of posts, but I only have to edit a few posts so I went ahead with the latter option.

If I pass the export XML file and the search string, my script would print URLs to edit posts that contain the string.  This is how I found all posts with links to a Picasa album:
% ./find_blog_posts.py \
     -b /tmp/blog-04-30-2011.xml \
     -s 'mankis.pics'
http://draft.blogger.com/post-edit.g?blogID=28645193&postID=5479412993915553873
http://draft.blogger.com/post-edit.g?blogID=28645193&postID=6291962710796224390
...
The script is available online if you want to use.

2 Jan 2015

A review of the year 2014

I am not much of a believer in “new years”. It’s just an arbitrary point in time which happens to be a round number (01/01). But, I like the fact you can think of this round number as a new beginning. Counting your blessings is a good thing, they say. I’m going to start this year by reminiscing on 2014 a bit.

If 2013 was when we bought a new car for our family, 2014 was the year when a car became my primary means of transportation. When I had to buy a car, the first thing I wanted was a BMW X3. Though I changed my mind later on after finding out the cost, I ended up getting an X3. Turns out, used cars are considerably cheaper. :-)

Getting this X3 was one of the good decisions of 2014
Before getting the X3, and for a while after getting it, I thought the X3 looked really nice. In a few months, I learned that irrespective of what car you have, you’d think of some other car to be nicer/better. I still wish I had gotten a Jeep Cherokee even though I know deep down that the Cherokee won’t be as refined as the X3, and the X3 is a better match for my needs.

By around the same time, I upgraded from Canon PowerShot S5, which had been my camera for about 6 years. I upgraded to Sony Nex-6 and got two prime lenses, thanks to guidance by +Karthik Nagaraj. I am so pleased with the quality of the images I took 3 to 5 times more pictures this year than the past 5 years. After a few years, I took pictures that I myself liked.
When I moved from Sydney, the most important goal I had in mind was to travel more. I started living outside India with the desire to travel, but I hadn’t travelled much when I was in Sydney. I wanted to change that with the move to California. Armed with my new Nex-6 and the X3, I travelled to a lot more places than I had originally planned.

2014 was my “year of broke” after having lived wealthy for several years. Often in 2014, I had much less money than I needed. It was all due to bad planning from my part, which made it easy to fix the issue. I can say I have a good hold on my monthly expenses now. 2015 might actually get better monetarily. Good times are ahead.

This was the year I bought my first non-Nexus Android phone. This was the year my much loved Toshiba Z830 laptop felt inadequate. It’s underpowered for running things like Android Studio. Has a 1366×768 screen, which is not pleasant to look at anymore. Sadly though, I just haven’t found a laptop in the market that’s worth upgrading to. Hopefully System76 will introduce a successor to their Galago Pro with a 4k display.

Here’s to a great 2015!