Drivel 2.0 and Ubuntu

Bill talked about Drivel, a GNOME application for posting to your blog. I tried the current version in Ubuntu but was confused when it only appeared to support LiveJournal. I caught Bill on IRC and found out he had to built the latest version of source to get it to work with his blog.

Get your Drivel 2.0.1 .deb (tested for Breezy) here. The official version of the latest Drivel should hit Breezy at the next sync but this will work in the meantime. Note that Drivel doesn’t have an explicit option for WordPress. Just choose Moveable Type and point it to http://your.blog.com/xmlrpc.php

C# Gripe: enum base types

As a whole I love C# but sometimes I find some quirk that I just don’t understand. I’m sure there is a reasonable explanation of why it works the way it does but I don’t know what it is.

I was building a Gtk.TreeView last night and setup an enum for each column in the TreeView. No big deal, right? The enum looks something like this:


enum Fields
{
enum1 = 0,
enum2,
enum3
}

Then, to build the column I do something like this:

TreeViewColumn col = new TreeViewColumn ();
CellRenderer NameRenderer = new CellRendererText ();
col.PackStart (NameRenderer, true);
col.AddAttribute (NameRenderer, "text", (int)Fields.Keyword);

Notice on that last line that I have to cast the enum member to an int, even though the type of the enum is int, you still have to cast its value.

You can specify the base type of an enumerator, but it defaults to an int. You could do this (and I tried) but it doesn’t change anything:


enum Fields : int
{
enum1 = 0,
enum2,
enum3
}

It would be nice to not need to cast the value of the enum, especially given the ability to explicitly set the type of the enum. I don’t know the internals of how the compiler works nor have I read the CLR specification. It’s just annoying to to tell an enum that it’s an int, only have to remind it of that fact every time you use it.

MailScanner Bliss

Spam is a huge problem for everyone. Running a mail server these days is particularly painful. Spam, viruses, and phishing are enough to drive me insane. Our spamassassin + amavis solution worked well for a while but something changed recently that made it a total bitch to keep running. Amavis would just hang randomly and mail would just sit in the queue until I noticed it. I was complaining about it to Jorge and he mentioned that he migrated to MailScanner.

MailScanner does some rather nifty things like act as a gateway to all sorts of mail filtering, like spam, phishing, and viruses. It basically calls whatever application you want to use for filtering, but also does things like making sure the filters don’t hang or take too long. The configuration might take a while to get right but it’s easy to follow and well-documented. In the week or so since I installed it it’s run rock solid. The only problem I had was a misconfiguration, not enough child threads to do the work so it fell behind. It never just hung or stopped working, though.

One of these days I’ll get around to writing something about the entire mail setup we are using.

John Ratzenberger in Star Wars

We watched Empire Strikes Back tonight. While the end credits were rolling by we noticed a familiar name scroll by: John Ratzenberger (who reminds me of John Fleck for some strange reason) aka Cliff Clavin on Cheers. We were shocked that we’ve seen this movie literally hundreds of times and never noticed him.

I found a copy of the script. Here are his two lines:

DERLIN: Your Highness, there’s nothing more we can do tonight. The
shield doors must be closed.

He turns to the lieutenant.

DERLIN: Close the doors.

We had an “oh duh” moment as soon as I read that. Kinda cool.

Monodevelop 0.7

I finished off my daily TODO list at 2am this morning, including a new edition of Linux.Ars.

To celebrate, I wanted to start work on a little app I’ve been thinking about writing. I was about to fire up MonoDevelop when I noticed that the current version in Ubuntu was 0.5.1, but the latest stable version was 0.7.

The only major gripe I have with Ubuntu right now (and this isn’t anyone’s fault; Tseng rules and has done an awesome job getting Mono stuff into Universe) is that the Mono stuff is nowhere near as current as I want it to be (Hoary ships with 1.0.5). Mono 1.1.7 hit Breezy (the ultra unstable branch) recently, but even that is not without problems. I grabbed the latest tarball of MonoDevelop. It needed a newer version of gtk-sharp. The configure script for gtk-sharp couldn’t find a working Mono environment for some reason and fell back to looking for the Microsoft compiler csc.exe.

I decided to grab the latest installer for Mono. Very nice, by the way. I installed a fresh mono environment in my home directory and pointed gtk-sharp to it. That worked like a charm. I had to build newer versions of that, gtksourceview#, and gecko#, and then on to MonoDevelop.

MonoDevelop 0.7

I haven’t really kicked the tires yet but I can say that it feels faster than 0.5.1. It still amazes me at just how fast the Mono community works. It doesn’t seem like it was that long ago I was evaluating a pre-1.0 mono. Today, I use Tomboy heavily, I use f-spot to manage my photos (and I even wrote a patch for it that was accepted upstream), and Beagle to search for files. You guys rock.

Posted in Uncategorized | 1 Reply

Professional Courtesy

So I sit down tonight to make some layout changes to a client’s website. The changes were minor, moving a form from the bottom of the page to the top and shifting some data around. No big deal, right? The code in question involves some external javascript code supplied by a third-party vendor. No big deal, I thought. Famous last words.

I move the code around and refresh the page. There is significant lag while the browser tries to render the form. Odd, I think, but maybe the server the javascript is being pulled from is slow. Better to pull the javascript local, right? I pull the code down and crack it open, with the intent of either embedding it directly in the page or at least pull it from a local file.

Holy shit what a disaster.

The file consisted of 5 lines of code, only one of which was actually necessary. The problem was that the single line was approximately 46,838 characters long. Yes, you read that right: 46,838 characters.

Let this serve as a public plea to anyone who develops web applications in any form: For the love of all that is sacred, never, ever, neglect the endline. Endline characters are my friend. They should be your friend, too. If you can’t grasp the fact that an application, especially a web browser, might have problems handling FOURTY SIX THOUSAND characters without a line break, then I have one favor to ask: find a new line of work. People like you make it more difficult for people like me to do my job. Sure, I get to play the part of hero when I show my client their “new and improved website” that loads an order of magnitude faster because I simply applied sane whitespace rules. At the end of the day, however, I would rather spend my time doing my job and not cleaning up your crap.

Wifi for everyone — Penguicon-style

I rolled into the hotel for Penguicon around 2pm today. Got checked in and inquired about wifi access. Last year they had arranged for free wifi access for the weekend. This year, however, the hotel is only offering us $5 coupons per day, for 24 hours of access. When the clerk was getting my coupon, I glanced at the stack and noticed that some of the numbers were the same. I promptly setup a ad-hoc wifi network so that the rest of the gang could use the internet.

Later that night, when Kyle got his coupon we confirmed that the coupon numbers are identical. Ineptitude rules.

Flickr and f-spot

I went to export a picture from f-spot to flickr this morning. The export failed and reported a problem logging in. Naturally, I double-checked my password and tried it a few more times without luck. Flickr had recently made some changes on their end, so I killed f-spot and fired it up in a terminal. Sure enough, somewhere during the login process it was throwing an integer overflow exception. Flickr is just too cool to be held back, so I grabbed f-spot from CVS, found the bug, wrote a patch, and saw it get committed this morning.

It’s a good start to the day so far. A meeting with a client I expected to last more than an hour took all of 10 minutes and I feel pretty good considering I was up until 2am trying to downgrade my laptop from Breezy to Hoary (and subsequently repair udev) to troubleshoot a smbfs issue.

Hopefully this bodes well for my productivity at Penguicon. I’m going to be hacking on some Mono apps all weekend, if all goes as planned.

What am I?

Once upon a time I used a wireless ISP. I dropped them when I was able to get cable. I got to keep the hardware, since I had to pay for it. I pulled the access point out of the attic and disassembled it. It uses a nice Senao PCMCIA card, which I’m currently using for wardriving. I’d like to figure out how to program this embedded device, though. It’s got a flash chip on it, but I don’t know who made it so I don’t know where to start.

What am I?

The only identifiable markings I can find is “3752-030000010” printed on the circuit board and “8520-203000UFO-R03 BP27001 01629” on a label attached to the board. Anyone have an idea what this might be?

Flickr

I’ve been using Flickr for a while now. I was getting frustrated with my old gallery, so I decided to stick with Flickr and signed up yesterday. Hours later they cut their prices. I was just about to send them an email when I noticed something very cool:

We’ve extended the length of your pro account to double whatever you originally paid for! So, now your pro account will expire on 18th April, 2007. You can check on your account if you wish.

But wait! There’s MORE…
You also have 2 FREE Pro Accounts to give away!

So in addition to the doubled bandwidth for uploads, they’ve given me an extra year, plus two Pro accounts to give away. Sweet!