Fun With Programming Languages

Tonight, a Facebook thread got a little out of control after I posted a status update that I was “mentally bankrupt.” It was a long day working on client work – a project that is just about done but past due.

After some commentary by Facebook friends, we got to writing little scripts that would take a random selection from a group of adjectives and adverbs and put similar phrases together randomly.

What came of this exercise was a fun little jaunt into a variety of programming languages.

PHP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$adverbs = array(
    'mentally',
    'morally',
    'emotionally',
    'socially',
    'psychologically'
);

$adjectives = array(
    'devoid',
    'bankrupt',
    'empty',
    'hollow',
    'vacant',
    'sleeping with fishes',
    'taking a dirt nap',
    'shallow'
);

echo $adverbs[array_rand( $adverbs )] . ' '
    . $adjectives[array_rand( $adjectives )];
?>

Ruby

1
2
3
4
5
6
7
8
9
10
11
adj = [ "mentally", "morally",
    "emotionally", "socially",
    "psychologically" ]

adv = [ "devoid","bankrupt",
    "empty", "hollow","vacant",
    "sleeping with fishes",
    "taking a dirt nap","shallow" ]

print adj[rand(adj.length)] + " "
    + adv[rand(adv.length)] + "n"

Python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import random

def popchoice(seq):
    return seq.pop(random.randrange(len(seq)))

adj = [ 'mentally', 'morally',
    'emotionally', 'socially',
    'psychologically' ]

adv = [ 'devoid','bankrupt','empty',
    'hollow','vacant','sleeping with fishes',
    'taking a dirt nap','shallow' ]

print popchoice(adj) + " "
    + popchoice(adv)

SQL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CREATE TEMPORARY TABLE adjectives (
    adjective VARCHAR (30) NOT NULL
    );

CREATE TEMPORARY TABLE adverbs (
    adverb VARCHAR (30) NOT NULL
    );
   
INSERT INTO adjectives (adjective)
    VALUES
    ('mentally'),
    ('morally'),
    ('emotionally'),
    ('socially'),
    ('psychologically');
   
INSERT INTO adverbs (adverb)
    VALUES
    ('devoid'),
    ('bankrupt'),
    ('empty'),
    ('hollow'),
    ('vacant'),
    ('sleeping with fishes'),
    ('taking a dirt nap'),
    ('shallow');
   
SELECT CONCAT_WS(
    ' ',
        ( SELECT adjective FROM adjectives ORDER BY 1 LIMIT 1 ),
        ( SELECT adverb FROM adverbs ORDER BY 1 LIMIT 1 ) )
    AS RandomStuff;

The Rules for Entrepreneurs

Venture Files founder and former curator, Steven Fisher, wrote a series last year that remains one of the best of its time. Even though he has moved on and is working with Network Solutions, I think it’s as important now (if not more so) than it was last year at this time. This is a consolidated (and updated) version of that series.

Pay Yourself First

Over the last 9 years and two startups I have learned many things and screwed up royally in some cases. This series is about providing you best practices of lessons learned and avoiding the mistakes I have already made.

In the past, I have had good years and bad years. When you have employees, they expect to be paid and when you mess with payroll (and payroll taxes, but that is a post for another time) you create such a negative culture that nothing will get done.

With that said, when you are starting your business regardless if it is a service or product company, you will have startup costs and probably forgo paying yourself for 6-12 months to keep growing the business. That is fine and to be expected. What you should not do (and what I did) is keep adding staff and sacrifice your own salary in the name of growth. If you keep going like that and have a bad quarter you will have nothing saved for a rainy day and if the business fails you will probably be in immense debt and got nothing out of the business.

Granted, the balance between growth and cash flow is a tenuous one but it is one thing you should never defer to someone else in beginning. Plus, there is a difference between creating a lifestyle business and an enterprise. A lifestyle business is really making enough money for yourself and having some contractors or 1-2 people that gives you a good salary but is more about freedom. An enterprise is a business that scales and gets big over time but you will be working intense amounts in the beginning but will need to hire those smarter than you with the intention that you are looking for an exit and will have time for freedom when you cash out.

So when you are growing the business you should work the first 6-12 months paying off the initial capital expenses and getting about 6 months of cashflow for yourself before you hire anyone else. Once you have that done, start paying yourself something, even if it is small and will ramp up over six months, pay yourself first. This will get you in the habit of being committed to making the business pay for itself and you so you are not worrying about living month to month and let you find some resources to help you deliver while you continue to sell and grow the business.

Once you are looking at hiring someone use these two rules as a starting basis:

– Have six months of payroll for that person in the bank on top of your salary

– Have 90 days of projects or sales committed for that person to deliver so they not only have something to do but are earning their keep.

You may have to be conservative at first in your growth but in the end you will scale better and create a business that is focused on delivery and customer service without putting you and your employees on a cash flow roller coaster.

Own Your Travel Itinerary with TripIt

In October 2006, a new service appeared on the web that promised to make it easy to manage all the fine travel details of a trip. As a frequent traveler, I signed up for TripIt in November of 2006, shortly after they launched, and have never looked back.

The concept is really simple. A traveler is headed to Austin, Texas (as I will be for SXSW Interactive in a few weeks). He books his flight on Southwest airlines and gets an email confirmation with ticket reservation, itinerary, etc. Sight unseen, he forwards this email to plans@tripit.com and moves on to reserving his rental car and hotel.

On the backend, TripIt recieves the forwarded confirmation email and knows exactly how to read it into their master database. The email can even be forwarded from an unregistered email address which you can claim later.

The beautiful next step is the organizing of all this information. TripIt sorts your travel plans out into “Trips” and will give you everything in chronological order. This traveler going to SXSW, for instance, has a chronological listing that shows his departing flight, his rental car pickup, his hotel information and his return flight. As a bonus, Tripit gives him a Google Map of the area you’re staying on.

picture-6

Now, I don’t like just plugging services for the sake of plugging services. You can go to Mashable if you want to be filled with nonsense. However, TripIt actually is a useful web product, but more than that, it’s a useful mobile product. If you have a smartphone (Blackberry, Treo, iPhone, etc) then TripIt becomes infinitely more useful.

For mobile users, you can access all of your itineraries by browsing to m.tripit.com, something that has become the defacto reference point for all of my travelling and checking in. It literally, if you’re a smartphone user, eliminates the need for a stack of trifolded paper printouts from 6 different reservations.

If you really want to own your travel itinerary and you own an iPhone, consider buying the “TravelTracker – with Tripit” iPhone app. While everything about TripIt is completely free, this app costs $19.99.