Archive for the 'Business' Category

The Tech That Should Not Be

Thursday, August 12th, 2010

I just read this post about a thing called the Espresso Book Machine that allows a bookstore to print a fully bound book in minutes. The idea is that they could print an out of stock book for you rather than ordering it.

I have mixed emotions about this. Nothing pisses me off more than going to an old fashioned bookstore in search of some instant gratification only to find that they don't have the book I'm looking for. "We can order it for you," they say. Well, I can order it for me too. Only, when I order it for me it comes to my house and not to your stupid little store (and I don't pay sales tax (or shipping fees usually (nested parens FTW))). This print on demand idea seems pretty boner inducing on the surface.

Unfortunately the kinds of technology that make this dream possible also instantly make it unnecessary. In a world where this machine can acquire and store the number of books required to make it useful it has already been replaced by the ability to instantly purchase, download, and read the book on an e-reader without leaving my precious home or touching any dirty, sweaty money. Sure it will probably still be successful but only because of the Luddite fetishists that insist on consuming their information the old fashioned way.

This whole thing reminds me of those stupid redbox DVD dispensaries. In any sane world they would have never existed. I have a relatively high speed Internet connection and an abundance of digital cash. Can't I just instantly stream those movies directly to my viewer of choice for a the same reasonable price? Ah, the devil's in the (bold) details. I have a variety of ways to pseudo instantly watch movies but the only reasonably priced option is Netflix. Unfortunately their instant queue selection needs a little work. Knock down that barrier and the only benefit of redbox is to satisfy weirdos that reached for the technological dream and missed, coming up with a beer in one hand and their disk in the other.

I digress. To sum up, in a perfect world everything would be peer reviewed, indexed, searchable, remixable, and digitally available from the comfort of my own home. I could watch new movies on my own television without someone kicking the back of my seat or mistaking the theater for open mic night at the Laughatorium. "And I wanna be rich. You know, someone important … like an actor."

Share

Job Postmortem #2

Tuesday, August 3rd, 2010

About the Company

Now that I'm done with my current job it's again time to reflect on what I learned and what went wrong. I've changed the names to protect the innocent. I spent about 2 years at "Company V." They make a retirement planning tool. It allows you to do some nice "what if" scenarios to determine whether or not you're on track to do all those things you dream of someday doing after you retire. It's much more sophisticated than the crappy one or two question forms on the website of most financial planning companies.

It's a great idea in my opinion. It has a lot of potential. For the record, I like the people at Company V and I love the product idea. I just think things could be better.

Now for the lessons. I won't bother talking about the many issues I had about software development methodology at Company V. Instead I'll just talk about the product side of things.

Analytics, Stupid

The first is a simple one: collect some fucking analytics. Any discussion about how important a feature is, why people aren't signing up, which type of sign up button is more attractive are all bullshit if you don't have some way of collecting data about your visitors. We collected almost zero data about our visitors. What was our conversion rate? Fuck if I know. How many people abandoned the sign up process once they saw all of the data we required? Fuck if I know. That's the answer to every one of those questions because there's no goddamn data.

I can't talk about analytics as well as these two videos: Startup Metrics for Pirates and Web App Marketing Metrics. They're pretty short and definitely worth a few minutes of your time.

Multiple Masters

Company V has two very different target customers. Home users and financial advisors. If you are serving two very disparate customer types you will wind up with some very serious conflicts. Each customer type is a reason not to do something for the other customer or a great way to more than double your effort in the rare case you actually get to work on a feature.

In the case of Company V it was that they have a feature called "offline mode." This allowed financial advisors to take their laptop to locations where they don't have an Internet connection and sit down with a customer, going over their retirement plan. This was accomplished via a desktop application written in Java.

Getting Java working on someone's computer is an unnecessary hurdle and places without Internet connections only exists in movies. Offline mode is not useful to the home user. I would argue that it's not sufficiently useful to the financial advisor either. However, it was a feature that kept us from doing a lot of cool stuff because we had to have it. Yes, this feature could be accomplished in a better way but the need to keep the feature presented unnecessary overhead and complexity in my opinion.

Too Many Hurdles

There's just too much shit for someone to do before they can use the product. They have to sign up for an account, install the Java plug-in, download the application (or launch the applet) which is over 100 megabytes, and figure out how to use your product.

The more of those steps you can eliminate the better. Each one of those steps throws away half of your potential users. They just go bye-bye. The observant reader will realize that I just pulled that number out of my ass since Company V doesn't collect that kind of data. Prove me wrong.

The Things I'd Do

Short and sweet. Here's a list of things I would have done that I firmly believe would make for a better product for Company V.

Web App

Easy. Ditch the desktop application and make it a web application. Use something like GWT so you can get some good use out of your current Java development staff and have a relatively rich UI for your user. No installation on your computer, no downloading. Nice. You could even use Gears to get some workable solution for offline mode.

Use It Before You Register

If you have that nice web application, let people start making their retirement plan without even signing up. Just start using the product. Of course it would be nice if your product guided people through unfamiliar territory, but that's a given.

Once you've proven your value to them then you can try and get them to create an account if that's really your sort of thing.

Don't Even Register

Even better is to let them sign in with their Facebook, Google, Yahoo!, or OpenID login. Create an imperfect, incomplete profile off of whatever data you've got and bug them later to fill in the blanks. So what if you don't have their email address? Why the hell do you want to email them anyway?

Stop Emailing People

We collected email as part of the registration so we could bother our customers. Why? If you have a product announcement or a change in your training schedule why not just Tweet it? Or post an update on your product's Facebook page? Fine, let them put in their email if they want to be updated that way or need a password reminder (assuming they aren't using a 3rd partly authentication mechanism), but don't demand it.

Be the Tool

With retirement planning there are a lot of financial advisors that blog about how cool they are and how huge their planning penises are. We should have helped them do that. Our web app should have allowed embedding of whole or partial plans into web pages. If you want to show the benefits of a 529 savings plan create a couple of portfolios and embed the relevant portions into your blog. Company V would have a teeny tiny link in there so they get a little free press and the financial planner gets a tool that makes displaying unwieldy information a little easier. It's one of those win-win things I hear so much about.

Be the Tool Part 2

If you go to a financial planner they need to ask you roughly 3500 questions (I made that up) to determine the current state of your financial clusterfuck. Company V helped them do this by creating a PDF that was 10 megabytes and 40 pages long. The advisor would email it to the potential customer, pray it doesn't bounce because it's fucking huge, the customer would print it out, fill out the relevant portions, take it to the financial advisor who then hands it off to some data entry monkey to type into our desktop application. Simple, no?

Yeah, to hell with that. Use the no registration web application to allow the financial advisor to email, host, whatever a guided process to determine the relevant data and collect it directly from the user and dump it straight into the Company V application. The advisor has access to it immediately and the end user doesn't see most of those irrelevant questions. Throw in some tracking codes so the advisor can see the ROI for different ad campaigns. Let the advisor create a special URL that they can include in every email signature or even print right on their business card that takes the potential customer right to where they need to go. You get the idea.

Nice Ideas, But…

In fairness Company V thought some of my ideas were good. They just weren't good enough to actually do. There was no shortage of excuses. We have to keep offline mode, there are more important features to work on, who's going to pay for the development, etc. I still think each of these is potentially a great idea in general and for Company V especially. My next task is to find a place to work that agrees with me.

Share

I Wish They Made This

Monday, August 2nd, 2010

Rhapsody is a music subscription service. For $10 a month you can stream music to your computer from their pretty massive catalog. It seems like a nice idea but I don't actually use it. I'm not sure why not. Anyway. I do love me some Guitar Hero (pretend I said Rock Band if your allegiances lie elsewhere). I would gladly pay a monthly fee to get access to a huge catalog of GH ready songs.

I know that Rock Band has opened up their tool set to allow independent bands to create RB tracks (and simultaneously get raped by an unfair split) but they're still selling the individual songs. I want to drink from the fire hose! Are there technical hurdles? Sure but that's not my problem. See, I'm an idea man, Chuck.

Yes, they can continue to release a new "game" every quarter or so and have a 50/50 chance of getting my $50, but wouldn't it be better to screw me out of $10 or $15 every month like clockwork? I think so.

Share

Recreating Foreign Keys in MySQL

Tuesday, October 20th, 2009

The short version of this story is that I had a test server that was inadvertently configured to use the MyISAM engine of MySQL. This engine doesn't support foreign keys. It will quietly ignore your attempts to add them. I meant to use the InnoDB engine (which does support foreign keys). Of course, who hasn't done that? Am I right?

I fixed the engine problem quickly enough. Next I wanted to take a version of our production / dev / whatever that had the foreign keys and export the necessary "alter table" statements to add them to the fixed version of the test database. I couldn't find anything so I whipped up this SELECT statement to generate a script based on my limited understanding of MySQL. If it helps someone else then great.

SELECT concat('ALTER TABLE `',  table_name, '` ADD CONSTRAINT `', CONSTRAINT_NAME, '` FOREIGN KEY (`', column_name, '`) REFERENCES `', referenced_table_name, '`(`', referenced_column_name, '`);') from information_schema.key_column_usage where referenced_table_name is not null and constraint_schema = 'ourserverdb' order by table_name, column_name

This of course results in a whole bunch of rows of the form:

ALTER TABLE `licensekeys` add constraint `FK_keysIssuerId__appuserId` FOREIGN KEY (`issuer_id`) REFERENCES `app_user`(`id`);
ALTER TABLE `subscription` add constraint `FK_subscription_entity_group_id__entityGroupId` FOREIGN KEY (`entity_group_id`) REFERENCES `entityGroup`(`id`);
ALTER TABLE `user_role` add constraint `FK_userRoleRoleId__roleId` FOREIGN KEY (`role_id`) REFERENCES `role`(`id`);

From there it's just a little copy / paste into MySQL command prompt and I'm done. Incidentally mysqldump with the --no-data flag didn't do quite what I wanted since the foreign key creation is in the middle of a CREATE TABLE statement. There are surely other ways to do this but this is what worked for me.

Share

Shell Scripting Madness

Friday, October 16th, 2009

Every now and then I bask in the beauty of the simple things. I'm not talking about children smiling, flowers, or any of that other crap. Shell scripting, baby! Today I had to move some SQL statements in some XML document into a Java class. So I needed to change this (which I didn't write):

SELECT CASE
    WHEN primaryStartAge < 20  THEN ' 0 to 19'
	WHEN primaryStartAge BETWEEN 20 AND 29 THEN '20 to 29'
	WHEN primaryStartAge BETWEEN 30 AND 39 THEN '30 to 39'
	WHEN primaryStartAge BETWEEN 40 AND 49 THEN '40 to 49'
	WHEN primaryStartAge BETWEEN 50 AND 59 THEN '50 to 59'
	WHEN primaryStartAge BETWEEN 60 AND 69 THEN '60 to 69'
	WHEN primaryStartAge > 70 THEN '70 and up'
	END as "Primary Start Age Range",
	count(1) as "Count" FROM analyticsResults
	WHERE calculatorType like ?
	GROUP BY CASE
	WHEN primaryStartAge < 20  THEN ' 0 to 19'
	WHEN primaryStartAge BETWEEN 20 AND 29 THEN '20 to 29'
	WHEN primaryStartAge BETWEEN 30 AND 39 THEN '30 to 39'
	WHEN primaryStartAge BETWEEN 40 AND 49 THEN '40 to 49'
	WHEN primaryStartAge BETWEEN 50 AND 59 THEN '50 to 59'
	WHEN primaryStartAge BETWEEN 60 AND 69 THEN '60 to 69'
	WHEN primaryStartAge > 70 THEN '70 and up'
END
ORDER BY 1 ASC

to something like this (which I still didn't write):

"SELECT CASE "
            + "    WHEN primaryStartAge < 20  THEN ' 0 to 19' "
            + "    WHEN primaryStartAge BETWEEN 20 AND 29 THEN '20 to 29' "
            + "    WHEN primaryStartAge BETWEEN 30 AND 39 THEN '30 to 39' "
            + "    WHEN primaryStartAge BETWEEN 40 AND 49 THEN '40 to 49' "
            + "    WHEN primaryStartAge BETWEEN 50 AND 59 THEN '50 to 59' "
            + "    WHEN primaryStartAge BETWEEN 60 AND 69 THEN '60 to 69' "
            + "    WHEN primaryStartAge > 70 THEN '70 and up' "
            + "    END as \"Primary Start Age Range\", "
            + "    count(1) as \"Count\" FROM analyticsResults "
            + "    WHERE calculatorType like ? "
            + "    GROUP BY CASE "
            + "    WHEN primaryStartAge < 20  THEN ' 0 to 19' "
            + "    WHEN primaryStartAge BETWEEN 20 AND 29 THEN '20 to 29' "
            + "    WHEN primaryStartAge BETWEEN 30 AND 39 THEN '30 to 39' "
            + "    WHEN primaryStartAge BETWEEN 40 AND 49 THEN '40 to 49' "
            + "    WHEN primaryStartAge BETWEEN 50 AND 59 THEN '50 to 59' "
            + "    WHEN primaryStartAge BETWEEN 60 AND 69 THEN '60 to 69' "
            + "    WHEN primaryStartAge > 70 THEN '70 and up' "
            + "END "
            + "ORDER BY 1 ASC";

I could copy and paste and fix it manually, use a text editor with regex search and replace, or something equally bland. Since it was Friday though i decided to treat myself and do it from a Cygwin shell. This got me close enough and made me giddy with satisfaction:

getclip |sed -e 's/"/\\"/g' -e 's/^/"/g' -e 's/$/ " +/g' |putclip

This grabs the contents of the clipboard, replaces all quotes with escaped quotes, replaces the beginning of each line with a double quote, and replaces the end of each line with a space / double quote / space / plus combo. It then sticks it back into the clipboard. It's not fancy, it could be better, but it was a minor bright point. And thanks to Cygwin it happened in Windows. Sort of.

Share

Ruby One Liner to Sort and Run Length Encode a String

Tuesday, December 30th, 2008

I'm not a Ruby programmer but I thought this was kind of cool. While poking around on Stack Overflow the subject of storing letter frequency for words came up. While there may be a better solution, the idea of alphabetizing the word and storing letter frequencies of 3 or over as the number of occurrences followed by the letter seemed like a passable solution. For instance, "mississippi" is alphabetized to "iiiimppssss" and the multiple occurrences are further reduced to result in "4impp4s". Seems simple enough and in the case being discussed it would result in very little impact on the storage mechanism or the code around it.

The whole thing turns out to be pretty easy as a Ruby one liner:

"mississippi".split( // ).sort.join.gsub(/(.)\1{2,}/) { |s| s.length.to_s + s[0,1] }

That can probably be made a lot better by a Ruby expert. The regular expression finds any character followed by the same character two or more times and then passes the matching string to the following block as a parameter s. It then returns the replacement string which will be the length of the matched string (the character count) followed by one of characters from the matching string. It executes this as a global substitution on the original string. Wha-bam!!! I wonder if there's an odd edge case where this breaks.

Share

Linux in the (Wannabe) Enterprise

Wednesday, December 10th, 2008

The footholds of Linux in small Windows shops are skunkworks projects and discarded hardware. Inevitably the old mail server or the equivalent is considered woefully underpowered and gets replaced. The old hardware sits in a corner of the server room and collects dust. That is until I need a "no money down" VMWare solution.

Of course the downside of this is that you will find yourself installing on frequently inadequate, old hardware that may or may not work–no one ever seems to be sure. When something goes wrong it's Linux's fault. Such was the case when I had to install on an old Dell PowerEdge 600SC. Of course, the install didn't work right off the bat.

The install hung with the last message being "Uniform CD-ROM driver Revision: 3.20". I randomly upgraded the BIOS hoping it's some weird problem with the on-board IDE and see the same problem. Then I noticed that the CD-ROM is attached to the tertiary channel. I can't recall ever having that setup before so I moved the CD-ROM drive from the tertiary to the secondary channel (by accident because the order of the IDE connectors from bottom to top of the motherboard appears to be secondary, primary, tertiary).

After the install it appears that I can't get either DHCP or a static IP to work. Everybody assures me that it's not the IP address they gave me or our DHCP server. I try a different network card with the same effect. Finally, I figure out that it is in fact the network of the IP address they gave me that is to blame (and our DHCP server seems to have crapped out at the same time, and no it isn't running on Linux). But, people stubbornly insist that it's Linux's fault until I waste my time proving otherwise. While I'm gathering evidence they make a point of wandering by my desk and asking why I'm not just using Windows. When society collapses they've got a special place on my post apocalyptic TODO list.

I finally get it all working with a fresh install of VMWare 2.0 (hate the new management web app, by the way) and a migrated VM from my desktop that has a copy of Zenoss Core happily monitoring our new production environment on EC2. Everything in that setup is new from the point of view of this organization. Of course while I'm patting myself on the back over a job well done, someone asks how to get to the desktop UI. Although it probably won't help them much I go ahead and install GNOME, VNC, and Webmin on the box even though I consider it a waste.

Now I get to sit back and eagerly await the opportunity to bask in the criticism the next time anything goes wrong with the box. I'm sure it'll be the fault of that darn Linux.

Share

Clearing Cached Authentication Info in Windows

Tuesday, November 4th, 2008

This comes up every now and then for me and I can never remember how to do it so I'm sticking it here to make it easier for me to find. The problem happens when I'm using Windows Explorer to open or browse a Windows share / Samba share / SMB mount point / etc. Windows Explorer has a tendency to cache the authentication information for the share and doesn't re-present the opportunity to provide authentication information in the event that the cached credentials have become invalid. This happened to me again today when the account I had used in the past had become disabled. You can find and clear the cached authentication(s) by doing the following:

Click Start, Run and type Control keymgr.dll
Remove the entries from the list

OR

Click Start, Run and type Control Userpasswords2
Click Advanced, Manage Passwords

The information is also in the Registry but these worked well enough for me to not go poking around in that rat's nest.

Share

Who Needs Milliseconds Anyway?

Thursday, October 9th, 2008

My latest bug adventure has to do with the fact that at work we're transitioning to MySQL from SQL Server, a move I fully support.

First some detail on the way our application works. When our applet client syncs with the server it copies the records locally and stores them in a local database which is not MySQL. When you modify a record in the client it gets persisted first to the local database. Anywhere from immediately to the nebulous "later", the client will sync again with the server. When this happens a summary list of the data you can see is sent to the client. This data includes when the record was last updated on the server. This time is compared with your local records and a sync occurs. Local records with a later modified date get sent to the server and remote records with a later modified date get pulled to the client.

I'm not wild about this setup, mainly because I don't trust the time on the client machine since it's well outside of my control. We're also using the client generated time on the server as the last modified time. I think at the very least we should use the server time (interestingly, this wouldn't solve this problem in this case). Slightly more ideally we should use an incrementing version field that will have the benefit of better detecting update conflicts. That aside, we found that when we moved our test systems to MySQL the client was sending way too many records up to the server. Everything in the client-side database appeared to be newer.

It turns out that MySQL truncates timestamps and dates to second granularity. Anything finer than a second (millisecond, microsecond, whatever) is simply dropped. In the client, we're using a database that supports milliseconds. What this means is that if you modify a record at 11:52:27.421 it gets stored with that timestamp locally. When it gets stored in MySQL it is marked as last modified at 11:52:27. Therefore, your local record is almost always newer by literally a fraction of a second. Cool, huh?

Luckily, there's already a bug report. Given that it was reported over 3 years ago, I'm confident it is very nearly fixed. I am still a bit amazed that a database so popular in the enterprise fails at this very basic level of functionality.

As always, there are workarounds to the problem ranging anywhere from storing sub-second values in a separate field and/or creating a user defined type.

Share

The Cluelessness of Sales People

Wednesday, September 10th, 2008

I recently got the task of finding a hosted monitoring solution for our production web site. There are quite a few options out there, so I decided to find a source listing a few of the options out there and sign up for some trial accounts. Most all of these sites are horny for your contact information. I'm fine with being contacted by email, but I don't particularly want to fill in the mandatory phone number field. I don't need to spend my day jawing with some glad-handing sales monkey. I write code for a living. So, I usually just put a 555 number in there (lazy developers never validate that shit). That way they can only get a hold of me if all of this is actually a movie, cleverly disguised to look like reality.

Not just one but two of the sales morons at these companies decided that my 555 number must be a cry for help. I want to talk to them and have them give me the hard sell, I was just confused about my real phone number. Not a problem. They used directory assistance and the rest of my real contact information to look up my company, find out our main number, and call several times. You would think that these idiots would realize that they were only going to piss me off by doing that.

The ultimate irony of it is that the site I was going to recommend was one of the ones that pulled this stunt. Unfortunately for them I'm a petty, angry developer. I'll be doing everything within my power to make sure they are the last solution we seriously consider. Now that's some sales job!

Share