Archive

Monthly Archives: September 2011

Before I get into this post I’m fully aware that I’m treading into cliche territory. I’m certainly not the first person to write a blog post comparing startups and surfing and I concede my lack of originality here. That said, I’m going to do it anyway :)

If you live in Northern California there’s a good chance you work at a startup, at least the odds are probably higher than the national average. There’s also a good chance that you surf, that’s just what we do here. You may even be one of those fortunate people like myself that do both. If so, you’ve likely drawn your own comparisons between the two. Either way I’m pretty sure you’ll join me in stating that both are awesome. So here’s my attempt to articulate that awesomeness via a series of comparison.


Failing Fast
When you’re trying to stand up on a wave it doesn’t take you very long to find out if things are going to work out. Sometimes you don’t even catch the wave, other times you catch it, standup and end up going face first into ocean. Those waves suck and you find that out really quick. With startups failing fast is something you want to do. If your business isn’t going to work out you’d like your proverbial face to hit ocean before you’ve sunk tons of cash and time into it.


Competition
Competition for a wave can be brutal. A common misconception people have about surfers is that they’re mellow and laid back. Just not true. If you get in between a surfer and their wave you might just end up getting shanked in the parking lot. Ok, so shanking’s a bit extreme but they’ll probably throw a couple of f-bombs your way. Another excuse for a shanking? Try getting between a big company and their profits. Actually making money as an early stage startup is tough! You’ve just gotten into the game and the other guys are bigger and have more resources. In both cases though competition is an excuse to kick more ass and get better. Over time you will catch more waves and hopefully your startup will also make money.



The Drop
The drop is awesome. It’s the moment a surfer hops up on their board, stares down the wave and drops over the edge. It’s exhilarating and addictive. It’s also the point of no return. Once you’re up on your board heading down a wave you can’t bail out without getting pummeled. When you join a startup there’s always a point of no return. For some, the drop might be the moment they decide to leave their stable, higher paying job to join a company that might not even be around in a year. Speaking strictly from my own experience this was one of the most exciting times of my life.

Adrenaline
Working at a startup has been a ridiculous thrill. Every day there’s something new: a new feature pushed, app going live in the app store, a new website, a new employee. The list could literally go on and on. It’s like catching the drop off of a wave. You’re going so fast you think you might fall right off the board, and sometimes you do. But sometimes you don’t and it’s freakin’ awesome!


Let’s face it, apartment hunting is one of those somewhat unpleasant things that perpetual renters have to do every once in a while, kind of like going to the dentist or spending the weekend with your parents (love you mom!). There’s the paperwork, the phone calls, open houses… If you’re shopping in San Francisco you’re probably putting more hours into your search than the realtors that are trying to sell the place to you! Admittedly it’s not all bad, the prospect of moving into a new place can be quite exciting. A new neighborhood means new restaurants and shops nearby, especially in SF, and your apartment is never as clean as when you first move in. Nevertheless, apartment shopping in SF right now is brutal!

The problem is there are way more people looking for apartments in SF than there are apartments, or bed rooms, or closets even. I have no idea how long this has persisted, as far as I know this may or may not, just be how it goes. Nevertheless, it’s not unusual to show up to an open house and find 30 other people there, luggage in tow, ready to stab anyone who gets in between them and their precious 1 bedroom with walk-in closet and brightly lit kitchen area. Like I said, brutal, it’s less apartment shopping and more like tenant shopping. The property owners get more applications than they need to fill the apartment so they’re at the advantage of picking and choosing the lucky winner of an exorbitant rent payment, 300 square feet and a parking space that only exists every other Tuesday at 1:00pm.

So maybe you’ve decided you’re ready to suck it up and damn it… you’re going to live in San Francisco. Well, I hear you, obviously that’s what I’ve done so I understand all the reasoning behind it. If that’s the case I have a few tips that just might make your search a bit less painful, provided you avoid getting stabbed by fellow applicants:

Tip #1: Credit Report With Credit Score. This is the best move I made. Get yourself over to annualcreditreport.com and get your free credit report. Then pay the extra $8 or so to get your FICA score. Why? For starters every place you visit will ask for it. It will save you money because you don’t have to pay a fee for each place to run your credit. This also means your credit doesn’t get dinged 50 times after you’ve submitted applications all over the city. Finally, it makes the process smoother for the property owner and anything you can do to make things easier for them is a gold star in your favor.

Tip #2: Be There First. With all the competition you’ve gotta set yourself apart from the masses and also beat them to the punch. One really good way to do this, and also say “Hi, I’m genuinely interested and responsible” is to show up first. At open houses get there early so you can be at the front of the line (cuz you know there’s a line). Also, check CraigsList multiple times a day. Posts are added throughout the day and if something’s more than 24 hours old, the masses are all over it by then.

Tip #3: Your Rental Resume. I already mentioned the credit report but there’s a few other things you should bring with you. The items that should make up your rental resume are as follows:

I’ve found that the SF Rental Application suffices for nearly everybody, even those companies that have their own application form. Having all of this on hand will make the application process smooth, and saves you and the property owner lots of time (especially you!). I printed out copies of each of these along with a coversheet that included my contact information and put it all in individual plastic folders. Now when I want to apply I just give them one of the folders with everything they need. I’m overly process oriented at times and I haven’t seen anyone else do this but it definitely shows you’ve got your shit together and has saved me enough time to write a blog post about it.

Tip #4: Dress It Up. When you go to an open house or a walk through dress it up a bit. You don’t want to look like you’re already homeless (even if you are), that only raises the question in their mind as to why you’re homeless. Maybe cuz this guy doesn’t pay his rent? Instead your clothes should say “Hi, I’m super responsible and always pay bills on time. I just came from a really responsible meeting where I was doing extremely responsible things. You know, like paying bills and getting paid lots of money.” Yeah, dress like that.

Tip #5: Follow Up. You don’t want to get lost in the shuffle. After the meeting follow up with an email or phone call and just ask if there’s anything else you can provide and make sure they know who you are. If it was an open house, tie it back to the meeting and refer to something recognizable. Part of this process is likability, you’re not very likable if they don’t know who you are.

Good luck with your search. If you’ll join me in following these few simple tips, together we can end homelessness. Probably not for the guy talking to the bushes and camping in Golden Gate Park but at least for ourselves.

Arduino Websocket Client Arduino Pusher Client Pusher – Real Time Push Notifications Follow Me On Twitter: @kevinrohling

If you don’t have your very own Arduino yet you should get one. What exactly are you waiting for? Arduinos are tons of fun, especially once you hook up some servos and start driving them around. Add a few pieces of military grade weaponry and you have your very own deathbot!

One of the first things you have to figure out once you’ve decided to personally catalyze the robot apocalypse is how to remotely control your robots, i.e. tell them when to turn left, turn right, stop, and of course… fire rocket launchers. There’s a number of ways you could do this. One of the more common I’ve seen is to open up a server port on your Arduino, connect to it and send it messages directly. The problem I ran into doing this was two fold: 1) I have to know the IP address of the Arduino on my network to make the connection and 2) I have to be on the same network as the Arduino. None of these things are very convenient and IP addresses and networks can change.

The solution I came up with was to use Pusher, a real-time push notification service that runs over WebSockets. Since the native Arduino libraries come with support for TCP connections, making this work involved writing a WebSocket Client library, as one does not appear to have previously existed, and building a Pusher client on top of that. Because the Arduino is connected to a Pusher Channel I don’t have to know anything about the actual device to control it, I just send messages to the Channel. My mechanized Arduinos of destruction are free to roam around, switching networks and destroying civilization, meanwhile I can still control them with my iPad from a hammock in the Bahamas.

Building the WebSocket Client

WebSockets are an interesting hybrid between HTTP and raw TCP connections. They start life very much like a normal HTTP GET request. In the request the client sends a bit information asking for an “upgraded” connection. Once the server sees this, if WebSockets are supported it sends a response back with a status code of 101 indicating that the connection was successfully upgraded. Then, and here’s where things diverge from HTTP, nobody closes the connection. Both the client and the server remain connected to each other. Here’s what this looks like at the socket level:

Client Requests a WebSocket Connection

GET /app/yourpusherapikey?client=js&version=1.9.0 HTTP/1.1
Upgrade: WebSocket 
Connection: Upgrade 
Host: ws.pusherapp.com:80 
Origin: ArduinoWebSocketClient

Server responds indicating that the upgrade was successful

HTTP/1.1 101 Web Socket Protocol Handshake
Upgrade: WebSocket 
Connection: Upgrade 
WebSocket-Origin: ArduinoWebSocketClient 
WebSocket-Location: ws://ws.pusherapp.com:80/app/yourpusherapikey?client=js&version=1.9.0 
Connected

Now that they’re connected both the client and the server can send each other messages any time they want using a process called Data Framing. Data Framing is a protocol for indicating the start and end of discrete messages on the socket. The Arduino Websocket Client Library currently only supports Text Frames, which use a 0×00 byte to indicate the start of a message, a 0xFF byte to indicate the end, and UTF-8 data in between. The WebSocket Specification also allows for Binary Frames, which use a length prefix followed by binary data. Here’s what the Arduino code looks like for sending a WebSocket message:

void  WebSocketClient::send (String data) {
     _client.print((char )0 ); 
     _client.print(data); 
     _client.print((char )255 ); 
}

Building the Pusher Client As I mentioned before Pusher is a real-time push notification service that operates over WebSockets. Like any WebSocket implementation they use Data Framing for passing messages back and forth but they’ve built their own messaging protocol on top of Data Framing. Each message sent to or received from Pusher is formatted as JSON. This is good for the Arduino because JSON is light weight and also easy to parse. Once the Arduino WebSocket Client was built developing the Arduino Pusher Client was a matter of implementing support for sending/receiving the right messages.

Sending a message is called “Triggering An Event”:

void PusherClient::triggerEvent(String eventName, String eventData) {
    _client.send("{\"event\": \"" + eventName + "\", \"data\": " + eventData + " }");
}

Receiving a message from Pusher:

 
void  PusherClient::dataArrived(WebSocketClient client, String data) {
     String eventNameStart = "event" ; 
     String eventName = parseMessageMember("event" , data); 

     if  (_bindAllDelegate != NULL ) { 
         _bindAllDelegate(data); 
     } 

     EventDelegate delegate = _bindMap.getValueOf(eventName); 
     if  (delegate != NULL ) { 
         delegate(data); 
     } 
}

Controlling our servos of destruction in response to events received from Pusher:

PusherClient client("your-api-key-here");

//Setup delegates for the Pusher Events
client.bind("forward", moveForward);
client.bind("backward", moveBackward);
client.bind("turn_left", turnLeft);
client.bind("turn_right", turnRight);
client.bind("stop", stopMoving);

//Subsribe to our Pusher Channel
client.subscribe("robot_channel");

void moveForward(String data) {
  leftServo.write(0);
  rightServo.write(180);
}

void moveBackward(String data) {
  leftServo.write(180);
  rightServo.write(0);
}

void turnLeft(String data) {
  leftServo.write(0);
  rightServo.write(0);
}

void turnRight(String data) {
  leftServo.write(180);
  rightServo.write(180);
}

void stopMoving(String data) {
  leftServo.write(95);
  rightServo.write(95);
}

All Wired Up

We’ve now solved what is likely the most challenging part of developing your Arduino army.

Pusher messages being received:



Tremble in fear of the Pusher Powered Arduino-Bot:



Follow

Get every new post delivered to your Inbox.