Afghanistan and Iraq, August 2010

Military deaths were down a bit in Afghanistan this past month, but not much Coalition deaths passed the 2000 mark, with little more than a brief mention in the news. I can’t stand thinking that the man I voted for is prolonging this war because of domestic politics, but I don’t know what else to believe. Obama doesn’t really expect anything good to come out of this war, does he?

As for Iraq, no real changes.

Despite what I said last month, I’ll probably continue to plot the Iraq data for the “residual” forces. 50,000 is a lot of advisors.


Elements v. Simplenote, Round 2

Last night, I was going to write a post comparing Simplenote to Elements. I’d already written a brief comparison of the two, but that was before the release of Simplenote 3. It seemed only fair to take into account the improvements in it.

But instead of writing the post, I got hooked on watching YouTube videos, and pretty soon the evening was gone. That turned out to be a lucky break, because when I opened iTunes today, I found that Second Gear had just done a small update to Elements. So now I can compare the latest and greatest of both apps.

If you’re the impatient type, here’s the bottom line: although I haven’t deleted Simplenote from my iPhone, I’ve stopped using it. All my notes are done in Elements now.

Simplnote

The primary new features in Simplenote 3 are:

These additions don’t address the downsides of Simplenote I mentioned in my earlier comparison:

  1. Its own syncing solution, which forces you to use either a web browser or a restricted set of applications when you want to access your notes from a computer.
  2. No option for a monospaced font. Some text files are just better suited for display in a monospaced font.

Elements

The big change in Elements is that you can now use any font on the iPhone, not just the “Roman” versions. I immediately switched from Courier to Courier Bold. The font looked ridiculously thick at first because I’d gotten used to the spindly look of plain Courier, but now it seems OK, especially when combined with the Silver background.

There’s no question I’d prefer a nice sans serif monospace font, but unless there’s a way for Second Gear to package a font with the app, we won’t see a really good looking monospaced font in Elements until Apple gives us one.

Elements is not without its problems.

These problems, though, don’t come close to outweighing the great simplicity that comes from Elements’ Dropbox syncing. I can use any text editor on my computer to create a file, save to the special Elements folder within my Dropbox folder, and it’ll be available in Elements on my phone in a minute or two. And for files edited in Elements, the syncing is just as automatic in the other direction.

Wrapup

As I said in my initial comparison, the two things that set Elements apart from Simplenote are:

  1. The text editor freedom provided by Elements’ Dropbox syncing.
  2. The ability to use a monospaced font to align columns in certain files.

That Elements can now display its notes in a font that actually looks black instead of light gray is just one more step ahead of Simplenote.

It’s true that Elements is $5, whereas Simplenote is free, but if that’s your overriding consideration, you might want to reconsider your priorities.


Checkcards on Github

My library loan tracking scripts, checkcards and checkcards.py, stopped working this weekend. After a bit of debugging, I came to learn that the library—or, more accurately, its software vendor—had snuck in a new <span> tag at the ends of magazine titles. My Python/BeautifulSoup code wasn’t expecting this and choked on it.1

The fix was fairly simple, but as I was editing checkcards.py, the Python script that does all the heavy lifting, I got a little too aggressive in tearing out the old code and had to reconstruct some of it from memory. It was then that I realized that I’d never put the checkcards scripts under version control. Now I have.

In addition to the README, the GitHub repository has three files:

My login information has been redacted, and the README tells you how to customize it for yourself. Frankly, I doubt that this will be useful to anyone who doesn’t use the Naperville Public Library, but who knows? I think it makes pretty good use of the mechanize library to interact with web pages.


  1. I swear this paragraph makes perfect sense. 


Never mind the crackpipe

Instead of writing a post on how the new version of Simplenote stacks up against Elements, as I’d intended, I spent the evening watching old episodes of Never Mind the Buzzcocks on YouTube. And found, in a show from the spring of 2004, a young, cute, and thoroughly delightful Amy Winehouse.

Sometimes goofing off pays dividends.


Spew

This column by Frank Rich in today’s New York Times has been mentioned favorably on some liberal blogs, but I don’t think much of it. First, it’s derivative of Jane Mayer’s recent article on the Koch brothers in The New Yorker. More important, it has some really tone-deaf passages.

Here’s the first:

Only the fat cats change — not their methods and not their pet bugaboos (taxes, corporate regulation, organized labor, and government “handouts” to the poor, unemployed, ill and elderly). Even the sources of their fortunes remain fairly constant. Koch Industries began with oil in the 1930s and now also spews an array of industrial products, from Dixie cups to Lycra, not unlike DuPont’s portfolio of paint and plastics.

Spews? Why use a derisive verb to describe a company that actually makes things? That’s something of a rarity in the US today, when everyone seems to want to be in the business of buying and selling money. Sure, if the company violates pollution laws, spews is a great word for what it puts into our air and water. Or if the products it makes are junk, then spews would fit the bill. But there’s nothing wrong with Dixie Cups and Lycra, or paint and plastics.

Make no mistake: the Kochs are evil bastards. But they’re not evil because they make Dixie Cups.

The problem here isn’t just that Rich is being stupid; it’s that he’s being stupid in a way that plays into conservative stereotypes about liberals. Frank Rich is a liberal elitist who thinks he’s too good for Dixie Cups, so he bashes the Real Americans who make them.

In the next paragraph, Rich mentions the Mayer article and pushes the stereotype again:

Her article caused a stir among those in Manhattan’s liberal elite who didn’t know that David Koch, widely celebrated for his cultural philanthropy, is not merely another rich conservative Republican but the founder of the Americans for Prosperity Foundation, which, as Mayer writes with some understatement, “has worked closely with the Tea Party since the movement’s inception.”

So first he slams the “fat cats” and in the very next paragraph he reports on a “stir” among the Manhattan charity ball crowd. Darling, did you hear our David associates with those dreadful Tea Party people? Worse yet, I hear he makes Dixie Cups.

Frank Rich knows the culture wars well enough to avoid crap like this. He’s presenting liberalism as a conservative cartoon.


Benchmarking password generation

In my recent post on password cracking, I mentioned in passing that I thought the values in this table of password generation times were a little high. In today’s post I’ll show why I said that and also prove that I can program, albeit clumsily, in C.

The table came from this LifeHacker article by John Pozadzides and purports to show how long it would take to generate all possible passwords of various lengths. Implicit in the table’s construction is the assumption that each password takes one one-millionth of a second to produce. Pozadzides says this represents what “an average computer” can do.

I thought that was a little slow, so I wrote this program to check it out.

 1:  #include <stdio.h>
 2:  char pw[] = "12345";
 3:  int i, j, k, l, m;
 4:  
 5:  int main(){
 6:    for (i=97; i<123; i++) {
 7:      pw[0] = i;
 8:      for (j=97; j<123; j++) {
 9:        pw[1] = j;
10:        for (k=97; k<123; k++) {
11:          pw[2] = k;
12:          for (l=97; l<123; l++) {
13:            pw[3] = l;
14:            for (m=97; m<123; m++) {
15:              pw[4] = m;
16:              printf("%s\n", pw);
17:            }
18:          }
19:        }
20:      }
21:    }
22:  }

A few things to note about this program:

  1. It’s written in C, a language I’ve actually taken a class in but haven’t programmed in in years. The logic of the program was a snap, and I’d even remembered the format for the for loop (probably because of my years of Perl programming), but I’d forgotten a lot of the basics. Like how to declare a string and that a program needs a main function. Fortunately, this kind of information is just a short Google away.

    So why did I use a language I’m unused to? Because I didn’t want the overhead of an interpreted or semi-compiled language. A real password cracker would certainly be compiled.

  2. It’s written specifically to generate lowercase passwords five characters long. A more general program would probably use a recursive function, but I didn’t want to spend the time or effort to do that.
  3. It does print the generated passwords to standard output in Line 16. Omitting that line would make the program run faster, but I didn’t think that was a fair test, as the purpose of a password generator is create a list of passwords for later testing.

I compiled the program with gcc and then timed its run with the time utility. Here’s the session on my old 1.2 GHz PowerPC G4 iBook (the dollar sign is my Terminal prompt):

$ gcc -o lower5 lower5.c
$ time ./lower5 > pw5-c.txt

real    0m8.451s
user    0m3.206s
sys     0m0.998s

Now you see why I said Pozadzides’ numbers looked slow. Even a creaking, ancient, six year old machine can whip up a list of passwords in less time than his table says.

After writing the post, I compiled and ran the same program on my 2.16 GHz Intel Core 2 Duo iMac and got these timings:

real    0m1.666s
user    0m0.835s
sys     0m0.282s

This computer—which I consider to be my “new, fast” machine, even though it’s nearly four years old—generated passwords nearly an order of magnitude faster than the “average computer” of Pozadzides’ table.

None of this is meant to dispute Pozadzides’ main point, that longer and more complicated passwords are much harder to crack. Nor is it meant to suggest that passwords have become easy to crack with modern computers. Just don’t believe everything you read, and when you can easily check something out, you should.