Archive for March, 2004

Of Subversion, Python, Warnings, PyObjC & Toes….

Sunday, March 21st, 2004

I was going to spend the afternoon gardening, but I managed to rip a toenail off on a rock. On the follow through, I managed to scrape the then exposed cuticle on the rock. That pretty much eliminated gardening for the afternoon. Or walking, for that matter. I’d post a picture, but it is not my intention to compete with Rotten.com (no, really, don’t click that).

However, it did give me an opportunity to putter around the computer for a bit…

I now have a personal Subversion repository set up at http://svn.red-bean.com/bbum/. It doesn’t contain anything yet, but that is to change shortly. The intention is to finally coalesce and import nearly 15 years of Objective-C and Python hacquery into one place that I can easily get too. If, in the process, others find it useful, so much the better.

The first project to make the jump is DeDat. It is a three or four year old PyObjC application that wraps around TNEF to rip apart attachments produced by certain mail programs (every receive an attachment labeled “foo.dat”?).

In cleaning it up, I ran across a deprecated warning. I was using API in PyObjC that had been moved somewhere else. Ronald has done a brilliant job of maintaining backwards compatibility across refactors, but Hubris encourages me to eliminate use-of-deprecated-API functionality any time I encounter it in a context I have control over.

Python has a warnings module that Ronald is using to indicate deprecated functionality. By default, it will happily tell you that you are using deprecated API, but not exactly where in your code.

Easy to fix. Once the ‘warnings’ module is imported, just set the defaultaction to error:

warnings.defaultaction = "error"

Your app will now crash violently upon use of deprecated API, dumping a full backtrace in the process.

“Little Snitch” tells all.

Friday, March 19th, 2004

SBook triggers the snitch.

Little Snitch is a little tool that monitors outbound connections from your system and, unless it already has a rule in place to permit or deny the connection outright, pops up a panel letting you know that an app is requesting a connection.

For example, the screen shot above was triggered by the launch of SBook as the app contacts the mothership to determine if a new version is available. Interesting.

I wonder what it is sending as a part of the “am I the latest version?” query?

Now, if you happen to have tcpflow installed (via Fink or from source or from Fred’s public iDisk), you can easily answer that question.

It is just a matter of copy/paste (before hitting the allow button):

% sudo tcpflow -c -i en1 'host ip-64-7-15-234.dsl.bos.megapath.net'
Password:
tcpflow[2703]: listening on en1
010.000.001.004.58896-064.007.015.234.00080: GET /build.txt?myversion=5.17 HTTP/1.0
User-Agent: CFNetwork/1.1
Host: www.sbook5.com
Connection: close


064.007.015.234.00080-010.000.001.004.58896: HTTP/1.1 200 OK
Date: Fri, 19 Mar 2004 05:46:42 GMT
Server: Apache/1.3.27 (Unix) mod_perl/1.27 PHP/4.3.4 mod_ssl/2.8.14 OpenSSL/0.9.7a
Last-Modified: Mon, 29 Dec 2003 03:34:19 GMT
ETag: "38747b-10-3fefa0bb"
Accept-Ranges: bytes
Content-Length: 16
Connection: close
Content-Type: text/plain

1072668795
5.18

(If you are on Ethernet, use ‘en0’ instead of ‘en1’.)

As expected (Simson definitely understands security & privacy), SBook doesn’t do anything nefarious. But what about the other apps on the system?

I don’t know. With the Little Snitch active, I’m certainly going to be keeping a closer eye on things…

(link fixed!)

Subversion 1.0 packages for OS X

Tuesday, March 16th, 2004

I took Fred’s Subversion 1.0 build and rolled it into Installer package using a packager derived from PyObjC’s make_distrib script.

A disk image of the 1.0 pkg can be found on my public iDisk (copy/paste the URL http://idisk.mac.com/bbum/Public/ into Finder’s “Connect to Server” panel or go to the public iDisk of ‘bbum’).

It seems to work for me. The package contains all the server bits along with the client, but nothing is configured to run or do anything automatic. I.e. it shouldn’t screw up your machine. All the bits drop into subdirectories below /usr/local/ and will hopefully not collide with anything already on a stock system. Use lsbom to verify the contents of the package, if you are concerned.

The package and disk image were built with the contents of this archive. Just plop whatever is to be packaged into a directory called packaging within the subversion-pkg directory and python pkgsvn.py (then fix the n details I left out and re-run).

To repeat: this package is just a hack I tossed together to make it convenient to drop Subversion onto multiple machines. It is just a wrapper around Fred’s hard work. If something breaks, let me know. Yes, I know that a new release of Subversion is available.

Other Means of Obtaining Subversion:

Martin Ott (a co-founder of The Coding Monkeys and one of the brains behind the ultra-cool SubEthaEdit) has made Subversion 1.0 and 1.0.1 client Installer Packages available from his home page. He went through the trouble of statically linking all of the libraries and that in combination with it being client only means that his package is about half the size of mine. This post on a subversion related mailing list gives some more technical details. (Thanks, Martin!)

Fink also has a complete set of subversion packages.

Tools for use with Subversion:

Some tools that work with Subversion:

  • SCPlugin is a Finder contextual menu that integrates Subversion (and CVS) functionality directly into the Finder. The badging daemon looks like it is going to be extremely cool.
  • svnX provides an OS X GUI for Subversion in a standalone app.

Others?

CSS: The Torture Never Stops

Friday, March 12th, 2004

Recently, I have been using ReStructuredText to write a series of documents for various purposes. It helps that I have a nice Cocoa based editor implemented in Python to which I can easily add features to support my needs.

Unfortunately, the CSS included with DocUtils does not produce documents that look like a decently formatted document.

In searching the web, I could not find anything resembling a set of CSS that would provide the basis for formatting whitepaper, reference or technical document style documents. I’m sure that if I looked closely enough at various random published papers, I could find some interesting CSS, but I really don’t want to just go and rip off someone else’s hard work.

Anyone know of a decent resource for CSS templates aimed at document formatting/publishing? Something other than the myriad of weblog templates? I don’t mind tweaking the various class declarations to fit the ReST structure, I just don’t want to start from scratch.

Speaking of hard work and weblog templates…

The current visual design of this weblog sucks. It is the generic default and it has zero character. I don’t like it, but I know that fixing it will suck many hours of my life away.

Why?

Because I know that CSS is amazingly powerful, but I don’t know how to harness that power without spending hours in a stupid text editor tweaking this, changing that, previewing the page, etc…

The various CSS editors I have tried don’t really seem to do WYSIWYG style editing. Then again, I haven’t tried any of the professional packages that claim to solve this problem.

CSS Zen Garden has a bunch of neat potential layouts. I might grab one, at some point. Yeah… right.

Plants & Rum

Friday, March 12th, 2004

The Meyer’s lemon in the yard is still producing lemons and if even one of the six lemons spread throughout the yard produce half as many lemons as any one tree has set buds, I’ll be up to my ears in lemons throughout the rest of the year. That is the kind of problem I like to have.

I haven’t been quite as proactive about weeding as I probably should be. End result; I have tons of volunteer Mint growing all over the place. Well, anyplace that the Pot Marigold (pictured) isn’t growing as a volunteer.

Of course, Mint is an invasive weed that will happily choke out everything else. It must be removed!

Hmmm…

Mint.
Lemons.

Crush the mint into a glass, squeeze in about a quarter / half a lemon (to taste), add a shot or two of white Rum, a couple of ice cubes, fill the rest of the way with Club Soda.

A Mojito, but without the sugar. The lemons are really quite sweet, so no sugar needed. That I don’t like terribly sweet things certainly contributes.

Blackness

Thursday, March 11th, 2004

There is some random band called Darkness that has apparently taken England by storm and is now raging through the US. The claim is that they are “the new Queen” or “the modern Led Zepplin”. Just heard an interview on KFOG: apparently, people either love ’em or hate ’em and if they hate ’em, it is because they saw the video and can’t stand the image. That was the claim of the lead singer and KFOG seems to have bought into it completely.

Uh, no.

I don’t watch videos. From listening to a couple of songs, Darkness does completely suck. Crap production of crap musicians fronted by painful vocals that, all together, make me want to drive rusty stakes into my ears so as to never be subject to such audible torture again.

This reminds me of that band that did Glass Tiger sometime in the mid-80s or so. Hyped all to hell. Turned out that they were a “one hit wonder” and that one hit was only the result of the awesome power of marketing.

If it follows prior over marketing band patterns, it won’t be safe to turn on the radio for at least 6 months…

Thank goodness for the music store.

Update: Yup. I screwed up the name. Fixed. And, yes, I understand sarcasm, I just live in a market that doesn’t and, as a result, I’ll have to listen to this shite band ad-nauseum until the next fad hits the market. That irritates me.

GNU GPL: Free as in herpes.

Thursday, March 4th, 2004

From someone’s signature:

GNU GPL: Free as in herpes.

Crude, but funny. Unfortunately, a somewhat accurate analogy.

It seems that I’m averaging about one conversation a week that goes something like “You’d think someone would have solved this problem…. oh, they did…. damnit, it is under the GPL… guess I’ll have to re-invent that particular wheel. *sigh*”. In almost all of the cases, the individual would have been perfectly happy to contribute their changes or improvements back to the community.

I have long contributed to or written a bunch of software that has been open sourced. Many years ago, I had a serious look at the licensing issues and made the decision to not contribute to GPL’d projects whenever possible. For any project where I could or can choose the license, I have used the MIT license or, more recently, a BSD license.

Part of the reason was because I wanted to ensure that I could use any of my creations in whatever professional context I might be in. This was back in 1995 or so — I had no idea what might be ahead. Another part of the reason was simply because I didn’t want my source wrapped up in some politically driven licensing drama. Why did RMS decide that “license” and “political manifesto” should be synonymous?

From what I have seen, the truly free licenses like BSD, MIT and some forms of the new Creative Commons family of licenses cause the least worry and foster the most innovation. I know many developers that regularly contribute to projects under one of the free license that cannot or will not contribute to GPL’d projects (including LGPL).

Nowadays, I would lean to putting code under Creative Commons Attribution License or simply put code into the Public Domain. SQLite is in the public domain, as an example of a good sized project that has built a successful community with effectively zero licensing considerations.

Funny, if I remember correctly. The original free software community on the Mac and Apple ][ (and, I’m sure other systems– those were just what I happened to be involved in) was labeled Public Domain. I have no memory of any particular licenses from that era.