4 Nov 2015

A few months ago, I dropped my 2014 Moto X and ended up with a shattered screen. While the phone was out for repair, I used a Galaxy Nexus for a few days. Typing on the smaller screen was so painful I realised I couldn’t go back to a smaller phone.

When I was in India a couple months ago, my brother bought a Moto X Play. The Play has a 5.5-inch screen. When I was in India, I used that phone once in a while, and the size didn’t seem all that unmanageable. Actually, it didn’t feel much larger than the 5.2-inch Moto X I was using.

In the context of both of these experiences, I decided getting a Nexus 6P will not be such a bad idea. And I received my 6P today.

Nexus 6P in box

My initial impressions after having the phone for about 5 hours:
  • I’m already missing Moto X’s Active Display feature. (It’s a shame new Moto X uses an LCD display. Active Display with the whole screen lighting up is much less nifty.)
  • I was thinking that the official case sold by Google would inhibit the use of NFC. But it looks like it really may not. I only wish they offered the case in more colours. Both the black and grey are boring colours.
  • As expected, the phone doesn’t feel too big on the hand. But the real test is when I put it in my pant pocket and ride a bicycle. I’ll know it in a few days. Good so far, though.
  • Setting up the phone was super-easy with the new ‘Set up nearby device’ option. It copied over all my apps and almost all settings. Installing all the apps took about an hour or so, but I didn’t have to hunt for apps, so it’s a win.
  • Moving WhatsApp messages to the new phone was a pain. I copied over WhatsApp’s entire folder and still WhatsApp only restored messages till last week. Messages from the past few days are just gone.
  • Fingerprint reader is nice, but I do find the placement a bit hard to use. Hopefully I’ll get used to it in a few days.

In short, nothing spectacular, and also nothing terrible. Let’s see how this goes!

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.