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.

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.

Why Product Manager

Product Manager is the dominant choice for an MBA grad. That does not mean this is the only possible role. Anecdotally speaking getting into a PM role at Google is harder than a Software Engineering role. And if you are an international student looking for visa sponsorships, then some tech companies are not willing to do that for the PM role. Lastly, if you are not from the Computer Science/Electrical Engineering background, it is harder to get shortlisted and clear interviews. My goal is not to discourage you from applying but make your expectations realistic.

Beyond Product Manager

Facebook, Google, Apple/Amazon, Netflix (FANG), and Microsoft are big businesses. They deal with a wide range of functions such as real estate to supply chain to short-term/long-term cash management. There are all sorts of finance-world equivalent roles beyond the PM role. I won’t be surprised if Google pays more in real-estate rents than say, WeWork. All big companies engage in regular M&A as well and have a full-time team staffed for that. Cisco, Apple, and Google, in particular, are known for M&A. Also, many companies have roles like Product Strategy and Product Marketing Manager. These roles are similar to Product Manager but attract much less attention since these titles do not look as coveted as the Product Manager. You can use these roles to get in and then can transition to a Product Manager role later.

Beyond tech companies, many venture firms, both domestic and foreign (like Rauketen and Softbank), invest in US tech startups. And for that, they hire analysts, principal, and associates. The job responsibilities range from scouting to deciding on the deals.

Does company size matter?

I like quantifying companies in three stages – stage 1 (pre-product market fit), stage 2 (post-product market fit, growth stage), and stage 3 (mature companies like FANGs). Do note that in a big company like one of the FANGs, you will find products which are in stage 1, stage 2, or stage 3.

If you need visa sponsorships and have loans to pay, then stay away from stage 1 companies. The risk-reward ratio is more skewed towards risk here. If this succeeds, even a small acquisition can net you a million-dollar or two easily.

In a stage 2 company, the likelihood of broad responsibility is higher. You could be doing inside sales one day and scouting for a new office lease the other. If you are willing to take the risk, then the long-term financial rewards are much higher here. If you need visa sponsorship, then you should join a stage 2 company with a non-US office as well. So, in case you don’t get H1-B before your OPT expires, the company can move you to one of the international offices. Confirm this after getting the offer letter and before signing it. Some companies like GitLab have a strong remote culture; this can be extra beneficial to someone concerned about the visa sponsorship issues.

In a stage 3 company, your role is going to be much more structured, narrow, and focused. The company won’t die overnight and would likely have international offices to move you to in case the visa situation does not work out. One caveat for those looking to apply for permanent residence (green card), join a company which did not do layoffs recently and is not planning to do in the next year. If a layoff happens than the permanent residence applications from that employer are usually rejected by the USCIS.

B2B, B2C, and marketplaces

B2C, Business-to-consumer startups, in their pure form, was thriving in the valley till about 2015. The users have swayed away from installing new apps, and more prominent companies have become good at making the whole startup a feature in their product. So, in 2019, software-only B2C exists, primarily, inside FANG and Snap. Two exciting classes have emerged beyond software-only B2C. One is prosumer (professional consumer) companies like recently-IPOed like Slack and startups like Savvy. The other exciting direction is the D2C, direct-to-consumer, startups like allbirds and brandless.com. D2C, in my opinion, requires a lot of operations and marketing experience. I notice more B2C startups focused on India, Latin America, and China than the USA these days.

B2B, business-to-business, are all in rage today. From Google cloud/Azure to small companies like Narmi, a lot of companies are capitalizing and building products for other businesses. While B2C is about understanding consumer psychology, B2B is about understanding the needs of another business.

Two-sided marketplaces are hard to grow. Most of them, in the US, are trying to build pieces of Craigslist, and some are doing well.

How to apply

Don’t apply directly for an off-campus opportunity. Go via a referral. The referral route ensures that you will get a response, even if it is a rejection. A lost of time direct applicants never get a response. And you don’t need to find someone you know. You need to find someone willing to spend 5 minutes submitting your resume internally. Culturally, it is not frowned upon to submit referrals for acquaintances. And if you get hired the person referring you will make referral fee which is usually a few 1000$.

Where to find stage 1 and stage 2 jobs

  1. Angel List
  2. Breakout list
  3. Y Combinator startups
  4. Hacker News’s who is hiring threads and a bit more readable version

Cryptocurrency trading

Background

There are three major types of financial exchanges

  1. Stocks and bonds
  2. Commodity exchange
  3. Foreign exchange (Forex)

Stock exchanges, where stocks and bonds are traded, are highly regulated and don’t transcend national boundaries. The listed companies have to follow disclosure protocols decided by the government and the exchange. The stocks that are traded on these exchanges are mostly unique to the exchanges. For example, Google is only listed on the American exchange of NASDAQ. So, to buy Google stock, you need to conform to American laws. Also, you can only sell these shares back on NASDAQ and that too only within certain hours of the day. Therefore, these exchanges have some monopoly power.

However, commodities can be easily resold and delivered on other domestic exchanges and with some effort across national boundaries as well. Therefore, unlike stock exchanges, commodity exchanges do not have a monopoly over what’s being traded on them. The only advantage they can offer to the traders is a marketplace where they can find counterparties to take a position against their trade. Traders don’t have to arbitrate, that is, buy from one market at a lower price and then sell to another at a higher. Just the fact they can do it ensures that prices differences are minimized. Crude oil is the most actively traded commodity in the world and unlike Google stock, a trader can trade in crude oil, practically, in any commodity exchange in the world. Some other commodities could be traded in exchanges specific to a country.

Foreign Exchange (forex) markets are different. In theory, one can be run a US Dollar – Euro foreign exchange in Nigeria. Therefore, these transcend national boundaries. Most forex markets, however, are regulated. Forex markets are practically 24-hours a day, 7-days a week. Since major currency pairs like USD-EURO can be traded in any major forex exchange on the world, these markets practically never close. This distinction is subtle but important. For example, consider Apple Inc. which is listed on NASDAQ in the USA. If some bad news related to say Apple is published in media on Friday evening after NASDAQ is closed for trading then the traders cannot trade their Apple stocks till the Monday morning. But if Britain’s exit from EU (Brexit) is canceled on a Friday evening then the forex market will react immediately to the news.

Another subtle distinction is that big stock exchanges can enforce their rules and if a trader behaves badly then they can ban him/her for life. Getting banned from a major exchange is career suicide. A trader who, say specializes in tech stocks or healthcare stocks of a country cannot simply move to another country and learn the rules there. Commodity and forex markets are different. One can simply register in a different jurisdiction and start trading. Thanks to the Internet, being registered in Malta does not require one to live in Malta.

Type Monopoly Restricted to a country 24-hours a day
Stock exchange Yes Yes No
Commodity exchange No Partially Yes
Foreign exchange No No Yes

Crypto Exchanges

What’s traded on crypto exchanges is not unique to those exchanges. Just like USD can be purchased on pretty much every exchange, one can buy Bitcoin from any exchange, 24-hours a day. But while Forex markets are trading on the optimism or pessimism around a nation’s economy, commodity markets are pure speculation around demand and supply of a commodity. Therefore, cryptocurrency exchanges are akin to commodity exchanges. And since the goods are virtual, they easily transcend national boundaries. Therefore, inter-exchange trading implies price arbitrage will be rare in the longer run. So, what decides one exchange will win over another? Given that an exchange does not have the monopoly over what’s being traded, the only major barriers I can think of are either regulatory or higher liquidity.

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.

Say, your website is example.com,

The tool starts from the starting URL and scans all the links on the page. If any of those links are in the domain, they are scanned further. If they are not, then they are checked against the whitelist, the non-whitelisted domains would be prompted back to you for whitelisting.

Using the tool, I caught quite a few more such bad links.
Note: The tool does not execute Javascript. Thus, it will miss any dynamically generated links.

Android: Handling JPEG images with Exif orientation flags

A JPEG file can have Exif metadata which can provide the rotation/translation field information for a raw JPEG image. So, a landscape raw JPEG image could actually be a portrait because it’s EXIF orientation could be set to ORIENTATION_ROTATE_90, the best way to handle such scenarios is to either use a library like Picasso or Glide or at least learn from them. Here is a piece of code from Picasso which loads a JPEG as an in-memory bitmap and performs the right translation/rotation.

 

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.

From this point onward, the issue and the fix were relatively straightforward. Apple marked Android Studio as quarantine and hence was in a read-only directory. Quarantine status was confirmed by

The fix was relatively simple as well

Update worked as expected after this.

Setting HOMEBREW_CASK_OPTS=–no-quarantine seems to enable this behavior for all the future installs.

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.

 

After starting the app, check that the READ_CONTACTS is revoked or revoke it with adbe

Now, when you click the “Click me” button, you will see a SecurityException in the logs but the app won’t crash. If you check Thread’s name via Thread.currentThread().name, it will return JavaBridge. It seems any Exception thrown on this thread is simply swallowed. This won’t show up in analytics or crash log reports. Your Javascript code on return simply won’t be executed. And your app will appear unusable. This is worse than crashes. crashes at least give the app a chance to get out of a bad state.

This is worse than crashes. crashes at least give the app a chance to get out of a bad state.

Remedy

Sending error information across languages is hard. At the bare minimum, every such call should be encapsulated with a try-catch which catches Exception. For severe unexpected errors, it might not be bad to let the app crash, as you would, while writing the Java code.

 

Full code for this blog post is posted on Github

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]

You should receive an invite from Apple’s Testflight service in the next few minutes. It will contain a code or link you need to install the app. You’ll also need to have the TestFlight app installed on your phone. If you need us to send the invite to a different email address, just reply to this message and let us know.

Once you’ve checked out the app, please send us your feedback — this is a beta and we need your help to improve! Be honest, frank, and opinionated: you won’t hurt our feelings. Bugs, ideas, concerns, etc all fair game. You can reply to me or send to team@orchard.ai.

Thank you!

Brian and the entire Orchard team

brian@orchard.ai

Which one do you think your early adopters have a higher likelihood of understanding and responding to?
Don’t forget while you might live and breathe your startup, your early adopters have probably signed up to try several such services, and unless you remind them what your product is about, they might as well delete the email and move on.