Older blog entries for logic (starting at number 111)

2 Oct 2002 (updated 2 Oct 2002 at 06:35 UTC) »

A few people asked me recently about my seeming obsession with trying to at least get a cursory grasp of every programming language I come into contact with, and how I go about the process of learning them. It always seemed like a pretty personal, informal process, until I thought about it a little more; I actually have a simple, but fairly formal, approach to learning a new programming langauge to the point where I can do semi-useful things with it (or at least feel comfortable enough to be able to figure out how). So, I decided to document it a little bit and put up a webpage about the effort.

The basic gist of it is "doing homework". (No, really! ;-) For my purposes, that assignment is to recreate a throw-back to the good 'ol days: build a very basic multi-user environment that you can telnet into and interact with other connected users. Nothing fancy, just group and private messaging, see who's connected, and unauthenticated logging in and out. It seems to me that you give a language a pretty good workout by the time you've completed this task; you need to learn basic syntax and the magic to build and/or execute the code (obviously), you usually have to figure out whatever kind of library or extension API scheme is in use (usually networking isn't a core component of a language), learn how to handle objects and threading if applicable and useful, absorb how file I/O is managed (logging, for example), and any number of other things depending on the language and how well it lends itself to this kind of problem.

I'm at the point where I can usually complete the task in a few days, given enough time to work on it and a few trips to the bookstore with my laptop (let's face it, there haven't been any real language design "breakthroughs" in a while, so it's mostly just a matter of wrapping your head around the new syntax). I believe my favorite for this problem so far is Tcl, if only because of how easy it makes serialized, event-driven I/O. Perl, Python, and Ruby seemed roughly equivilent, and C, C++, Java, and C# are a pain in the ass (IMHO, YMMV). (No, not all of those are up on the page yet; I have to re-create them from memory, since it's been a while since I went through the exercise with any of them.) I'm not putting these up to win any style awards; frankly, the code for each example is...well...ugly. But it served the purpose: introduce the language quickly. Hmm, which reminds me, I should see if I still have my Guile implementation lying around somewhere...Scheme/Lisp is actually different enough in structure to be interesting for a project like this.

As a result of my little language project, I decided to get Mono installed to take a whack at trying it in C#. I'm impressed, not by the language (syntactically, I don't see much divergence from Java), but by the maturity of the Mono project iteself. The whole package (which is surprisingly light-weight) installed without a hitch, and it seems to have no difficulty with the code I've thrown at it so far. Nice work, guys. Now, if only "using System.Net.Sockets.EventDriven;" worked...:-) (Astute readers will note that this is a C# issue, not a Mono issue; they may even notice the smiley at the end of the line.)

More PHP

Doh. Having written the crufty mess that is my resume presenter, you'd think I'd have been more careful about relying on $argv containing parameters passed to the script. Nope. Problem fixed, parameters are now named and read via $_GET. Thank goodness for mailing list archives; I'd have spent a very long time trying to figure out why that wasn't working anymore.

The good 'ol days

Anyone else miss writing things in LPC, or am I the only old throwback around here who remembers such things? Geez, what a fun language and development environment. All this new dynamic jay-two-double-E-ifed whizbang-oriented frobnitz-driven wondersplat-dot-net, makes my head hurt. Bah. I'm going to bed. ;-)

27 Sep 2002 (updated 2 Oct 2002 at 06:43 UTC) »

Finally got around to generating nightly statistics on the websites I host; in the past, I've usually used Analog or Webalizer, but a friend of mine mentioned AWStats when I was in the process of setting up his new election website (if you live in Brandon, go, uh, vote, 'n stuff), so I decided to take a look. Not too shabby, has a nice sane set of defaults out of the box, and seems to lend itself well to doing processing for multiple virtual hosts. I'll have to see how it looks after a few months of logs have been ground by it.

Yay! They've finally pushed out a release that plays well with PHP's new register_globals default (when enabled, it creates global variables named after parameters passed via the HTTP request; it doesn't take a very crafty person to think of exploits related to that). The new default is off (good), but a LOT of software out there relies on the old behavior, even though the safer means of accessing this data has been around for a while. That was the last piece of PHP-driven software I needed to get converted so I could disable register_globals once and for all, which I've finally done.

Argh. After pulling out a little more hair, I now have my other half's Wiki back online. It seems that the PhpWiki developers decided to ob_start("ob_gzhandler") any time it was detected (with the laudable goal of compressing everything sent via the wiki). The problem is, most modern browsers don't support it correctly. Both IE and Mozilla were ignoring the Content-Encoding header that Apache was delivering, and tried to display the random gobbledy-gook that is a gzip-compressed stream. *sigh* A quick application of /* */ around the body of compress_output() in lib/Request.php was just what the doctor ordered.

The amusing part is that I had no idea the problem existed until Erica tried to access it from her place of employment; it seems that Squid was performing the necessary magic to make all of our internal browsers happy. Whee!

I was greatly amused by today's Ditherati quote (original CNN article), where Jim Brock of Yahoo! essentially apologizes for the substandard programming work they've been doing up until now. It reminded me of an article from Paul Graham called Beating the Averages (all about his work with ViaWeb, which was later acquired by Yahoo! and turned into their shopping portal), where he discusses how doing all of their development in Lisp gave them a serious competitive advantage.

I'm so confused now, I don't know who to believe! ;-)

Still here...

I'm still around, even though I've been a little too quiet lately. Life has taken a few interesting turns lately, which has resulted in very little energy for updating the diary. I'll be better from now on. Honest.

What's down?

Tomcat is dead again, bah. I'm having no end of trouble getting it to actually fire up; it's failing with an obscure exception. Likely another case of PEBKAC (problem exists between keyboard and chair). On top of that, a recent glibc upgrade appears to have b0rked jabberd (or, more specifically, the AIM transport; I really need to start lobbying my friends to start running Jabber natively). On the upside, I've cut over completely to Apache 2.0. I can't imagine ever switching back to 1.3 after playing with this version.


I'm hosting a friend's website for his election campaign (no link just yet, I'm not sure if he wants it made public until he's done setting it up). Sounds like he's a pretty strong candidate for the position in comparison to the competition. Hope he wins. :-)

Work, or lack thereof...

I have been without a full-time employer for 292 days now, not counting the occasional consulting work I've been able to find in the interim. Money is getting very tight these days; yay stress. I continue to be amazed at the change in the job market from just a couple of years ago. (Shameless plug: Anyone looking for a jack-of-all-trades fellow who can manage high-availability/high-visibility UNIX environments, read and occasionally write in a hodge-podge of programming languages, and put up with requirements that change daily without strangling too many nearby developers? I'm your guy. Have your people call my people, we'll do lunch. :-)

Random ramblings

It's 2:30 in the morning in my neck of the woods, and I've been seeing this hour come and go quite a bit lately. I've always thrived on a little bit of stress, and this is the usual result; late nights doing anything until I can fall asleep quickly. ;-) I've noticed that I don't take to the weird hours like I used to; yet another sign that I'm not a kid anymore. I've been polishing the resume a bit lately, and I have nearly a decade of honest experience in this industry behind me now; a few of you old-timers reading this might laugh, but that sounds like a lot longer than it felt. Today, I have friends running for public office, educating at the post-secondary level, and operating successful companies, but it doesn't seem like very long ago that I was talking with neighbors in residence about what we'd be doing four years from now (then?) when we graduated. Back then, geekishly asking a cute music major to dance and making a complete fool of yourself; today, wives and ex-wives, long-term plans, and wondering what ever happened to that cute music major (or if she even remembers your name ;-).

Yikes. I just re-read that; you'd think I was 80 from the way it sounded, but I'm only barely approaching 30. Hmm, I wonder what I'll be remembering a decade from now?

Whew. After a couple of days of making myself use XSLT to parse a simple XML database into something useful for my home page, I think I finally have a reasonable handle on both XSLT and XPATH (although I do have a headache now; why they're specified separately, I'll never know...one would seem to be an academic curiosity without the other). Unfortunately, the version of PHP bundled with Red Hat Linux doesn't have support for XSLT; oh well, xsltproc from the libxslt package does the job just fine for now, until I can get PHP rebuilt. (Hmmm, maybe now is a good time to just bite the bullet and cut over completely to Apache 2 while I'm at it.)

In another fit of energy, I finally got Tomcat installed in a semi-production form, and I converted over the netlogic website (as-yet unreleased) from PHP to JSP (it was really just some simple templating, so the conversion was easy and served to demonstrate that yes, I did in fact get the Tomcat working). If you work with this stuff and use an RPM-based system of some kind, you really want to see the JPackage project; they've done a spiffy job of packaging up almost everything the Jakarta Apache project has put together (except, unfortunately, mod_jk). Definitely a time-saver trying to get all the dependancies right.


More modifications to the car, and I've been getting a serious itch to get out to the track and get some quarter-mile times. New business cards ordered, which reflect the fact that I have a registered corporation name now; just need to get the damn logo done (which means I'll probably be digging back into SVG; it's funny, every time I want to learn a new "thing", I find a good non-trivial project to do with said thing, and make myself accomplish it...seems to work for me, anyway). Other than that, still trying to market myself in the local area, and watching the declining bank balance; isn't being a free agent fun? ;-)

1 Jun 2002 (updated 2 Jun 2002 at 19:30 UTC) »

Just finished a two-day job on-site for an ex-employer helping them move their data center and a good deal of other gear to their new facility down the road. Sore legs and backs help determine the difference between systems administration and programming, methinks. ;-)

In lieu of my daily fee for the first day of work, I managed to acquire some rather nice hardware that they needed to clear out; a full 42U Compaq 19" rack with several shelves and keyboard drawer/keyboard+trackball, an 8-port Compaq KVM, two of the 1U 800MHz systems from Penguin Computing that I lovingly cared for when I used to work at this employer, and a dead (but RMA-able) rack-mount LCD display. I have no idea how I'm going to get this monster up the stairs to the office, but it'll be nice to not have my rackmount APC 2200 UPS lying on the floor anymore. Hmm. Now I just need a Cisco Catalyst 2900 from somewhere, to replace these annoying little Netgear switches with...

Episode II

Finally saw it. Better than Episode I by immeasurable amounts. Everyone keeps asking me whether I liked Spiderman or Attack of the Clones more; that's like asking if I like downhill skiing better than the flavor of peanut butter.


I have the Eclipse shop manual on order, and I'm planning on picking up the Symborski shifter bushing kit to stiffen up the currently overly-loose shifting. Need to find someone with a short-shifter installed to see what I think of it; not sure if it'll result in enough of a difference to be worth it. My better half has been researching a lift kit for her Jeep Wrangler, and the height of the lift has changed recently from 2.5" to 4", with 35" tires. Should be fun figuring out how best to injure myself while installing this with her. ;-)

Heh. Who knew I'd ever start turning into a car geek?
20 May 2002 (updated 2 Jun 2002 at 19:33 UTC) »
On the road...

Quick update from Butte, Montana, via LodgeNet service at an area Best Western. My tip for the day: if you find yourself at a hotel which offers LodgeNet service, save your money, unless the ability to hook up your laptop/travelling system of choice is available; a crappy IR keyboard coupled with a stripped-down product offering (no traffic on ports other than 80 or 443 permitted, no non-HTTP protocol support such as a basic telnet or ssh client, an unchangable and huge font for displaying everything, and no Java support in the browser, meaning on ability to compensate for the lack of telnet support). Not that I'm surprised that a more technical user would find the service grating, but I thought they might make a somewhat better effort, considering how well-integrated the other services are (Nintendo 64 service, access to your hotel room account, etc).


Despite a small glitch resulting from the last-minute modifications I made to the Eclipse just before departing on this vacation (one hose not tightened properly), the car has performed admirably on several different terrains (wide-open roads in North Dakota, Saskatchewan, and Alberta; winding mountain roads in Alberta, British Columbia, and Montana). I'm quite pleased with my new toy. :-)

More later, when I'm at a terminal that doesn't make me retype everything three times before it gets it right...
18 Apr 2002 (updated 18 Apr 2002 at 22:31 UTC) »

Got the car. A white 1999 Mitsubishi Eclipse GSX, 5-speed manual, sunroof, surrounded by power accessories, and a wing on the back that nicely frames the car I just passed at an ungodly speed.

No hacking today. <div style="simpson">Can't talk, driving.</div>
18 Apr 2002 (updated 18 Apr 2002 at 05:59 UTC) »

Realized that I didn't know of any handy command-line XML-RPC clients, and decided to do something about it. I've written an extremely simple XML-RPC library interface (right now, it consists merely of a methodCall() function, which returns an XML-RPC response). In the process, I've decided to delve further into libcurl and libxml. Handy little libraries; libcurl definitely makes it easy to deal with HTTP transactions (including automatic http_proxy and family support by default), and libxml has made handling the XML responses trivial. I'm hoping this will make a handy little command-line utility when it's done; what can I say, I won't be happy until I can do everything I need to with /bin/sh. ;-)


There's been an incredible series of good events happening around me lately; Erica finished her MCSA yesterday; I just found out that, despite being self-employed, my credit is good enough for the car I've been wanting for quite a while now; I've just successfully billed three separate contracts, with a fourth that should be closing soon; once the car is purchased, we'll probably be taking a road trip back to Canada to visit Mom (yes, I'll be stopping in Brandon for a day, for the folks back home who read this); and Erica might have a shot at a permanent position at one of the companies I just finished working for. Life is busy as hell, and I'm happier than I've been in a long time.
5 Apr 2002 (updated 2 Jun 2002 at 19:34 UTC) »
Note to self:

Start writing Advogato diaries in XHTML 1.1 so it doesn't skew my home page's conformance. ;-)

102 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!