Saturday, November 26, 2011

Q: How many people can you fit into an Athenian taxi?

A: As many as possible

I am forever amazed by the number of cars in the world that sit around doing absolutely nothing. Take my car, for instance. It sits in my carport all day Saturday and Sunday doing absolutely nothing. Monday to Friday it sits deep in the bowels of an office complex, three levels down, away from the elements, for 8 hours a day, doing absolutely nothing. It is just sitting there existing through another day in eternity, because eternity is how long the machine will last if left unfettered in its absolutely doing nothingness.

So let's do some math.

Let's say the typical consumer, non-commercial, car owner uses his or her vehicle for 2 hours a day. This translates in to a daily capacity usage of 8%. The unused capacity is a whopping 92%. Or to put it another way, 1 person is using a resource that has the capacity to service 11 other people. It's almost like owning a 2400 sq. ft. house, but only living in one of the bathrooms.

Sort of a waste, I'd say. Yeah, you could make the argument that by not using the excess capacity, you're not having to pay money to support the resource, heating the entire house or keeping the gas tank full for 24 hours of automotive operation. But, we'll let this go for now.

The fact is that, for the most part, having a lot of cars sitting around doing absolutely nothing might not be good in the Big Picture. But, we're Americans. We seem to have a historical sense of having unlimited resource. In Europe this is not the case. They used up all the forests a long time ago. Efficiency counts: don't heat water in big ass tanks that go cold; heat the water intensively as it comes through the pipe to the shower head, which is what I experienced in an old house at the foot of the Pyrenees. Or pack as many riders into a taxi as you can, as I experienced in Athens.

Taxi drivers in Athens can pick up passengers in transit. It's the way they do business, nothing shady about it.

I remember sitting in the back of a cab, on my way to the airport and at each stop light the driver negotiated with would-be fares for the available seating next to me. If the driver could make the deal, the street corner traveler jumped in. The driver was continually revising his route given the destinations in play, mindful of keeping his gasoline consumption down. It's sort of brilliant in a way.

So back to the 8%. Imagine what it would be like if any given non-commercial automobile was operating at say, 70% capacity. First off, parking in LA would be a lot easier because most of the cars would in use and not sitting on the side of the street doing absolutely nothing.

So, how would it work? Well, instead of owning your own car, you'd belong to a "Car Association". Membership would get you access to the car you need, when you need it. For example, when it's time to leave for work in the morning, I'd go to my smartphone, sign into my Car Association App, and get the photo and license number of the car that I'd use to get to work. The car would be sitting in the parking lot outside the local Ralphs down the street. When I get to the car, I'd use my smartphone again to photograph a bar code on the car's windshield to verify that I was indeed at the car and then punch in my password. The App would have the smarts to unlock the car via a service such as OnStar. The key would be under the driver's seat.

I'd drive the car to work, to a Ralph's nearby or to a parking lot underneath my office complex. I'd leave the key under seat. Once I exit the car, I'd contact the Car Association to have the car locked and make it available to anther driver as soon as possible.

I'd pay a monthly fee to belong the the Car Association. The fee would vary according to the class of car I want, figure Standard Plan (Corolla, no older than 5 years) to Triple Platinum (BMW 700 series, no older than 2 years). Maybe one month I'd want to go Standard. If my in-laws are coming to town around the Holidays and I want to impress them, I'd go Triple Platinum. I'd have status on demand!

Gas and upkeep? If I take an Association car to the car wash or gas it up, I'd receive a credit against my monthly fee. Or the Association would pay contractors to maintain the properties, just as my Home Owners Association pays a contractor the keep the building grounds well groomed.

Of course, for this to work, we'd need to have a lot of cars and a lot of people in the Car Association. So it will probably be an urban thing. But, what the hell? There's already a lot of cars out there. They just happen to be sitting around doing absolutely nothing. From my point of view it's just a matter of the ability to think and act differently, a small nudge on the collective automotive consciousness.

Here's some good news: It's happening as I write. There are a number of Rent-Your-Car-Out services on the rise. Think of the these service as first generation Car Associations. You have Spride and Getaround which allows you to rent the cars of others starting at $5 an hour. And the technology is already in place. OnStar has just cut a deal with Relay Rides, to unlock cars for renters.

If Car Associations take hold, maybe via Facebook or Google+, it's only a matter of time before Hertz, Enterprise and National will want a piece of the pie providing the vehicles. Having a car will be about... well... huh.... using a car.

To my understanding the dining policy in the US Army's Boot Camp is this: You can have all the food you want. Just make sure you eat what you take.

So, all we have to do is map the thinking onto automobiles: You can have all the car you want. Just make sure you use what you take.




Saturday, November 19, 2011

Q: Is it possible to own a car in good conscience?

A: Might be, might be

I find it funny in a way that for the last 5 years I have made my living coding around the automobile industry. I don't particularly like driving and each time I get behind the wheel I think of myself as an ecological liability. Yet, there I go driving around solo like most of the other people in LA, sucking up gas and throwing out carbon monoxide in a mechanical conglomeration of metal, glass, plastic and hand-crafted leather that will last longer than my time on Earth.

Owning a car causes me no end of moral dilemma. Yeah, I try to reduce my ecological footprint. I drive about 8 miles a day. I own a car manufactured in 2003. I rarely drive on the weekend, walking whenever I can, which might be de rigueur on the island of Manhattan, but is quite the oddity here in Tinsel Town. Yet, at the end of the day, I own and maintain close to two tons of environmental terror.

But, last week I learned something that offered me a morsel of hope that those of us driving on the highways of the planet can actually do so without bringing Mother Nature to her knees.

There is a little doubt the the electric car is here to stay. Just about all the major manufacturers are pumping out battery powered vehicles. And, new manufacturers such as Tesla and Coda are completely dedicated to the electric car space. So for me, it is not very hard to image a future 10 years from now when there are 50 million electric vehicles traveling the highways and byways of the nation. And, each of these puppies is going to require charging everyday. That's a lot of demand to drop on the power generation capabilities of America. That's the bad news.

The good news is that our national power grid has gotten pretty good at figuring out how to provide large amounts of electricity on demand to consumers everywhere, without putting the entire country into a state of anticipatory anxiety due to episodic blackouts.

Right now many houses have two power meters. One for the usual household stuff and the other for the central air conditioner. The reason for this separation is that having the air conditioner on a separate meter allows the Power Company to effectively monitor and control the device. In other words, the Power Company knows your air conditioner, it knows how much electricity it is using, has used and is likely to use. Also, the Power Company has the ability to turn the air conditioner on and off. So, when it's noontime on a hot July day in Topeka, Kansas and every air conditioner in the area wants to go on, machine intelligence at the Power Company can assess the situation and say, "well, we have so much electricity to go around and all these air conditioners want a part of it. Let's see if we can turn some of the air conditioners off for 10 minutes and allow the ones left on to get the cooling going. Then, we'll turn off those that are running and turn on the dormant ones. The humans will never notice a thing."

Great technology. So what does this have to do with cars?

This is what it has to do with cars: Most modern cars are digitally identifiable. For example, if you have a car with OnStar installed, the company will send you an email each month that reports the state of your car--do you need an oil change? Do you need to inflate your tires, etc...? OnStar technology talks to your car's on-board computing system and sends the email.

When it comes to electric cars, it will be possible to pass certain information about you and the car onto the Power Company: What is your customer profile? Where is the car being charge? What type of car you have? What is your current battery state? When do you need the vehicle fully charged?

Based on this information, the Power Company can figure out demand in terms of the Big Picture: "We know we have to charge 50 million cars in the next 8 hours. Given our super duper computing capabilities, we can figure out the most efficient way to charge all these cars to the specification of all these customers."

It's the typical win-win: the consumer gets another day of driving bliss; Mother Nature remains chaste.

I gotta tell ya, for the longest time I felt as if we are driving our way to vehicular Armageddon, without a care in the world about the effect that our 300 horse-power, fuel-injected beasts have on others and our planet. But, when I learn about something like the ability to power all the cars in the world using smart supply, I sleep better at night. Maybe this technology thing works, just maybe.

Saturday, November 12, 2011

Q: How much data is Big Data?

A: More than a single human being can type in a lifetime

(PS: This post is like a box of Cracker Jacks. There's a prize at the end.)

Recently I've developed more than a passing interest in working with Big Data. I made the obligatory pilgrimage to Hadoopsville: got a little bit of HDFS and MapReduce under my belt, taught a few intro classes. I even did an interview with Doug Cutting.

Then, about a month ago a colleague at the Day Job suggested that I take a look at MongoDB as a data store for a project I was imagining. So, I did.

As I began to piddle around the innards and start to work with the on-demand, distributed features of the product, I found myself in need of a lot of structured data, to do some advanced piddling, about 45 gigs worth.

(I wanted to make it so that I was performing operations that exceeded the memory capacity of any one machine, or any two machines for that matter.)

As I said before, I'm interested in Big Data. So allow me a moment to share with you just how big, big is. The sort of structured data I figured to use is the typical log file entry, about 100 characters long, which looks like this:

20204,2011-11-11 19:19:07.123,Leslee,Falleti,777-64-9738,625 Orange Terr.,Suite 87,MT,59430,16413,A

The structure of the line above is:

unique_id,datetime,firstname,lastname,ssn,address_1,address_2,state,zip,a_random_number,a_random_character

I figure a structured log entry like the above will provide a lot of flexibility to do some MongoDB indexing, run some Map-Reduce analysis and do some benchmarking comparison between Hadoop and MongoDB.

So let's take a look at what 45 gigs of log data looks like. Say I want to make a ~1 MB text file full of unique log entries. Such a file will contain about ~10,000 lines of text. Again, this is for ~1 MB file.

45 gigs translates into forty-five thousand 1 MB files.

Now, this is not the type of data that you keep around on a hard drive next to the pictures of your dog and grandkids. In fact, getting your hands on this sort of data is kinda hard.

So, I figured I'd make some.

I could type out 450,000,000 lines of structured data at a rate of a line every thirty seconds, which translates to 120 lines a hour, Thus, I can get out 2400 lines in a day, provided I forsake sleep and go for twenty hours without mistake. But, being the world's worst typist, we're more likely looking at a lot less than the optimal. Anyway, typing as required, I could do ~12,000 lines during a work week, which means that I could get my 45 gigs of data in say, 40 thousand days, which translates into ~123 years.

Not an option.

Or, I could create a website and get a grant from the Federal Government as a jobs initiative to get everybody in the US to go to a web site I've made and enter some data according to the structure I need. Actually, upon reflection I would need every man, woman and child to enter data over 150 times.

Again, not an option. Government cutbacks are rampant and few innocent bystanders have the patience to do a structured task 150 times.

So, I decided to automate.

I made a cute little project in Java under Maven. The program uses an address and name randomizer I made a few years ago. You can download a zip file containing the project--data generator and randomizer all-- here. (There is also a Post Office module included that is more relevant to the article that describes the randomizer.)

One of the modules, DataGen, kicks off files of unique log entries. You can set it to kick off a variable amount a files. You can kick off 10 files of 100 bytes of unique log entries. You can set the DataGen to kick off 1000 files of 1000 bytes of unique entries.

In terms of rate, DataGen presently kicks off a ~1 MB file of unique log entries of random names, addresses and US zip codes taken from some predefined lists loaded into memory, in about 2 minutes.

I configured DataGen to kick off 45,000, ~1 MB files of log entries. I started running the generation last night on my Ubuntu laptop. So in about 2 months I'll have the 45 gigs I need.

Sorta makes possible the notion that if you chained a chimp to a typewriter for eternity, eventually the beast would produce Hamlet.