Archives For Coding / Programming

Resources to learn and improve coding / programming skills

Web vs Mobile

May 8, 2016 — Leave a comment

YCombinator recently released this article about the companies that are applying to YC. I find it interesting that, although apps have overtaken websites as the platform of choice, websites had a significant uptick this year for the first time in 8 years.

We applied (and got into the YC Fellowship) with BODY, a website-first application. With BODY, users need to be able to easily position their camera and have enough screen real estate to see fitness instructors real-time. In addition, mobile is often connected to 3G, which isn’t fast enough to support WebRTC with more than 2 connections. Finally, the increasing power of Javascript and its frameworks is driving novel web-app use cases and powerful web-based mobile interfaces.

First software ate the world. Then it was mobile. Is it time for web to make a comeback in a big way?

dragonArtwork

Dragons of Destiny Game Now in iOS App Store

To all my dedicated fans – sorry for not posting anything in a while.  I’m happy to report that after ~2 months of development, I released Dragons of Destiny in the iPhone App Store today.  Built entirely in Swift, it’s a game where you fly around collecting coins and destroying arrows to survive and upgrade your dragon.

I was originally planning on making this multiplayer (player vs. player), but beta testers loved the relative simplicity of this single-player version.  It has a bit of a learning curve to master the controls, but should only take you a few attempts to get the hang of it.

I did all of the coding / design except the main logo dragon above, which my friend Deyna Cast designed.

I welcome any/all feedback! You can check it out by clicking on the picture above.

DNA sequencing is following an exponential technology curve and is one step on a path towards controlling our own biological destinies.  From eliminating hereditary diseases by fixing specific genetic mutations to choosing physical and mental traits in our children, we are on the brink of a genetic revolution.  However, using DNA to store data is already possible and may be a game changer in the near future.

Let me explain 

In 2010, Dr. Craig Venter proved that DNA contains all of the necessary information for life by creating the first synthetic life form.  At the most recent Abundance 360 summit, he pointed out that the 4 building blocks of DNA (A, T, C and G) can be converted into binary (1s and 0s), which is the boolean system used by computers.  By converting ATCG into binary, it is possible to store and manipulate genetic code digitally.  Saving data to a synthetic DNA ‘hard drive’ works by converting binary back into ATCG.

DNA has evolved over billions of years to efficiently store information.  In 2012, researchers fit 700 Terabytes of information into a single gram of DNA. Storing that much data on digital hard drives would require hard drives weighing ~151 kilos (333 lbs).  This technology is improving exponentially and the very next year, researchers tripled the storage density to 2,200 Terabytes per gram of DNA.

IBM predicts that 35 Zetabytes (35 billion Terabytes) of data will be generated annually in 2020.  That’s ~7.6 billion kilos (8.4 million tons) of additional hard drive capacity required annually.  The average skyscraper, like the Sears Tower, is ~222,500 tons, so we would need to build 378 new skyscrapers in 2020 just to house our data from that year.  New York City has ~250 skyscrapers, so imagine building a new data storage city as big as NYC each year.

Even assuming that DNA data storage density doesn’t improve from the 2013 rate of 2,200 Terabytes per gram of DNA, we could store all 35 Zetabytes of annual data in ~15,909 kilos (17 tons) of DNA.  That’s less than 2 buses worth.

The primary thing holding this technology back is the current expense of sequencing DNA to convert the data back to binary.  Current DNA sequencing techniques cost ~$12k per Megabyte, which means that sequencing DNA that contains a 1 Gigabyte movie would cost $12 million.

DNA sequencing is an exponential technology and the cost is falling quickly.  Given the amount of data we will soon be generating and the physical space that would be required using hard drives, DNA data storage may be our only hope.

Over the past few years, I have helped many of my friends understand options in their employment contracts.  Most candidates have a general misunderstanding and discomfort when it comes to options, so I’ll give a brief overview to try and shed some light on the issue.

First, options are not equity.  If you receive options, you won’t actually own any of the company yet.  You are being given an opportunity to buy shares at a later date for a fixed (and predetermined) price per share.  You will make money by buying at the predetermined price and selling during an exit event at a new, higher price.  Without an exit event (sale, merger, or IPO), you won’t be able to sell your illiquid shares and your purchase will represent an investment in the company’s future.

Options vest (become exercisable) over time based on your vesting schedule.  If you leave the company at any point, you will typically have ~90 days to exercise your vested options or you will forfeit them. If you are leaving the company because it isn’t doing well, it’s unlikely that you will want to invest cash in exchange for shares.

On the flip side, if a company gets bought for a valuation that is 10x larger than it was on your grant date, you can immediately convert your vested options into shares and sell them for a 900% profit (assuming no dilution, which is highly unrealistic).

Almost every company will insist on a 1-year cliff so that none of your options vest until you’ve been with the company for a full year.  But what happens if the company gets bought after 10 months of your being employed there?  If you don’t have an acceleration clause (and most contracts do not come with one), you get nothing.

Things you should look for in your contract

  1. A grant date – Important for many reasons including determining when your vesting schedule / 1-year cliff begin and for tax purposes.
  2. A strike price – At what price you can buy shares of the company.  Options are exercised and converted to shares by paying the company the strike price per share.
  3. Total # of options granted – With this you can determine what your cash outflow will be if all your options vest and you buy shares at the strike price.  Keep in mind that the company will probably issue additional shares to you each year or with each promotion.
  4. Total # of shares currently outstanding or % of the company your options represent – How much of the company will you own (prior to dilution) once all of your shares vest?  If they give you the total shares outstanding, you can just divide your # of shares by the # of shares outstanding.
  5. Dilution – This is where the company issues additional shares, which they will do for multiple reasons.  You should assume that your % ownership will be 1/2 of what it is now by in an exit event.  They probably won’t give you dilution protection, but it doesn’t hurt to ask!
  6. Vesting schedule – Typically 4 years.  Vesting is the rate at which your options become exercisable.  Before any of your options vest, you can’t convert them into ownership and there is typically a 1-year cliff on vesting.
  7. A 1-year cliff – Will likely be in every contract and prevents the employee from having any options vest in their first year.  If you have a 4-year vesting schedule, 25% of your options will vest on your 1-year anniversary.  Be wary of any cliffs that have a longer duration, especially if you don’t have an acceleration clause.
  8. An acceleration clause – Single trigger if the company is acquired and double trigger if acquired and you get fired.  At a minimum, 25% of your options should vest in a single trigger and another ~25% in a double trigger situation.  Many contracts won’t include anything about acceleration, so make sure to bring this up.  This is particularly important if the company is doing well and has already raised significant ($2m+) capital, as they are more likely to be an acquisition target in the near-term.

Have you come across anything that I’m missing?  Please let me know in the comments or shoot me an email.  I’m happy to dive deeper into any of these topics or speak with you 1-on-1 if that would be helpful.

https://github.com/liebeskind/leapdrone

What I’m Doing

I initialize my Node.js server, plug my Leap Motion into the computer’s USB port and hold my hand in the air.  I make a gesture that looks like left-clicking on a mouse, but am not actually touching anything.  Suddenly, with a whoosh, the rotors on my drone buzz to life.  This particular model, the AR Drone 2.0, has a quadcopter structure with 4 rotors in a square shape, which gives it enhanced stability.  The drone lifts into the air and hovers there, waiting for me to issue a command.  I move my hand forward and the drone edges away from me.

The further away from center I move my hand, the faster the drone moves until I realize, almost too late, that it is quickly approaching a tree.  I drive my hand down and to the right and the drone dodges to the right and under the looming branches, narrowly escaping disaster.  I point with my finger and make a circle in the air counter-clockwise and the drone rotates so that it is facing me.  Moving my hand forward again, the drone accelerates towards me.  Glancing back at my computer, I can see myself getting closer in the drone’s video camera, which is streaming in my browser.   This is only the beginning of my drone journey.

Why Node opens the door for programming robotics with Javascript

A few years ago, it was virtually impossible to control robots using Javascript alone because it was so slow that any application that required a reasonable response time would not function properly.

With Google’s V8 Javascript Engine, Javascript’s day has arrived.  V8 is written in C++ and compiles down to assembly, so it is very fast.  Recent benchmarks put it ahead of PHP, Ruby, and Python – second only to C itself.  Despite being initially designed to run in Google’s Chrome browser, V8 has since been adopted by several javascript frameworks, including Node.

Node is used to make web applications responsive by quickly pushing javascript from the server to the client.  Node also functions asynchronously so that multiple data streams can be queried simultaneously.  This non-blocking data transmission means that Node is able to process a second and third command without waiting for the first command to succeed.  Another unique feature of Node is that it leverages callbacks (functions that run upon success or failure to receive data) to chain instructions so that you can create a series of commands that will run in order upon completion of the previous command.

The implications for robotics are that multiple commands can either be processed simultaneously or chained to occur in a particular sequence.  Languages like Ruby and Python are not asynchronous and commands block one another, which may result in disaster if a single command gets stuck and takes a long time to process.

Why I used Leap Motion and The Future of Controllers

Leap Motion is the first viable product in a paradigm shift that is changing the way we interact with technology.  For those that don’t know, Leap Motion is a small camera that plugs into a computer’s USB port.  It can detect and track each of your hands and every finger’s movement in the half-dome-shaped space above it.  There are several applications, including playing video games, computer interfacing and, now, flying drones.  I used the javascript framework leap.js to translate hand coordinates into drone commands, then published instructions to my Node server using Faye (a simple publish-subscribe messaging system), and issued movement commands to the drone.

At this point, Leap Motion’s software is in need of an upgrade and isn’t very effective at detecting finger movements if, for instance, you turn your hand to the side.  As a result, I used hand movements for everything except takeoff / landing (done by gesturing with pointer finger as though left-clicking mouse) and rotation (done by making a circle in the air with pointer finger).  I have heard that Leap Motion is upgrading their firmware in the next few weeks and am excited that one of the features is much more precise finger tracking. In the meantime, I am leveraging Leap Motion’s X, Y and Z axes hand position detection to control left/right, up/down and forward/back actions.

Devices for interacting with the world around us are rapidly increasing in effectiveness.  Imagine if you could use something like Leap Motion without being tied to a computer.  In early 2014, Thalmic Labs is releasing the Myo, an arm band that detects electrical activity in muscles associated with finger movements to wirelessly control digital technologies.  In the near future, I may be able to build a pocket-sized autonomous personal drone that follows me down the sidewalk while sending a video feed to my Google Glass, then disengage autopilot and control my drone assistant through hand gestures.  I could also send my drone on missions to pick up a burrito, survey surrounding traffic, mow my lawn, take an aerial picture of me and my buddies, and thousands of other possibilities.

In part 2 of this article, I’ll go through some of the challenges facing the emerging drone industry and why we are on the cusp of a hardware revolution.

To Be Continued…

Hey everyone, check out this chat app I built today using Node.js and Angular.js: Node & Angular Chat App

Node and Angular are both relatively new javascript frameworks that pack a lot of power.  Node is a platform for building really fast network applications that can run on many different devices.  It is great at processing multiple connections without blocking and is one of the most important javascript developments in the last 5 years.  I’ll likely use Node extensively in the future running on Raspberry Pi to build some cool Internet of Things devices.

Angular is a javascript framework, maintained by Google, that can serve as a backbone for single-page web application.  It augments browser-based applications with MVC (model-view-controller) capability and enables rapid prototyping with easy-to-read code.  Angular’s two-way data binding reduces the amount of code that needs to be written and brings templating responsibilities to the client side.  Angular is often compared to Backbone.js, which relies on boilerplate code instead of two way data-binding.

I’m three weeks into Hack Reactor and have gotten to the point where I can create some pretty cool web applications.  The first week was focused on core computer science curriculum like data structures, recursion and algorithms.  I learned more about coding in those seven days than I had in all of my previous programming experience.

Week two was a deeper dive into algorithms and inheritance patterns and an exploration of the emerging javascript framework D3.  I built my first web application using D3 technology, which you can check out here: http://colliderd3.herokuapp.com/.  What’s cool about this game is that it doesn’t use flash or any other third-party technology.  Everything you see is HTML5 and javascript.  D3 is a powerful javascript library for data visualization and my game doesn’t even touch the surface of what is possible.

Last week we spent most of our time learning Backbone.js, which is a javascript framework for structuring an application and providing server communication on the client side through a REST API.  Backbone enables lightening-fast user interaction with data so that elements in a collection can change without needing to reload the page.  Despite being a fairly new technology, some big players are using Backbone including Hulu, Foursquare, Khan Academy, Basecamp, AirBNB, Stripe, Pandora and ZocDoc.

Next week we are going to start diving into Node.js, servers and databases.

A lot of people have been asking me why I am leaving the venture capital world to begin a difficult and uncertain life as an entrepreneur.  It’s simple – I want to make awesome stuff.  I taught myself the basics of coding and was accepted into Hack Reactor, a coding bootcamp that runs 6 days per week and ~12 hours per day.

There are many reasons that I chose Hack Reactor over other bootcamps and a brief discussion of this topic is available on Quora.  The instructors were senior engineers at companies like Twitter and Google and are focused on teaching emerging web browser languages (javascript, jQuery, node, coffeescript, etc).  Most graduates become software engineers at leading tech companies and they have a near 100% placement rate.  Hack Reactor made headlines recently when a few current students set a world record for an algorithmmic challenge called the N-Queens problem.

I want to point out that Venture Capitalists are an essential component of the startup ecosystem and my departure from VC is due to the fact that I want to be a builder.  Without Venture Capitalists, early stage founders would have a much more difficult time raising funds, exits would be far fewer, and many of the most interesting tech companies would likely never have existed.

Jacques Mattheij posted a great article today that orders the complexity of ‘programming’ tasks by least difficult (0) to most difficult (27).  Can see from this list that most people can really only get up to 4, professionals that deal with complex systems every day can typically get up to 8 or 9 and anything past 11 requires intimate knowledge of coding.

What I found particularly interesting in this post is that the author ranked ‘spreadsheets with simple formulas’ as being more difficult than ‘static websites, html & basic css’.  I guess that means all of us business folks really don’t have an excuse for not knowing how to make a basic website.  There are some really great resources available these days to learn the basics of web design from CodecademyTeamTreeHouse, and others.

If you learn to program you’ll have a superior sense of the true cost of software development and will be a much more successful non-technical cofounder.  The most precious resource is time and many non-technical cofounders get tripped up by a false sense of how long things should take to implement.  Learning to code has never been easier and you can check out my earlier post on how to get started.

Business cofounders shouldn’t get lured into thinking that they don’t need technical skills when looking at the CEOs of multi-billion dollar tech companies.  Guys like Zuckerberg, Bezos, Steve Jobs and Bill Gates all started out with a solid foundation of technical knowledge, which contributed to development efficiency.

This article from Rob Spectre over at Fast Company points out that Donald Trump’s success is the result of his knowing the costs associated with real estate development better than any of his competitors.  In the end, running a successful startup is about out competing your competition in the pursuit of limited resources: funding, advice, talented engineers, time, etc.  Having a basic understanding of coding makes entrepreneurs better competitors.