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. ...

Android Logo

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] ...

The "key" problem in cryptocurrency

All cryptocurrencies are eventually tied to a “private” key. You lose this key, and the funds are gone, forever. Millions worth of bitcoins have disappeared from the circulation due to lost keys. You can memorize the key by mapping it into passphrase consisting of memorizable words but if you forget that, like many others, the coins are unrecoverable. An alternative is to trust a centralized service like Coinbase, but then all the benefits of investing in a decentralized currency are gone. Lastly, one can use a hardware wallet, but again, if you lose the wallet, the key is lost. If you keep the key on your device, then a malware might target and try to steal it someday. Thus, even if you are bullish on cryptocurrencies, there are no good decentralized ways of holding a significant chunk of your net worth in cryptocurrencies. ...

ADB Enhanced logo

adb-enhanced: A swiss army knife for Android development

Android development requires tons of disconnected approaches for development and testing. Consider some scenarios To test runtime permission - Go to Settings -> Applications -> Application info of the app you are looking for and disable that permission. To test a fresh install - adb shell pm clear-data com.example To test your app under the battery-saver mode - turn on the battery saver mode by expanding the notification bar To stop the execution of an app - kill it via activity manager, adb shell am kill com.example To test your app under doze mode - first, make the device believe that it is unplugged via adb shell dumpsys battery unplug, then, make it think that it is discharging via adb shell dumpsys battery set status 3, and then enable doze mode via adb shell dumpsys deviceidle force-idle. And don’t forget to execute a set of unrelated complementary commands once you are done to bring the device back to its normal state. To see the over draw of the app - Go to the developer options and enable/disable it there. Over time, this became a significant mental burden that I first wrote some of these flows in a text file and then converted them to automated shell scripts. But when even that felt insufficient, I created a tool for myself called adb-enhanced. ...

Swift, Kotlin, and Go

It is impressive to see the amount of similarity which exists in Swift, Kotlin and Go, the three new languages for iOS, Android, and server-development respectively. Consider a simple, Hello World program. Swift Swift 1 2 3 4 5 func printHello() { // Type automatically inferred to string let name = "Ashish" // let declares a read-only variable print("Hello world from \(name)!") } Kotlin ...