Posts for October 2010

2010-10-10: spin 1.76

It's been quite a while (nearly two years) since a release of spin, but I finally got around to fixing a handful of bugs. The main bug fix was in processing the output of external converters (like pod2html or faq2html) that caused spin to duplicate the <body> tag in the resulting HTML output and make the HTML invalid. Thanks to Julien √ČLIE for the report!

The other change was something I needed for multi-column output using a table. The \tablerow processing already had special handling of a table cell wrapped in a <span>, lifting the attributes of the <span> to become attributes of the surrounding table cell. Now, \tablerow also does the same processing with a <div>. When making that change, I also noticed that \tablerow wasn't establishing a boundary, so tags could be left unclosed across <td> tags creating another type of invalid HTML; that is now also fixed.

You can get the latest release from my web tools distribution page.

2010-10-10: podlators 2.4.0

I finally got around to fixing the way that output encoding was done in podlators when the utf8 option is used so that it doesn't require PerlIO. Pod::Man and Pod::Text now require Encode and use Encode to convert output to UTF-8 if there isn't a PerlIO translation layer already in place.

This release also splits the style guide for writing POD documentation out of the pod2man page, where people mostly didn't see it, and into a separate perlpodstyle man page. I may have to do another point release to change how that's done to play well with the rest of Perl, but what I have seems to work for a standalone installation.

Thanks to Kevin Ryde, this release fixes a bug in Pod::Man when S<> whitespace was at the end of a line. Pod::Man was leaving a stray backslash without the whitespace in the output, which caused *roff to escape the newline instead and led to weird results.

Finally, I discovered that ExtUtils::MakeMaker will deal with the #! munging that I was previously doing by hand, so I now just use that facility rather than trying to handle it with .PL files, which makes the packaging much simpler and easier to work with.

You can get the latest version from the podlators distribution page.

2010-10-10: release 1.42

I had a request a while back to create symlinks in my software archive site with a persistant name so that people can just link to and download the current version, whatever version that happens to be. I finally got around to implementing that in my release script today, although I haven't gone back and added the symlinks for all my older software. That will start happening as I release new versions, and I might go back and add the symlinks for everything later.

While I was at it, I removed support in the release script for generating and copying MD5 checksum files for tarball releases. They're pointless now that I'm always generating GnuPG signatures (and were probably pointless before that).

You can get the latest version from my scripts page.

2010-10-12: spin-rss 1.23

The entry in my web site change log for the last release of spin revealed a problem with spin-rss, which I use to generate the RSS files for my journal and web site. It previously supported two different modes: full journal entries got CDATA wrapped around the HTML of the entry, and the web site changelog just had the change description dropped directly into the RSS. The problem with the latter is that it doesn't work properly with HTML tags in the description, even if they're escaped.

Now, spin-rss uniformly wraps the description in CDATA no matter what its origin. This means that the contents need to be valid HTML, so the description taken from a .rss file is now wrapped in <p> tags as well. This seems to clear up all the remaining problems in various different readers, although let me know if you still see something weird.

Thanks to Julien √ČLIE for the testing help!

You can get the latest version of spin-rss from my web tools distribution page.

2010-10-13: pkg-config Generation

A little while back, as part of a discussion on debian-devel, I spent some time bad-mouthing pkg-config, and then later realized (with the help of an IRC conversation) that I was doing so unfairly. So as penance here is some documentation for how to add a pkg-config configuration file to a typical Automake project.

This information is also in my build system coding style and will be maintained there (so if you see this some time after I wrote it, check that page for more up-to-date information).

pkg-config is a tool to provide the flags required to compile or link against a shared library. It's a replacement for complex Autoconf probes and for all of the incompatible and occasionally buggy *-config scripts.

To install a pkg-config configuration file, provide a template pkg-config configuration in a file named after the library but with a extension. Here is an example:


    Name: <library>
    Description: <short description>
    URL: <upstream url>
    Version: @PACKAGE_VERSION@
    Cflags: -I${includedir}
    Libs: -L${libdir} -l<library>
    Libs.private: @KRB5_LDFLAGS@ @KRB5_LIBS@

Replace <library> with the official name of the library (which isn't necessarily the library name with lib removed). This is only informational, may contain spaces, and isn't used to locate the file. Its filename is used for that.

Replace <short description> with a short description of the purpose of the library. Often the short description of the package from the start of the README file works well here. Replace <upstream url> with the URL of the package's distribution page.

Normally, all Cflags needs to contain is what's indicated above, which lets the compiler find the header files if installed in a non-standard location. For Libs, note that pkg-config distinguishes between the shared libraries that must be linked against on a system with proper transitive dependency support and the libraries that must be linked for a static build or on a system with poor support for shared libraries. For a well-designed shared library, one should rarely need anything in Libs other than what's listed above. Libs.private, on the other hand, needs all the LDFLAGS and LIBS of everything the library itself links with external to this package. In this example, the shared library is linked with the Kerberos libraries and therefore needs the Kerberos LDFLAGS and LIBS; modify as needed for your example.

If the dependencies of the shared library also use pkg-config, just list the other pkg-config file names in Requires or Requires.private instead of using Libs or Libs.private for them.

Finally, add the Automake code to build and install the pkg-config configuration file. It should look like this:

    pkgconfigdir = $(libdir)/pkgconfig
    nodist_pkgconfig_DATA = lib/libfoo.pc

    lib/libfoo.pc: $(srcdir)/lib/
            sed -e 's![@]prefix[@]!$(prefix)!g' \
                -e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
                -e 's![@]includedir[@]!$(includedir)!g' \
                -e 's![@]libdir[@]!$(libdir)!g' \
                -e 's![@]PACKAGE_VERSION[@]!$(PACKAGE_VERSION)!g' \
                -e 's![@]KRB5_LDFLAGS[@]!$(KRB5_LDFLAGS)!g' \
                -e 's![@]KRB5_LIBS[@]!$(KRB5_LIBS)!g' \
                $(srcdir)/lib/ > $@

Replace libfoo with the actual name of the library and change its path in the source package as needed. Note the pattern above and use it for any Autoconf substitution variables that you need to replace in the pkg-config template. The above example adds KRB5_LDFLAGS and KRB5_LIBS to the variables; you may have other ones you need, particularly to construct Libs.private.

The above installs the pkg-config configuration file under $(libdir)/pkgconfig. $(datadir)/pkgconfig is appropriate instead if one is certain that the flags required to link with this library will never vary by architecture, but that's not the case for most libraries due to Libs.private.

Note that the Automake documentation recommends using comma as the sed delimiter for doing this sort of trick, but LDFLAGS frequently contains a comma since it's the separator for parts of a linker-specific option. I use an exclamation point instead.

2010-10-14: pkg-config and Autoconf

Five different people asked or commented, in reply to my previous journal post about pkg-config files, why I didn't just have Autoconf generate the pkg-config configuration file directly. One could use the same template that I proposed in the previous post, but rather than adding the sed fragment to, instead add libfoo.pc to AC_CONFIG_FILES and let configure and config.status generate it directly.

This is simpler, but it has two problems:

I therefore prefer this approach, even though it's a bit more complex. I think it's more robust against both unusual ways in which people want to build my source packages and any future changes to Autoconf. Note, for example, that it's possible and sometimes useful to configure a package with a command like:

    ./configure --libdir='${datadir}'

(admittedly, more common to do that the other way arond) but that would fail with a pkg-config configuration file generated directly from Autoconf unless I'd anticipated that usage and added both datadir and datarootdir to the pkg-config template even though I wasn't using either.

I've updated my build system coding style page to include this rationale.

2010-10-15: Women writing SFF

There's a discussion going on right now in various science fiction and fantasy blogs about gender balance in science fiction authors (and, to a lesser extent, fantasy authors). It mostly started with an excellent interview of Tricia Sullivan and then continued with a long discussion of gender balance in the Clarke awards at Torque Control.

One of the many interesting constructive reactions to that thread was from Martin Wisse, who analyzed his own reading and found that only about 10% of the science fiction and fantasy that he read was written by women, and that a good place to start would be for he personally to read more books written by women. I love this sort of reaction to this sort of discussion: personalize it, find the small local thing that one can do, and own one's own possible subconscious or cultural bias without obsessing over fault.

So, I did the same thing today with my own reading out of curiosity. Of the 421 books that I classify as science fiction or fantasy (I tend not to differentiate between the two) that I've read since I started writing reviews, 228 of them are by men (54%), 192 are by women (46%), and 1 is by Raphael Carter. It's interesting to me that this is so much higher than other people have seen (or that is reported in the pattern of submissions to the Clarke award); I wonder why that is. Maybe the pattern of where I get book recommendations from is different?

For those who are looking for more good science fiction by women, I recommend:

Several of these authors also write fantasy, but I can also supplement that list with a few more authors who I've only read in fantasy:

I could add more, but that's a good list that I'm fairly confident of.

While I seem to be doing okay on gender balance in reading, my big hole, I know, is reading works by people from cultures other than Europe and North America and by people living in Europe or America who aren't white. I've only made the barest of beginnings at broadening my reading there.

2010-10-17: reminder 1.15

I'm about done with vacation and thinking about how I'm going to structure work when I get back to the regular daily grind, and it occurred to me that it would be a lot easier to generate a daily to-do list the night before if I had an easy way to get reminders that were going to become active the next day. So this release of reminder adds a next command, which is like active but also shows reminders that will become active in the next day.

You can get the latest version from the reminder distribution page. A Debian package of the script is available from my personal repository.

2010-10-23: California general election

Probably only of interest to California residents.

Time for the general election voting. I'm a bit late this year compared to most years, but here's a record of how I'm voting this year.


Proposition 19: YES. Legalizes marijuana. I'm quite happy to pick this fight with the federal government. The way we handle drugs in this country is ridiculous. Other countries have had very good results from legalization, and marijuana is no more dangerous than drugs like tobacco and alcohol that are already legal.

Proposition 20: YES. Extends the redistricting reform already enacted for state offices in Proposition 11 to congressional districts as well. I think the effects of gerrymandering are overstated, but I'm strongly in favor of non-partisan districting and strongly opposed to having it be a legislative action. The Democrats are opposed to this, presumably because they like drawing the districts to their advantage. Even though I agree with them more than the Republicans, this is bullshit; districts should as closely as possible be simple divisions of the state into manageable chunks in a non-partisan way.

Proposition 21: YES. Increases vehicle registration fees to fund state parks. A fee increase, a fee on cars, and support for parks and wildlife programs. Fee increases are unfortunately somewhat regressive, but for me that's balanced by having it be a good idea as a matter of public policy to make owning and driving cars more expensive to make the cost closer to the real full cost to society.

Proposition 22: NO. I'm sympathetic to the argument from local governments that having their budgets played with by the state causes huge problems in local areas. However, protecting redevelopment programs is a bad idea; those are often giveaways to local (and even non-local) businesses. And I'm in general opposed to limiting government spending flexibility, since lack of flexibility has been behind a lot of our budget problems.

Proposition 23: NO. The worst proposition on the ballot. It's not only actively regressive, it's also actively deceptive. It purports to be a pragmatic suspension of a difficult requirement until the state economy is better, but the standard it uses for "better" would postpone any environmental action until the state economy reached a roaring pinnacle of runaway economic success that's been vanishingly rare in state history. In other words, in practice this is a flat-out repeal of state air pollution laws. We cannot improve state economy (even putting aside the fact that it's far from obvious air pollution laws are a net loss to the state economy) by killing people with air pollution and making the state's pollution problems far worse. This simply isn't right. The proposition is, unsurprisingly, funded by out-of-state oil companies.

Proposition 24: YES. Repeals a business tax loophole passd by the legislature that makes the state tax code more complicated and provides businesses with an unnecessary tax break (allowing them to not just carry forward losses as a tax deducation in future years, which is reasonable and still permitted, but allowing them to reduce previous year's taxes retroactively). Businesses are undertaxed already as far as I'm concerned and don't need new tax breaks, particularly complex time travelling tax breaks. That the federal government allows this is no excuse; the federal government shouldn't allow it either.

Proposition 25: YES. Repeals the two-thirds majority required for passing a state budget. The most important proposition on the ballot. Vote for this. This is the second most positive reform that we can enact to fix the state budgetary and financial process (the most effective would be to repeal Proposition 13).

Proposition 26: NO. Yet another attempt to prevent people from paying more taxes, particularly if they're rich. After all the paralyzation caused by similar measures, we need to put a stop to this. Local communities need to be able to raise taxes to fund local services, particularly when the state government is not able to fund local programs the way that it has in previous years.

Proposition 27: NO. The gerrymander reinstatement proposition. Repeals the redistricting reform passed in Proposition 11. The major political parties appear to be desperate to avoid losing control over their own districts. I'm completely unsympathetic.

State offices:

For all state-wide partisan offices and for Congress and local assembly positions, I'm voting a Democratic ticket, unsurprisingly. As always, it's the lesser of two evils. The only one there I'll particularly emphasize is that it's very much worth voting to keep Barbara Boxer and prevent Carly Fiorina from being elected. Even apart from her regressive and odious politics, I can't believe anyone would want to vote for someone who was so vastly incompetent and useless in her career at HP. If one wants to vote for a business executive, at least vote for one who didn't do her best to destroy a company.

Superintendent of Public Instruction: Tom Torlakson. The Mercury News endorsed Larry Aceves, but their caveats about him bother me much more than they apparently bother the newspaper. Having a hostile past with citizen groups is a very bad sign. I also like Torlakson's statements of priorities, and I want to elect someone who's skeptical of charter schools, since that represents my beliefs as well.

Chief Justice of the Supreme Court: Tani G. Cantil-Sakauye: YES. My inclination is to vote against any Republican appointee since we should hopefully have a change of party for the governor and will then are likely to get a better judge. However, my inclination is also to vote in favor of a Filipino woman for this sort of office. What I've seen on-line inclines me towards her moderately, she seems to be thought of very highly for fair and intelligent rulings, and overall I think the diversity issue beats the political leaning for me.

Associate Justice of the Supreme Court: Ming W. Chin: NO. Dissented on the decision to legalize gay marriage, so automatic no vote from me.

Associate Justice of the Supreme Court: Carlos R. Moreno: YES. Very strong history of rulings in support of gay marriage.

Local measures:

Measure A: YES. Increases property taxes to pay for child health care insurance, replacing lost funding from the housing collapse and the state budget crisis.

Measure B: YES. Increases the vehicle registration fee to pay for local transportation programs. The vehicle registration fee should be way higher than it is now, so I'm all in favor.

Measure C: NO. Term limits for Santa Clara Valley Water District representatives. I'm not generally a fan of term limits, and I'm particularly not a fan of term limits for obscure offices, since the resulting more-frequently-contested elections tend to go to whoever has the most money and political insider support. I'd rather tend towards going with the incumbant unless something is going wrong that raises enough interest to have a well-informed election.

Measure E: YES. Increases local property taxes to fund the local community college district. This is a slam-dunk for me. I'm a strong proponent and supporter of community colleges, and I think our property taxes should be much higher than they are.

Measure R: NO. Amends the city charter to place a permanent requirement on the number of Fire Department personnel the city must employ, requiring a measure to change it. This is nonsense. It's this sort of bullshit micromanagement of budgetary decisions by voters that has caused the mess the state budgetary crisis.

Measure S: YES. Realigns local election timing to match state and federal elections so that the city doesn't have to run its own separate election. Obvious cost savings. The only argument against is that local measures may be lost in the partisan election, which I don't think is a good enough reason to spend the extra money.

Local offices:

Santa Clara Valley Water District (District 7): Brian Andrew Schmidt. I like that his background is in environmental law, since the primary thing I want from the water district is solid support for enviromentalism and proper handling of natural resources. He's also been endorsed by progressive and environmental groups. His opponent is a Republican who's arguing for spending cuts, and I've had enough of that.

Last spun 2020-01-01 from thread modified 2015-03-24