#fun stuff

I was catching up with a friend of mine yesterday who’s looking to build a company in the wearables space and we started chatting about fast the wearables has been growing. The conversation stuck with me and as I left lunch I started wondering what the next big “tools” markets were going to be. The “tools” metaphor is referring to the observation that during a gold rush it’s usually more profitable to sell the pickaxes, wheelbarrows, and other supplies that miners need versus prospecting for gold yourself. Chris Dixon has an interesting post describing this phenomenom that’s worth a read, Selling pickaxes during a gold rush. Some recent examples would include the growth of collaborative open source development fostering GitHub and the shift to “cloud infrastructure” spawning PaaS companies like Heroku. Anyway, so what areas might end up creating $1bn+ tools markets?

IoT and Wearables

2014 might well go down as the year of The “Internet of things” (IoT), everyone is buzzing about it, everyone wants to leverage it, and everyone is a bit confused by it. The market is still immature but there’s already a flurry of competing standards and technologies. Looking just at connectivity, developers could potentially dealing with NFC, RFID, and Bluetooth LE. Given this early fragmentation and the wide range of potential applications, I think it’s a good bet that the IoT tools market will grow quickly over the course of the year. Locally, ThingWorx has already had a succesful exit and the Boston Business Journal is already throwing around nicknames.

On the consumer side, wearables is already a large market and its only projected to grow larger. Currently, the “activity tracker” space is fairly consolidated but that’ll certainly change as devices emerge to track different metrics through different technologies. The net result of this is that anyone looking to aggregate data from a heterogeneous set of devices will face an uphill battle. To combat this, we’ll definitely see tools emerging to help manage this complexity and create uniform interfaces. RunKeeper’s Health Graph is an early player here and they’ll certainly continue to innovate.


Bitcoin (and *coin) baby! Even though an $8bn market cap isn’t enough to buy WhatsApp, it’s certainly nothing to sneeze at. At this point, it’s still to early to declare that Bitcoin is “here to stay” but it’s definitely going to hang out for a bit. Given its immense disruptive potential and the archaic nature of existing financial infrastructure software, it’s almost a certainty that hugely successful “tool” companies will be built in the cryptocurrency space. From the “Bitcoin” version of payment processors like Braintree to electronic brokerage software like Interactive Brokers I think we’re going to see dozens of interesting cryptocurrency companies.

SaaS cloud wrangling

In the last few years, the number of SaaS products a typical company uses has grown exponentially. Nearly every function in a typical company has been influenced by SaaS products, from marketing and sales to accounting and strategy planning everyone’s data is now “in the cloud”. Despite the the availability of APIs, it’s become increasingly difficult to extract, manipulate, and analyze all the data stored within cloud services. Ad-hoc reports that used to involved combining a few Excel sheets now might require costly custom development. Tom Rikert of a16z has a great post describing the early stages of companies addressing this market and more will certainly follow suit. After the groundwork is laid, we’ll certainly see Google Now style “smart insights” to help companies discover new opportunities and insights.

Making predictions is always risky business and hopefully I don’t look back with these and facepalm. Anyway, would love to hear what anyone thinks in the comments.

Posted In: General


Earlier this week, a buddy of mine reached out asking for a good solution to programmatically taking screenshots of a few thousand URLs. For whatever reason, this question seems to come up ever so often so I pointed him towards PhantomJS and figured he’d be on his way. Wrong. Not one to pass up free beer and the opportunity to learn something I agreed to write up the script to generate screenshots from a list of URLs.

Looking at PhantomJS, it seems relatively straightforward but it’s clear you’d really need something “else” to orchestrate this entire process. After some poking around, NodeJS, everyone’s favorite hipster runtime, seemed to be the obvious choice. There’s a handful of node modules that basically “bridge” node with phantom and allow a node script to asynchronously manipulate a PhantomJS instance. Based solely on the funny description I decided to run with phantomjs-node and was off to the races.

Getting everything setup was straightforward enough but then as I started looking at the phantomjs-node examples I started realizing this was a one way trip to callback soup. I’ve been doing some PhoneGap work recently and using jQuery’s Deferreds has significantly help keep the project from becoming a mess of callbacks. On the NodeJS side, it looks like there’s two functionally equivalent implementations but I decided to run with Q since the “wrapper” function names are shorter.

The Code

Anyway, the main problem we’re trying to address is that with multiple nested callbacks code becomes particularly difficult to follow. It’s hard to read, hard to trace control flow, and obviously hard to debug. Take for example, the phantomjs-node example:

It’s already THREE callbacks deep and all it’s done is initialize PhantomJS and load a page. Imagine layering on a few more asynchronous operations, doing all of this in a loop, and then some post-processing. Enter Deferreds. How To Node has an eloquent explanation of what deferreds are and how Node impliments them but in a nutshell they’re useful for making asynchronous code easier to follow.

The main issue I ran into using Q was that “Q.ninvoke” and “Q.npost” wrapper functions kept causing exceptions while using them with phantomjs-node. What I ended up doing instead was creating my own Deferreds in separate functions and then resolving them inside a normal callback.

My PhantomJS-node code ended up looking like:

It’s without a doubt easier to follow and would also make it much easier to do more complicated PhantomJS related tasks.

So how did screenshotting a few thousand domains go? Well there’s a story about that as well…

Posted In: Javascript

Tags: , ,

Note: I have zero real estate experience beyond renting apartments in Boston/Cambridge so obviously this is all just hearsay.

I was grabbing drinks with a buddy of mine earlier and we started chatting about “brick and mortar” businesses that for whatever reason weren’t being disrupted by technology. As we were throwing out ideas, one of the business that really captured both of us was rental real estate brokerages. Specifically, we were talking about those typically scummy brokerages that constantly post on Craigslist, show you a few apartments, and then follow through by putting you through a painful experience to actually rent the place. I’m admittedly no expert, but out of the four apartments I’ve rented every experience has been terrible to a varying degree.

What makes them so bad?

The entire process of finding an apartment is pretty terrible but ultimately most of the frustrations boil down to dealing with brokers being lazy or incompetent, inaccurate or incomplete data, and then the absurdity of having to drop of paper forms…in 2014. Venturing into specifics gripes wouldn’t be useful since they’re anecdotal but my general sense is the majority of Boston/Cambridge renters aren’t thrilled with their broker experiences.

A playbook for a better brokerage

At a high level, being successful at this will be driven by building a company culture of excellence and customer service. You’ll have to take Tony Hsieh’s playbook from Zappos, adapt it to running a brokerage, and then feriously build a culture to support it. Concretely, that’ll translate to hiring individuals with high emotional intelligence, trusting them to make decisions, and then buying or building the right tools to make it happen. Ok great, we’re knocking off a famous management philosophy and hiring “awesome people” how are we actually running this thing?

Don’t just pay on commission: This is entirely 2nd hand but my understanding is that most of the brokerages in Cambridge/Boston pay agents entirely on commission. It seems like the net result of this is that agents spend a lot of time chasing crappy deals, and have no incentives to actively help the brokerage. We’re going to pay an hourly rate along with a lower commission based on a combination of factors beyond just the number of deals closed.

Pick a price tier and own it: At all the brokerages I’ve interacted with, they were trying to move apartments throughout the entire pricing spectrum. From $800/mon studios in sketchy neighborhoods to premium 2 bedrooms at $3200/mon in desirable locations. From the brokerage’s point of view it makes perfect sense, since they’re paying on commission they really don’t care if their agents burn hours on low margin apartments – a rental is still money in their pockets. We’re doing it differently, pick a price range and own it. Intuitively, it seems like the best range to focus on would be moderately high priced multi-bedroom apartments in order to optimize both demand and fees captured.

Qualified lead gen: As an outsider looking in, a significant challenge for the strategy we’re outlining is going to be how do you keep a pipeline of qualified leads? Instead of waiting for people to “drop in”, we’re going to be pro-active and be identifying, meeting, and connecting with potential renters before they’re actively renting. From attending startup events to sponsoring events for graduating seniors, we’ll be top of mind for potential renters that certainly will have a future need.

Social and email: None of the brokerages I’ve used ever asked for my email address, guess how many got repeat business? It’s 2014, social and email are critically important channels for winning customers, driving referrals, and building a brand. We’ll start small, with Twitter and Facebook to connect with potential leads and then leverage email to send follow up emails, ask for potential referrals, and then hopefully win repeat business. After that, start experimenting with Faceook ads and display ads.

High quality photos and accurate data: Photos matter, a lot. We’re going to source our own, high quality photos of every apartment that we show. After a year or two, we’ll end up with the best sets of photos for some of the most expensive apartments in the city. On top of that, we’ll be gathering clean, structured data about all of the apartments we’re showing and renting. With this data, our listings will be the most attractive and we’ll also be able to place clients using only our own internal datasets.

Make the paperwork not suck: We’re going to end the frustration of dealing with paper forms. Renters will be able to pay their deposit with a credit card (+2.5% fee) online, fill out the MA renters agreement online, and we’ll actually have them credit checked before they get this far. Close faster, less deals fall apart, and everything is digital. I know companies like RocketLease are already playing in this space and they’d be a perfect partner.

Access better inventory: Unfortunately, this is an exercise for the reader. Beyond hooking into the public MLS feed and tapping into syndicate services like You Got Listings I’m not familiar enough with the real estate market to speak to how to get better listings. Would love to hear any ideas in the comments though!

Anyway, there’s obviously more to running a successful brokerage but looking at my experiences renting and techniques that have worked in other industries I think it would be possible to build a customer focused, technology powered brokerage that was extremely competitive.

Posted In: General

Tags: , ,

Last week, President Obama made headlines by suggesting that every American in school should learn how to code. Predictably, the comment sparked some heated discussion across the web from Fred Wilson’s blog to several threads on Hacker News. Surprisingly, some of the viewpoints were extremely polarized ranging from “its useless, some people will never get it” to “of course!”. Personally, I think everyone should definitely be exposed to some form of programming while they’re in school.

An inescapable reality is that in 2013 computers are a part of everyone’s personal and professional day to day. From non-technical roles in technical fields like account managers or project managers to traditionally non-technical jobs, like teachers, everyone is ultimately interacting with computers on a daily basis. With that in mind, having a basic understanding of how computing abstractions and programming work will benefit everyone. From being able to modify a VBA macro to construct a complex Gmail search query, having a basic understanding of how the pieces fit together certainly can’t hurt.

Looking back at high school, drawing an analogy between studying programming and studying a foreign language isn’t really accurate. A better analogy is really the general experience people have studying math in middle and high school. For people that don’t take a math class in college, that’ll normally be the last time they study math in an academic setting. Although most people forget most of the details they learned, they still retain the overarching fundamentals of how things like algebra and geometry work. Because of this, when people are faced with a basic math problem they generally know what they need to look up in order to solve it. Extending this, if people were introduced to basic programming early on they’d have a sense that there might be an easier way to approach certain tasks. Need to format a list of names in Excel? There might be a function for that.

So how can we make this happen? The good news is there’s already a push to make high quality, programming focused education material available to everyone. There are already dozens of masively online open course projects including Khan Academy, Coursera, and Code Academy providing free, interactive, computer science resource for everyone. The next step is pushing states and school systems to actively adopt CS education for their middle school and high school students. Hopefully it’ll prove and easy and effective step to keeping everyone competitive in an increasingly technology powered workplace.

Posted In: General

Tags: ,

In the last post, we walked through how to install HipHop PHP on a Ubuntu 13.04 EC2. Well thats great but it now leads us to the question of how fast HipHop PHP actually is. The problem with “toy benchmarks” is they tend to not really capture the real performance characteristics of whatever you’re benchmarking. This is why comparing the performance of a “Hello World” app across various languages and frameworks is generally a waste of time, since its not capturing a real world scenario. Luckily, I actually have some “real world”‘ish benchmarks from my PHP: Does “big-o” complexity really matter? post a couple of months ago.

Ok so great, lets checkout the repository, run the benchmark with HipHop and Zend PHP, and then marvel at how HipHop blows Zend PHP out of the water.


Well so that is weird, in 3 out of the 4 tests HipHop is an order of magnitude slower than Zend PHP. Clearly, something is definitely not right. I double checked the commands and everything is being run correctly. I started debugging the readMemoryScan function on HipHop specifically and it turns out that the problem function is actually str_getcsv. I decided to remove that function as well as the array_maps() since I wasn’t sure if HipHop would be able to optimize given the anonymous function being passed in. The new algorithms file is algorithms_hiphop.php which has str_getcsv replaced with an explode and array_map replaced with a loop.

Running the same benchmarks again except with the new algorithms file gives you:

Wow. So the HipHop implementation is clearly faster but what’s even more surprising is that the Zend PHP implementation gains a significant speedup just by removing str_getcsv and array_map.

Anyway, as expected, HipHop is a faster implementation most likely due to its JIT compilation and additional optimizations that it’s able to add along the way.

Despite the speedup though, Facebook has made it clear that HipHop will only support a subset of the PHP language, notably that the dynamic features will never be implemented. At the end of the day, its not clear if HipHop will gain any mainstream penetration but hopefully it’ll push Zend to keep improving their interpreter and potentially incorporate some of HipHop’s JIT features.

Per Dan’s comment below, HHVM currently supports almost all of PHP 5.5s features.

Why is str_getcsv so slow?

Well benchmarks are all fine and well but I was curious why str_getcsv was so slow on both Zend and HipHop. Digging around, the HipHop implementation looks like:

So basically just a wrapper around fgetcsv that works by writing the string to a temporary file. I’d expect file operations to be slow but I’m still surprised they’re that slow.

Anyway, looking at the Zend implementation it’s a native C function that calls into php_fgetcsv but doesn’t use temporary files.

Looking at the actual implementation of php_fgetcsv though its not surprising its significantly slower compared to explode().

Posted In: PHP

Tags: , ,