The more software you have, the more software you need.

Posted: April 24th, 2013 | Author: | Filed under: coding | No Comments »

Jevons Paradox says that as a resource can be used more efficiently, more of it ends up being used overall. That is, the better the deal you’re getting, the more you’re interested in buying.

This example of real-world compounding reminded me of another example: software. There’s an interesting quirk about software — the more you have of it, the more you need.

Let’s trace through one recent path of the software industry. We start with a website.

A website is a great idea. Websites (code) make it easy to distribute information. There’s so much information that people create dynamic websites (more code).

Dynamic websites are useful, but once you’ve got dynamic data, you want the data available via API (even more code) so that outside developers can build applications (lots more code).

To help with this, you build an API management layer (tons more code), which produces information about all these other applications.

You want that data combined in a dashboard (still even more code) alongside data from all of the other software that relates to your business (which is even more code than all of the other code so far).

Whew.

Anything that cannot go on forever must stop. But there doesn’t seem to be any reasonable end in sight. This is one small piece of the software industry that points to a bigger trend, which seems to contradict common sense. People intuitively understand supply and demand. But here, supply creates more demand.

It’s a good time to be a programmer.


Voxeo, Tropo, & ORUG

Posted: March 20th, 2009 | Author: | Filed under: coding, javascript, science | Tags: , , , , | 1 Comment »

I went out to ORUG tonight. Voxeo was presenting a thing they’re working on, Tropo. Disclosure: they bought us dinner. Full disclosure: I think this thing is really tight.

I used to help set up phone systems in high school, and phone trees have always seemed like kind of a mystery. Tropo lets you build whole phone apps, and it’s ridiculously easy. It’s basically a phone system DSL. They handle text-to-speech, speech-to-text, playing recorded sound files; there’s lots of convenience things for capturing different types of inputs, handling error cases, recording calls, transferring calls, etc. They give local phone numbers in different area codes, they’ve also got Skype integration, and a few other ways to connect to the system. The very cool part is that it’s all free to play around with, but once you start using it for commercial reasons, then you have to pay.

Ever hear of Google’s Grand Central? With this, you could easily make your own. I’ve been playing around with a few things using Tropo’s Ruby setup, and I’ve put the demo code on GitHub. Very cool stuff.

You can write apps in Ruby, PHP, Python, Javascript, and Groovy (“Java++”). There’s a bunch of example code on their site, and development is really easy to do. For example:

answer

digits = $currentCall.callerID.to_s.split('')

area_code = digits[0..2]
city_code = digits[3..5]
subscriber_number = digits[6..9]

# single dashes get spoken as 'dash', use doubles for a pause.
# Double commas don't work, neither do extra spaces
say "-- -- -- S-up. Your phone number is -- #{area_code.join(',')}--#{city_code.join(',')}--#{subscriber_number.join(',')}"

hangup

There is a debugger that you can print messages to. Right now there’s a *ton* of output to it, but you’ll find your messages in there.

One thing: I was getting a message that the caller was “not accepting calls at this time”. I realized this was a parse/compile error in my script. So, if you can’t get something to load, check it. The debugger doesn’t seem really helpful with this, I got a generic seeming Java Exception for a variable name typo. They use Java under the hood for tons of stuff, so even though I’m writing Ruby code, it gets interpreted in Java.

I did learn a cool fact about these phone trees. You know how a lot of phone trees suck when you try and talk to them? Well, for speech-to-text conversion, you can only get around an 80% success rate. The reason is that phones are only around 64kbps of data. There’s too much loss for the algorithms to work well. That’s why apps that run on the local computer/phone are able to do better — they embed part of the recognition algorithm in the client.

And, on a final note: skateboarding through downtown is awesome.


Restoring a WordPress blog from Google Cache

Posted: February 8th, 2009 | Author: | Filed under: coding, hustle | Tags: , , , , | 1 Comment »

I found this and thought it might be useful to someone. Paying it forward.

 How to restore your hacked WordPress database from Google Cache through Ruby


There are many Rubies, but one is faster

Posted: January 20th, 2009 | Author: | Filed under: coding, science | Tags: , , | 443 Comments »

Wow. (From: The Great Ruby Shootout)


The HTML structure of webmail interfaces: Gmail, Hotmail, and Yahoo Mail

Posted: December 29th, 2008 | Author: | Filed under: coding, firefox extensions, ideas, javascript, science | Tags: , , , , , , , | 5 Comments »

As part of the Zentact project I’ve been working on, we were asked to integrate with various webmail clients. This makes it easy to manage your contacts while sending email.

Doing this was a bit of a pain. Since all code is minified, and they all use Javascript events differently, there was a good bit of working to figure out the details. I wanted to share this info in a blog post for programmers who come along in the future. If you don’t know/care about HTML, Javascript events, the DOM, YUI, or AJAX, this post is not for you. Please enjoy one of my other fine posts, perhaps this post on military code names.

Before I begin: there was a ton of info learned (and already forgotten) about this process. This is not a complete guide, but is mostly a brain dump from implementing UI integration on three different webmail interfaces.

  • Gmail uses 6-character strings, [A-Za-z0-9] for all its classes. These classes remain the same from load-to-load, but I believe that they may change over time with minification. IDs are not as constant, and many are dynamically assigned. These start with a colon.
  • When you’re working with events, you may get inconsistent results. Some events are not fully propagated, they get captured and you can’t find out about them. If onclick doesn’t work, try listening for onmousedown or onmouseup. One of them may get you notified of the event you want. Same advice goes for onkeydown, onkeyup, and onkeypress. That being said, once you get into these, be sure to realize that these three events will occur in particular orders. Make sure you’ll be getting notified at the right time.
  • All of the webmail UIs use iframes. This lets them keep their code for loading the UI separate from the code to display the UI. I know there’s some cross-site scripting implications in this, but I’m not sure of all the details. Gmail’s loading screen (the loading bar they show you) is a different iframe than the one that shows you the inbox. All of these iframes are at the root of the document, and there’s nothing else in there.
  • You could use Firebug break points to pause the code and examine what’s going on, but nearly all JS is minified. Since breakpoints can only be set by line, and there’s multiple functions defined per line, it ends up not being helpful.
  • For its UI, Yahoo seems to use YUI, plus some other stuff on top of that. There’s some weird results because of this. The body of the email editor is a group of DIVs, some are invisible, some are for border decoration, and others are for the background of the editor.
  • When we inserted elements into Yahoo Mail using regular DOM operations, they would appear behind other page elements, until another part of the UI was interacted with, when the screen would redraw and then they would bump into place. YUI seems to have its own redraw/repaint functionality, and it won’t play nice with DOM manipulations.
  • Hotmail is strangely one of the less-exotic interfaces. They use consistent IDs. I don’t think they’re hand-coded, however, because they submit to a naming scheme that seems too machine-generated. But still, they are there, and you should take advantage of them.
  • When you’re using events, and you get notified of an event, use the event.originalTarget property to find out where in the DOM you are. That’s useful information when you’re dealing with a DOM tree of nonsense class names and IDs.
  • When you’re trying to figure out where in a DOM tree you are, don’t hesitate to go up several levels and check a great grandparent node, or a “cousin” node. Once you get a single point of reference, you can generally work out where everything else is, relative to it.
  • Some UIs open each message in its own iframe, which means that IDs are consistent since they’re in their own namespace.

Also, thanks to Nate Koechley for helping me get through some of the Yahoo details.

If you’ve got other questions, shoot me an email. I remember more stuff, but might need a good question to shake it loose.


Code reviews

Posted: December 23rd, 2008 | Author: | Filed under: coding, ideas | Tags: , , | 589 Comments »

I’ve been quoted in a series of articles at CIO.com on code reviews. The two particular ones I’m in are

Neat!

The author of the articles is Esther Schindler, who has also written articles like “Four Non-Obvious Things Pink Floyd Can Teach Your Team“. I <3 analogies.


acts_as_presenter

Posted: December 21st, 2008 | Author: | Filed under: coding, firefox extensions, hustle | Tags: , , , | 1 Comment »

Hey kids! Guess who’s presenting at Acts as Conference, 2009! These guys! Also, some guy with a big nose.

I’m giving a talk on OAuth, the greatest way to protect your APIs while keeping your users secure. Simple, easy, fun, and it might even get you laid. The amazing, spectacular, splendiforous OAuth! Yea. It’s gonna be that good.

And now, for the official marketing:

Acts as Conference 2009 is a two-day Rails conference that will make you a more competitive Rails developer by learning from those driving the innovation that is fueling the Rails community. Held February 6th and 7th in Orlando, Florida, Acts as Conference features a great speaker lineup, free food, a chance to meet with Rails innovators, and a live via video Q&A session with David Heinemeier Hansson. At $125 dollars and limited to 175 attendees, the conference will sell out fast, perhaps faster than last year. Register today at http://www.actsasconference.com. See you there!


Zentact reaches out to web and says hi. Web waves back.

Posted: December 10th, 2008 | Author: | Filed under: coding, firefox extensions, hustle | Tags: , , , , | 5 Comments »

It’s official, Zentact is live. This is the product that Cloudspace has been building for the past several months for John Sampson, Eric Marcoullier, and Jared Brandt (who also makes some damn fine wine).

The skinny of Zentact is that it’s an address book with a Firefox extension that lets you know when someone in your address book might be interested in the page you’re viewing. Go to the site and give it a whirl.

It has been an exciting day. Watching the comments roll in on Twitter is awesome, and so is watching the emails go out from Zentact.

Mashable loves us. So do the fine folks at ReadWriteWeb and VentureBeat. And finally, an excellent review of Zentact from Mr Howard Lindzon. Also, coverage from some unbiased sources, like Cloudspace. :D

You should check it out. You’ll need a invite code, and you can use TIMZEN. Or, just sign up with this link, which magically includes the Zentact invite code. Let me know what you think.


A Javascript debugging tip for Firebug (or “Stop using alert()!”)

Posted: November 26th, 2008 | Author: | Filed under: coding, firefox extensions, ideas, javascript | Tags: , , , , , | 6 Comments »

Did you know that if you’ve got Firebug for Firefox installed, you can use it for debugging your own code? By calling

console.log("Here's a message!");

Firebug will print the message to it’s internal message log. Neat!

Firebug message console

Now, that’s all good. But let’s say you’re on a project that’s not using a Javascript preprocessor to minify and strip debugging code — which would be the best option. You want the benefits of debugging, but not having to constantly remove debugging code for deployment. If a user doesn’t have Firebug installed, they won’t have a console object. So obviously leaving your debug code in is going to cause an error.

Or will it?

Try adding this code before any of your other Javascript. It will set up a fake console so that if Firebug is not installed, there won’t be any errors.

if(!console || !console.log) {
var console = new Array();
console.log = function () {}
}

Bonus idea! If you combine the idea shown here, with my previous post about debugging Firefox extensions, you can see how to prevent extension debugging from getting in the way of your users.

if(!Firebug || !Firebug.Console || !Firebug.Console.log) {
var Firebug = new Array();
Firebug.Console = new Array();
Firebug.Console.log = function () {}
}

How to use Extension Developer’s Extension in Firefox 3

Posted: November 24th, 2008 | Author: | Filed under: coding, firefox extensions, javascript | Tags: , , , | 5 Comments »

Here’s a tip for developing Firefox Extensions in FF3.

You might have heard of the Extension Developer’s Extension (EDE). EDE is an extension that provides useful settings and features for people who are writing their own extensions. For example, EDE makes it easy to activate Javascript debug settings, interactively debug Javascript, and a few other goodies.

My personal favorite feature is the “Extension Builder” — it that lets you install a development copy of the extension . That is, you can run an extension from your working copy/dev folder. Without EDE, you’d have to — uninstall an extension, restart Firefox, install, restart — every time you wanted to test a change. With it, you can just restart Firefox one time, and your dev extension is reloaded. When doing heavy development, I have personally saved over an hour per day from this one feature.

The sad part is that this feature does not work in FF3. The option is just grayed out. But, there’s a workaround. Load up FF2 with the same profile that you use for FF3. Use EDE to install the extension from disk like you normally would. Then, quit FF2, and launch FF3. Since the extension is tied to your profile, FF3 will load your extension from your dev folder, just like in FF2.

Win!