Irony and Self Reflection

Posted by Jim Jagielski on Sunday, May 18. 2008 in Programming

From Bileblog:
Were you so unloved as children that you’re so desperate to squeal out your emotions to every inanimate object you come across? Are you THAT insecure that you so desperately plead for attention whenever you sense sentience nearby?
Most likely crafted during an instance of clarity whilst looking in a mirror.
More...

Evolution of a script

Posted by Jim Jagielski on Tuesday, March 25. 2008 in Programming

Two of the more useful pages on my http://people.apache.org/~jim/ site are my ASF Projects and ASF Committers pages. These are autogenerated pages which look at various resources and files to determine the "current" list (and status) of the ASF projects and their committers. The script that generates these pages actually has a pretty interesting heritage. The initial version was written by Sam Ruby in Python. I decided to take that as a starting point and ported it to Perl since, at the time, I didn't like Python all that much (that, of course, has changed greatly). Along the way, people started using and referring to the pages more and more, and so the script itself gained some increased functionality. After awhile though, I tired of doing the script in Perl and decided to rewrite it in Ruby, resulting in the current version. What is interesting, I think, in reviewing all 3 "main" versions is that the original heritage of the script still is apparent in certain sections. If instead of simply "porting" to a new language, if I instead had "rewritten" it, I think the structure would be different, maybe even vastly different in some areas. Also note that in some sections I do things very Ruby-like, and in others, take a more "traditional" approach... This is something I tend to do in all my coding, to reinforce the fact that there are always different ways to code things, and to keep myself, and my code readers, on our toes.
More...

proxy hooks

Posted by Jim Jagielski on Wednesday, February 27. 2008 in Programming

In the Apache httpd 2.2 development, I've spent a lot of time on the proxy module, especially on the load balancer aspects of mod_proxy. This is an area which interests me and, based on the feedback and popularity of various presentations and webinars I've done, interests others as well. Not that long ago, on the httpd development list, we were discussing ways of enhancing the load balancing mechanism, with possibly a separate process/thread which periodically verifies the health of backend servers and maybe even providing information on their CPU load, stuff like that. With all that in mind, I started working on some additional load balancing (LB) implementations but ran into a snag. See, right before the proxy module runs the actual scheme handler (that is, "what to do with this request"), it calls a special hook: proxy_run_pre_request. The problem is that this hook is implemented as RUN_FIRST/DECLINED, meaning that all functions registered with this hook will run in order until one returns something other than DECLINED. Now this makes sense for a lot of hooks, but really thinking through the proxy module, it doesn't make sense for this one. Adding insult to injury, the one mod_proxy registers is also noted as APR_HOOK_FIRST, making this hook pretty much useless for other modules/submodules to be able to use if you want to also do "other things" at the same time. This is also the same for the proxy_run_post_request as well. So what I proposed was "fixing" these hooks instead be RUN_ALL, allowing other modules/submodules from using them (eg: OK, we've found a balancer, now do some checks against them, or create a timestamp or even bypass that selected balancer all together). Unfortunately, this can be considered an API change, which would make it unsuitable for inclusion in 2.2. In other words, this is easy to address/fix in trunk, but I also want to see this functionality in 2.2.x as well, and a major API change would forbid that. We haven't decided yet, conclusively, if, in fact, it is an API change, or, if it is, how "dangerous" it is (due to the way it's implemented, I'm pretty confident that no one is using it, but that doesn't carry too much weight). So what I'm looking at are adding 2 more hooks: proxy_hook_pre_shandler and proxy_hook_post_shandler, which runs before and after proxy_hook_scheme_handler (that's what the 'shandler' means). This would provide the hook opportunites that I think mod_proxy requires around this stage of processing, as well as being suitable for both trunk and 2.2. The disadvantage is that it adds some cycles to "work around" what is really (IMO), a design/API flaw. The overhead, from all my testing, is pretty much a non-issue, but it still seems an in-elegant solution. But it's likely the one I'll be pushing for...
More...

mod_site_utime

Posted by Jim Jagielski on Monday, February 11. 2008 in Programming

I've used proftpd as my preferred FTP server for quite awhile now (although I do have a few sites running mod_ftp as well). I've also been baselining Transmit as my main OS X FTP client as well, supplementing the various CLI FTP clients as well. In any case, I've noticed that Transmit, after uploading files, tries to reset the timestamp on those files. The rub is that, except for the IETF draft, there really is no standard way to do this under FTP. There is overloading the MDTM FTP command, which some clients and servers support. There is also the SITE UTIME command as well. Unfortunately, there appears to be 2 popular formats for SITE UTIME:
SITE UTIME YYYYMMDDhhmm[ss] path
and
SITE UTIME path YYYYMMDDhhmm[ss] YYYYMMDDhhmm[ss] YYYYMMDDhhmm[ss] UTC
What is even more unfortunate is the proftpd doesn't support the MDTM overload and only supports the 1st flavor of SITE UTIME, whereas Transmit (and others) use the 2nd SITE UTIME flavor. So using the mod_site_misc.c proftpd contrib module as a starting point, I've crafted mod_site_utime.c. It's designed to just implement SITE UTIME (not other SITE commands, like mod_site_misc), and to add some extra flexibility on what is provided in mod_site_misc, like supporting timestamps with seconds values, supporting both format flavors and some basic error checking. I hear that later versions of proftpd will support the IETF drafts, but until that time, mod_site_utime just may be quite useful for a number of people.
More...

Happy belated birthday, Donald Knuth

Posted by Jim Jagielski on Friday, January 11. 2008 in Programming

It wasn't until I read Yoav's blog post that I realized that I had missed Donald Knuth's birthday. Mr. Knuth is on my short list of programming and computer science giants. And it goes without saying that his seminal work, The Art of Computer Programming, holds a place of honor on my bookshelf... it also goes without saying that it is an incredibly worn and dog-eared copy...
More...

Page 3 of 11, totaling 54 entries

Quicksearch

Search for an entry in IMO:

Did not find what you were looking for? Post a comment for an entry or contact us via email!