Sunday, May 04, 2008

Martin Fowler's DSL Material

I'm not a big link blog guy, but Martin Fowler's note/outline/draft material for an upcoming book on Domain-Specific Languages is worth checking out at your earliest convenience. I've been impressed.

Lest you be tempted to pick sides for or against DSLs (really not the point of Mssr. Fowler's book), or to postpone thinking hard about them, consider: DSLs are already merging with with 'traditional' languages and APIs ... it is likely that this trend will continue, with the result that DSLs will be a fact of life in the 'standard model' approach for many types of applications.

So it's probably useful to get a grounding in what they can really do, how they can best do it... and how they can best not interfere when they shouldn't.

Sunday, April 27, 2008

Don't Feel Bad, It's Also Amateur Hour at Analog Devices

Analog Devices, whose D/A, A/D, and DSP circuitry power on-board sound in everything from ThinkPads to ASUS' main line of motherboards, makes a wicked bad driver suite.

Last summer, I was troubleshooting a situation where laptops were exhibiting lots of really short freezes at a close-to-the-metal level ... keystroke input being delayed, or mouse cursors getting jittery. Turned out to be DPC storms resulting from the Analog Devices SoundMAX driver and usermode controls.

Today I was struggling with the latest flavor of this driver set, which attempts to detect what you've plugged in to which port, and then auto-configure. Which it does wrong, forcing you to come up with tricks to get basic things like a headset and microphone working. Guys, we've had the "green" and "pink" sockets on sound cards for like 15 years now, give me some credit here.

But that's not what got me really annoyed. No, these guys have gotten themselves really confused about how multi-user logon and fast user switching works on XP. They've only had seven years to get that right. They pop up some of their controls and wizards in the wrong user session ... when I tried to close them and switch back to the account I needed to be on, their driver blue-screened my box.

As a developer, I install all kinds of stuff on my machines and I often torture them in unseemly ways. But, since 2001 when I started using Windows XP, this is the first time I've had a blue screen during a regular old user session, after a successful boot.

This is a WHQL certified driver too. For a long time there were problems where developers didn't get their drivers WHQL certified, which led to users clicking the infamous "continue anyway" button, and companies ignoring WHQL; I'd hate to suppose Microsoft solved that problem by letting junk like this pass the test.

Saturday, April 26, 2008

DVD Flick Installer Needs to Rewrite a System Library Why?

I feel bad ripping one in the crew that builds DVD Flick, a well regarded open source tool. From what I can tell, this is a fully-open, Sourceforge-hosted, quick-authoring tool similar to the excellent ConvertXToDVD.

During its installation, though, it attempts to overwrite the richtx32.ocx file in the windows/system32 directory. Richtx32.ocx is a Microsoft-authored GUI widget component (an AcitveX library) present in all or most Windows systems.

Trying to overwrite this is bad on so many levels. Who knows which version of this lib is being supplied by DVD Flick? The installer definitely doesn't compare versions and make an intelligent choice, or it would have chosen not to even try on my systems, where everything is up to date. So it's an old version, maybe one with bugs or security vulnerabilities, that could compromise my system because any process might load this code up.

Not to mention it appears to the user that the app needs to alter their system in order to continue. Since they trust this app (it's been written up in blogs like LifeHacker), they start thinking "oh, sometimes free apps I download off the Internet need to overwrite my system libraries, no big deal" ... all the UAC in the world won't be able to overcome that mentality (although theoretically Vista has other protections to remedy this specific problem).

I tried to think of any justification for this behavior, but I couldn't. True, there are aspects of the ActiveX/Registry/DLL Hell problem that can make something like this a little tricky, but there are workarounds as well.

Starting with the easiest fix: include a legit Microsoft merge module containing the latest DLL version, and first, in the installer script, check the installed lib version/signature to see if it's necessary to install a new one at all.

The other possibility, that DVD Flick isn't trying to update this library, but needs to install its own version on top of the existing one, with some extended functionality, would be even more ridiculous... I entertained this idea for a moment, but it appears not to be the case.

Wednesday, April 23, 2008

Augmented Reality is Here, You Just Can't See It

Augmented reality is here now, and is going to get bigger fast. In fact, it's going to be a killer app for the semantic web.

Where did I come up with that?

Well, as far as not seeing it ... that's because it doesn't look like the picture you have in your head. You're thinking of stuff floating in midair like in Minority Report or at least a heads-up display with goggles or a sceen that overlays data onto video.

Those may be nice implementations. But the core utility of augmented reality is getting information on stuff you're near (where near can be physical or by mental association) and having it delivered to you in an actionable "heads-up way" even if it's not on a HUD.

In the information sense, AR is already popular. Joe calls Fred on his cell phone: "I'm trying to find a hardware store down here near 20th, can you hop on Google maps and find it?" Fred looks it up, maybe hits Street Views, done. Later he calls Fred again from a party: "That girl is here -- the one I met at your office party, used to work with you... what is her name? She's looking great. What is her whole deal again?" That's augmented reality by cellphone and human reverse TTY, call it v 0.5.

Then there's v 0.6, which is Google Local for Mobile/iPhone, Windows Live Mobile, or the like. GLM offers "My Location"-biased search results, while WLM has solid speech recognition (you can just tell it where you are or what you want). These mobile search products are great, except that they are relatively active, not passive -- you need to tell them what you're interested in, they doesn't already know. And they only knows a little bit about places and a little more about businesses.

Despite the limitations, these two methods are real examples of AR in use today, even if people don't call it that.

I assert that AR is a killer semantic web app because it's the semantic tools that let the machine filter the Internet down to what's relevant in your (metaphorical) field of view, when you're out in the real world.

Googling for answers in many real-world situations is drinking from a firehose, and you need to go all the way into the cyber world (iPhone, laptop, etc.) and invest effort to get what you want. That's not AR, it's just context switching and portable cyberspace.

AR is a system that can matrix your interests, contacts, places, and needs against all the current information germane to where you are or what you're doing ... and then pick out just the high level parts you want, with a mechanism to drill down by concept. Doing that by brute-force search, or even collaborative methods (think geotags), won't get you far enough. You need a true semantic layer to front-load the work and make this real-time.

On the other side, once you have a workable if basic semantic layer, then AR becomes a very basic incredibly useful flavor of personal, semantic search.

Saturday, April 19, 2008

Social Net 2.0 is about the Edges not the Nodes

In a the social graph model, people are usually the nodes and their relationships to one another are the edges. Profile data become node properties. Relationship data (worked with, married to, used to date) are the edge properties. There are some twists on this, like making a company or school (say Stanford) into a node that people connect to, rather than an aspect of a relationship ("used to go to Stanford with").

Proposition 1

Today's graphs have lots of node data, but are very weak on edge data. It's the problem where

  1. If I come to your Facebook profile, it is hard or impossible to tell, just from your friends list, who you are actually friends with and why.
  2. You may reasonably hesitate to fess up to some legit social graph links because if this missing data. Like, say, an anti-copyright crusader who's really an old buddy from junior high, but whose link might jeopardize your Hollywood job chances if the relationship were misconstrued.

This binary friendship is the weakest form of social graph, especially as it gets syndicated via apps and APIs throughout the Internet. It's poor quality information.

Proposition 2

The next step, the of 1.1 of edge data, appears in schemes like FOAF, and apps like LinkedIn. LinkedIn at least asks how you know someone ... did you work with them? where? when? That information adds value to their network.

The uber-social-graph (the hypothetical union of graphs) that we imagine and talk about can only have real value when the edges have quality (how do you connect), quantity (how well), sign/directionality (let's face it, there some people I might like, know, or relate to more than they do me, even if we're generally on the same level). In fact, the edges are multidimensional ... multiple different linearly independent quality/quantity/sign groups might all apply over a single relationship. Like anytime you've spent time working professionally with a good friend. If it's someone you've been romantically involved with, toss another set of attributes on there as well.

Proposition 3

One way to get to 2.0 would be to ask people to create a profile for each relationship (friend) they add. Probably not likely to happen, because it's labor intensive in proportion to the value of the data: Saying I worked with someone is not as good as saying where it was and when, adding that we were pretty friendly and had beers a lot after work, adding that we were both really interested in, say, programming languages or biking, adding that I convinced him to volunteer with me on so-and-so's political campaign.

It's a lot of work.

Passive acquisition of the data would be easier and more accurate: my emails or IMs with someone would tell how often I talked to them, what about, in what context, etc. The existing email, IM, and soc net comms providers (e.g. facebook messaging) have most of this data already. Ideally they would get my approval and once-over before asserting any conclusions, since it's still early days as far as accuracy of automated semantic analysis.

Proposition 4

Even if passive acquisition and analysis were occurring and were accurate, the data could be quite wrong as long as my life spans multiple systems. E.g., gmail sees 50 emails with someone, all related to Java work. The Google graph system draws one conclusion. But if there are 2500 AIM messages somewhere else, about wacky topics and at different times of day or night to the same person, the picture of the relationship might look a lot different. So the data from many modalities of communication (chat, IM, email, TXT, phone calls) and many systems needs to be analyzed together.

Proposition 5

This will require an ingenious entity to manage the graph. The government's attempt to do more or less exactly what I'm talking about is likely to be kept far from us law-abiding citizens. (I consider it only a matter of time before the world's top cybercrime / warfare / terrorism groups actually compromise this database, but they're not about to give us an API to it either.)

It won't be practical to keep this data secret; users will need to understand that once they allow data to flow into the system, it will be syndicated and replicated forever; it can't be pulled back. This should not shock current users of social networks, who must assume that not only their friends list/network, but the history of its deltas over time, and any tracking-cookie-enabled assumptions about the people it, may already be in a Google cache somewhere or in someone's data scraping startup.

What is to be hoped is that there is some centralized mechanism for auditing, correcting, and marking things as questionable. I.e., some group of graph engines that have a higher degree of trust than generic web scraping. Incorrect data could be challenged by allowing the engines access to additional information.

Proposition 6

Automation in turn gives rise to graph spam and graph phishing: if a med vendor sends me 100 emails a day, does that imply something? If a foreign con-man tricks me into clicking his link or sending him an email, does that get him mileage in my social graph?

One way or another, this stuff is coming, so we may as well start figuring it out right now.

Wednesday, April 16, 2008

Real Psystar Story: Mac Users Caught Looking ... or Apple != Hardware

Apple believes that they are a hardware company, even though their fabulous software and consistently broken, mediocre, (tech-and-policy-)crippled, and overpriced hardware make it clear that's not the case.

These folks have enablers, too: fans who think about the hardware like they think about tables at Design Within Reach ... who get a warm fuzzy knowing they have the authentic overpriced article. And other fans who don't think at all, but love a glowy apple logo because it makes them fit in with the crowd they want to imitate, er, um, that came out wrong, the crowd who all want to, uh, think different with. Identically. Or something.

Truth is, aside from the hardcore enablers, all the other Mac users don't give a damn about the hardware (until it breaks). They sit at the their glass desks from Ikea or Target (not DWR), they boot up their who-cares-I-just-like-Mac-OS machines, and they work.

The real Psystar story is not about a vaporware company, or unenforceable EULAs. It's a story about the story. The real Psystar story is this: it's a big deal because most Mac lovers don't love, worship, or want to pay for Apple's charade of being about hardware. So they would consider buying a Mac clone.

Think of it this way:

  • PC users who don't want a Mac don't care about Psystar
  • PC users who are technophiles and would like to play with Mac stuff without a real Mac don't care much, because they can build their own Hackintosh for very cheap
  • Mac users who believe there is critical value in the Apple hardware don't care either, because they (and, they figure, those in the know) would not be interested in a Mac clone to save a couple hundred bucks.

Who's left? Why is everyone so spun up? (Google shows 220,000 results for Psystar right now, and only a few are psystar.com itself)

Because when the mere possibility of a Mac clone gets so many people feverishly looking, writing, and thinking, it puts the lie to the Apple-is-really-a-hardware-company positioning. And that realization ... if it were to take hold ... would have implications for Apple's strategy, product line, and stock price.

At some level, the Macosphere has always known, that the software was 98% of the experience. And a big part of them viscerally responded to the proposition that all they need is a software subscription to really nice OS.

Tuesday, April 15, 2008

Not News, But Still Weak: PPV Timeouts on DirecTV DVR

Just got my DirecTV bill which mentions how, from now on, pay-per-view videos will self-destruct from my DVR after 24 hours (they used to remain indefinitely). This wasn't a surprise, as it was reported ages ago.

Sad and amusing really: the PPV offerings are already more expensive (by 2x) than the video store 4 minutes from my house. Oh, but PPV has second-run films that aren't on video, and it's more convenient.

But they're not competing with the video store, are they?

BitTorrent has first-run films and is even more convenient, and the films stick around as long as they want. Oh and they have gorgeous HD specimens with an open codec and no HDCP, special video cards, fancy cables, strange monitors, blah blah blah.

And if I'm going the PPV route, and I really wanted to keep the PPV videos from the DVR, I could just push the record button on the attached DVD recorder, which records in the clear, obviating any CSS-based, DMCA-granted restrictions (beyond the normal copyright restrictions) that might get in the way of my time- and place- shifting.

Those DirecTV guys and the Hollywood schemers who thought this up are so smart, I want to know what they're eating for breakfast so I can get some too.

Saturday, April 12, 2008

A Hint in the Quest for S3 Suspend on Windows

Unlike most geeks I know, when I'm working, I don't like to put on headphones and listen to music. I concentrate and focus better in quiet places. So when I put together a new PC, one of my top priorities was quiet. Quiet case, quiet cooling, low power consumption (relative to horsepower) and S3 suspend.

Since I switch between a few different boxes, multiple power supply fans churning in a small room is a loud problem. Plus, S3 is a great user experience (instant restart, exactly where you were) and enviro/energy-bill friendly (far less power consumption than an S1 fake suspend).

Google around and you'll find lots of tips for S3:

  • First, you need to be running the ACPI HAL underneath Windows. Typically not a problem, but you can check under Device Manager / Computer node.
  • Second, check that your BIOS ACPI setting allows S3 (e.g., mine has as option "S1 Only" that would prevent it from going S3 if it were selected)
  • Windows XP normally omits a registry entry (USBBIOSx) required for S3 because apparently some hardware can't wake from it via USB devices. Why that warrants disabling a sleep mode that I've always woken up with the big ol' power button I don't know.

Check the BIOS before you install Windows and the ACPI HAL immediately afterward, because conventional wisdom is you may need to reinstall the OS if you want to change these items.

I did all this stuff, still no S3. What next? There's a Microsoft command-line utility called DUMPPO.EXE which outputs a bunch of useful power management status stuff and lets you set power policy as well.

When I ran it with the cap argument, it produced a report that said no suspend modes were available on my hardware at all! Huh? Whah?

At the bottom of the report is a separate line about a legacy driver. It was the default VGA driver that XP uses on install, since I hadn't loaded the real nVidia driver yet.

Hmmm...

I installed nVidia's latest and rebooted -- all of the power options were now enabled. DUMPPO also reported all of the suspend modes available.

So... first, bad, bad Microsoft for defaulting virtually all video hardware to a legacy driver that breaks the OS's own power management. Maybe there's a fix for that in XP SP3.

But second, check ALL of your drivers -- chipset, sound hardware, and video at least, and don't bother testing S3 until after you've gotten your drivers installed.

Tuesday, April 08, 2008

The Big Bad Rewrite Isn't Always a Bad Idea

The other day I wrote about how a lot of value in legacy systems could be liberated by more freethinking and vigorous modification and refactoring -- not the defaults of "replacement" or "incremental maintenance."

Now I'm going to look at the other end of things -- when it makes sense for to replace even "young" systems with a full-on rewrite.

Joel Spolsky has written one of the more famous essays on the big rewrite as anti-pattern. And he's right in that essay. Don't rewrite because you have grand dreams of tearing down the house to build a beautiful code palace, or because code is easier to write than to read, or because you don't like the platform the other guys used, or because your team ends every status meeting with "we need to throw the codebase out and start over," like Cato the Elder ending every speech Carthago delenda est.

A rewrite makes a lot of sense, though, in situations where the original implementation was pushing the bounds of the platform, resulting in some hairy, troublesome, and expensive-to-maintain code ... and meanwhile the industry has caught up and moved past you to the point that the hard areas are now trivial.

In the late 90s, you might have spent a bunch of time on a very complex desktop reporting app with Java 2D graphics. Your engineers hacked to the limits of what Java could do ... and maybe even tore out into the world of JNI/OpenGL or COM/DirectX to push the bounds. You used CORBA or wrote your own communication protocol, worked around firewall issues, etc. Suppose that today, the code still causes trouble, is difficult to maintain -- and could be replaced with a few hundred lines Adobe AIR/ActionScript code and web service calls. The smart thing to do is rewrite.

Look at the apps your company may have built 5-10 years ago, especially anywhere you were pushing the bleeding edge not as value-add but just as support. Do you have a roll-your-own communication protocol that made sense at the time, but could now be replaced with 10-lines of script, or a point-and-click binding in your IDE of choice? Did you write a persistence layer (or work the source code of an open-source one) when databases were more expensive and each server could house much less data than today?

Here are some common factors indicating it may be time to do a rewrite:

  1. Volumes of code can be replaced with much less code (leveraging newer open source and/or vendor-supported libraries).
  2. The existing code is creating real, measurable, avoidable expense at a large ratio (like 2:1, not 1.15:1)
  3. Your goal is to leverage other smart people's work, not prove that you're smarter than the guy who wrote your old system.
  4. At the business level, you need to gain leverage by getting back up on top of a technology stack and out of the middle where you're toiling away creating no externally measurable value.

AppEngine is Pretty Much What I Was Talking About

None of the people I know at Google had leaked me any info whatsoever about AppEngine.

It's pretty much the environment I wrote about when I talked about simplifying cloud computing. AppEngine could stand some more simplification and standardization, but it's a a rockin' first step.

Although it was tempting to be a little self-satisfied, discussing something like this initiative a month or so before launch means ... well ... discussing it many months after it was already thought of, planned, coded, and up and running inside of Google, so humility is probably a better approach.

Sunday, April 06, 2008

Want More Money? Repair, Remediate, Refactor

In the time it takes you to read this sentence, about $6.02x1023 dollars will have been wasted in lost productivity due to old, rickety, hard-to-use, non-performant software systems.

Well not so many dollars, but the loss is real -- whether it's the energy and cost-of-operation for more servers, when fewer could do the same job; whether it's hours spent waiting for CSRs to tab through tens of screens in legacy line-of-business apps to find the one field they still use; or worse, when a police dispatcher makes a mistake because software makes it hard to click the right thing fast and dangerously easy to click the wrong one.

Strategies for making "bad old systems" better are not the most popular topic for the tech elite. This makes sense for a bunch of reasons. The mythologies we live by are generally startup oriented. But, more importantly, real roll-up-your sleeves work on old systems doesn't scale. The hard problems are business-specific and not ones that licensable products can solve ... so anyone on a mission to save the world from these systems ends up with a services approach -- i.e., a process approach -- that is bottlenecked by human quality-and-scaling problems.

That's a bummer, because there is a lot that can be done with old systems once a really good team starts thinking about them. Forget the big rewrites and the magic bullets. Forget the awful HTML front ends that barely hide COBOL.

In between are some great possibilities. A lot of legacy architectures lend themselves to SOA without even knowing it. Inexpensive hardware and storage means, in some cases, legacy client bits can be moved back to the datacenter and integrated into a middle tier. Other times, the clients can be done away with altogether if someone has the chutzpah to figure out the "old" protocols and implement them with modern tech.

While I mostly work with startups, I've been involved with at least three projects in the last five years that included some re-engineering of legacy systems. One of these systems was almost 40 years old and used emulation of custom hardware (and a custom physical network) just to communicate. Two of the three were barely documented, or not documented at all. And at least one was a total clusterfudge, in the sense that it hadn't aged and "crufted" naturally, but was the result of crackpot work that was known to be broken from the relatively recent start.

In all of these cases, it was possible to improve the architecture, performance, and functionality of the system without the mega-rewrite. And since the existing systems had tons of data and transactions running, the new software needed to run smoothly side-by-side with existing software, allowing a limited and careful transition.

Here's the kicker: in two out of the three cases, although the "new" software was a vast improvement, it was never allowed to take on a larger role in the enterprise outside of a niche for which it had been developed. A bunch of startup hotshots writing cutting-edge stuff was simply not in the Enterprise IT Legacy Technology Lifecycle Planning Regime and so, like the dismissal of Heron's steam engine in the first century, the new technology was regarded as a mere novelty.

There are some reasons for conservatism and stodginess around legacy systems. But there is also a ton of value waiting to be liberated as soon as some of that stodginess can be shed.

Sunday, March 30, 2008

Take Silverlight Offline with Prism

Microsoft has been cagey about taking Silverlight "offline" to create cross-platform, desktop-installable RIA-style apps to compete with Adobe AIR. But if you are interested in building an offline or occasionally-connected app with Silverlight, it's not too hard to do.

If you're targeting Windows, then it's tennis-without-a-net:

  1. you can create an "HTML Application" (HTA) and embed Silverlight
  2. or you can create a Windows Forms app and embed Silverlight 1.0 in it as an ActiveX (this might be possible with Silverlight 2 as well)
  3. or you can create a Windows Forms app that hosts the WebBrowser control, and load your Silverlight 2 app in there

Playing around with that last scenario, it was easy to get full communication between the Win Forms app (which has privileges based on the user who's running it), the DOM doc inside the browser control, and the Silverlight control inside the document. On Windows, that pattern allows a lot of options.

But what if you want a cross-platform app that works the same on Windows, Mac (and Linux, if the Moonlight initiative pans out)?

Take a look at Mozilla Prism: Prism gets you the basic desktop integration for running your app. Now you just grab your Silverlight files and make that the "web site" you're going to bundle via Prism.

Out of the box, Silverlight gets you offline isolated storage in the file system. Prism's separate Mozilla profile should keep the offline storage space separate from the user's general browser cache.

And with LINQ over objects and LINQ to XML, that may be enough for your data management needs. Silverlight doesn't come with a relational API or database like AIR does, though I expect someone will cook one up -- or write an adapter to SQL Server Express (if the odd restriction on Socket destination port numbers is relaxed.) And of course Silverlight doesn't have the native PDF support that AIR does (although XPS support will presumably show up at some point).

Before any of this can happen, all the related software has to get closer to production. Silverlight (2b1) has to stop crashing Firefox (3b4) when it terminates, and that combo also needs to get better at handling things like the SHIFT key.

Monday, March 24, 2008

Sprint Keeps Fighting the Good Fight with 'Titan' Mobile Platform

Sprint has long been the most developer-friendly of the major carriers, and they're raising the Java bar with their new Titan platform.

Titan is a significant improvement over J2ME, and Sprint is doing the smart thing by making sure all Titan-capable devices run the same implementation (something Sprint actually started doing a few years back with their J2ME VM, in an attempt to ameliorate the write-once debug-everywhere problem).

But sadly, Sprint's leap forward (and Sun's, if they succeed in getting their SavaJe-derivative JavaFX mobile platform shipped) is just more trouble for the mobile application industry: it's yet another incompatible platform that must be supported, but which doesn't replace any existing platform.

No one wants to build or fund a company (or application project) that can only reach a subset of Sprint subscribers (those with the Titan handsets). It's a non-starter. While the iPhone has enough sex appeal to drum up an entire investment fund just for its own apps, Titan has no hope of accomplishing the same thing.

So a "great new mobile app" can only choose to support the legacy platforms and ignore Titan, or support the legacy platforms and also support Titan. Anyone else see the problem here?

Wednesday, March 19, 2008

Stored Procedures and Code in the Cloud

For modest-sized Internet applications, the allure of cloud services has two elements.

First, there's simplicity of implementation and maintenance -- the hassle of real-world ops is the sort of problem startup CEOs dream of having, while startup engineers (and engineering budgets) are ill-equipped to deal with it. Second is the promise of easy scalability -- another problem the CEOs dream of, and the engineers secretly hope will become Somebody Else's Problem.

Storage in the cloud is conceptually easy. Especially with ActiveRecord patterns that ignore (at their own peril, but that's an article for another day) 35 years' worth of learnings about data integrity in the relational model. And for those who need to write things more complicated than 37signals' latest masterpiece, true structured data services in the cloud are coming.

What about application logic, though? There's raw EC2, which works on the level of provisioned VM images, and makes you design for clustering, manage your instances (while they're up), and keep your dynamic data somewhere else. Fabulous infrastructure but non-trivial to use.

Folks like heroku have value-added application-level services above EC2, which offer the elasticity with less hassle.

But what about going even higher level, and defining a unit of work, or a service module that can be deployed into a scalable container, preferable "nearby" the data it needs?

Real world example: in a recent project, I needed to be able to run Dijkstra's algorithm on big (250,000+ nodes) graphs in a persistent store. It would be great to use SimpleDB or SSDS (Astoria) for storage, but what about running the algorithm? It's not practical to extract a representation of the graph over the network, and then run Dijkstra on it just to find some interesting nodes each and every time. Changing the algorithm or using a different one? Maybe ... But what I really wanted to do was create a small module that I could ship over to the data, and run there. Even better, I'd like to be able to compute on the data "in place" in a storage facility, rather than extract. Conceptually a bit like a stored procedure.

I believe that the solution -- and an easier way to start shipping computing into a cloud facility -- is to create a module definition that one can code to, and then just upload. I think Python or Ruby would be ideal languages as they are popular, truly cross-platform, and not encumbered with a IP issues. Plus the modules would be provided as source, so that they could be scanned for, e.g., insecure or computationally intensive uses of stuff like eval. In fact, given Google's investment in Python and in interesting tooling in general, they may already be most of the way there.

I just need a better name than "stored procedures" -- that one's not getting any points for cool.

Sunday, March 16, 2008

Well, That's Embarrassing (VASGen Bug Fix)

The other day I was using VASGen, my free tool for generating ActionScript 3 code from UML via Violet, and realized the getters and setters on generated properties had the wrong visibility.

Doh!

Not sure how I missed that one before, but it was a trivial fix. Visit the VASGen project page to get the latest (0.2.1) code.

Rails is "Slow," But Railshosting.Org May Be Scaring People Away Unnecessarily

Rails is slower (by many metrics) that a lot of web frameworks. But that doesn't mean it's not both great and cost-effective for many kinds of applications.

Here's a problem, though: if you're someone thinking about putting up a small-to-moderate-sized app on Rails, and you Google either "rails host, "rails hosting," "host rails," or "hosting rails," you will find RailsHosting.Org as search result #1 or #2.

RailsHosting has a section called "What is the right plan/stack for you?" and it basically paints such a terrifying picture that it might scare a lot of newcomers away. Is that hyperbole? You tell me: according to rh.org, a shared hosting plan with FastCGI is only good for 1,000 hits per day. For 2,000, you should be using a virtual dedicated server or an actual dedicated server along with Mongrel, Pound, and/or mod_proxy_balancer. 5,000+ hits/day? You need a dedicated server.

What? what?! whaaaat?!?!? If I'm a developer in an enterprise and I see numbers like this, it's game over, forget it.

Happily, these numbers aren't right. Based on my testing with actual shared hosts, it should be possible to run a site at least up to 10,000 hits/day (assuming that load ranges from 0.33x to 3x at different times of day) with a decently configured and run shared hosting plan -- even with a non-optimized app, little or no caching, etc. If the average host can't handle that, it's not a Rails problem, it's a shared hosting provider problem.

Now, if you want 10,000 hits/hour with lots of writes per page into the same database, and peak rates higher, than you're gonna need a different approach. Rails may still do it for you, but it won't be plug-and-play on a shared host.

In any case, server technology, virtual datacenter technology, and "point-click-buy" Mongrel and dedicated memory has improved since RailsHosting first put this data online.

So, notwithstanding the fact that my Samsung Blackjack (running .Net Compact 3.5) could probably serve ASP.Net faster than the average hosting provider can serve Rails, the first information kiosk on the Road to Rails should offer a less pessimistic and more realistic view!

Large File Uploads with ASP.Net Require a Config Setting

I'm just putting this out there to save someone else an extra search: last week, a colleague and I were discovering that an ASP.Net app was throwing exceptions when we tried to upload files around 5 MB in size. Turns out that one's by design: here's an article that covers two relevant points:

  1. There's a configuration setting (detailed in the article) which limits uploads to 4MB by default.
  2. The uploaded file needs to fit in the memory used by the worker process that's handling that particular HTTP request -- all at once; apparently, it can't be configured to 'stream' to a file object or the like. ASP.Net "health management" of the worker processes can get in the way of really large uploads because it gets anxious if the worker process memory consumption exceeds certain thresholds. There are additional config params around this feature that you can tweak if you need to.

Sunday, March 09, 2008

Giving the Right Stuff Away with Your Freemium / Free Trial

Freemium maybe a neologism, but the model has been around since the days of shareware, and the free trial concept is prevalent not just in 'web 2.0,' but in everything from end-user software to enterprise software to dev tools.

After all these years, it's interesting to see how far off some vendors end up when they try to decide what exactly they want to give away and why.

Let's look at "why" first: there lots of reasons to offer the free SKU, among them

  1. The obvious: get users hooked somehow and get them to buy the paid SKU
  2. Build a really big user base with an appealing free product, never mind how many actually upgrade. Variant (a): your ability to give stuff away is limited by specific costs (e.g., bandwidth, burn). Variant (b): you are intentionally burning investor cash to give away more than you can "afford" to in order to build your user base.
  3. Build mindshare by giving away something (else) that has exchange value (i.e., is worth real money). This is the most unusual, but examples include sites giving away iTunes song tokens, or software companies giving away a license to a tool or server product if you join one of their sites and do some activities.

Once you know why you're giving something away, you can use that knowledge to inform what and how.

Online, there is a big difference between giving away space (e.g, remote storage of documents) and time (a trial period that ends). If you offer a time-limited trial of an online service, you're discouraging your users from making a commitment of their time or energy, or from storing their valuable data. Why? Because their initial assumption is that if they don't pay, then at the end of the trial period they will not be using your product anymore. Paradoxically, this initial "pessimistic assumption" makes them unlikely to commit enough that they really get hooked and decide the service is worth paying for.

Free space is a much better (and more popular) model: it tells users to relax, get comfortable ... as long as they don't exceed a certain allotment, they can use your service for free forever. Something about free forever makes folks more comfortable. Eventually they really love -- nay, need -- the service, but their free space allotment is full. It's a smaller cognitive leap to toss in a few bucks for some more space, bandwidth, or logins at that point.

There's a big difference between a long trial period, a short trial period, and a "number of uses" period in an offline product. A short trial period makes it difficult for people to settle in before having to take the leap. If they project-switch a lot, they could end up spending a big part of the trial period working on something unrelated and never getting to really eval the product.

A long trial will pick up some casual users who treat it as their own licensed product. Especially if, a couple of months after the trial expires, they can expect to get a beta trial of your next version. A number-of-uses period fixes some of the "short period" problems, but can discourage users from getting comfortable by launching your app just to play around with it.

The idea that the trial period should be purely trial, and not enough for the user to accomplish a real task, is a poor idea. The trial should allow a well-intentioned user to get something done so that he or she can ascertain that the product actually solves a real problem.

There's also a big difference in how you "degrade" functionality for a free version. Online, an ad-encrusted free version is nice because it is very clear what the core product does, even if it may encourage more parasitism than you ultimately want. Removing features, on the other hand, can make the core product look weak and unappealing.

In the offline software world, degradation may take some thought. One time, I was testing video conversion products for Windows. The DirectShow architecture notwithstanding, some software is robust at processing video, even when there are issues in the video or the DShow filters, and some software explodes violently whenever anything unexpected happens. So it's necessary to thoroughly "trial" any app that claims to convert a big range of formats.

Some trial packages added a watermark or logo to the output. Other trials didn't add a watermark, but limited the length of the video clip you could process. Still others had calendar-time-limit features.

Of these approaches, the "limited-length clip" approach was a total loser: I could see the beautiful output quality produced in a few cases, but by making it impossible to convert a lot videos for real viewing in the trial, the authors made sure I couldn't learn whether the app works in the general case.

The watermark apps were somewhat better -- I could use these for a lot of "fooling around" projects and find out if they worked or not. And the calendar-limit apps were the best: within the limit, I used them as though they were my solution ... until one or another demonstrated through failure that it was not.

In the end, the obvious tip is to think hard about your trials. But more to the point: if you're doing free trial or freemium software or services, the free/trial experience should really be designed into the customer lifecycle experience from day one.

Wednesday, March 05, 2008

Application Models, Part 2

A little while back I described the idea of an "application model."

The application model is a key concept that keeps getting muddled and confused with partially overlapping concepts like languages (e.g., Paul Graham's discussions of "languages for smart people" vs. "languages for the masses") and platforms (a legacy platform vs. a "great new" platform, etc.)

So besides being a useful term for which I'm not sure there is an equivalent, what is the role of application models?

First, application models -- not languages or platforms or vendors -- argue, persuade, and sometimes win.

Whether it's Visual Basic (the original), or C++ and OpenGL, or Rails, the question is "How well does the application model solve the world's (ok, domain's) problems for the folks who actually do the solving?"

And the cool thing is that application models are very malleable in a way that languages and platforms aren't -- because the they include (well, really their complements or negations include) all kinds of APIs and libs that people cook up.

Huh? Like this: the application model for JSP/Servlet apps (including "model 2") stunk. So folks created all sorts of libs (Struts, Tapestry, etc.) and templating engines (FreeMarker, Velocity, etc.) in order to create a better-shaped "hole" -- a better application model for what were still fundamentally Java Servlet apps. Still a hassle. Nice underpinnings, great performance, needs some work. We got IoC containers and the application model became friendlier. For small, quick apps, Rails had a lot of appeal, so we got Groovy and Grails as options. In the .Net world, we have C# adopting elements of Ruby (yes, they're really Smalltalk or Lisp elements) and ASP.Net offering the "MVC Framework" which -- with LINQ -- creates a flavor of Rails.

There is no intellectual property violation going on here. Platforms and languages are adapting around good application models. Some of this adaptation is vendor driven, some is community driven, some involves new languages, some involves new tools, and some involves APIs. But the common thread is a desire to alter an application model in a particular direction.

Application models are what get mindshare and what make provide for the continuity of commercial application development patterns over time. More on this point later.

Before I get there, it's worth pointing out that the application model also bears heavily on the aspects of application development apart from core feature development. When we get into these aspects, non-functional requirements, or orthogonal (really non-collinear) concerns, the application model determines (or at least posits an optimal or easiest path for) integration. How the UI attaches, how app-level security is managed, how different services are integrated -- these all fall under the sway of the app model, and if we want to make these things better, the app model is what we should be talking about.

Over time, the adaptation of application models (by the all of the parties mentioned above) is the story of the evolution of commercial software. Commercial software evolution is often described as a sequence of machines, or OSes, or platforms, or languages. It most definitely is not these things, any more than it is a story of vendors fighting and dying and rising. The thread of continuity, and the real underlying story, is about people adapting application models, piece by piece, over the years.

Saturday, March 01, 2008

The Pecking Order of Free Email Services

Why is it that hotmail.com and yahoo.com email addresses are viewed with a certain disdain by technical folks, but gmail.com has a different and higher status?

Is it that Google is (or was?) more respected than Yahoo or Microsoft?

I have actually seen services that specifically say that yahoo addresses are not allowed but gmail is ok. Gmail obviously isn't less anonymous, so it's not about pretending one address is somehow traceable and another isn't.

Is it a spam filter issue? Is the Yahoo spam filter so bad that folks' emails get lost in there, when they should have landed in the Inbox? Or does it have to do with other people spamming/spoofing from real or pretend Yahoo accounts? It's hard to imagine there is a server-based solution to that problem that gmail can implement but Yahoo Mail cannot, given the open standards for email and history of the spam problem.

There's also a fashion aspect. It seems perfectly respectable for a pro geek to use a gmail address for work, while a yahoo or hotmail (is that Windows Live now?) address somehow smells a little suspect. In particular, hotmail.com is below yahoo.com in respect, and other anonymous inbox services fall even further down.

There's definitely some groupthink at work here... if you have ideas as to what/why/whence it is, please comment!