Mac OS: App Translocation and Android Studio updates failure

I installed Android Studio via homebrew “brew cask install android-studio” as a part of my automated Mac OS setup . Recently, Android Studio prompted me that an update is available. When I accepted to update, it failed with an error “Studio does not have write access to /private/var/folders/wt/rjv6_wcn4f97_2nth7fqftqh0000gn/T/AppTranslocation/19A80F28-865B-41FC-AA87-B8E43C826FCB/d/Android Studio.app/Contents. Please run it by a privileged user to update.” This error was confusing; I was running Android Studio as myself, a nonprivileged user and the same user owned this directory. Googling it a bit for AppTranslocation took me here . ...

Cross-language bridge error handling: JS-to-Java Example

All languages have certain semantics for dealing with error cases. C deals with them by setting error codes. Java deals with them by throwing exceptions. JavaScript deals with them by throwing exceptions as well but unlike Java, it does have any concept of checked Exceptions. The JS interpreter just stops. And this has some interesting implications in hybrid scenarios like a Webview based app. Consider a simple Android app where most of the code is in JavaScript but is making a request to Java layer. ...

Made to Stick by Chip Heath and Dan Heath

Book summary: Made to Stick by Chip Heath and Dan Heath

The book is aimed at anyone who has an idea to convey and is trying to ensure that what they are trying to communicate sticks with their audience. Proverbs and folklores survive while corporate marketing material does not.

Testing resumable uploads

The core idea behind resumable upload is straightforward if you are uploading a big file, then you are going to encounter users in the network conditions where they cannot upload the file in a single network session. The client-side code, to avoid restarting the file upload from the beginning, must figure out what portion of the file was uploaded and “resume” the upload of the rest. How to do resumable upload Before starting the upload, send a unique ID generated from the file contents to the server like MD-5 or SHA-256. The server decides and declares what the format of that unique ID is. Next, the server responds with an offset which indicates how many bytes server already has. The client uploads rest of the bytes with a Content-Range header . ...

falls_cover3

Five days in Kauai, Hawaii

Kauai is the nature island of Hawai’i. It is smaller than Big Island and way less developed than Oahu . Kauai is more about hikes and waterfalls than watersports. Day 1 We started our first day with Kauai’s Hindu Monastery It’s a beautiful temple with picturesque surroundings. I would recommend reserving a few hours to check out the whole area. The monastery is only accessible till noon, so, plan accordingly. Then we headed to Makauwahi cave, it’s a bit of drive, but the caves are accessible only for a few days every week from 10 AM -2 PM. Unfortunately, the caves were closed due to a medical emergency, but the short hike to the caves and the tortoise farm was excellent. ...

Antelope Canyon

A trip to Antelope Canyon

Antelope Canyon is probably the most photographed canyon in the world. Located in the Navajo Indian preservation, only guided tours are permitted. We took a trip to Antelope Canyon Tours. The tour lasts about an hour, and it takes ~20 mins one-way drive to reach the canyon. There aren’t any hikes, just simple walks in the canyon. Everyone is crazy running around and taking photos, so it does become a bit hard to enjoy in the mad rush. Even then, if you are in the area, I would recommend booking a tour in advance to visit the canyon. ...

How to speed up HTML5 videos

Some video streaming websites like YouTube provides an option for speeding up/slowing down videos; some don’t. The trick is simple, find out the Video object via Js 1 document.querySelector("video") and then set its playbackRate property to the desired value ...

French Laundry

A vegetarian lunch at French Laundry

For the uninitiated, French Laundry is one of the best restaurants in the world. I got a chance to try the tasting menu. I had a vegetarian, or to be precise, a lacto-vegetarian (milk and cheese but not eggs) meal here. The restaurant looks nondescript from the outside, and it is easy to miss it while driving. It was an 8-10 course meal, depending on how you count a course. Portion sizes were small but delicious. And there was a gap of about 15-20 mins before each serving. So, a commitment of 3-4 hours for the full course. ...

Architecting Android apps for emerging markets

This is a long post. It covers several decisions like API version, distribution beyond play store, UI & network performance, and minimizing RAM, disk, and battery usage.

Startup founders: How not to write an email

Consider this email, And now consider this one, Hi Ashish, You signed up for the Orchard beta not too long ago, and we’re excited to finally send you an invite! ( Just to jog your memory, Orchard helps you make the most of your relationships, keeping you up to date on where you’re spending your time and who you need to catch up with. It’s somewhere between a personal CRM and a todo list for your connections.) [Emphasis mine] ...