Tomorrow: The First Annual D Language Conference

This week Amazon is hosting the first annual D Programming Language Conference here in Seattle. Looks like the conference will have just over 50 people attending. There’s a single track of speakers, so I hope to attend most/all the sessions, and blog some notes and thoughts here.

There is so much rich thinking going on with dynamic languages like Ruby, etc. This can be a much more expressive, productive way to program, compared to the more verbose and brittle static-typed language world. And with the web at the forefront, they have attracted a great community that is pushing the envelope in many areas.

But with Ruby, I often I feel like I’m building a house on shifting sands. And there is much that C/C++ can do to improve. Where Ruby is flexible and concise, but loose and slow — C/C++ is fast and strong but verbose and brittle. [That seeming contradiction of being both strong and brittle is a truth, but one that's sometimes not immediately obvious]

D is a tight, elegant evolution of C/C++ that retains the strength, but attacks the verbosity and brittleness from several angles, especially with its metaprogramming features. It is C++ completely rethought, simplified, and done right.

As a device driver developer, the language has features that I often wished I had (like static ifs, better templatized functions, and compile-time code execution). And they are syntactically elegant, unlike C++.

The first talk of the morning starts it off right, given by Walter Bright, D’s designer and mind behind the Zortech C++ compiler and others; and Andre Alexandrescu, the C++ guru and author of the brilliant, dense Modern C++ Design: Generic Programming and Design Patterns Applied, among many other things. D already has the signs of attracting its own great community. These are two minds to follow, and I’m looking forward to this talk and others.

iGoogle preferences have reliability problems

Just a quick note that lots of other users/widgets have been having problems with iGoogle preference saves not working reliability. Based on emails exchanged with users of my gadgets, many of the problems seem to be specific to certain browsers versions. But the problems have been out there for quite a few months, unresolved. My apologies to users of Days Since or Days Until that experience trouble saving new preferences (since these widgets rely on preferences to store all the reminders and other data). Data that has been there will stick around — it’s new adds that are the problem.

Hopefully Google will recognize and resolve these problems soon. Until then, I’ve had good luck using Firefox (2.0.0.5), other than the known iGoogle problem when moving widgets after a preference change.

Breaking up long words in HTML with Javascript/CSS

[update 10/17: The substitution has been updated to cover more browsers. This should work on every major modern browser, EXCEPT Safari -- I can find no solution for that browser. If you find a solution for Safari, or a browser this doesn't work on, please comment. Thanks!]

Long words can create a significant layout problem, especially for widgets which have to live in a small amount of screen space.

DaysSince and DaysUntil were both having a problem where very long words in the reminder description could push the “delete item” icon and other content off the right of the widget, make the text unreadable — and unreachable, so you can no longer delete the offending item.

What would be nice is to break up long words, but what’s the easiest way to do that, given that you don’t have a knowable fixed width to display in?

For a Javascript widget, this combination of regular expression and CSS hacks might get you what you need.

First, break up your strings with non-breaking spaces (nbsp), wrapped in a span that lets us make them invisible. If x holds the string with potentially long words, this regex will return this result (splitting every 9 characters).

x.replace(/(\S{8,}?)/g, "$1<wbr/><span class='break'> </span>")

In the regex,

  • ? is to make the match not greedy — that is, it will stop after just 8+1 characters.
  • /g is to match all 8+1 character or longer sets of non-whitespace characters
  • $1 returns the matched characters, to which we add a non-breaking space within a span that we’ll format below

Next, add a new selector to your CSS for the spans you just inserted, to make them invisible (credit to Martin Kliehm for this hack).

.break {
font-size: 1px;
line-height: 1px;
float:right !important;
float: none;
}

All the styles are essential — the two apparently conflicting float styles are to set different values for IE6 vs. other browsers.

Days Since and Days Until have been updated with this fix (it may take some time for Google’s caches to update — so use a new copy Add to Google to test.

Any refinements we can make to this solution? Anyone see any problems with specific browser versions?

New Feedsparks Supports Free FeedBurner TotalStats Pro

Feedsparks screenshotYesterday, FeedBurner announced that their previously TotalStats package is now free.

This morning, the Feedsparks widget has gotten support for some of that FeedBurner Pro data, particularly the new “reach” statistic.

Here’s what you need to get it working

  1. Install Feedsparks Add to Google.
    There is an old version (hosted on Google Pages) that has a widget titlebar of “FeedBurner Trends”. Yours should be the newer version (hosted on Google Code), that simply has the title “Feedsparks”
  2. Get Feedsparks working on your feeds — see the Feedsparks page, which describes enabling FeedBurner’s Awareness API or providing a login for your feeds
  3. Enable TotalStats Pro, per yesterday’s FeedBurner annoucement.
  4. In the “Edit Settings” page for the widget on iGoogle, select “reach” instead of “circulation”

You’ll need to give FeedBurner time to collect some days of additional historical data. For example, since I just enabled Pro last night and wrote these updates to Feedsparks this morning, Leancode.com currently has a “reach” of 1 reader. Woo-hoo. :)

First month of widget growth stats

On one Saturday in May (the 19th), we were in the car talking about kids baths or something, and my wife said “you know that widget you talked about writing — the one that tracks how many days since we did something? I want it. You should write it.” Well, when any of my kooky ideas get even a little bit of validation, it’s great. And a command from the wife is certainly over the top.

So the widget was roughly done by the next evening. On Monday night, I emailed lifehacker, not really expecting much. Here are some charts with the usage patterns over the first 30 days since then.

Days Since Pageviews Chart

This is a chart of pageviews for the widget. You can see the huge jump on Tuesday May 22nd, when I was luckly enough to have lifehacker post an article about the widget that morning. It basically set the level of use moving forward.

Days Since Statistics

This adds up to a lot of pageviews in a month. If these were hitting one of my servers, it would be enough load that I’d be worrying a bit about spikes of traffic and slowness. Fortunately, one of the design goals these widgets have is to use no server resources of my own: all code runs in the browser, and all data is stored in the settings of the widget itself — Google’s servers. So these could grow to 10 or 100 times the traffic, and I wouldn’t loose sleep at night. You can also see that for these iGoogle widgets, unique views tend to run about half the pageview rate.

This is a good rate of usage, but still not yet quite enough to qualify for Google’s new Gadget Ventures program, which offers seed funding for selected widgets with over 250,000 page views per week. With a little more press or an increase in organic growth, it’s possible it could hit that level.

One of the requests that came in early was “how about the same kind of thing for counting down the days until a future event?”. There were already many countdown timers, but not one that tracked several, with easy UI for add/remove and annual recurrence. Starting from the Days Since code, two weeks later the Days Until widget was written. But what would the conversion rate be, if this widget didn’t get the same level of press on a site like Lifehacker? Here is a 30-day graph over the same timeperiod as the one above.

Days Until Pageviews Chart
Around June 10th, I added a mini-message to Days Since, advertising the Days Until widget. I didn’t know what kind of conversion ratio would happen — but these are clearly related and complementary things, so it turned out to be surprisingly high — today, it appears that approx 25% of Days Since users became users of the Days Until widget.
Days Until Statistics

Between Days Since and Days Until, there has been about 13,000 unique users of the two widgets so far in this first month. Some startups would kill for that level of unique users, but it’s just getting interesting here for the widget world.

So where does this go from here? The level of usage so far makes me feel good that the relatively small investment of time is delivering value to the world — a few thousand people are finding it useful, and there’s been some really kind comments on the blog and in email.

From a business model perspective, there isn’t a direct one yet. By showing what’s possible, and what Leancode is capable of, it could generate some leads (particularly from companies which want to create a closer connection with customers by providing widgets that tie into their products or services). And you could imagine creating a portfolio of time management widgets, some of which are higher-value and could have premium versions.

But, for now, this is just a fun and interesting experiment.

Paul Dowman’s Rails image for EC2

Paul Dowman has created what looks to be a very promising Ubuntu+Rails image for Amazon’s EC2 platform. He has support for capistrano deployment, mongrel_cluster, mysql backup to Amazon’s S3 service, and a few other nifty features. When multiple server support is completed (said to be soon), this will be a great package. Definitely worth following.

An Amazon Machine Image is basically a filesystem image that then gets loaded in Amazon’s farm of Xen servers. Does anyone know of existing scripts that can create a Xen image from an AMI? It’d be nice have the ability to test and stage locally with the same image used for any of your EC2 hosted test, staging, or production instances.

Knowing when it’s been too many Days Since

[update: These ideas have evolved into the latest mainline version of Days Since. Here's an update.]

One of the early feature requests for the Days Since widget (which is getting over 400K page views/month now — more on that later) was the ability to get reminded when it’s been too long since one of your repetitive tasks was done. When you think about it, this kind of feature saves you a lot mental energy — instead of having to scan the whole list, you just look at those that have been flagged (or those turned red, etc.).

But does this mean there’s another field to enter (days until “overdue”)? Should you enter one number for days, or perhaps a full date upon which it’s due?

Every additional field and option is another bit of complexity which can turn people off. And one of the things good web apps have taught us is using the smarts of the machine to figure out some stuff for us humans is a big win. Things like a single search box that doesn’t ask lots of questions (what are you searching for? where? which category of stuff?) or a “quick add” button for a calendar that takes the whole event as a free-form string.

In the case of Days Since, we want to (1) Not add UI which might turn off current users (who don’t care about a concept of overdue) with clutter and extra complexity. (2) Try to have the widget do some of our work for us. (3) Not add much code & complexity to the widget itself.

One of the users of Days Since, Ping Zou, was looking for just this kind of functionality and decided to work with the Days Since code and add it. We’ve been tossing ideas and code and back forth, and have gotten Ping added as a first additional project member of the Days Since subversion repository on Google Code.

At the moment, Ping is a PHD student with the Electronic and Electrical Engineering Department, University of Sheffield. He has a blog (in Chinese), which you can see at http://sg71cherub.spaces.live.com/.

Ping has also generously done a translation of the strings for the main Days Since widget to Simplified Chinese — which is great, as Days Since has been lacking non-English translations. And for the the new features, we’re doing on a very small scale what many large projects (like Linux) do — have a “development branch” where new features and ideas are played with, and a “stable branch” where all our regular users are and changes are done carefully.

If you’re interested in getting the development branch (possibly bugs and all), you can add and play with the version of days since here.

And for everyone else, please keep any requests you have coming (in comments or in email). In time, the ones that provide value without getting in the way of current users will make their way to the stable, production-version Days Since widget.