Two Things

Two things of note, both of which amount to this: What the hell is wrong with us?

1. Starbucks has really awful coffee. What the hell is wrong with you people?

Seriously. I’ve never had a good cup of coffee (or a good tall of coffee, or grande of coffee, or venti of coffee, or whatever the hell they want to call it) at a Starbucks. Never. It always tastes a little burnt, and it’s always too goddamned hot even to hold the cup, even with one of those little wraps designed to make hot coffee cups holdable. I can only imagine that it’s their mixed drinks that people are after…but if the fundamentals of the mixed coffee drink are not sound, how in the hell can the mixed drink even taste good, except by masking the goddamned coffee? So why not just chug a Mountain Dew or whatever? Go ahead and warm it up and add some cream if you need to.

And yet—AND YET—this morning, driving home from the airport, there’s some backed up traffic at Broadway and Campbell. “Hm,” I think to myself. “Must be an accident.” Yeah, well, it kind of was an accident. An accident of marketing. These people are backed up waiting to get into the Starbucks parking lot! And it looks like it’s two goddamned lines in, merging into one! What the fuck is wrong with you people? Seriously, if it’s 7:30 in the morning and I want coffee, I’ll be fucked if I’m gonna wait in line. I’m getting coffee at 7:30 in the morning because I need a fucking cup of coffee right now!

7-11 never has a line. Circle K never has a line. And it tastes better. And there are more of them than there are of Starbucks. They surround them.

Also, punch line: The very same intersection has a Safeway kitty-corner across the way, at the southeast corner. That Safeway? Yep, it has a Starbucks in it. Lewis Black wasn’t kidding. You can, even today, walk out of a Starbucks and see another Starbucks.

I’m enjoying a delicious cup of Diedrich French roast right now. It’s tasty. I had to wait a whole 40 seconds for it to brew in my Keurig. In a few minutes, I’m gonna grab a delicious cup of Timothy’s cinnamon flavored coffee. Suck on that, you chumps waiting in line at Starbucks.

2. Check out the grocery store pop (“soda”) aisle. What the hell is wrong with us?

I was at that Safeway (not getting coffee, thank you very much) and ventured into the pop aisle. “Soda” for you heathens not from MN. You know what I saw?

I saw an entire aisle with pop on one side and snack chips on the other.

Repeat: The whole goddamned aisle was pop on one side and snack chips on the other.

Please consider that for a moment. Where do I even begin? Well, aside from the obvious two-word declaration: We’re fucked.

(The crackers, popcorn, and mixed nuts were in an entirely different aisle, by the way.)

3. Bonus Thing of Note

Grocery store salsa is pretty damned good. And in great variety.

If only I could find some chips to go with it…


JFreeChart’s (Ab)Normal Distribution Function

I’ve got a long-running project that’s very nearly completed, in which I’m converting some old IDL code to Java for the modeling of Martian photometry as observed by HiRISE. I use JFreeChart in this project (and all of my projects that require charts, in fact).

I happened to be digging into the source code for the NormalDistributionFunction2D class and I found this piece of madness:

public double getValue(double x) {

  return Math.exp(-1.0 * (x - this.mean) * (x - this.mean)

    / (2 * this.std * this.std)) / Math.sqrt(2 * Math.PI

    * this.std * this.std);


“std” is the function’s standard deviation, set at construction.

The madness is in the denominator of the function: the square root of…a constant times the standard deviation squared. Isn’t that just the standard deviation times the square root of a constant? And the square root of a constant is itself a constant.

So why isn’t the denominator just a constant times the standard deviation? Why have four multiplications in there followed by a call to the math library? This expression is evaluated every single time the NormalDistributionFunction2D’s getValue method is called!

Because the standard deviation could be negative! Wait, what? No, it can’t. Even if there was some sense to it, the only computation in this code involves squaring the standard deviation, effectively stripping it of its sign. The denominator really ought to be a pre-computed constant times the standard deviation.

Also, since the class doesn’t let standard deviation be changed after construction, the entire denominator can be pre-computed at construction, as can the denominator of the exponent used in the numerator. Neither component ever changes once the object has been constructed.


This is in version 1.0.10 of JFreeChart, by the way. Maybe it’s been fixed by now. I probably ought to be a good open source citizen and submit a fix myself if it’s not been fixed.

Client Tests

I’m not exactly a fan of the various built-in posting tools for the blogs. I’m referring to the browser-based forms you typically fill out to create a new or edit an old post. I prefer a standalone app, so I’m giving several of them a test drive.

I’ve got two basic desires, aside from the whole offline storage thing:

  1. I want a built-in word counting widget. I have in mind a few uses for this blog (or others) in which word count might be important.
  2. I want the text editor to behave like a Mac rich text editor. In fact, I want the editing pane to be the Mac rich text editor. I want the usual rich text widgets. I want the usual keystrokes (command-B for bold, thanks very much).

I tried five such apps out while using a Blogger (that is, a Blogspot) blog I started up, to limited success. Not a single one of them seemed to perform worth a damn, yet two of them (MarsEdit and Ecto) are always mentioned as the clients to use. On a whim, I tried them out with a WordPress blog, too—one installed locally on my laptop, unavailable to the web.

Surprise, surprise, surprise. The annoying problems I was having with Ecto and MarsEdit vanished! It looks like at least some of the problem was not with the client but with the host.

So I switched to a blog, and here I am about to run the same tests.

First though… Gah, duh. I’ve always loved WordPress, since the day I saw it. It. Looks. Pretty. I don’t mean the themes, though some of them are quite pretty in their own right. (I’m fond of Garland, for example.) I mean the text. The text. Is. Pretty. One of the things that appealed to me was that it did automatic ligatures, plus it does automatic smart quotes. Smart quotes, okay, fine. Ligatures, though? Nice. Massively nice. They’re a minor detail, but they help make computer rendered text look like professionally published text (though more and more paper publishers seem not to be using them, for shame). The text just looks nicer.

(As an aside, it looks like WordPress is not automatically making ligatures. Still, the typography of the few themes I’ve used is lovely.)

Plus, the whole presentation is better. The Dashboard, for instance, by which one customizes and manages one’s blog, is beautiful. It looks like it was professionally designed, by the kinds of people who do professional graphic design work for Apple, not for many of those other platforms. (And I’m not just referring to the stuff from Redmond. Too many platforms look to me like they were designed by amateurs. I include the stuff from Mountain View, and I’m not talking about NASA Ames here.)

So yes, WordPress is beautiful. Yes, that matters. This is a visual medium, both the reading of the blog posts and the creation/management thereof. If it looks like an amateur put it together, it’s hard to read. (Not to give amateurs a bad name.)

Second… Well, second is that the built-in WordPress post creator/editor seems to do what I want! It’s got a word counter right there! I’ll be damned! And the editing pane is indeed a fine, fine, fine rich text editor, with all manner of lovely (and good looking) widgets for managing the richness of the text. Nice!

The main drawback is that it’s browser-based, which, yes, means it’s agnostic about keyboard shortcuts. And you know what that means: Command-B does not make bold. It’s Control-Alt-Shift-B, which is not exactly a natural keyboard shortcut for a person used to a particular platform. I really dislike this fact.

It also doesn’t do offline composition and storage, of course.

On the other hand, it. Looks. Good. And it has much of what I want anyway. And it’s not an extra cost; the cheapest of the apps I’ve looked at (other than the free one) is $18. The built-in editor here in WordPress is part of the package. And it’s pretty much guaranteed to work perfectly well with WordPress itself, of course.

And if I really want offline storage? Well why not work in an another app entirely, one that’s not trying to be a blog-posting client? Apple’s TextEdit is a perfectly good example of a functional rich text editor. Something like Journler or Scrivner or Voodoo Pad would work just as well, since all three use the very same rich text editing pane. Each of them has its own means of storing files within a larger framework, too, meaning I wouldn’t have to save offline posts in separate files, which could get cumbersome to manage. (And each has its own built-in word counter.)

So perhaps I don’t even really need to bother with an offline client.

Still, here come some tests. I intend to test their basic functionality, their handling of slightly complex entities like lists (ordered and unordered), and their image management functionality. This latter may be more difficult than I’d like; earlier tests on the Blogger platform with one of the clients (I forget which) wanted me to post the uploaded image to Flikr. Bzzt. Not gonna happen. If I happen to want to post a Flikr image here, fine, but I don’t want to be forced to upload images to Flikr. WordPress has hosted image storage, so presumably the clients can deal with that fact.

Let’s introduce the apps, in no particular order:

  • WordPress built-in editor
  • Ecto
  • MarsEdit
  • MacJournal
  • Blogo
  • Flock

Two of them, Blogo and Flock, didn’t pass my most basic of tests, for various reasons. Blogo had some annoying ideas of how a user interface should function, and while that’s not automatically a bad thing, when it actively goes against the normal operation of standard menu items, forget it. (It presented no difference between Save and Save As.) Plus the basic UI just didn’t look good to me.

Flock is based on FireFox, and I’m very sorry to have to say this, but I hate FireFox. When FireFox looks like a Mac app, and not like an app trying to look like a Mac app, I’ll be happier. Of more substance, though, Flock kept flagging contractions as misspelled while I was typing, until I got to a new line. Lame. (And it’s FireFox. Yech.)

So… On to the other clients.

Posted in Apps. Tags: . Leave a Comment »