Sunday, July 4, 2010

uml deadend or why your proprietary file format is a really, fantasically bad idea

So, I'm working on a project. Pretty big SQL setup, lots and lots of complexities. Good news is that the whole thing is described well with a "UML" document. There is also a tool in place to generate SQL-like stuff for MS SQLServer, but it takes advantage of some of MS SQL's quirks in the code it generates.

What I'd like to do is take the UML document as input, and have it spit out a bunch of ORM files for me in another language and just let the ORM's framework worry about the messy SQL details for whichever database ends up being used. Not only would this be (slightly) less tedious than manually building up the objects by hand, it would have the benefit of making the UML document a single point where the database could be managed in the abstract and I could get on with doing the stuff that's more computer sciencey and less data enterishy.

But. I can't. Because the UML file was created with a very feature rich UML editor that lets you draw really nice and really well annotated diagrams, but locks it all up inside of a very non-UMLish file format. And for the icing on the cake, the company that made the editor closed up shop in May and has decided to not only stop taking orders for their software but providing the free evaluation download as well.

From my point of view, this makes the file just as programmatically useful as a jpeg picture of a diagram of the database layout. The tedious grunt work of examining the diagram and manually hacking it all together is unavoidable, which means that now we've introduced the chance of documentation skewing away from the implementation. Inadvertent forks from last minute bugfixes or poorly communicated design changes are now on the table.

All because a software developer thought his method for storing UML data was better than just using simple UML, and that his clever method would assure him of job security.

Wrong on both counts, mang.

And now we're both hosed.

Just stick with the standards, people. Please?

Friday, May 28, 2010

screw you, firefox tab complete!

For some reason that is completely unfathomable to me, the URL that's shown as hilighted in firefox's URL window can get out of sync with options that show up in the drop down menu of possible alternatives, yet firefox gives preference to the drop down menu when you hit the TAB key to complete.

Case in point: I want to go to gmail. I start typing in "http://www.g" and the drop down shows up. The first thing its got highlighted is "http://www.google.com/", which makes sense. I next hit "m" (so what I got in the URL window is "http://www.gm")... the text in the URL window goes ahead and auto-completes out to "http://www.gmail.com", BUT the drop down highlight remains on "http:"//www.google.com/").

So when I hit ENTER, I'm being queried for a search string instead of looking at my inbox.

I sigh and once again curse my blazing fast touch typing skills and lightning quick ENTER key pressing reflex. So I go fumble around for the mouse, point the stupid pointer over the URL, double click to highlight the entire URL, hit BACKSPACE, and... we go back to where I said "Case in point:" up above.

Repeat 3-4 times until I finally am able to remember to force myself to stop and wait for the drop down to catch up and get to my email so I can read the latest chain letter my old high buds have forwarded to me.

KAAAAAAAAAAHHHHHHHHHHHHHHHHNNNN! \o|

Monday, May 3, 2010

the science of chords

So I just got finished watching "It Might Get Loud" (trailer below) on Netflix's Watch Instantly deal. It was interesting to see representatives of 3 different generations of rock talking about what motivated them, what their journey to where they are was like, how they view the craft of making music, and hints at some of the tricks they use.



The guy I was most interested in hearing from was "The Edge".


Monday, April 12, 2010

tunnel vision

The other day I was browsing around on a professional networking site and came across a post in one of the forums from a guy asking for help on solving a monitoring problem. The problem was that when the servers got under a heavy enough load they would become unresponsive to his monitoring systems and the page would light up like a Christmas tree. He was looking for suggestions to relax the monitoring thresholds so the alerts wouldn't bug him.

/o\

The problem is not that the monitoring system is doing its job. The problem is that the servers are under such high enough load that they can't respond to simple "Are you still alive?" queries from a monitoring system. The correct solution is to either add hardware to the cluster and distribute the load or find some way to refactor the code so that it's more efficient.

More alarming was the fact that a bunch of people weighed in before I got there with various suggestions on how to increase timeouts, drop SNMP monitoring, etc. In a week, none of them said, "Hey, maybe the server being in distress is like, bad."

In the tech world, we fall prey to tunnel vision a lot. We become willing to push an incorrect solution to a problem so far that we will layer bad idea after bad idea on to a system, which in turn just keeps bringing in more and more points of failure. Pretty soon, you end up with a shaky, complex Akira style thing that is impossible for anyone else to understand or modify that does nothing but create unnecessary work for you.

The more I look around at my colleagues and talk with them about the battles they're fighting daily, the more I start to wonder if anyone else understands why the bearded Unixy elders held elegance in such high regard.

Wednesday, January 13, 2010

win32 c++

So I was presented with a situation where I needed a binary to simply run some predetermined commands on Windows. I said, "Why, this is a simple fork/exec under Linux. How hard could it be in Windows?"

Turns out, a lot fscking harder than it needs to be.

The primary problem stems from the way Windows "attempts" to support multibyte characters. Or rather, the wayS it supports multibyte characters... you have a choice of the ANSIish widechar that can do UTF-8, or the one that MS Visual Studio defaults to LPWSTR for UTF-16. The Windows libraries helpfully provide replacement functions for stuff like sprintf() and such, but the common and well known string functions are cut off from you. Worse, some wrappers to system calls like GetCurrentDirectory() will only return LPWSTR and only take LPWSTR args, and because these are differently sized types you can't just cast your out of the problem.

Oh, and stuff like malloc()/calloc() doesn't appear to work with the macros, either. Or at least I didn't have the time to unravel what the correct way to use them were in the time I had alotted.

In the end, I used something like:

wchar_t* thing[SIZE];

and just used a typecast whenever I needed to move into or out of the variable: (LPRWSTR) thing, like when using _stprintf() to build up these strings.

So, basically, I ended up being corralled into doing freshman level C just to get stuff working.

What I've taken away from this experience is that I absolutely, positively, 100% don not ever want to do any serious Win32 C/C++ development. Ever. EVER. And if I do have to go down that road, then I'm going to try and stick with ANSI... maybe even to the point of using cygwin exclusively to avoid getting sucked into this nightmare again.

kindle 2 weeks later

I still like what I said before about the Kindle, but the one thing it hasn't done is spurred my recreational reading. Yeah, I can rip through books quicker, but having trouble finding the time to actually commit to reading. Suspect this is work related, since I'm basically learning (or relearning) tech just about each day.

I tried out the magazine and newspaper subscriptions, but I found that even those weren't enough incentive to turn the sucker on each morning. I also found that periodicals who are publishing their content in Kindle format are playing this weak game of not including everything and instead reserving that for customers who have paid for subs to their website (or ordered the dead tree version). Same money, less content? No, but thanks anyway.

I'm also discovering that anything beyond new releases is going to be kind of hard to find kindlefied. An elusive book that has remained on my Stuff To Read list for way too long is When Harlie was One... but it's been out of print for nearly decades. The only way I'm likely to see it is if I can track it down at the library or maybe stumble across it in the Half Price Bookstore. Chances of getting via kindle (legally) are pretty low.

In other news, I've discovered that if you put the text to speech feature on it's fastest setting and use the female voice, it does a passable job of reading flowing prose to you at a rate that doesn't require too much attention. Was able to drive with it going on.

Bottom line: it's by no means perfect, but it's got enough bonuses to justify purchase. And those are mainly, 1) text to speech, 2) ability to convert your own material to kindle format, and 3) the fact that I won't have another 5 boxes of books to pack up.

Tuesday, December 29, 2009

[books] ragamuffin

I'd heard about Tobias Buckell when he showed up on Dead Robots Society to do a podcast episode, and from the interview he sounded like exactly the kind of creative little monkey that makes stuff I like reading about. He'd mentioned a couple of his books, but the one that stuck out in my mind was "Ragamuffin".

As a result, that was the first I ended up snagging after I got my Kindle online.

It turns out that this is book two in a series that has 3 entries so far ("Crystal Rain" being the first, and "Sly Mongoose" being third) which means I've once again been introduced to a universe in the middle of the story. But the way the book is structured, you're eased into the history of the universe while being started off with some pretty brutal action in the story. I also really enjoyed the pace of the story and found it to be pretty well crafted overall.

I'd highly recommend this book, and have already snagged the other two in the series.