Angel investing for Software Engineers

Software Engineers peak early in their career and especially in places in the San Francisco Bay area, New York, and Seattle attain accredited investor status early on in their career. Hearing stories of Jason Calacanis and Chris Sacca, many consider trying their hands-on angel investing in startups. If you are considering it, here are my few suggestions for that. Should you do it Angel investing, just like many other exotic ventures such as buying arts and vintage coins, is optional. It is much more safe to make money by investing in publicly listed companies. So, don’t do it for money. Find a better reason to do it. For me, the opportunity to connect with other entrepreneurs makes it worthwhile. ...

A short guide for MBAs looking for a job in the tech world

Why Tech In the past decade, interest among MBA grads towards tech companies has drastically gone up. If you are one of those, take a pause and ask yourself “why”. Of course, there are upsides; the tech sector is growing faster, pays well, has a much better work-life balance than finance, private equity, or consulting. But at the same time, do remember that you spend almost 50% of your waking hours at your workplace, so you must as well enjoy it. If you enjoy flashy presentations, regular travel, or an opportunity to think about big M&A deals, then these things come much earlier in your career on the east coast than that on the west. ...

Cryptocurrency trading

Background There are three major types of financial exchanges Stocks and bonds Commodity exchange Foreign exchange (Forex)

This website was compromised

For 6-months, this website was compromised. I am not sure what exactly happened, but it was most likely password-reuse, which lend itself to this problem. The problem became apparent when I first noticed an unusual link to a ride-sharing service. Later, I saw more of those links. That’s when I realized that I couldn’t merely sit and scan every blog post manually and decided to write a small interactive link checker tool. This tool whitelists the starting domain and allows you to whitelist URLs on a per-domain basis. The whitelist is persisted at the end of execution and will be used next time you use the tool. ...

Closeum - closed-source in disguise

Earlier, the Software world was rigidly divided between closed and open-source software. Microsoft Windows is closed-source, GNU/Linux is open-source. Microsoft Office and Lotus Notes are closed-source, LibreOffice is open-source. Turbo C++ is closed-source, and GCC is open-source. But now, a new class of software products has emerged whose core is open-source, but still, the open-source software is of limited use. One model is to offer some critical and useful functionality in a closed-source layer via a managed service in AWS/GCP/Azure, for example, Redis is open-source, but useful modules on top of it are not. Another model is to use licensing gimmickry, for example, MongoDB is licensed under SSPL which requires that if anyone offers MongoDB as a service, then the source code of the full service must be published under this license. The third approach is to make the core software open-source but make it dependent on closed-source cloud services. For example, the node package manager (npm) is open-source, but a closed source company owns the default npm registry. Android is open-source, but most day-to-day application ranging from Google Maps to Google Music are closed-source. Now onwards, rather than calling such software open-source, we should call them closeum. ...

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

Server vs mobile development: Where the code runs matter

When the code runs on your servers, you have much more control over the “context” in which it runs. On the mobile devices, the device OS and the user control the context. This difference leads to some subtle implications. One significant set of differences comes from the lack of control of the platform. For server-side code, one can choose from a wide array of languages. For the mobile code, however, the best choice would almost always be the one dictated by the platform - Java/Kotlin on Android and Objective-C/Swift on iOS. Further, for the server-side where one can stick to a particular version of the language. In the case of mobile, the platform controls the language version. Same goes regarding the hardware choices - one can choose to use different types of server machines specialized in handling those jobs, eg. GPUs for math-intensive computes. While for the mobile-code, one had to write a good enough fallback to support a wide-enough set the devices. Similarly, the server-side has to rarely worry about the server killing a running process while it is normal for mobile OSes to kill backgrounded processes eventually. ...

Google I/O 2018: Android Notes

Highlights All android support library code is moving to the androidx namespace. No more android.support.v4 or android. support.v7 namespaces. Android app bundle to split the app into downloadable modules Navigation library to set up navigation between different activities/fragments. Use WorkManager for background work - this is an improvement to JobScheduler Major improvements to Android Studio. Most standalone tools were deprecated in favor of adding the same functionality into Android Studio. Major improvements to Android Vitals which in Google Play to learn more about what’s going on with the Android app’s performance. Android P does more profiling to improve code locality for faster execution. Modern Android Development hierarchy viewer is replaced by ViewTree in Android Studio TraceView is replaced by Systrace in Android Studio Profiler (DDMS) is replaced by Android Profiler in Android Studio Dalvik is replaced by ART Java is replaced by Kotlin as a preferred language Layouts Absolute Layout - deprecated Linear Layout - still OK Frame Layout - still OK Grid Layout - discouraged Relative Layout - discouraged ConstraintLayout - recommended ListView, GridView, and Gallery are deprecated. RecyclerView is recommended with ListAdapter for updations. Platform Fragments (android.app.fragments) are deprecated. Support library fragments are recommended. Single activity app recommended Rather than managing activity lifecycle use Lifecycle to observe state changes Rather than keeping plain data with views, use LiveData to update views automatically. Use ViewModel to deal with screen rotation. Room is recommended in place of SQLite CursorAdapter and AsyncListUtil are discouraged. Use Paging instead with a neat, graceful offline use-case handling trick. Don’t do manual bitmap management. Use Glide, Picasso, or Lottie instead. Between TextureView and SurfaceView, use SurfaceView. Nine patches are discouraged. Use Vector Drawables. Use FusedLocationProviderClient for fetching the device location. Wi-Fi access triangulation is coming to Android P. FusedLocationProvider will eventually add support for that for indoor location tracking. MediaPlayer is discouraged, use ExoPlayer instead. A detailed hands-on presentation on ExoPlayer Performance 42% of 1-star reviews mention crashes/bugs ANR/crash rate reduces engagement - use StrictMode to catch them early Avoid IPC on the main thread, StrictMode won’t catch the violation, and you would never know what’s happening on the other side of the IPC call which can block the main thread If BroadcastReceiver#onReceive is going to take more than 10 seconds, then call goAsync for background processing and call PendingResult#onFinish() once that’s finished WakeLocks - avoid using them. All except PARTIAL_WAKE_LOCK are deprecated with Android P. Use FLAG_KEEP_SCREEN_ON for keeping the screen on in an activity Use WorkManager for background work Use AlarmManager for short-interval callback enums are not discouraged anymore. Platform code avoids it but unlike in prior Android versions, the penalty for enums is low now. A good introduction to Android’s display rendering A good introduction to Android’s text handling Text handling issues Only framework spans can be parceled, don’t mix custom spans with framework spans since only the frameworks will be part of the copied text After ~250 spans or more, SpannableStringBuilder ends up being more performant than SpannableString since the former internally uses trees. Metrics affecting spans cause measure-layout-draw calls, while appearance affecting spans cause layout-draw calls, therefore, the former is more expensive. Text measurement takes a lot of time on the UI thread, consider creating PrecomputedText on the background thread. android:autoLink = true works via RegEx and has bad performance. Consider using Linkify on the background thread. Android P also supports deep learning-based TextClassifier which is also invoked on the background thread. Testing your app for background restriction - adb shell apps set <package name> RUN_ANY_IN_BACKGROUND ignore # applies background restriction (change “ignore” to “allow” to remove restriction) Next Billion Users 28% of searches in India are voice searches 2-wheeler mode added to Google Maps Google Tez uses Ultrasound for pairing and sending money to the nearby receiver Files Go - Folder-based hierarchy won’t work for users who have never had a PC before. Therefore, shows photos based on associations like “WhatsApp Images” or “Camera”. Supports P2P file sharing for fast transfers. Design for next billion users - http://design.google/nbu Android Go 25% of devices in 2018 shipped with <= 1GB RAM (target for Android Go) Every 6 MB app size reduces the installation rate by 1% India - largest market for Go. The USA - is the second-largest market for Go. 5 seconds cold start goal Users opt for smaller apk sizes with a lower rating. The average apk size is 30 MB. Go recommends a 40MB max app size for non-game and 65MB for game apps. MLKit On-device + cloud APIs. On-device APIs are free. Firebase supports downloading models and even doing A/B testing. Experimental support to convert TensorFlow models to TensorFlow Lite models. Compiler D8 - new Dexer, now default. Enable/disable via “android.enableD8 = true/false” R8 - new optimizer, now default replacing proguard, still opt-in in 3.2. Enable via android.enableR8 = true Kotlin - talk can be here Use properties instead of default getters/setters Use data classes to generate equals, hash method, etc. Use default args instead of method overloading Use top-level functions as well as local functions (function inside functions for better encapsulation Use function extensions to make the code more readable, eg. extend String class with isDigit to be able to later write the code like “1234”.isDigit Use smart casts Use sealed classes for a superclass which should not be extendable beyond the compile-time Use string interpolation in println, eg. println(“name is ${name}”) Use val (read-only values) by default, only use var (read-write var iable) when there is a strong reason Declare lambda functions as inline to remove the cost of having an extra class Use co-routines via async instead of creating new threads Use suspend + async to convert callbacks into more readable synchronously written code

Google I/O 2017: Android Notes

Infrastructure - Architecture & Performance Android Vitals - More visibility in Google Play dev console on battery drain, wakelocks being held for too long, ANRs, crashes, dropped frames, and frozen frames. Architecture components - better handling of the lifecycle, Room (ORM for Sqlite), live data observers. The API looks clunky though. Performance 50% 1-star reviews mention stability & bugs. 60% 5-star reviews mention speed, design, or reliability. Apps with > 5% crash rate have 30% higher uninstall rate. Emerging Markets > 100M users came online in 2016. 1B 2G devices expected in 2020. 50% of India is on 2G 33% users run out of storage in India every day. Data is expensive - it costs ~$2 to download a 40MB free app in India 53% users abandon websites if it takes more than 3 seconds to load Action items ...