Monday, March 23, 2009

$500 shorts - It *is* the apocalypse



In case anyone was wondering about exactly what they wanted to do with the $500 they had lying around, its here, right here. Wander over to the-glade and get yerself one of these. Its got TecSys! Its got Pockets! Its got WWII technology! W00t!!!

Thursday, March 12, 2009

Test Oriented Programming

I know, somebody has thought of it before, but I don't particularly care. *I* thought of it today, and thats whats important.

Basics are really simple. Everybody Works In Pairs.

Yeah, yeah. XP did that. But XP slaps two people with *one* keyboard in front of *one* computer doing *one* thing.

Me, I do it differently. One person writes whatever the heck he/she is writing, and the other writes the test harnesses. There Must Always Be Two.

See, except for the real deep architectural stuff, virtually everything I write - modules, apis, accessors, database futzers, whatever - tends to consist of small chunklets. I almost *always* proceed to then unit-tests these like mad (maybe. ok, probably not), then writes some more, then realize that I only tested the stuff that I thought of, and not the stuff that *you* thought of but which turns out to be terribly important, and so on and so forth.
In fact, when I really get down to it, around 50% of my writing literally consists of me writing little harnesses to validate what I'm *going* to write, then writing my code against said harnesses. Which is nice, but it
  1. causes target fixation. I know what I'm testing so of course (well, usually) its going to pass.
  2. automagically means that i am spending 50% of my time not writing the *real* stuff.
OK. Lets pretend that the other stuff *is* the real stuff. Please. Just work with me here.
Lets also pretend that it is *my* baby, and I'm the only one that can do this in the style, manner, and gravitas that it deserves.
I just blew half my time doing *other* stuff!
Factor in general inefficiencies in the process, and you may as well use two people, because, face it, someone else writing Test Harnesses is pretty much guaranteed to expose the weakness of your style, manner, and gravitas....

TOP - Test Oriented Programming.
You heard it here first (unless you heard about it somewhere else first)

Note: How is this not Test Driven Development? Well, it is, kinda, 'cept that the key point here is that it is not you writing the tests.

Update: I've pretty much junked any/all variations on Test Driven Development.  It turns out that, like anything else, you end up having people learn how to get really, really good at writing tests, but the actual work still never gets done.
Sigh.
My latest approach is to just get heavily functional about everthing (erlang! w00t!), and minimize the amount of testing that is even necessary - if you decompose the f**k out of everything, the tests become, kinda, sorta, redundant...

Wednesday, March 11, 2009

Mahesh's Fourth Law - Adjectives

Adjectives have no place in Data Analysis

The papers are always full of it. And whats worse, i am not referring to just the news-papers. Scientific Journals can be just as bad (sometimes).

"We are looking for a simple correlation between Poverty and Crime" - a nice statement to make, but the Simplicity is not up to you. You may (or may not!) be able to get a correlation between Poverty and Crime, but its Simplicity is going to be either present (if only in the eye of the beholder), or non-existent. All *you* can do is find the correlation - again, *if* it exists.

Statements like these - avec adjectives, tend to drive me up a wall. They are everywhere! Mind you, I'm fine with adjectives used appropriately - heck, I have used 'em all over the place here - and any conversation about food or wine would be a non-starter without 'em, but in Data Analysis?

So please, no more Simple Correlations!!!

By the way, if you think *I'm* annoyed by these adjectives, you should see their effect on my Father

Monday, March 9, 2009

Health Care - Back to the Basics

Care, Insurance, Doctor-Patient relationships, Malpractice, etc., etc. - in this entire discussion, there is one underlying issue that tends to be glossed over (by choice, or by happenstance : the difference pretty much defines your 'conspiracy theorist' level).

Who is this supposed to benefit?

Deep pause, intake of breath, and sudden realization that the answer isn't that easy.

Some answers are really easy. Take National Security for instance. The direct and immediate beneficiaries are the Citizens. Yes, defense contractors, military-industrial complex, etc, but in the end, it is the Citizens. Not quite convinced? Follow the money - the difference between mercenaries and an army is that one is for hire, and one isn't. As Shlock Mercenary tends to point out every now and then, just because you hired a bunch of mercenaries doesn't mean that they aren't - at the same time - also working for someone else! Follow the money indeed. Do you really want to take the chance that your prized National Defense Apparatus is suborned by the simple task that someone else just Paid More?

But, Health Care? Who should it be for? The Citizens? The Companies? In the end, that is the question that needs to be answered. Once that is defined, the rest can be argued based on whatever political/economic/ideological viewpoints you may tend to have.

If the answer is Companies, then lets all drop the Moral, Ethical, and Social statements. Stop saying 'Everybody should have Health Care', because, that is *not* what we are trying to get at. Instead, stick with what we have, and stop whining about The Cost Of Health Care, because, frankly, You Are Not Paying Enough (Remember, its got nothing to do with you. You aren't paying Enough, because its for the greater good and glory of the Companies)

If the answer is Citizens, then the equations change, but only slightly. Lets frame the question as follows - What is the best way to maximize the Health of each Citizen? There are any number of answers here, and a lot of them would make Free-Marketers really really happy. Not to mention, swell the coffers of a lot of companies in the process. Maybe not the coffers of the Companies that currently offer Health Services, but that is not what we are aiming for, right?

Take Tontines for example. To dumb it down, this works as follows
  1. You pay your insurance
  2. If you fall ill, you are covered by the insurance
  3. If you don't fall ill, you get cash-money back.
Of course, the money back in (3) isn't the money you paid in (1), but there'll be a nice market-based spread there, and you can pick/choose. In fact, there are all sorts of fun market-based thingies buried in this.
  1. Insurance companies will now be incented to bring young people into the system. After all, young people don't fall ill,
  2. The spread between what young people pay, and the cash-money-back can be pump up the Insurance Company's profits. Some companies will stick to Business As Usual, and just play around with this spread, varying it to maximize the number of young-uns that they attract.
  3. Some Insurance companies will use this spread to reduce the costs of the Not-So-Young insurance payers. This will bring more of them into the system, thus pumping up profits just as well.
  4. The only sure thing here is that the guaranteed money that an insurance company *has* to pay out is when you fall ill. Sooo, the insurance company now doesnt want you to fall ill. It is in their best interest to make sure that you get preventative care . Heck, they might incent you to go to the doctor! Get checkups! Get vaccinated!
Brilliant, right? And nary a subversive fifth-column socialist thought there anywhere. Lots of money to be made by a lot of companies, and Health-Care for all!

Wednesday, March 4, 2009

Stimulus 2.0

Ok, I just figured out the perfect way to implement the stimulus, whilst simultaneously dealing with the Mortgage crisis and resolving the credit crisis.
Whats that you say?  This trifecta seems too good to be true?
I Say Thee Nay!
Heres the scoop.
The gummint buys out - i.e., pays for - the mortgages of the 2,000,000 or so people out there who are currently at risk of defaulting on their mortgages.

Before you start throwing stuff at the screen, here me out.
Thats 2 Million people.
At approximately $300,000 per head (on average) on a "What I can't pay on my mortgage" basis, that comes to $600 Billion.

What we do is just pay it off.  Completely.  At one shot.  These people no longer owe  a mortgage.

How does this help?  Bear with me on this.  Each of these 2  Million people now own - free and clear - their house.  That means they are free to go ahead and get home-equity loans on their houses to buy a new LCD TV, a Hummer H2, a new Astro-Turf backyard, or some other remarkably stupid consumerist idea, thus pumping money into the economy, and thus solving the current financial crisis.  And the banks will - quite readily - loosen their purse-strings since this is real cash-money sitting there waiting to be exploited
Thats a *lot* of moolah.  
Yes, that just postpones the day of reckoning. But, we are Americans, which means, we are nothing if not dumb.  We don't worry about tomorrow, if we can make it through today with our Krups coffee mker.
Brilliant, no?  And I thought of it first!


I miss fruits

No, this isn't one of those I miss all the wacky fruits that one gets in Bangalore/Kanpur/All-Over-India posts.  Though, mind you, I do miss them - Jackfruit, Custard-Apples, Ramphal, Sitaphal, Sapote, Jamun, 72-Types-Of-Mangoes-And-Counting - the list goes on.  Half of these can't even be found on these-here shores.

I actually just miss fruits that taste like fruits.  Not like the output of a Universal Cellulosic Composite Fruit Fabricator.  Its particularly bad when you realize that the average Pear tastes exactly like the average Nectarine, which tastes almost like the average Apple (not a red one.  Those are mealy!) which tastes almost like a Plum (just slightly less astringent), and so on, and so forth.  
Breeding fruits for shipping as compared to taste has gotten out of hand.  Waaay out of hand.  Heck, breeding them for looks has gotten so out of hand that I've pretty much decided that anything that looks tasty is almost certainly going to actually be the result of the UCCFF.

Hmmm.  Maybe there is a rule here?  
Ugly Fruits Taste Good?
Then again, there *is* something called the Ugly Fruit, and it *does* taste good, so who knows....

Tuesday, March 3, 2009

HINs - Towards Sanity in the Knockoff World

Why should Prada have a government-backed monopoly (their Trademark/C/whatever) on their handbags? Instead of going after Chinese factories making knock-offs (cheap or otherwise), why not go the Microsoft route? Prada could create 'Certificates of Authenticity', with serial numbers, etc. If you buy a Prada bag, you go to their web-site, and register the unique ID associated with the bag. Heck, Prada could even watermark their bags with HINs (Handbag Identification Numbers).

It certainly doesnt prevent people from creating imitation bags, but hey, even if the bag gets made in the same factory, and is virtually identical, it wont have the HIN, which means it isn't The Real Thing.

Which does bring up the associated point - Why *do* people buy knockoffs? Maybe
  1. It makes people feel good about themselves. Great. In this case, they won't buy the knockoff anyhow
  2. It allows people to show off to others about what they have (and the others dont). In which case, if they need to buy knockoffs to show off, what does this actually say about the intrinsic worth of a Prada bag?

I assume there are other reasons, but HIN or not, I'm not quite sure I can even begin to understand why I would need to walk around with a Fake Prada. Mind you, I can't begin to see that anyhow.
Not even if it was a Man-Bag.
Wait, especially if it wasn't a Man-Bag...

Mahesh's Second Law - Beer

You can always get a Good Beer.

Really.

There is probably some form of historical context associated with this, probably referring to Mankind's Transformation From Hunter-Gather To Agrarian, or some other equally relevant, esoteric, and verbose take on Society. The bottom line is, it doesnt matter where you are in the world, if you need a beer, you can get one.
And, it will be Good.

There Can Be Only One

Ok, maybe more than one specific wine, but frankly, if you are floating around Indian and feel the urge to consume a decent glass of wine, your choices are
  1. Get a bottle of Sula Something, Grover SomethingElse, or Kinvha SomethingAltogetherDifferent, followed by a little bit of hoping for the best, and a lot of "Meh, it doesn't really suck"
  2. Get a bottle of Grover Viognier, Sula Chenin/Sauvignon Blanc, or Big Banyan Whatever, and actually not be disappointed.
  3. Buy a bottle of massively overpriced "imported" wine - typically australian - and think to yourself "I am paying $20 for this $7 bottle of wine, and heck, if I was in the U.S., I would not be paying $7 either"
On second thoughts, skip the whole exercise, and get a bottle of chilled Kingfisher Beer instead.  Much easier on the palate, and actually quite good...