kai_mactane: (Default)

I see that I never bothered announcing the v0.61 release. That was a minor bug-fix, resolving an issue where Hummingbird would fail if the XML cache file was empty.

The latest release is one that allows multiple versions of Hummingbird to run on the same machine without conflict, as long as they’re using different Twitter usernames.

In addition, I’ve changed the destination of auto-hashtag links. Since the hashtags.org service is often a bit flaky, or simply returns useless null results, I’ve switched to using Twitter’s own internal search service.

Downloads are available from the Hummingbird project page, or using these links:


Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Let’s organize a 10K footrace. At the end of the footrace — for, say, the last kilometer — we’re going to do whatever we can to encourage the people who are wearing blue jerseys and t-shirts and athletic clothing. There will be people standing by the sidelines to hand out bottles of refreshing sports drinks, and others jumping up and down and shouting slogans like “Dressed in blue! We love you!” whenever they see a blue-garbed contestant.

Why all the commotion over the people in blue? Well, that’s an attempt to offset what we’re going to do to them for the first nine-tenths of the race. You see, they’re going to be dealing with some seriously unfair shit: Instead of cheerleaders, the blue-wearing racers will have to deal with people jeering at them, shouting insults and telling them they don’t belong in this race. Some will be armed with Nerf guns or water balloons, which they’ll be hurling at the racers in blue in an attempt to slow them down or make them drop out of the race altogether.

And it’s not just the spectators; before the race begins, we’ll distribute secret notes to the racers wearing other colors, encouraging them to jostle their blue-garbed peers and even try to trip them up. Of course, many of our runners will abide by a sense of fair play regardless, but there will undoubtedly be those who take advantage of the biased environment we’re creating.

If a huge percentage of the racers in blue drop out before they ever reach the last kilometer… would you say that “not enough people in blue want to win races”?

Obviously, this footrace is a parallel for something else.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)
First, a note about pingbacks: Pingbacks simply let you know when another LJ user posts an entry (on LJ) that links to one of yours. It does this by adding a screened comment to your entry, which also means you get your usual comment notification. If you take no action, nobody else sees a thing. (You could unscreen the comment, if you want.)

I have no problem with this.

Then there's that Facebook crosspost feature. That's a little more dodgy. Just to make clear what it does and doesn't do (based on Livejournal's FAQ entry called "How do I update my Facebook or Twitter when I post to LiveJournal?"):
  • If you set it to crosspost your own entries by default (or automatically), it will do just that — but only for public entries. As I understand it, it will not send your friends-locked posts to other services.
  • If you set it to crosspost your comments by default (or automatically), it will crosspost every comment you write... even if that comment is on someone else's journal. Even if that comment is on someone else's friends-locked post.

Note that I'm taking Livejournal's word on this, perforce, because I deleted my Facebook account a few months ago. (Yes, because of privacy concerns. Funny, that.)

A public comment on the announcement about this sums up the problem pretty well: “Say, for example, you complain about your manager at work under f-lock. Someone can then reply with, "Man, your manager sounds like a bitch", and crosspost that to their Facebook. The possibility for badness is epic.” (I see no problem in linking to or quoting a public post. The main substance of the objections to this is that it tends to publicize information that was intended to be friends-locked.)

Some people have pointed out that a person who can see one of your protected entries can always copy-paste the whole thing. True enough, and that's not even really a technological problem; it's a social problem. If you tell a friend a secret verbally, they can always violate your confidence and spread the "secret" far and wide. No technology can guard against people deliberately breaking trust with you.

However, this setting would automatically and habitually publish one's comments to Facebook, without the person having to take any deliberate action. This makes it very easy to forget about. And totally aside from the way people can leak information by posting things that make it obvious what they're responding to, there are also the people who sometimes quote part of the post they're responding to.

In general, this is a good thing. Heck, I do it myself whenever I feel it's warranted. But until now, we've all done so with the knowledge and understanding that what we copied and quoted was staying on the same page, with the same read permissions.

That's no longer true. Now, if Joe or Jane responds to someone's friends-locked post, their comment can be automatically crossposted to Facebook without my even thinking about it, based on a checkbox they ticked at some point in the past.

Or, more apropos to my life: If I write a locked post, and my friend Stan writes a response that quotes some of my text (because it's the sensible thing to do in that context), Stan can accidentally export my words out to a service that I've deliberately severed all ties with. Even if he'd never consciously, deliberately do so.

That's what bugs so many people about this. That what bugs me about it, too.

My policy has always been that if I post something publicly, with no friends-lock, that means it's intended to be public. Link to it freely, no permission needed. I see no reason to change that policy, and you'll note that I've made this post public.

But to my friends who comment on my journal: Please, don't crosspost my locked stuff to other services. And don't crosspost text that makes it obvious what I must have written, either. I locked it for a reason.
kai_mactane: (Default)

It’s awfully convenient for Google that their famed corporate motto, “Don’t be evil”, doesn’t actually specify or define what counts as “evil”. And without any definition, they’re pretty much free to do anything they want, and just declare it not-evil.

Now, some of the things they’ve done have just been misguided. For example, I really, honestly believe that when they sniffed people’s unencrypted wifi traffic while doing Street View mapping drives, they weren’t being purposefully malicious, just absent-mindedly misguided. (I also have trouble getting too upset about sniffing unencrypted wifi signals — yeah, it’s kind of bad, but if the people who owned those networks really wanted privacy, would it have been that hard to turn on WPA?)

And then there was the bit where they auto-subscribed everyone with a Gmail account to Google Buzz — which, by default, made huge amounts of information public that shouldn’t have been. This was a really massive mistake, but given the way Google backpedaled from it, I still believe that they were just misguided and didn’t think things through at all, rather than actively wanting to cause harm.

But when Google Checkout tried to impose a “no adult content” rule on Dreamwidth? That’s a lot greyer. In essence, what Google did was tell an organization devoted to enabling free speech that it had to muzzle its users.

Google has the right to choose who it wants to do business with, based on whatever criteria it wants. But just because their choice is legal doesn’t make it “non-evil”. It’s not clear just exactly what “adult content” would have included, but there’s a strong likelihood that it would have included things like:

  • safer-sex information, including family planning, contraception, and how to use condoms properly;
  • discussion of rape, including rape survivor groups;
  • promotion of equal rights for sexual minorities

Keeping information like that off the Internet? Is not helping the world. Suppressing that kind of information harms the world, and I’d qualify it as a straight-up evil act.

It’s possible, though, that they only mean “actual pornography” (however you define that). As much as I personally may like both pornography itself, and the right to disseminate and receive it, I have to admit that simply choosing not to do business with a company that helps people publish it is not, in itself, evil.

So what about entering into secret back-room agreements to try to do an end-run around Net Neutrality and everything it stands for? And then promulgating a legislative framework proposal for Internet governance that would turn the principle of Net Neutrality into a defanged, loophole-ridden and corporation-appeasing shadow of its former self — while pretending, on the surface, to support it?

In effect, this means a full-scale attack on the core of a free Internet. This is something that reminds me of when Microsoft was going to try to “de-commoditize [the] protocols” that formed the basis for the Internet and World Wide Web, back in the first Halloween memo.

If there is a way in which this isn’t evil, can someone please explain it to me? Because it sure looks evil to me.

In the meantime, there’s one tiny problem with trying to boycott Google: They make some damned useful products. Still, if you want to start reducing your reliance on Google, here are some pointers that may help.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I keep hearing about developers who, when interviewing for potential jobs, consider coding tests to be “a waste of time”, “insulting”, or “beneath me”. The logic seems to be: Once you’ve risen to the level of Senior Developer (or some similar title), people should realize that yes, you really do know how to write simple pieces of code. You can write functions that sum all elements in an array, or reverse a string, or whatever.

I’m not bothered by them. I’m far too aware of the great number of coders that, to put it bluntly, simply can’t code. It doesn’t matter to me whether they’ve risen to their level of incompetence, or they’ve been in sky-high architect territory for too long and gotten rusty at function-level coding, or they’re simply lying on their résumé and they were never able to so much as solve a FizzBuzz problem. The fact is, they keep winding up in interviews, and it’s (part of) the interviewer’s job to weed them out. As quickly as possible, to avoid wasting any more time than necessary.

Back when I was in my first tech job, as a Linux sysadmin, I was one of the people interviewing potential candidates. I decided it would be nice to set them at ease by starting off with a few easy, “warmup” questions. So I’d start off with things like, “What is a runlevel in Unix? What are the most commonly-used runlevels, and what do they do?” Or, “What port does HTTP use by default? How about SMTP?”

I was astounded to find that there were applicants who couldn’t answer these questions.

Not in the sense of, “I’m sorry, but I’d have to look that up” (though even that would be a little odd; these are things any Unix sysadmin should have engraved on their consciousness). No, this was in the sense of “A runlevel? Ummm… I think I’ve heard that term, but I don’t know those kinds of details.”

My only real quarrel with FizzBuzz is that, at this point, any developer worth their salt is familiar with it. And tired of it. It’d be nice to have a few slightly new and different tests of completely basic competence… but you know what? Any test that is so basic would have to be just as boring. That’s okay.

These tests are essentially saying, “Prove that you’re not lying on your résumé.” And while I may know perfectly well that I’m not lying, how is a total stranger to know that about me? I’m not bothered by the “trust, but verify” stance of modern interviewers, because there are so many people who do lie on their résumés (and fail at simple, FizzBuzz-style tests) that it would be lunacy to blindly believe applicants any more.

(What that says about our society is a topic for another post… a post on another blog. It’s outside Coyote Tracks‘ scope.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

In my ongoing job search, I’m sometimes asked by recruiters: “How many years of experience do you have with [name of some technology or skill]?” It’s a somewhat reasonable question when the item involved is a programming language or technique that I use every day, or at least every week. But there are far too many things that it just doesn’t work for.

For example, I can reasonably well say that I have 5 years of experience with AJAX: I taught myself AJAX in the summer of 2005, and have been using it pretty consistently since then. But how many “years of experience” do I have with SQL?

I started using it around 2002 or 2003, but if I say that I “have 7 years of experience” with it, I give the impression that I’m some kind of SQL expert… which is definitely not true. It’s the sort of thing I use about once every week or two. I’ll set up a database schema, maybe even type out some raw commands in a MySQL command-line client, and then I’ll just let whatever framework I’m using handle all the details for me.

So, what sort of answer should I give to the question? The sense in which I “use” (or “have experience with”) SQL is simply not the same as the sense in which I use things like JavaScript, PHP, or CSS. (The sense in which a DBA uses SQL is probably comparable to the sense in which I use CSS… but I can’t be sure, not being one myself.)

At least the idea of having “a year of experience with” SQL does make a certain sort of sense. What should I say when asked how many “years of experience” I have with XML or JSON? These aren’t really “technologies” so much as data formats. It’s like asking someone how many years of experience they have saving files in .txt or .doc format (as opposed to using Notepad or MS Word).

The only metrics that are worse than “years of experience” are: “When did you start using Technology X?” (which, thankfully, very few people have asked), and the utterly subjective “How would you rate yourself with Technology X, on a scale of 1 to 10?” (I need to write an entire post about that particular metric, when I get a chance.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Long before I learned to program — and long before the World-Wide Web was even a gleam in Tim Berners-Lee’s eye — I was introduced to typography by Douglas R. Hofstadter’s Metamagical Themas. In his chapter “Variations on a Theme as the Crux of Creativity”, Hofstadter presents a full-page figure that shows 56 different versions of the letter “A”. The 56 fonts he uses show versions of “A” ranging from the spare to the ornate, with every other variation in between.

I’d never realized there was so much variation just in one letter. I was converted into a fontaholic on the spot (though not so completely as my sister, who now designs typefaces professionally for a prestigious font foundry — way to go, sis!). But it’s easy to get too absorbed in the letters.

Like Debussy, who noted that “music is the space between the notes”, I’ve become enamored with the kind of typography that happens between the letters. It’s more important than you think it is, because: It makes your text easier for people to read.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Just under a month ago, an iPhone developer from Australia — one who’s previously defended Apple’s approval process — had his own app suddenly dis-approved by Apple. According to his blog post about the sudden revocation of approval, “I had convinced my company to take a gamble and make some apps for Apple’s Store. Tennis Stats had been a great success and we wanted to get on the iPad train with My Frame. Things were going well, new features were being planned money, real money was being invested. Then Apple pulled the pin”.

I could say all sorts of things about schadenfreude, or how the developer — who goes by the nom de plume “Shifty Jelly” — should have seen this coming. But the guy’s already having a bad enough month, and there are broader issues to examine. Among them the thought raised by commenter Erik K. Veland:

Remember when Apple cracked down on Podcast downloaders? It was because they themselves were introducing this very feature in iTunes.

[I] would surmise [that] Apple is now bringing “widgets” to their dashboard in the near future, and that they are pre-empting any apps conflicting with the “duplicate functionality” clause. [historical links, added by Kai]

Once you’ve considered Apple’s penchant for banning apps that compete with features that are built in to the OS, you’ve got to consider how this compares against other companies’ competitive practices.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

One of the biggest problems with Flash isn’t Flash itself. It’s Flash designers. More particularly, it’s Flash designers’ basic failure to understand why certain UI elements are the way they are. This leads to one of the most common Flash designer diseases: The drive to reinvent basic UI elements. Poorly.

Page Transitions

When a user clicks a link, they’re sending a specific message with a specific intent. That intent is “show me the information I’m interested in”. It’s not “show me a nifty animation effect that takes another 5 seconds out of my busy schedule”.

Users (rightly) consider page transitions to be the space in between what they’re actually interested in. Don’t force them to pay even more attention to them.

Reinventing Scroll Bars

This error is so common, and people screw it up so badly, that I’ve already written an entire post about it. However, I’d be remiss in not listing it here, as well.

Auto-Playing Sound

Speaking of things I’ve written about before… people have been complaining about auto-playing sound since Netscape Navigator first gave us the ability to include such an abomination, way back around 1994. Eleven years later, I listed auto-playing music as a “no-brainer”, in the sense that excluding it from your site should be a no-brainer decision.

Some people will apparently never learn.

Assuming Everyone Has Enormous Bandwidth

Yes, broadband is much more common in the United States now than it used to be. That means that people are less ready to wait a long time for your page to load, not more. And a designer, developer, or other professional who understands how HTML, CSS, and JavaScript work can arrange things so that at least part of the page (or AJAXified web app, or whatever) is usable when only part of the code has arrived at the user’s browser.

If it’s possible to provide the user with something more useful than a “Loading…” indicator before all the code has arrived, then why do Flash developers never actually do so? (This is a real, not rhetorical, questions, and an open invitation for Flash designers and developers to answer it.)

Here’s Why So Many People Disparage Flash “Designers”

For a trifecta of awfulness, check out the site for Alembic, a bar in San Francisco. On my fiber-optic, 6 Mbit connection, it takes nearly 10 seconds just for the site’s intro to load. Then, once the little rocks glass is full of liquor, the page blasts some sound at me — sound that doesn’t even convey any information. (Believe it or not, I already know what a crowded bar sounds like.)

Then there are the slow transitions from sub-page to sub-page. All told, it took me a ridiculous amount of time just to find out what their hours were. But for a true dose of awfulness, try clicking on “Menus”. Then try clicking on one of the other main menu items. The site’s “background” doesn’t even realize that there’s still a “window” open in front of it… even though both the “background” and the “popup” are just visual elements of the same Flash object!

The real kicker comes when you try clicking on one of the menu pages. Rolling over zooms them a bit, but clicking? Launches a PDF document! A separate one for each page! That zoom effect was apparently just a red herring, and trying to get the place’s full menu would require seven separate PDF downloads.

I suppose they could, somehow, have disrespected their users a little more. At least the page doesn’t literally throw a drink in the user’s face. Just figuratively.

Please, if you’re designing your sites in Flash, don’t make them like this. Don’t be the web equivalent of “that guy”.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Okay, so I’m a little late to the party in posting this. All the professional bloggers have already written about it, while I’ve been busy with my day job. Nonetheless, something that’s been on my mind since the beginning of the week, when it would have been timely:

I think Facebook has now hit its “cap”. People who don’t yet have Facebook accounts now seem to be saying, “I ain’t gettin’ one now!” Others who do have accounts are finally abandoning them. And I’m one of those abandoners.

I have a little bit of interest in the Disapora* Project, but I don’t think it will really take off. On the other hand, in a recent New York Times article about the project, both its staffers and backers have some things to say about just how quickly they managed to raise funding — and all of those things point to a very clear demand for an alternative to Facebook.

Facebook Co-Founder and CEO Mark Zuckerberg has lately been saying that privacy is no longer a social norm, but lots of people don’t accept this. In fact, many of us think that Zuckerberg is saying such things in the hope of making them come true, rather than as observations of something that’s already come to pass.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Think about some of the great Internet memes: (Warning: Most of these links have auto-playing sound.) All Your Base Are Belong to Us. The Viking Kittens, and Longcat (who is looooong). The Badger Badger Badger song. “Don’t tase me, bro!”, “I kiss you!”, and “Leeeeeeeroy… Jenkins!!!” Why do we get “Internet memes”, but not “radio memes” or “printing press memes” or anything else like them?

Let’s try a biological analogy: Imagine you had some microorganism that could only survive in a Petri dish full of agar solution, between 60 and 80 degrees Fahrenheit (roughly 15 to 25 degrees Celsius). Make it too hot or too cold, and this thing will die. Change its food supply to some other, less plentiful, sugar source, and it can’t continue to reproduce.

Wouldn’t this organism be destined to die out?

In the real world, sure. But it might be able to thrive in a specially engineered, very gentle environment, like a climate-controlled lab.

The Internet is just such an environment, but for data and memes instead of living creatures. It’s an environment designed explicitly to propagate information — with no regard to what kind of information it is.

When we say something is “an Internet meme”, what we really mean is “a meme that’s too unfit to survive anywhere else”. Some memes — like democracy, or the works of Shakespeare, or fashion trends or the latest commercial jingle or catch-phrase — can survive and thrive outside the Internet, but some could never have taken off without the Internet making it easy for them.

They’re like hothouse flowers. Calling something “an Internet meme” is effectively calling it “an idea that could only thrive in the Internet’s no-fail sandbox”. It’s not a compliment to the meme at all.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I’ve written before about augmented reality, Sixth Sense, and so on. Here’s a question: Is this really augmentation? As augmented reality takes hold, we’ll have more and more people wandering around looking at their smartphones’ screens rather than what’s actually in front of them. The smartphone delivers some extra information, of course, but it imposes a cost, too: the information takes a while to arrive; it takes attention to process; focusing on the screen means sacrificing practically all your peripheral vision…

It’s a trade-off, and I’m probably missing some aspects of it. What I’m wondering about, simply, is whether the trade is a net gain or a net loss.

Another way to put this — in harshly evolutionary terms, in fact — is: If someone with augmented reality and someone without it were competing for some life-or-death resource, who would win?

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Recently, a bunch of the blogs and journals I read (including my friends, not just big, famous sources) have had some bones to pick with Clifford Stoll’s 1995 Newsweek opinion piece, “Why Web Won’t Be Nirvana”. Stoll said: “no online database will replace your daily newspaper, no CD-ROM can take the place of a competent teacher and no computer network will change the way government works.”

A lot of people have been, effectively, pointing and laughing at Stoll’s failed prediction. I’d rather consider it a cautionary tale: The man who was so totally wrong wasn’t just a random pundit who didn’t know what he was talking about. He was Clifford Stoll — author of The Cuckoo’s Egg, a man who had been online for 20 years at a time when most people were just beginning to hear that there was a such thing as the World-Wide Web, and the man who traced German cracker Markus Hess through umpteen layers of insecure computer systems and networks.

In short, the man knew what he was talking about. He wasn’t a Senator Ted Stevens. If he could be so wrong, how much faith can I place in my own predictions about where the Internet’s headed?

But wait, there’s more — how wrong was he?

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Here are a few things that I consider to be basic requirements for functionality in a smartphone, along with notes on how my Palm Prē fails to deliver:

When I press the power switch, the phone should turn on.
(Assuming the battery is charged, of course. And I’m willing to accept that a modern smartphone needs to be charged every night. No problem there.) But given that, when I press the “on” switch, I should see the screen light up within, say, one second. It should not take ten seconds. By the time ten seconds go by, I’ll assume that I must not have pressed the power switch hard enough, and I’ll try pressing it a second time.

Did you know that the Palm Prē stores power-switch presses in its input buffer? That means that when the phone finally does get around to waking up, it processes the first impulse, lights up the screen… and then immediately blanks it again as it processes the second impulse. This is extremely frustrating.
When the screen lights up and shows me an “unlock” icon, it should actually let me unlock the unit.
I’m not complaining about the fact that it shows me that icon. I recognize that it’s there to conserve my battery life by making me prove that I’m a human being, and not an inanimate object that jostled the phone in a crowded purse or backpack. I’m fine with that.

What I’m not fine with is having to try three-to-five times to get the icon to recognize my input. And it’s not like the Prē stores this stimulus in its input buffer, so if I just wait for it to catch up… it blanks out the screen and I have to try again.

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

I went to find a package to install Git. The page at http://www.slackware.com/packages/ still says that the Slackware Package Browser has been moved to http://packages.slackware.it/ — it’s said this for years, and I keep wondering when they’re going to move the package browser back onto the main Slackware site.

But this time, when I followed that link, I found a page that’s so short, I can reproduce it in its entirety here:

The Slackware Package Browser

The old package browser was broken — instead of trying to fix it I am creating a new one from scratch. I’ll be using the Django framework. I’m also looking into Solr and Haystack to see if they can be of some use here.

It’s not going to take a lot of time and I will publish the working portions of the Package Browser as I finish and test them. Also, we’ll have some other thing to announce in a few days, so stay tuned ;-)

You should follow us on Twitter here.

The cherry on top of this sundae of fail awaits at the Twitter feed: the last tweet in it is from October 23rd, 2009. As of the time I’m writing this, that’s four months ago.

The one saving grace is that that last tweet includes a link to a web-browsable repository where I was able to download the package I needed. And yes, I do realize that Slackware’s essentially a volunteer project in Patrick Volkerding’s spare time. And I really do appreciate and love the distro’s commitment to remaining Unix-like.

But I need something that’s a little more rigorously maintained.

(Now I need to figure out what to migrate to. That’s likely to be quite a headache.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Right now, the question of what you need in a mobile computing platform is most often phrased in terms of “Do you need a netbook or a full laptop? Or perhaps one of the new high-end smartphones will manage?” I think the question isn’t one of capabilities as much as it is a question about how we access those capabilities.

For some people, the iPhone’s lack of a physical keyboard is a deal-breaker. For me, the smaller-than-standard keyboard on the average netbook is a powerful disincentive: If I had to use one, it would slow down my interaction with the netbook — and if I learned to be fluent and productive with the small keyboard, it might mess up my muscle memory for dealing with full-size keyboards on my “real” computers. It’s not a trade-off I’m willing to make.

The Palm Prē’s physical keyboard is tiny. I can only key it with my thumbs, and there’s no risk of interference with my pre-existing keyboarding skills. Inputting data with it is achingly slow, but offset by the device’s wonderful portability (it fits into a pocket even easier than an iPhone does). But I can’t really edit text with it, because there’s no D-pad to do precise cursor positioning with. Even the Orange+finger-movement trick is balky and awkward, in my experience; if I want to correct a single-letter typo, getting the cursor after the incorrect character so I can backspace and correct it is such an ordeal, it’s often quicker and easier for me to use Shift+Backspace to delete the entire word and then retype the whole thing.

In effect, even though the phone has the ability to edit text, the interface makes it so difficult that I can’t use the capability. It might as well not be there. What would a better interface mechanism look like?

Read the rest of this entry »

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

First things first: Never actually do this. This is just a fun curiosity, for amusement value only.

Because of the way JavaScript’s search() method works, you can do:

var my_url = 'http://kai.mactane.org';
if (! my_url.search(/http:\/\/kai.mactane.org/)) {
    alert("Your URL is http://kai.mactane.org");
} else {
    alert("Nope, your URL isn't http://kai.mactane.org");

Try running this, and it will correctly claim that “Your URL is http://kai.mactane.org” — even though there’s a ! at the beginning of the test. What gives?

That exclamation point looks like it’s saying: “If the search for http://kai.mactane.org within the given string fails…” But what that test is really saying is: “If the search for http://kai.mactane.org returns Boolean false — or anything that evaluates as Boolean false…”

What that search() call actually returns is the character index at which the needle is found, or -1 if it isn’t found. Since the needle is found at the very beginning of the haystack — at character index 0 — search() returns zero. Which evaluates to false in a Boolean context.

If the needle isn’t found, the search will return -1 — which evaluates as true in a Boolean context!

Effectively, the ! operator is reconciling the disagreement between search()’s idea of falsehood and if()’s idea of falsehood: search() returns -1 for a false result (a failed match), but if() considers -1 to be true, not false.

This trick only works with needles that you are sure will only occur at the beginning of the haystack.

Once again, you should never, ever actually write code like this for any serious purpose or in anything you intend to deploy in the real world. The maintainability problems are not worth the amusement of confusing all your co-workers with a test that looks reversed. Instead, use a positional anchor in your regex, and explicitly test against -1…

if (my_url.search(/^http:\/\/kai.mactane.org) != -1)

…like any sensible JavaScript coder. (Yes, that last bit is intended to be ironic. I wrote something once about the silliness of having to add that extra test; I’ll have to see if I can find it and republish it here. )

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

Different people use applications in different ways. Sounds simple and obvious, but how often do you look at the real implications of it? Just to take a simple example, let’s suppose you’re using Windows (pretty much any recent version), and you want to perform a simple task: Exit the active application. How many different ways might a user do that?

  1. Alt, F, X (that is, “tap the Alt key and release it, then hit F, then X”)
  2. Alt+F, X (i.e., “hold Alt while pressing F, then release both and press X”)
  3. Alt+F4
  4. Alt+F, up-arrow, Enter
  5. mouse-click on “File”, move down and mouse-click on “Exit”
  6. mouse-click the top-right corner “x” button
  7. in some apps: Ctrl+Q (this is particularly likely if the user has just migrated over from the Mac world, or often has to switch back and forth)

Seven different ways of doing this simple action. I could come up with similar lists for “save the active document”, “copy and paste some text”, and other common actions. Note that Save, Cut, Copy, and Paste are often found on toolbars, unlike Exit, so that makes another way-of-doing-it that’s not on the previous list.

If you want your application to be perceived as “intuitive” or “user-friendly” by all of your users, rather than just a narrow range, make sure that the first thing the user tries works just like they expected.

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

If you haven’t been getting as much email as usual this past week, the culprit may be SpamAssassin. It turns out that SpamAssassin 3.2.5 (the current version, released in June of 2008) has a Year 2010 Bug.

The problem lies in the core configuration file 72_active.cf, which contains a wide variety of “currently active” rules. On line 543, it says:

header FH_DATE_PAST_20XX Date =~ /20[1-9][0-9]/ [if-unset: 2006]

For those who don’t read regular expressions, this rule will match any Date: header that contains a string like 201x, 202x, 203x, etc., where “x” could be replaced by any digit. So, back in 2008, this rule would catch email that claimed to hail from the year 2010 or later. (Well, up to 2099.)

Starting on the morning of last Friday, this rule started triggering on pretty much all mail that hadn’t been delayed, thus adding 3.384 points to every piece of incoming email. Naturally, this could easily push mail over the threshold from “not spam” into “spam” when it doesn’t belong there.

If you’ve been expecting some mail that hasn’t arrived, and your mail host uses SpamAssassin, you might want to check your spam folder.

According to a note on the SpamAssassin project’s main page, you can easily correct this problem in either of two ways:

  1. If your system is configured to use sa-update, run it now.
  2. Remove the FH_DATE_PAST_20XX rule altogether by putting “score FH_DATE_PAST_20XX 0″ at the end of your local.cf file.

Alternatively, if you’re the mail administrator, and you don’t mind setting up a Year 2020 Bug for yourself, you could always change the part that says Date =~ /20[1-9][0-9]/ so that it says Date =~ /20[2-9][0-9]/ instead. After all, stuff that claims to be from years in the future (or past) is likely to be something you don’t feel like reading. But if you do this, I strongly urge you to find some way to send yourself an alert around December of 2019, warning yourself that you need to fix that problem. (And that may be easier said than done.)

Originally published at Coyote Tracks. You can comment here or there.

kai_mactane: (Default)

This is rapidly becoming one of my pet peeves, right up there with misuse of the word “literally”:

This thing I’m writing right now? This single entry in my blog? This isn’t “a blog”. It’s “an entry” or “a post”.

Sort of like that piece of paper in a book is a page, not a book.

“Writing a blog” is like writing a book, or a novel. Don’t tell me “I wrote a blog yesterday”; you wrote in your blog. Jeff Atwood writes a popular coding blog. A few days ago, he wrote an entry about…

I’m fighting a losing battle, aren’t I? But I really dislike the ambiguity of having “blog” mean “a single thing” or “a collection of that thing”. I have no problem with language growing and changing (after all, the word “blog” didn’t even exist 15 years ago), but I’m firmly against making language messier and more awkward to use and understand. I don’t think the people saying “I wrote a blog yesterday” are adding anything; I think they’re just being sloppy.

Originally published at Coyote Tracks. You can comment here or there.


kai_mactane: (Default)

July 2011

101112 13141516


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 23rd, 2017 08:37 pm
Powered by Dreamwidth Studios