| Subcribe via RSS

I Would Like My Brain Back, Please

November 3rd, 2009 | No Comments | Posted in Meta-Posts, Perl

For a while now, I have been having some health problems that have spilled over into my professional life. More to the point, a variety of issues ranging from thyroid to others have made it very hard to sleep well and killed a lot of my ability to concentrate. To make matters worse, some of the medications I take for these problems have been compounding the other problems.

The end result? I miss my old brain in a lot of ways. Mostly, I miss hacking my CPAN modules as much as I did just a few years ago. I have a number of modules with exciting features waiting to be added, or bugs that I know how to fix, waiting to be fixed. And that’s just Perl/CPAN work… there’s Java, JavaScript, and other things rattling around in my head, but never quite making it to my fingertips. I can’t really explain very well in this medium what it is that is interfering with my efforts; it’s sufficient just to say that I’m very unhappy with myself over the last few years.

I need desperately to break out of this cycle, and get myself back on track. It’s affecting $DAY_JOB, as well, and I happen to be rather fond of the current job and I’m not in any hurry to be moving on to things new.

Tags: ,

Idle Thoughts on Parsing XML (slightly Perlish)

October 7th, 2009 | No Comments | Posted in Perl, XML

(Side note: There was no Module Monday post this week, as I was too swamped to look for one to cover. Check back next week…)

I’m in the (achingly slow) process of writing a new XML-RPC parser using XML::LibXML. Because (according to their own docs) their SAX support is spotty, I’m letting the library parse the whole message into a DOM object and then using that object to get the request or response. This has proven to be a serious pain in the lower regions.

The XML::Parser approach I’ve had since RPC::XML’s inception is an event-based parser: I use a state-machine/stack approach and push/pop items as needed, based on whether my event is a tag-start, tag-end, text, etc. As a side effect, I validate the document, since the stack/state machine will throw an exception if some event doesn’t fit in to what it is expecting.

Taking a DOM approach means more work, as not only am I drilling down for the data I need, I also have to do some checking for validity as well. (Some might point out that XML::LibXML supports checking document validity against any of a DTD, XML Schema or RelaxNG schema… I’m actually familiar with that. But there is no “real” (i.e., “official”) DTD or schema for XML-RPC for me to use in this case.)

So here’s my observation, which is probably blindingly-obvious to everyone else who’s worked with XML: SAX/event-based parsing is the way to go for processing a whole document, and DOM is better for cherry-picking pieces from different parts of it.

Like I said, probably pretty obvious to the rest of you, but it’s hitting me over the head pretty hard these days.

Tags: , ,

A Blog is Hatched, or, Why It Took Me So Long

July 22nd, 2009 | No Comments | Posted in Meta-Posts

Welcome to the inauguration of my latest effort at avoid real work or responsibility: my blog devoted to software, programming and miscellaneous related things.

I am kicking this effort off in sync with my return to the O’Reilly & Associates Open Source Convention. I have attended these gatherings, though not contiguously, since the very first Perl Conference in 1997. Little did I know, when I came to San Jose in 1997 for that conference, how many things would shake out and change either as a result or at least helped along by it.

Firstly, it lead to my first published writings on Perl (as opposed to papers I had written that were focused on software configuration management that happened to be implemented in Perl), as Jon Orwant recruited me to write a column for The Perl Journal. During the week I was in SJ, I met some local folks who shared my hobby, and made fast friends with them. This would prove handy, as I found myself relocating to San Jose area just a few months later in October.

Since then, I’ve been on a fairly-typical roller-coaster ride of one small(-ish) company after another. Along the way, I did some journaling via use.perl.org, but was never very active or consistent about it. (That said, my first successful SOAP application was a Perl filter to post to my journal, that in turn was tied to some Emacs Lisp code, allowing me to post directly from a scratch-buffer in XEmacs.) As chance would have it, I’ve been on something of a health-related roller-coaster as well. This is a project that I’ve wanted to do for well over two years, but I just haven’t been able to do it before now. (I’m not 100% sure that now is a great time, either…)

Skipping ahead to (hopefully) avoid boring anyone, I’m starting this project because it offers me the chance to have tools that will hopefully help me to write more often, tools that will give me more exposure to PHP (which I am having to use for the first time at $DAY_JOB), and also allow me to easily share my content with various aggregators based on that over-used concept, tags. Initially, it’s going to look pretty rough around here; I don’t know PHP that well, and I know sweet fuck-all about Wordpress. For example, I like the aesthetics of this theme, but need to fix some things or it just won’t work for me. And I’m pretty intimidated by the unwashed hoards of WP plug-ins out there… it’s almost as bad as trying to pick a templating solution on CPAN!

Over time, though, I hope to make this thing work, both content-wise and visually. Read long-enough, and I’m sure to either interest you or offend you. And if I do things right, I should accomplish both.

Tags: