Voted

Popped down the street to my place of voting. Lines were nice and short — for my little chunk of the alphabet anyway. There was another line that was nearly out the back door of the school, but I got right up to the registration desk.

When I got there, they asked if I wanted a paper ballot. Yes, yes and yes! For those who don’t know, those touch screen, paperless voting machines scare the hell out of us programmers, for a variety of reasons that have been well covered elsewhere.

Fill in a couple of bubbles with the provided pen (just a cheap bic) and run it through the scanning machine, and you’re done. No muss, no fuss. And it works if you lose power.

Now, off to spend the rest of the day pretending to work, instead of watching poll results like one of pavlov’s dogs …

athas.org gone live

So, I finally pulled the trigger this weekend: Athas.org is no longer written in PHP.

I’ve been working on a Rails based re-write on-and-off for the last few months, and we’ve been using the new site internally, as I work through various different approaches to the project.

By far, one of the trickiest things was figuring out how to deal with file distribution and versioning. Shipping out files, PDFs primarily, is the entire reason for the site[0]. We tend to do multiple releases of the same product — beta/playtesting releases, followed by revisions, followed eventually by a “final” release. (I put final in quotes, because we can always go back and revisit a product) …

I wrestled for a long time with how to manage this versioning issue; I’m still not necessarily satisified with the current solution. Which is: A product (which contains multiple files) is what holds the current status — Internal, Beta, Final, Under Review. Files are associated with the product, but aren’t really tracked themselves. They’re either public or private (for purely internal development files) and can be archived. Basically, the product is a big bucket for all of the associated files, but the file records themselves are “dumb”.

It seems to work out well enough. Time, I suppose, will tell.

[0] For the moment; I do plan on making a much more web-based interface for distributing 4e material in development.

Rubyconf

I’ll be heading to rubyconf this weekend, along with about half of my project team.

We’ll see if I actually blog anything, since I didn’t write a damned thing about Railsconf.

Printing error in IE

So … that was fun.

Bug report gets filed about the application at work. It seems that there’s an error that crops up when you print from IE. The error, of course, being the characteristically unhelpful dialog of garbage that IE likes to throw at you. After a bit of digging, it got even better. I was hoping I’d be able to respond with something technically snotty, like “Do you have your printer installed?”

But, I managed to reproduce the bug. Even better, I managed to narrow down it’s occurance. It turned out that when you were logged in, the error would occur, but only if you were logged in. Now that’s strange, since we’re using application level (cookie based) authentication — IE wouldn’t know anything about your logged in state. Everything works fine in Firefox (of course, the browser with good diagnostic tools doesn’t show the problem …)

So, in stumbling around trying to find some clue as to what the problem is, I came across this … It seems that id="tags" ends up conflicting with some builtin function in IE that’s used in printing. Sure enough, we had a field with <input name="tags" id="tags" type="text"> that was wrapped inside an if logged_in? check. Renamed the field, and printing now works like it’s supposed to.

So, what could have been really long and painful was short circuited by a lucky find in my net searches. No thanks to IE, it’s non-reserved reserved fields and opaque error messages. Have I mentioned lately how much I hate IE?

Oracle and rails 1.2.1

Grrr … So, in the course of updating to rails 1.2, it seems that the automagically generated names for database indexes were changed. Went from “#{table}_#{columns}_index” to “index_#{table}_on_#{columns}” … an annoying little change that bumps me up against some sort of Oracle column name length ceiling. And has the effect of probably breaking down migrations.

So, I’m gonna jump into the migrations and patch the existing add_index calls to specify a :name => value for all of the existing indexes, so that migrations will actually work and leave me with a database that matches the one in production ….

Figuring out why I suddenly couldn’t build my test database was not exactly the way I meant to spend the last hour ….

Update

Changeset 4768 is responsible for all this. Apparently, to allow reverse parsing of the indexes from the index name. Not alltogether a bad goal, but it still breaks down migrations … (thanks to Devin for find this one)

And, I discovered another problem last night. Seems that all of my text fields have a default value of “empy_clob()” … not the function, but that actual string. Sort of trashes one’s assumptions about unset fields. Apparently (thanks Roy) this has been worked out in ticket 7344 and already applied to Edge. Some sort of thing that only applies to Oracle, because, of course, nobody tests Rails on Oracle, it’s all MySQL. And I can’t really look into the patch attached to the ticket, because I keep getting Trac errors. Shaping up to have been a lovely adventure …

update
Finally got through to the site, and worked out a monkey patch to fix this. For those of you who might be running with oracle, and can’t upgrade to Edge (gee, wonder why not) the patch is below. This is a temporary thing, given that the ticket is closed, and will hopefully be fixed in 1.2.2 …
[ruby]
class ActiveRecord::ConnectionAdapters::OracleColumn
attr_writer :default
end if defined? ActiveRecord::ConnectionAdapters::OracleColumn

class ActiveRecord::ConnectionAdapters::OracleAdapter
def quote(value, column = nil) #:nodoc:
if value && column && [:text, :binary].include?(column.type)
%Q{empty_#{ column.sql_type.downcase rescue ‘blob’ }()}
else
super
end
end

alias columns_orig columns
def columns(*a)
columns_orig(*a).each do |col|
col.default = nil if col.default =~ /^(null|empty_[bc]lob\(\))$/i
end
end
end if defined? ActiveRecord::ConnectionAdapters::OracleAdapter
[/ruby]

This appears to do the trick … a dump of the test schema no longer defaults all of our text columns to “empty_clob()” and tests are again passing …

Railsconf 2007

I’m signed up for railsconf 2007, which runs in late May of 2007, up in Portland, Oregon. Looks like I’m one of about 10 NoVaRUG members going.

A breather, of sorts

So, after a marathon at work, we deployed our first delivery of the appilcation I’ve been working on since July. It’s an enterprise application, on a private intranet, so no links. However, it’s fair to say that we’ll be getting hits from a wide variety of sources. It should be good to see how well it holds up.

Right now, it’s deployed using the standard-mongrel-rails-stack ™, using 2 mongrel servers, all on one box. Seems to be holding up very well. As a note, moving your session store off the disc and into the database (ARSeession) does wonderful things for performance. Down side: It appears that a Text field in oracle is capped out at 4096b. Which puts an upper limit on an individual session size. Not necessarily a bad thing, but it’s likely to bite us in the butt at some point.

To top off the deployment exctiement, I’m buying a house. Closing comes in on Wednesday. We’ve already been through and plotted everything out. New appliances are ordered and on their way, buying up lighting fixtures, picking out paint colors … it’s pretty much all done but the installation, which is scheduled for Friday.

So, after about a month, I finally get a chance to breath. So, what am I doing? Refocusing on Dark Sun stuff. Lots to do there, including actually following through on the site. At least that one will be public … ;)

laptopless …

So, for the second time in as many months, my laptop is going back for repairs.  Strange problem, another one of those things that I’m apparently not sure how to google for … either that, or it really is some kind of isolated problem.

What happens is that the backlight on my Toshiba m55 is blanking out on me … when I open the hinge past a certain point.  That’s not good, because that certain point is well below the one where I can actually read what’s on the screen without hunching over and reading over my hands … And, of course, the problem is getting worse.  It gets harder and harder to even get the backlight to turn on.  Happened to me earlier, sent it to the shop, and they swapped out the backlight.  Apparently, that wasn’t the initial problem, because whatever’s wrong worked it’s way through a second one in pretty short order.

So, it’s back in the shop.  Hopefully, this doesn’t take too long.  Otherwise, it’s back to “what’s a good laptop …”  And this one was only 10 months old; not a good record.

Virtual List Domains and Reply-To

I discovered something “interesting” about my mailing list setup and how it’s interpreted by some mail readers. When I was trying to debug it, nothing came up, so I’m blogging here to leave a record. Hopefully, the search engines manage to pick it up. This is a bit tricky, however…

The setup: I run just under a dozen mailing lists for athas.org. The server they live on is the same one that this blog, and several other domains, are hosted on. Because I’m hosting several domains, and I don’t want email bleed (because they’re not all mine), I set things up more or less as described in this howto. So, my mailserver operates off the idea of virtual domains. There’s a special virtual domain, lists.athas.org — all emails sent to this domain are piped into mailman. It’s worked out pretty cleanly, and by doing it that way, my mailing lists are well-deliniated, and I don’t have to update aliases at the mail-server level every time I add or remove a mailing list.

The problem cropped up when I got an email from one of my list subscribers who was using yahoo mail. It turns out that he was getting bounces whenever he tried to respond to a mail from the list. So, I checked out my logs, and found his bounce in my postfix logs. Turns out that he was trying to send email to mochajava.athas.org instead of lists.athas.org. Mochajava is the “real” name of the server.

I had him forward me a copy of a mail from that list. Reply-To header set correctly. So, I know what the problem is: His mail user agent was sending an email to the wrong address. I just had no idea why. Looking through the headers, the only instance of “mochajava.athas.org” I found was in the Recieved headers.

It wasn’t until a couple of weeks later that I realized what it was. lists.athas.org was registered as a CNAME alias for mochajava.athas.org in my DNS setup. So, a ns-lookup gives back something like:

Non-authoritative answer:
Name: mochajava.athas.org
Address: 65.78.231.230
Aliases: lists.athas.org

So, I think what happened was this: Yahoo mail client does a DNS lookup to ensure that the domain in the reply-to actually exists — makes sense from a user-friendly sort of approach — and, upon seeing that the given domain is an alias, replaces the name wih the host’s cannonical name. Unfortunately, my mail server’s setup depended on the use of that alias to direct emails to the list server software …

The solution was simple: Change the DNS entry. Now, lists.athas.org, instead of being a CNAME alias, is a top-level A record. Everything works smoothly now, and replys to the list from my yahoo users actually get sent to the list.

Here’s hoping this helps someone spend less time scratching their heads than I had to…

gReader

After encountering yet-another subscriptions?-what-subscriptions? bug in Rojo, I decided to take my most recent OPML export and check out google’s Reader again. I’ve heard some good things about it — after it’s recent redesign it’s supposedly actually usuable as an aggregator …

Look ma, an RSS aggregator that can go through a software update without completely tanking!

I’ve been on it for about a week. Seems to flow decently enough. I have a couple of complaints, but the fact that I can go through it using (mostly) keyboard commands is a big plus. It *mostly* fits in well with my feed reading style, which, for lack of a better term, I’ll call skim-and-queue. Skim through all my feeds, and queue up items I want to read in depty by opening them up in a new tab. Then, close the aggregator, and make my way through the tabs. Works well for me. Thanks to greader’s shortcuts, I don’t have to deal with the mouse, except to open in a new tab — while the title link works to open items in a new window, the keyboard shortcut gets caught by Firefox’s popup-blocker. Most annoying.

That’s a fairly minor thing though. I do wish I could find an aggregator that would let me specify an oldest-first sorting for my unread items though. Having to jump to the bottom in order to read sequentially is one of the really annoying things about … well, just about any aggregator.

So, it looks like, for the time being, I’ll be dropping yet another daily bit into Google’s silo … Until, I suppose, I get annoyed enough with the whole thing to write-my-own-damn-aggregator ….