somewhat daily mutterings

/Programming Creating an IntelliJ Module Dependency Graph with Only Unix tools, Dot, and GraphViz

Every so often I like to generate a dependency graph of the modules in our system. Historically, I've used an IntelliJ plug-in to do it. The plug-in generated a "graphml" file that could be displayed using yEd. All-in-all a pretty good approach.

So, yesterday I went to do just that. However, the plug-in apparently doesn't work in IntelliJ 9.x. Bummer. What to do? Well, I know that IntelliJ module definitions are stored in .iml files. I also know these files are XML. So, I popped open one of our .imls and discovered that module dependencies are recorded as follows:

<orderEntry type="module" module-name="bridging" />
I thought to myself, "Self, seems like I should be able to process our .iml files with some Unix utilities and generate a "dot" file that can be rendered by GraphViz. I'll bet I can do that in a half-hour." I won the bet.

Here is the script I hacked out in about 20 minutes. I first did it at the command line, then canned it in a .sh file.

  echo 'digraph g {'
  echo 'graph [ ratio="1.0" ];'
  echo 'node [ shape="rectangle", style="bold", width="5.0", height="2.0", fontsize="42" ];'

  # Find all the module files beneath this directory
  # Process only orderEntry elements of those files
  # Get rid of XML stuff
  # Extract module name from file name
  # Unquote to get tokens accessible to awk
  # Output node dependencies
  # Strip out uninteresting nodes (could be done earlier, but prettier at the bottom).
  find . -name '*.iml' \
      | xargs grep -H 'orderEntry.*module' \
      | sort \
      | sed 's///g' \
      | sed 's/\..*\///g;s/\.iml://g' \
      | sed 's/"/ /g;' \
      | awk '{print $1, "->", $6, ";"}' \
      | grep -v 'webapp' \
      | grep -v 'devTools' \
      | grep -v 'common' \
  echo '}'

Note: I make no claims about the elegance of the script!

The above script processes all the .iml files in our project, extracts the module dependency lines, does some sed replacements to get useable tokens, and awk to print out the actual dependency lines. If you open the file in GraphViz, it generates a diagram something like this:

This, my friends, is why all the cool kids run Unix-like OSs (Mac OS X in my case).

Posted: Wed Sep 29 20:29:11 -0700 2010

/Creations New Site:

I recently had the opportunity to donate usage of one of my watercolors to a hospital fundraising effort. The hospital wanted to use the painting for the cover of a brochure. How could I say no? When they asked how to attribute the image, I said, just my name, and a URL for (the then non-existent)

my painting on 'the kentucky bash' brochure

Well, now it exists :-). It's just a placeholder. I may be able to build a business there. Then again, maybe not! At least I can find out how many visitors I get, and know how effective that brochure was as a traffic-grabber (at least until google indexes the site, which it will, now that I've mentioned it here). At this point, most of the hits were created by me repeatedly looking at the site while I designed it.

Posted: Sat Sep 19 16:50:09 -0700 2009

/Miscellany Me Meme

I haven't posted in forever, but I thought it would be fun to continue this meme:

Via Eric Burke

  1. Take a picture of yourself right now.
  2. Don't change your clothes, don't fix your hair ... just take a picture.
  3. Post that picture with NO editing.
  4. Post these instructions with your picture.

Posted: Thu Oct 09 07:19:06 -0700 2008

/Cycling Switching Gears, Part Deux

Sorry, this is a bit of a ramble, but I wanted to write something, rather than nothing.

I made veiled reference, in a previous post a while back, to a new bike I'd be receiving in the mail. I've waited way to long to post the follow-up to that reference. Now that the dramatic tension has been drained out of the scenario, I thought I'd go ahead and post about the new bike. I bought a Rivendell Quickbeam (I'd link to it, but their stupid new site's design doesn't allow direct links), and it is a thing of beauty. It is a purpose-built single speed bicycle. Pretty, lugged steel frame, track dropouts, etc., but also with a lot of practical goodies like a rideable geometry and rack/fender eyelets, etc.

Rivendell Quickbeam Glamour Shot

Yes, I sprung the big bux for the Nigel Smythe plaid wool tweed bags that really make the bike look as though it rolled up out of the British 50's. Since I took these photos, I converted the bike to SPD platform pedals that have one flat side so it can be ridden with "regular" shoes. The bike is also outfitted with a Brooks saddle. Classic, and actually really comfortable even though it's not really broken in. I've heard and read many horror stories about the lengthy break-in period with Brooks saddles, but I must be one of the lucky ones for whom "it just works". I like it so much that I put a black one on my Serotta commuter.

What I'm lightly hinting around at, is that I'm Switching Gears in the sense that I'm trying to change my relationship to riding. For most of my riding career it's been an "informally competitive" activity. I rode hard and called it training. I wasn't training for races, but just in order to be able to ride fast. I'm not so much into that any more. I had a over a year away from riding and didn't really miss it much. Now, looking back on it, maybe what I didn't miss was the struggle of it -- the idea that I had to ride hard and fast all the time. I'm hoping to ride more now for the fun of it, and to some degree for transportation (I'm commuting again, and hope to use my bikes as a way to get to sketching sites, for example).

Rivendell Quickbeam Glamour Shot

What I've done to my Serotta, and what I've done in ordering the Quickbeam is to try to further stimulate this change in my relationship to cycling. On a singlespeed (and similarly on a fixie), you have more constraints. You have to kind of give up a bit of control to the environment, rather than just switching gars. When the hill is steep, you stand. When you have a headwind, you tough it out. When going down a big hill you coast (on a single speed, anyway). I'm trying to keep the experience pure, so no bike computer on the Quickbeam (matter of fact I took the computer off my Serotta as well). Also, I no longer subscribe to Bicycling magazine (which has basically become a fashion catalog), but Bicycle Quarterly, instead. I'll be selling my Trek 5200, which is still in the shipping box from last year's ill-fated ride, and which I haven't missed.

I'm trying to reduce the overhead around riding. I put the half-flat pedals on my bikes to allow me to just hop on and ride when I want, without putting on special cycling shoes. I still think that cycling shoes give the best pedal interface, and I will always use them, but it's great to just be able to hop on the bike in sandals, regular shorts, and a t-shirt. I am still not attracted to riding significant distances in non-cycling clothes, however. Bicycle shorts are black and seamless for really good reasons. Jerseys wick sweat, have handy back pockets, and open wide for venting, all practical features. Still, I'm willing to try riding in non-specialized clothing.

Rivendell Quickbeam Glamour Shot

A few weeks ago, MB and I rode around Buena Vista and enjoyed ourselves a lot. We just tooled around the back streets (OK, they're all back streets there), and then rode the trails down by the Arkansas river. I did all this in regular shorts (with UnderArmour boxers underneath -- seamless), a t-shirt, hiking shoes, and with no helmet or gloves. It was like being a kid again. It was fun riding singletrack on a single speed -- having to keep my momentum just right, really grunting up hills, etc. I was basically comfortable the whole time, except for the climb back to the cabin. I actually felt that I'd have been more comfy in a helmet. It would have acted like a hat to keep the sun off my head, and would have caught the inevitable waterfall of sweat coming down my forehead, not to mention the safety aspect.

Wrapping up, I'm not sure where I stand on large organized rides. Not sure if I'm interested any more, or at least whether I'm interested in riding them so fast as I used to. For example, I may do TOSRV again, but I may approach it differently. I might do it on a single speed. I'll surely do it on a lugged-steel bicycle with an old-school comfy fit in a touring-oriented riding position on big fat tires, on a Brooks saddle.

Maybe I'm just getting old :-).

Posted: Wed Sep 19 20:47:02 -0700 2007

/Cycling Switching Gears

I wrote recently about starting to bicycle commute again. I made vague reference to a new bike coming, and even though it's not here yet, I thought I'd write about some work I've done on my Serotta, which is somewhat related.

I've converted it to a single speed:

Serotta Rapid Tour Commuter
Serotta Rapid Tour Commuter SS Conversion

Yes, I've caught the single speed bug, and have removed everything that is not essential from the Serotta's drivetrain. No more derailleurs, cables, cassette, or even STI levers with their clicking and clacking. It's sweet and silent and elegant (except for the tensioner, which is unfortunately required due to the vertical dropouts on the Serotta).

My knees have been fine so far, just the tiny bit of "tweakiness", but I attribute that more to the increased riding (hell, riding at all) than to riding one and only one gear. Besides, it's only a 39x18, which is hardly a big gear. So, I have to stand on the bigger climbs, and coast on the faster descents. But that's just dandy.

Anyway, that's a clue as to what is eventually coming in the mail -- a bike for me to use down in Buena Vista. A really nice bike. Nicer than it should be, but it seemed to be the only thing I could find that fit all my desires. Again, more on that later.

Posted: Mon Aug 13 19:27:25 -0700 2007

/Cycling Return to Bike Commuting

Over a year ago my company moved to a building without a shower. That, combined with a minor injury last spring, contributed to my discontinuation of my previously religious bicycle commuting. Recently, I got fed up with not bike commuting (perhaps a new bike purchase had something to do with that, even though the new bike is not the bike I will be commuting on, not to mention I don't even have it yet -- more on that in an upcoming post). So, I decided to find a way.

My way is as follows:

  • Leave some standard toiletries and a washcloth and towel at work (the most important being a box of baby wipes).
  • Set up a drying rack in an unused office.
  • Ride my commuter bike in as relaxed as possible. No speeding. No attacking hills. No bombing downhill.
  • Upon arrival at work, cool down in nearby parking lot, just riding in circles.
  • Head up to the office, grab the toiletries, and clean up in the handicap stall.
  • Bask in having bicycle commuted to work.

Let's hope I can keep it up.

Posted: Tue Jul 31 06:18:28 -0700 2007

/Creations/Art There's No Action... my Man Elvis (Costello) once said. Why no action at Oh, I've been busy I guess. I'm actually spending a lot more time doing artwork and (minor) journaling, and maintaining a presence for that stuff at flickr.

The Oasis Bar, downtown Littleton, CO

I suppose I could figure out how to write an API for my little homegrown weblog engine to allow me to post stuff from flickr to this site autmagically, but I'm not driven enough to do that (yet). So bear with me as I obsessively attack something (the art thing) that I will eventually give up again.

Posted: Thu Jun 14 08:17:36 -0700 2007

/Miscellany You Gotta Love(craft) This...

I was doing a little H.P. Lovecraft random link-following, and tripped across the company ToyVault, which makes a variety of Lovecraftian stuffed toys and other objects. The company doesn't do direct sales, but the goods are sold at a variety of online stores (click on the "where to buy" link on the site). Pretty cool.

Who can resist Cthulhu slippers?

Posted: Sat Feb 17 14:21:44 -0800 2007

/Computing 1TB Drive, Less than $0.50/Gig

I'm working on a new home theater setup for our vacation place that involves a Mac Mini as the "media center", and which involved ripping all of my movies to disk (I'll write on this home theater in a later post). For additional storage I used a pair of LaCie 500Gb Mini Disks, which go quite nicely with the Mini. The time that went into ripping the disks was not inconsiderable, so I wanted to back up those drives to yet another drive.

The OWC Mercury Elite fits in nicely on a Mac-oriented desk

I searched far and wide and finally settled on a nice Firewire 800/400 RAID 0 (striped) enclosure from Other World Computing. The company also offers a model pre-configured with drives.

I put a couple of Seagate Barracuda 500Gb drives in the enclosure with little effort (I must admit I FUBARed my first attempt by failing to set the drives as master/slave, but that was easily addressed). Once the drive was assembled, I attached it to one of the firewire ports on a Mini drive, and started the process of copying about 650Gb of data to the drive (this took about 13 hours total). I am happy to report that during the copying it ran as quiet as a mouse — just a whisper of fan noise, but nothing compared to the Mac Mini and the Mini drive(s). So far, I can highly recommend this enclosure/drive.

PS — OWC doesn't say what sort of drives they put in their pre-built model. If you don't care about such details, you don't really "save" any money by building the drive yourself. Only go the enclosure route if you want to put your own "special sauce" into the enclosure!

Posted: Sun Feb 11 21:22:24 -0800 2007

/Programming Programming in Color

Whoa. Just Whoa.

This is source code

Mark Chu-Carrol has just officially blown my mind.

Posted: Tue Nov 07 09:12:44 -0800 2006

/Creations/Photography Aperture 1.5 Rocks

I updated to Apple Aperture 1.5 a few days ago. The upgrade went smoothly, although the library conversion preview generation process took a very long time (a couple of hours for my 27G library). Now that I've had a few days to use 1.5, I can say with confidence that this is a really great release. The whole app seems much snappier, and they've added a bunch of new features. Here are the changes (features and fixes) that are important to me:

  • All operations and GUI controls seem more responsive. For example, I can actually start reviewing images in fullscreen immediately after upload now, without suffering tons of whirling beachball cursor activity. I believe this might be because Aperture is working on the preview images, rather than doing everything in memory. I don't know the architecture of Aperture, so I could be completely wrong. But who cares -- the performance is great now.
  • More stability. I had a lot of trouble with crashes moving into and out of full-screen, using two monitors, in previous versions. I haven't had a crash on the new version yet.
  • Much finer control of sharpness adjustments
  • Better color control (more at James Duncan Davidson's site). You can now make saturation/hue/brightness adjustments to particular ranges, which saves trips to Photoshop or Elements.
  • A much better, centered loupe mode that is not attached to the cursor. You can place the loupe on the image and leave it there, and make adjustments while watching the effect -- great!

Posted: Fri Oct 06 12:05:01 -0700 2006

/Creations/Photography Canon to Offer 50mm f/1.2L

A fellow flickr-phile just told me that Canon is releasing a 50mm 'L' lens with a maximum aperture of f/1.2. This is great news! I recently bought the fastest 50mm, the f/1.4, and love it but I wondered at the time why there was no 'L' offering. So now there is, and I'm going to have to start saving for it!

Posted: Sat Sep 02 09:36:49 -0700 2006

/Creations/Photography Hello, My Name is Mike Thomas, and I'm a Flickr Addict

I've been a flickr member for, oh, about a year. However not until recently, when I became a member of a photo club that uses flickr as its "photo repository", did I really spend much time on the site. Oh, how I wish I had that innocence back. Once I discovered the array of interest groups, commenting and organization tools, and some truly top-notch photographers and artists, I was hittin' the flickrack-pipe hard.

But it's not all wine and roses. My ass is sore from sitting here, rating others' photos and having others rape ... I mean rate ... mine in turn. Here's one example of a favorite photo of mine getting the business (click the photo to see the comment-carnage at flickr).

portland botanical gardens

On the other hand, I've learned that I'm a reasonably successful "bokeh photographer" if that's even a legal construction. I guess I have an eye (and certainly an appreciation) for that style of photo. I've also "met" some pretty interesting, talented folks, so in the balance it's been a great time.

If you would like to follow my flickr-diction via RSS, flick, I mean click, here.

Posted: Sun Aug 27 21:42:27 -0700 2006

/Creations/Photography HDR Photography Experimentation

I've lately been experimenting with HDR (high dynamic range) photography. So what is HDR, really, you ask? In a very small, imprecise nutshell HDR uses software to combine multiple identical compositions, taken at different exposures (under exposed, normally exposed, and overexposed), to take advantage of details not captured in the normal exposure.

Imagine taking a picture of a very contrasty scene. You've probably taken photos where the detail is either hidden in the shadows or in the highlights. If you were to adjust your exposure to get detail in one area you lose it in another. The HDR solution is to take multiple shots with different exposures and combine them into a 32-bit image (which is unviewable), and then to use another softare tool (a tone mapper) to smash the bits back into a viewable depth (8, 12, or 16 bits).

Cottonwood Tree [HDR Gallery]

When used properly (not saying that I do), HDR can provide incredible results. Sometimes though, it can come off as a gimmicky processing trick (probably like mine). I'm experimenting to find the right combination of techniques to get natural-looking improvements on very contrasty scenes.

The software I used to do the HDR processing of the photos in my HDR Gallery is Photomatix Pro, which sells for about $100. There's a lot more detail on HDR and other dynamic range enhancement techniques on that site.

Posted: Sat Aug 05 15:11:30 -0700 2006

Thanks for visiting! Send comments to Mike Thomas.