Dealing with phone numbers in contact book

If you are building an app that uses the user’s contact book then their certain gotchas to avoid.

Telephone country codes are prefix-free

If a country has a country code “+91”, then no other country will get a country code like “+912” or “+913”. This scheme ensures that numbers are inherently unambiguous.

Telephone numbers can have multiple representations

Since most people don’t dial internationally, telecom systems implicitly assume a domestic call. So, someone dialing 612-555-1234 in the US is dialing “+1-612-555-1234”, while the same person in India is dialing “+91-612-555-1234”. Since international dialing would be more infrequent, telecoms require unique prefix numbers like “00” to distinguish whether someone is 612-555-1234 in their country or 0061-255-51234 in Austria. In some states, even the domestic area code is not explicitly required. So, a user might have stored “555-1234” as the phone number to which telecoms will implicitly prefix the user’s area code. And if the user wants to dial beyond their area, the telecom operator would require an additional “0” prefix to mark that it is an STD call. This localization has a massive implication regarding processing cleaning and normalizing phone numbers retrieved from the user’s contact book. Both country code and area code don’t contain “0”, and usually, that’s superfluous. So, while telecoms might be OK with calling or sending SMS to “0-612-555-1234”, they will treat a number like “91-0-612-555-1234” as incorrect.

Multiple countries can share telephone codes

USA, Canada, and many countries in the Caribbean share the “+1” telephony code. The carriers would treat calls or SMS as international, though. Italy and Vatican city share “+39”.

Continuous area codes or country codes are not always adjacent

As the population grows in certain areas more than others, the codes reserved for other regions can get allotted to them. An example of that is the San Francisco Bay area, where the first 408 and then 669 was allocated on top of the existing 650 area codes to deal with the growing population.

Confirming phone number ownership

You can never trust an incoming call or incoming SMS’s phone number. Therefore, the only way to verify that the user owns a phone number is by sending them a text message or making them a phone call.

Incremental testing: save time and money on CI for monorepo

To use monorepo or not is an eternal debate. Each has its pros and cons. Let’s say you decide to go with monorepo, one major issue you will face over time is slow testing. Imagine a monorepo, consisting of an Android app, an iOS app, some backend code, some web frontend code. On only very few occasions will someone modify more than one of those simultaneously.

Further, most of these projects confined to their directories would be using different build systems as well, for example, gradle for Android, yarn/npm for Javascript, go/rust/java/npm for the backend. The total build time and test time will only grow over time. It annoys developers making small modifications to their part of the codebase. And it slows down the development velocity drastically.

Read More

How to deploy side projects as web services for free

In 2020, the web is still the most accessible permission-less platform. For the past few months, I have been playing and building side projects to simplify my life. I started with a Calendar Bot for scheduling events, DeckSaver for downloading decks from Docsend, AutoSnoozer for email management, and StayInTouch for maintaining follow-ups.

When I started on this journey, I had the following in my mind.

  1. Cost of domain ~ 12$ a year or 1$ a month
  2. Cost of a VM ~ 10$ a month

Read More

Docker 101: A basic web-server displaying hello world

A basic webserver

Docker containers are small OS images in themselves that one can deploy and run without worrying about dependencies or interoperability. All the dependencies are packed in the same container file. And the docker runtime takes care of the interoperability. You are not tied to using a single language or framework. You can write code in Python, Go, Java, Node.js, or any of your favorite languages and pack it in a container.

Consider a simple example of a Go-based webserver

Read More

Android: Using “Die with me” app without killing the phone’s battery

Die with me¬†is a chat app which can be used only when the phone’s battery is below 5%.

Here is a fun way to use the app without draining your phone’s battery. Connect the phone via ADB or start Android emulator and fake the battery level to 4%.

sudo pip3 install adb-enhanced
adbe battery level 4 # Set battery level to 4%

And now, you can use the app. After playing with the app, reset the battery level with,
adbe battery reset

 

Keep your dotfiles bug-free with Continuous Integration

Update: As of April 2020, I have switched over to GitHub Actions. Travis CI has become buggy and flaky over time and I got tired of trying to keep the builds green. My GitHub action scripts can be seen here.

Just like many software engineers, I maintain my config files for GNU/Linux and Mac OS in a git repository. Given that, I wrote a fair bit of them in interpreted code, notably, Bash, it is a bit hard to ensure that it is bug-free. The other problem I face is that packages on homebrew, the Mac OS package manager becomes obsolete and gets deleted from time to time.

I added CI testing on Travis CI to prevent these breakages and to ensure that my dotfiles are always in good shape for installation. The great thing about Travis CI is that it is entirely free for open-source repositories even for testing on Mac OS containers.

Read More

Circle CI vs Travis CI

I maintain a somewhat popular Android developer tool (adb-enhanced). The tool is written in Python, supporting both Python 2 and 3. Testing the tool requires both Python runtime as well a running Android emulator. I, initially, used Travis CI for setting up continuous testing of this tool. Later, I felt that Travis CI was too slow and when I came across Circle CI, I decided to give it a try. As of now, both Travis and Circle CI are used for testing. Here is what I learned from my experience.

Read More

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.

How much to invest?

Don’t invest more than 5-10% of your net worth. Most angel investments fail; it is best to diversify. In the early stages, don’t invest substantial check sizes (50K-100K) in a single startup.

How to start?

Get your feet wet via Angellist Syndicates. You can invest a small amount and gain confidence. These investment opportunities come without the information rights, so, you learn a little less than what you get when investing directly.

Once you are confident, watch more pitches either at local pitching events or online pitching events like Stanford’s StartX and Alchemist Accelerator Demo day.

Whether you are looking at companies on AngelList or the pitching events, the quality will vary a lot. More often than not, you will say no, but occasionally, you will come across a gem to invest in.

Dealflow

Good deal flow is crucial. Either you will have to scout a lot of good deals, or you need to be friends with people who are going to make it big. Also, try to have some VC friends, so that, you know what not in trend. Here’s the hard reality, almost every angel investment of yours will need VC money at some point. If most VCs are going to reject the opportunity outright, for example, because it is located in unacceptable geography or is in a crowded space, then that startup is almost bound to die.

In the case of a hot oversubscribed deal, you will have to convince a founder to take money from you. And that’s where you have to answer what value-add do you bring beyond the capital. Put some thought to prepare that. Here’s mine – “I can help you with thinking around engineering as well as product. My background ranging from backend engineering at big companies to mobile development for emerging markets to blockchain gives me a unique engineering + product perspective. You can see my writings at https://ashishb.net/category/tech-thoughts/ and my prior investments at https://angel.co/ashishb“.

Learn to say no

You will be saying no most of the times. Say that fast and move on. Don’t waste your time or the founder’s time.

Don’t give up on pro-rata

Angel investing is way riskier than late-stage investing. And if you end up investing in a gem, you don’t want to miss out maintaining your pro-rata, fight for this right.

Understand the different type of investments

SAFE is the most popular now. Convertible debt creates phantom tax implications. Equity investing is less prevalent in early stage than the late stage.

Criteria

Develop some criteria to decide what would you invest in and what would you not invest in. For example, I don’t understand health tech and pharmaceutical, and I would not invest in it. Similarly, for the lack of understanding, I avoid startups targeting Latin America or Africa. Remember that laws are different everywhere; for example, in India, a minority shareholder can block an acquisition, in the USA, they cannot.

Process

Decide how you are going to invest. Are you going to decide over a phone call or multiple in-person meetings? Have a written questionnaire which you ask to ensure you are not missing on something.