Archive for the ‘Technology’ Category

Was it a bug?

Monday, April 13th, 2009

If you’ve read the news today - particularly the gay news - you may have discovered that Amazon has “chosen” to remove all gay & lesbian items from their best seller lists. Now, usually I’d be the first to complain about something like this, but I’m also a programmer. As such, the possibility that it might actually be a bug as Amazon claims isn’t that hard to believe. Writing a new algorithm - which they’ve clearly done - always brings with it the risk of mistakes and bugs. I’m not saying that that is what has happened, but you know? I’m giving them the benefit of the doubt for now.

Now, if they haven’t fixed the issue in a week or two, that’s when I’m going to get upset.

Firefox 2.0 -> Firefox 3.0 -> 2.0 -> 3.0

Thursday, January 15th, 2009

Back when Firefox 3.0 came out, I downloaded it to try it out. At the time, several of the extensions I use did not support Firefox 3, so I promptly downgraded again. Since Firefox 2.* just got end-of-life’d, I figured it was time to update to 3.* for real. I did so at work with no problem, but had to spend several hours tonight getting 3.* working correctly at home. No matter what I tried, I couldn’t get 3.* to recognize my new bookmarks since my initial install.

I tried new profiles, deleting default profiles, uninstalling, reinstalling, and just about everything else I could think of. I finally stumbled across the answer after lots of frustration. Turns out Firefox 3.* changes the serialization format for bookmarks. When I’d initially installed 3.0, a new bookmark file had gotten created. Every new version above 3.0 looks for the places.sqlite file before the traditional bookmarks.html. To make Firefox 3.* re-import from 2.* you need to manually delete the places.sqlite file from your profile directory. WARNING: You will loose any bookmarks you’ve added in Firefox 3.* before switching over for good.

This is probably an edge case, but I thought I’d mention it for anyone else who stumbles into the same situation. As of this time, I do not know of a way to merge a changed bookmarks.html into a places.sqlite database you want to keep. If you make changes to both, I think you’re going to loose one set or the other.

FYI, if you’re interested in why the serialization format changed, go read about Places (advanced usage, technical design). Its a major new feature in Firefox 3.0.

Using an ostrsteam correctly

Thursday, November 20th, 2008

At work, I recently ran across a bug in some legacy code using ostrstream. As it turns out ostrsteam is extremely bug prone. In fact, ostrsteam has actually been deprecated in favor of stringstream. If you’re writing new code, do yourself a favor, stop now, and go use stringstream.

If you can’t - say you’re maintaining legacy code - I strongly advise checking to ensure that your code follows the pattern below. If you’re not - and you’re using dynamic buffering (the default) - you probably have at least one bug and one memory leak in your code.


/* By default the constructor allocates a 512 byte block of memory which is managed by the object itself. */
ostrstream stream;

stream << /* some data */;

/* This is the first bug fix. An ostrstream is a BINARY stream. It is not NULL terminated by default, even when calling str(). Since an allocator is not guaranteed to give you a zeroed block of memory, your string may be much longer then you expect. This could cause memory corruption, data corruption, or stack dumps. (Mine was the first two and was a royal pain in the ass to track down.) */
stream << std::ends;

/* Not absolutely required, but the second parameter is an example of paranoid programming. Just in case someone comments out the line above, you'll still be safe from memory corruption. Note: Depending on you're implementation of string, you might get a string with two null characters at the end. This shouldn't cause any problems, but is worth mentioning for clarity sake. */
std::string str( stream.str(), stream.pcount() );

/* This is the fix for the memory leak. The str() call above gave the caller (you) responsibility for deleting the dynamically created buffer. Rather than worry about how that buffer was allocated (new[] versus malloc), you can just tell ostrstream that you don't have a reference to its internal buffer and it will take ownership of the buffer again. Thus the dynamic buffer gets deleted when stream goes out of scope. */
str.freeze(false);

Now if only more UI designers would read this

Tuesday, November 18th, 2008

I have occasionally been tempted to write a post/rant about about interface design. Instead, I’ll just refer you to a couple of useful resources, and say “what they said!”

What reading Tufte won’t teach you: Interface design guidelines - Simply stated rules for designing UIs.

User Interface Design for Programmers by Joel - If you haven’t read this, and you claim to be a UI programmer, who the heck are you kidding?

more to come.. Suggestions welcome.

Never fight your way through a phone menu again

Friday, August 15th, 2008

I’m sure most of you hate phone menus as much as I do. Hell, I recently moved my brokerage account away from E*Trade primarily because their phone system (and thus customer service) was an absolute disaster. Well, I just ran across a product which could change all that. *

Fonolo essentially allows you to call a company and skip the whole damn phone tree to get right to the person you want. Honestly, if it weren’t for the privacy concerns, I’d be jumping up and down and begging to sign up for the beta. This sounds like it could save hours of frustration.

Unfortunately, there is one big catch for me: all of your calls are routed through Fonolo’s servers and recorded. Do I really want them recording my call to my credit card issuer? Or bank? The ramifications of them having that data is beyond scary. I don’t know what there privacy policy is, but honestly it doesn’t really matter. How long until they get bought out? What happens to all that - potentially very personal - information then?

* I first saw mention of Fonolo in Seth Godin’s blog.

Goverment enforcement of copyright

Thursday, July 31st, 2008

One of the strengths/weakness (depending on whom you ask) of copyright law has long been that the government had no real roll in enforcing it. If someone was misusing your copyright, it’s your job to find them, sue them, and prove your case. The only real help the government provides is the court room.

However, this may soon change. There is a bill being introduced in the Senate that would grant the US Attorney General the ability to file civil law suits and the responsibility to enforce copyright. While there are some pluses to the bill (mostly to copyright holders like music labels and movie studios) the consequences of the bill are quite scary.

First, the government has significantly more resources than even the richest company. And since the government is not out to make a profit, there’s no “it’s not worth it financially” incentive to restrict suits. As a result, were likely to find the number of enforcement suits going way up. Personally, I don’t like that idea much at all.

More importantly though, this is breaking into some significant new legal ground. Traditionally, the government has been (in theory at least) a neutral party in the battle* between consumer rights and corporate profits. This bill would bring the government down strongly on the “wrong” side of that battle. It sets the government up as the enforcer of corporate policy and profits. Equally importantly, the government has traditionally had no roll in the enforcement of civil law. This bill will be opening a while new legal arena in terms of government involvement and possible prosecution. Do you really want the government suing you for libel? (Say of George W Bush or Hillary Clinton?) We’re heading in that direction folks.

* Yes “battle” is a slightly inflammatory term, but can you truthfully tell me its become anything less?

Further Reading:

Senators Announce New Intellectual Property Enforcement Bill
Posted by Richard Esguerra of the Electronic Frontier Foundation

Some of the articles best quotes are:

The real “problem” may be that some so-called “offenses” can’t be proven beyond a reasonable doubt, the standard for any crime. This new provision would allow the AG to sidestep that high burden of proof — a burden that gives the average citizen an important measure of protection from the overwhelming power of the government.

If the bill is passed, something as simple as taking your iPod to Mexico could be considered an infringement of the copyright owners’ distribution right.

Civil law (legal system)
From Wikipedia

Lawsuit
From Wikipedia

Marketing quotes from Seth Godin

Thursday, July 24th, 2008

Never heard of Seth Godin? Neither had I until a few days ago. Now, I’m getting seriously addicted to his blog. The man can write. Every one of his posts make an interesting succinct point and does it in an enjoyable read. Here are some of my favorite quites so far. You’ll probably be seeing more in later posts.

Updated (7-27-08): Added extra quote and corrected grammar in post title

Most people, most of the time, steadfastly refuse to pay attention.

The tragic mistake of demographics and media planning is that they overlook the single most important issue: is the person you’re talking to ready to listen?

– From “Are they ready to listen?”

If you want to enrage customers, just sit idle while they rage against a broken system at your organization.

– From “What do you do when your systems break?”

The world needs fixed-price web podiatrists.

Podiatrists, not doctors.

Doctors do surgery and prescribe expensive drugs and stuff. Podiatrists can just make it easier to get around.

– From “Two simple web businesses”

Here’s my number one fiduciary rule for big brand marketers: The executives involved in approving a sports or entertainment promotion should not be permitted to attend the event.

– From “Promoting the promotion”

Cognative Bias: Jumping to Conclusions

Sunday, July 20th, 2008

A few days ago, the folks over at the Business of Software blog posted an article on how the human minds tends to jump to conclusions. For me, this turned out to be a fairly timely article that I kept coming back to over the last couple of days.

This artificial experiment is an interesting illustration of a couple of human tendencies. First of all, we jump to conclusions. Secondly - more important, but also far more subtle - we tend to seek out evidence that confirms our hasty conclusions, rather than evidence that might contradict them.

At work, I often find myself trying to make educated guesses from very little information while trying to debug issues found in either QA or released code. One of the things I’ve gotten burnt by several times now is exactly the type of failure to test my initial conclusions that this article describes. I’ll be fairly convinced of my initial conclusion, mention it to someone else, and have them shoot (what were in retrospect) very obvious holes in my theory. As a result, I’ve been trying to apply a much more systemic approach to confirming my initial theories before taking them to anyone else. It’s been helping so far; at least when I remember it that is! Overall, I highly recommend this one for anyone who has to solve problems with insufficient information.

As for the Business of Software conference itself, man do I wish I could afford to attend. Sounds like it’ll be a blast, but at “only” $1495, that’s not going to happen anytime soon.

Attempting to upgrade blog == Ouch!

Sunday, July 20th, 2008

As some of you may have noticed, earlier this afternoon I attempted to upgrade the software that runs this blog. I made backups before starting, but didn’t bother to do a beta run on a clone first. After all, this was going to be an easy upgrade right? Wrong. Thank God I made backups before starting.

Turns out there are some significant bugs in the upgrade process having to do with some of the new tagging and taxometry features in Wordpress 2.6. Essentially, the upgrade of the categories tables got royally screwed up. This site describes the problem and a hackish work around to fix it.

I thought about editing my database tables manually, but you know what? I just don’t care that much. Instead, I reverted back to my backups and have the site up and running again. I may upgrade once 2.6.1 comes out if they fix the upgrade problems, but frankly I’ll be much more reluctant to do so in the future.

If you insist on trying to upgrade to Wordpress 2.6, I recommend two important steps:
- Backup your database and complete wordpress installation first
- Install a complete copy of your site (using the backups you just made) and test the upgrade there. The upgrade brought my entire blog down for a little over 30 minutes before I could revert. While that isn’t a big deal to me with the low traffic this site receives, I wouldn’t recommend it for anyone else.

Elegant technology makes things simple

Monday, June 23rd, 2008

A great example is the Capital Words project. Every wonder what our politicians are actually talking about in Washington but don’t have the time to read the full transcript? This site will tell you in a single word. I really like how they’ve used technology to simply something really complex (congressional transcripts) down to something really simple (a single word.) The result is easily understood by anyone and gives a good insight into the current hot topics on capital hill. Now if only the had source linking…

I encountered this site through the blog of the Open House Project. As I’ve said before, I enjoy reading their articles for the occasional gems scattered throughout. Most of their posts aren’t that useful, but some really make you stop and think.