It’s 8AM, and you are…listening…

… to rain.
This week has me down in New Jersey visiting my client. These visits are invariably very productive, very tiring, and very important in maintaining an even keel and a steady course on the work that’s being done. (I blame the rain for all the nautical references. Hopefully it doesn’t carry over into my drive to the office). The visit is pretty much a repeat of the other times I’ve been here. The seasons just keep changing, so sometimes it’s hot, sometimes it’s snowing, today, it’s rain.
One thing that has struck me is that I’m actually commuting to work. Up in the morning, do my morning stuff, pack up, drive to the office, do that stuff, then drive back to the hotel. It’s a short commute, only about 9 miles (I keep saying I’ll bike to the office some day, but haven’t yet), but it’s far more of a commute than I have when I’m at home. I’m still not sure about which one is better for me in the long run, but the variation lets me have perspective on it.
In a year, there’ll be a whole new living situation, so it’s not like we’re in a long term situation with the commute. There’s change-a-comin.

Zorching Memory Leaks. I Am Teh Stud

Tonight, I am Da Man.

It’s rare I get to sit down and see, so directly, a problem in the code I’m working on. In this case, while running at Ubercon the other weekend, I noticed that CONGO was showing every sign of a memory leak. After a while I’d get sluggish performance, and eventually I’d get an OutOfMemory error from the JVM. Didn’t look good.

This had me in somewhat of a panic, since Arisia is right around the corner, and I need the system stable and useable for the event. With the help of the wonderous tool that is JConsole, I was able to actually see the memory usage going up in the JVM as I worked with the server. There was definately a problem.

It turns out my hastily set up code to handle changes to my JDBC driver was not being handled correctly. Apparently with the old mm.mysql driver, SQL handles were automatically closed at the end of use. With the new Connector/J driver from MySQL, you had to explicitely issue a close() statement on any Statement, or the handle would never be freed. This was probably always the case, it was just my sloppy code and a twitch of the old driver that made it never come up.

Unfortunately, this necessitated changing just about every SQL call in the server, all 10,000 lines of it. It was long, painful, boring work. I had some help from blk, but it still took a good week of off-hour fiddling to finish the changes and do some basic regression tests.

Tonight, I made the last set of changes, did some basic runthroughs, and didn’t have a single crash. With someone trembling fingers, I started up JConsole again, connected to the application server, and started working with CONGO. Registrant lookups, reports, modifications, creations, subscriptions, convention detail editing – throughout it all, JConsole happily continued showing the normal ‘sawtooth’ pattern of memory usage. Things would get allocated, used, and then the garbage collector would come along and reap the memory.

Success! I had successfully searched for, found, and fixed a major memory leak that was persistent throughout the code.

For those insisting on the details, here’s a properly structured, Prepared, and appropriately exception-managed call to get a number from the database. (And, before I get abusive comments all over the place, the Exception handling here is VERY POOR, and will result in a clean result coming back from the method, even though the call may have crashed. I know, thank you, now go away).

private static int calcRegistered(int cid, String typeName) {
PreparedStatement p = null;
ResultSet rset = null;
String sql = "SELECT count(*) AS total FROM reg_state " +
"WHERE state_cid=? AND state_regtype=? " +
"AND state_registered=1";
int value = 0;
try {
p = cserver.Conn.prepareStatement(sql);
p.setInt(1,cid);
p.setString(2,typeName);
rset = p.executeQuery();
if (rset.next()) {
value = rset.getInt("total");
logger.debug("tcalcRegistered: count for conference '" + cid + "', type '" +
typeName + "' is --: " + value);
}
}
catch (Exception e) {
dumpException(e);
}
finally {
try { p.close(); }
catch (Exception e) { dumpException(e); }
}
return value;
}

I feel all geeklystudly.

Next is to start seriously hammering away at the buglist, and get a test environment set up so other CONGO users can test out the new Merge function against ‘real’ data. If all goes well, we’ll roll this version into production in time to run Arisia.

Oops :(

IMG_1468.JPGI have a lot of laserdiscs. Last count had it around 210. Since we moved almost 2 years ago, about half of these were stored in the basement in what I thought was a stable box.
Well, it wasn’t.
Apparently the box had shifted and moved around a lot, and ended up with the discs leaning over on one side, where they stayed for a year. The end result is I now have a dozen or so burrito shaped laserdiscs.
I’ve reconfigured the stack, and owing to the fact that laserdiscs weigh a helluva lot, I’ve placed the ‘bent’ discs interleaved at the bottom, and placed the rest on top of them. Hopefully this will restore some sort of flatness.
If I have to write off the bad discs, it won’t be the end of the world. Most are available now on DVD (and have the benefits thereof, like better resolution and added features and stuff), but I don’t like having to replace movies I already own.

Yawl gets a new face.




New Desktop

Originally uploaded by eidolon

Investing in hardware for my workspace is always hard, particularly when it could easily be interpreted as “Oh, that’s just for FUN.”

But with the price of LCD monitors dropping, it was time to take the plunge and replace my 17″ 1280×1024 monitor with a Dell 2001FP 19″ 1600×1200 version. Ebay helped me find one for just a hair under $200, and a few days later, here it is.

Gutsy on yawl was very easy to reconfigure, using the nvidia-settings tool to generate a new Xorg.conf file (it was ALMOST pointy clicky from beginning to end, the only thing I had to do manually was copy the Xorg.conf file into place.

I’m already comfortably settled into the idea I’ve increased my desktop area by about 30 percent, but occasionally I find myself wondering at all this great real estate.

Can’t go flying? How about the next best thing.

I have a strong attraction to flight, in all it’s forms, but I feel the strongest attraction to things that are the closest to free flight… it’s one of the reasons I’m very interested in soaring – it’s as close as I can get without actually growing wings.
But, what if you can’t fly yourself… How about flying models? Okay, that’s fun, but you can’t actually get IN the plane and fly it around.
Or can you?
[youtube http://www.youtube.com/watch?v=K2ezJKQa2Us&rel=1]
This was linked from all over the place, but today’s reminder of it came from Hackaday.

Photo Managers – Digikam rocks

Today I am full of Mad Love for DigiKam, the photo manager distributed with KDE. I’ve been using it off and on for a few years, and for one reason or another, I would stray away and use manual file copies for a while.
As of about a year ago though, I’ve moved to using it full time for managing the (sometimes hundreds) of pictures I take in a given session. There’s a whole slew of wonderful functions in it, but the ones that made me finally stick with it can be summed up as follows:

  • Automatic directory creation and sorting when importing from the camera. Directories can be created according to the date the picture was taken (importing 250 pictures from my camera may make 4 directories, if I was shooting over several days)
  • Direct support for my Canon 400D. When I plug in the USB, KDE prompts me to start Digikam, and everything is imported.
  • Full support for Exif data, including image orientaton, etc. Exif data is never removed or ‘flushed’ from the images.
  • Excellent export functionality to either Flickr or to a series of HTML files and thumbnails.
  • Very good gallery organization, sorting, and previewing. I can work with thousands of images and sort them into appropriate directories.
  • Tagging allows sorting and categorizing of images without reordering the directories. Searching for tags, dates, or other data generates a new view based on the tag criteria.
  • Easy calling of external programs such as The Gimp for post-processing.

All of this, combined with, well, it LOOKS great, make Digikam one of my favorite KDE apps.

Deep Breath.

Aaaaand, we’re back.
What an insane couple of days. There’s a whole series of posts brewing in my head right now, but I’ll just touch on probably the one that’s most on my mind.
Last week, I was in mid-preparation for Ubercon, an awesome gaming convention I regularly work down in NJ. CONGO has been pretty idle for the last few months as the summer is not a big time for conventions. With a week to go until Ubercon started, it was time to pull out all the hardware and make sure everything was working.
Well, unsurprisingly, it wasn’t.
The first major issue was coming to the conclusion that endor, the venerable server of dozens of conventions, really wasn’t going to handle Yet Another Apt Upgrade. It was still running on a baseline Debian Sarge install that had been upgraded a dozen times over the years, and finally, after enough apt tweaking had gone on, a dependency just wouldn’t resolve, and the machine would not take new upgrades. It was time to nuke from orbit and reinstall the OS from an Ubuntu baseline.
No problem, sez I. I whip out my Gutsy Gibbon Ubuntu CD, do a quick database dump and backup, install Ubuntu, and restore my home directory and databases. Reinstalled CONGO, loaded the working databases and…
stopped.
See, CONGO was my first big Java application. And as such, it has some… intriguing ways of doing database work. And by ‘intriguing’ I mean butt-ass stupid. In particular, not using PreparedStatements for SQL commands, not checking for failed transactions, etc etc. While this was okay for a fairly static application, once you replace the entire OS underneath it, things start to get a little squirrely. And, well, we had squirrels aplenty.
So over the space of 3 days I basically had to rewrite every SQL interraction in CONGO, resulting in some fairly major code changes, and all of this 3 days before a con.
Add on top of this the fact that I’m also using a brand new printer from Evolis for the first time under Linux. There’s a whole nother post about this experience, but it did bring yet another variable into play. Oh, and did I mention that I rewrote the print routine in CONGO to generate PDFs on the fly and use them for badge rendering? Yep, also new.
Needless to say, things were a little panicy leading up to the event. Fortunately, by Wednesday afternoon, I had things fairly well stabilized, the code worked, endor was stable and functioning properly, and I could start packing for the event with a clear conscience.

The end result? It all worked. The convention went fine, the printer behaved wonderfully, running badges twice as fast as my old Fargo printers, and we had only minor glitches through the weekend. There’s still some work to do to get endor ready for larger events, but for a week that started out with totally broken software, an unuseable server, and an untested printing system, things went mighty well.
Onwards.

Mame Cabinet, continued.




IMG_1239.JPG

Originally uploaded by eidolon

Well last night I put in some time to assemble the frame for the pedestal. This is the bottom third of the cabinet, and will contain the PC and other hardware necessary.

It’s pretty solid (and heavy) at the moment. Once I fabricate the front and rear panels, it’ll be ready for hardware to be installed. I hope to do one of the panels tomorrow before I leave for Ubercon, so it’ll hold up for the event.

This whole project has been quite therapeutic for me. It’s getting me to get up from behind my desk and go down and work in the shop. My shop is cleaner and more organized than it’s ever been, and I feel like I’m accomplishing something. On the one hand I’m looking forward to showing off the end product, but on the other hand, the travelling the road has been rewarding in it’s own right.

Thank you Sun and Ubuntu!

… and the cast of thousands that made installing a Sun JDK onto Linux as simple as:

root@endor:~# apt-get install sun-java6-jdk
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
gcc-3.3-base java-common libstdc++5 odbcinst1debian1 sun-java6-bin sun-java6-jre unixodbc
Suggested packages:
equivs binfmt-support sun-java6-demo sun-java6-doc sun-java6-source sun-java6-plugin ia32-sun-java6-plugin sun-java6-fonts
ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming libmyodbc odbc-postgresql
libct1
Recommended packages:
libxp6 libnss-mdns gsfonts-x11
The following NEW packages will be installed:
gcc-3.3-base java-common libstdc++5 odbcinst1debian1 sun-java6-bin sun-java6-jdk sun-java6-jre unixodbc
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 42.3MB/43.1MB of archives.
After unpacking 128MB of additional disk space will be used.
Do you want to continue [Y/n]?

For those on the sidelines, Sun has not been particularly forthcoming regarding a licensing arrangement that makes the RMS-ites at least mildly comfortable with automating an installation. In point of fact, I believe Debian is still uncomfortable with the whole license arrangement, though they do have it in the non-free repository.
Up until recently, getting Java onto a Linux box was, well, not difficult, but certainly not trivial. I’m happy to say it’s gotten as easy as installing any other package, which, with current package managers, means it’s a breeze.
Yay progress.

Of Systems and Services, Mame and Madmen…

It’s been a challenging few days here at Chez Geek. In true journal fashion, here are the highlights, because I know my devoted readers are sitting on the edge of their seats, waiting for every geeky installment of my daily encounters with recalcitrant hardware, misconfigured servers, and twitchy environments.
Ahem.
Of Mame
Mame console underneathOn Friday night I finished wiring the console. I’m short a half dozen buttons, so some functionality is missing, but I really wanted coin drop buttons. I picked up a couple small single-throw pushbuttons I had lying around, and wired them in with duct tape, so now I can ‘drop coins’ to get credits just by pushing a button on the console. Looks like ass, but it does work. I’ve ordered the new buttons, and they’ll arrive in a couple days, and I wanted to play games NOW.
There’s a whole post about things I’m learning regarding building a Mame cabinet, but that can wait. For now, I’m using deathstar, my MythTV box, as my ‘mame front end’. MythGame is “okay” as far as interfaces. Mostly it’s “okay” because it’s actually working correctly, and works with the controller. I’m hoping to haul the entire setup to Ubercon this coming weekend, so minimizing fuss is a big win.
Of Stonekeep and Conventions
Next weekend I’ll be down at Ubercon in New Jersey. This of course means I need to get most of the CONGO system up and running to run badges. Unfortunately, endor is not behaving. After almost 4 years of constantly apt-getting and updating packages on it (Starting from a Debian ‘woody’ install), a series of packages failed miserably during an upgrade (I haven’t really worked on it in about a year), and has left it in an unuseable state. I’ve backed the data off it, and reloaded Ubuntu Feisty Fawn on it. There’s a bunch of configuration that still needs to be done, and that’s making me nervous so close to an event. At least the install seems to have completed cleanly.
Those are the two primary things on my mind these days. Oh, and in the background is ongoing Java work and the slow moving ahead of Mosaic Commons, but that’s sort of the ‘steady noise’ bits. I’m just covering the highlights right now.

Fall in Massachusetts




IMG_0898.JPG

Originally uploaded by eidolon

I do love the fall, particularly when it gets cool enough to really enjoy the outdoors. Hiking in the woods is one of the best ways I have of unwinding.

I took the new camera along and spent some time outside Callahan State Park, in Sudbury, and found the colors just fabulous. By this time of day, things had gotten overcast, but that certainly didn’t make it any less enjoyable.

Audacity Ate my Konqueror

I’ve been having a problem in KDE for the last 6 months or so (perhaps longer, I’m not sure). On the face of it, it seemed like a standard file association problem, but it was pervasive.
Recently I switched to using Konqueror as my primary web browser. With the advances in plugin support for things like Flash and Shockwave, the actual browser platform has become less important. Since I switched away from Firefox, I’ve been using Konqueror and, for the most part, things have been pretty good.
Except for one annoying bit.
Because I’m a developer, I have to, on occasion, do the ‘View Source’ thing from inside my browser to see how the HTML, CSS, and JavaScript in a page I’m working with is put together. For some bizarre reason, Konqueror had decided that when I selected View Source, it would try and open the source in… Audacity.
Now, I’m all for great programs like Audacity. It’s a fantastic multi-track audio editor. But in no way, shape, or form is it a source code viewer.
This afternoon I finally sat down to try and figure out what the heck was wrong. Konqueror has a great tool for associating various file types with helper applications (something old time users of Mozilla are very familiar with), but the sheer number of associations is staggering. And since I didn’t know what type was that was causing the external app to be launched, I didn’t know which one to look for.
I got my first clue when I noticed that Konqueror had associated .py (Python) files with Audacity. “Aha!” sez I, “That’s not right!” – I started to change the association, then went “Wait, I don’t want Audacity started ever. Just remove the helper.” Which confronted me with the dialog box stating that Audacity had been attached to text/plain and could not be removed.
Another clue! Navigated to text/plain, saw Audacity listed in the helpers, and promptly moved it down to the bottom of the list (Okay, maybe someday I’ll want to use Audacity. Allow me my foibles.) Clicking Apply and then trying a view source finally got me… the source!
Note that this entire problem was solved inside KDE without resorting to editing configuration files, typing cryptic commands, or knowing esoteric and mystical Linux incantations. It was a misconfigured browser, nothing more. In the good old days this would have required said gyrations to fix, but I’m constantly impressed at how far environments like KDE have come, making problem solving like this a lot more intuitive.

My Gibbons Runneth Over

Now there’s a topic that won’t make much sense unless you’re in the Linux community.
This week saw the release of Ubuntu 7.10, aka ‘Gutsy Gibbon’. I’ve been firmly in the “Stick with the stable releases” Linux camp for quite a while, even when Debian was pushing 2 years behind on their ‘stable’ release.
I’ve been running Ubuntu 7.04 (aka ‘Feisty Fawn’) on yawl for the last year or so, and have had nothing but good things to say about it. It’s been stable, useable, and lets me do my work. Excellent.
Yesterday I ran the update process and told the system to update itself to 7.10. The total processing time would be about 2.5 hours, due to a gig and change of data that needed to be downloaded (okay, I have a lot of packages), so I decided to go to lunch.
Upon returning, I answered 2 questions about local files I had modified, let the installation finish, and, with a small dose of trepidation, rebooted.
It came back fine.
In fact, everything came back fine. I have seen not the tiniest indication of a problem. Ubuntu just upgraded something like 1100 packages on this machine to newer versions, and everything Just Plain Works. All my basic tools are fine, if upgraded and showing some new bells and whistles. The traditional boondoggles of Linux system maintenance never even flinched. Sound, network, accelerated graphics (I have an nVidia card) – all came back up flawlessly, even with my desktop back as it looked before.
There are some noteable changes in the new release. The file manager has been replaced with ‘Dolphin’, which I have to say the jury is still out on. Initially I was very nervous about replacing my beloved Konqueror file system browser with something new, but my initial impressions of Dolphin are good. Everything seems there, if a little heavy on the big icons. I’ll play with it a while and see if it will cut the mustard.
This is how computers are supposed to work. No license hassles, no nightmare changes from one revision to another, no “Burn it to bedrock and reinstall from scratch” problems with upgrades, or problems with “This app worked with my old OS, but doesn’t work with the new one!” – one big distribution contributed to by everyone, with everything updated at once and confirmed to work together.
Yay Ubuntu!

Mame project – Some more work done.

Tonight while Catya and Zach were off doing stuff, and after a frustrating afternoon of successfully NOT getting an LDAP server working, I decided to put in some time on the cabinet.
IMG_0855.JPGI needed some minor parts, so I went by Home Depot and picked up some basic assembly hardware (screws and some electricians bolts and nuts, etc).
Most of tonight was measuring, measuring, and re-measuring, THEN cutting… the pieces for the console ‘box’. This was a little tricky because it’s angled, but after screwing everything together, I’m pretty happy with how it turned out.
I also installed the second joystick and re-mounted the first one with the correct bolts.
I’m short a couple buttons, and I’m considering getting the trackball sooner than later. Probably off to an arcade supply store later tonight / tomorrow to quick-order some buttons.
In all the blogs, websites, and books regarding building Mame cabinets, one thing is said over and over again. Plan, plan plan. I’m really glad I took quite a long time planning, drawing, re-drawing, and sketching components of this thing before I started cutting wood. So far I haven’t had to ‘go back on’ anything, or re-think anything on the fly. Since everything is already measured out, the assembly is not running into any problems along the way.
Some minor geekynotes…
I have mad, deep love for Irwin quick-grip tools. These are one-handed rubberized wood clamps (or anything, really) that you can put in place very quickly. They hold things incredibly well, and since I work primarily on sawhorses for cutting, these things are awesome.
It’s funny also that my workspace is getting CLEANER the more I work on it. With my new tool cabinet, I’m getting things organized as I’m working. This is the most use I’ve gotten out of my shop space in a while, and it’s nice knowing where tools are and what I have and don’t have.
I may be able to start work on the base cabinet by this weekend. We’ll see!