Thoughts and Notes Ideas that stay with me long enough to get written down

27Jan/060

Slashes before quotes in WordPress?

I don't know why, but in my last post the quotes within the pre element were escaped with a slash character. Anyone have a solution?

Filed under: Blogging No Comments
27Jan/060

ATI Binary Driver, xorg, and Debian

I installed the ATI binary drivers on my debian system. Everything seemed to be okay, but I was getting lousy GL performance. So I had to figure out why.
First step is to see which OpenGL drivers are being loaded. Open a command prompt and type fglrxinfo. You should see a vendor string like this:

display: :0.0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: RADEON 9600 Generic
OpenGL version string: 1.3.5461 (X4.3.0-8.19.10)

I didn't. Mine said I was using the Mesa drivers. Mesa is great, but those aren't the drivers I wanted to use.
Next step, why is Mesa getting loaded rather than the ATI drivers. Take a look at /var/log/Xorg.0.log. There's lots of stuff in here, but don't be too intimidated. Look for things that say error. In my case I saw an error that told me DRI wasn't loading. Hmm, that would explain it. DRI is the Direct Rendering Infrastructure. ATI's Gl depends on DRI. Here's what it looked like:

(WW) fglrx(0): ***********************************************
(WW) fglrx(0): * DRI initialization failed! *
(WW) fglrx(0): * (maybe driver kernel module missing or bad) *
(WW) fglrx(0): * 2D acceleraton available (MMIO) *
(WW) fglrx(0): * no 3D acceleration available *
(WW) fglrx(0): ********************************************* *

So I searched for the error message I was getting. Not a lot of help was out there, really, but I eventually found a website that told me that Composite doesn't work with ATI's DRI implementation. Turning off Composite is pretty easy. In your /etc/X11/xorg.conf add the following:

Section "Extensions"
Option "Composite" "false"
EndSection

Bingo. That did it for me. I'd like to be able to use Composite (it allows you to do some interesting things with transparency and xfce), but I'd rather have a fast driver.
BTW, I've seen some posts suggesting using an option in your xorg.conf called AllowGLXWithComposite. Sorry to inform you, but that's a nvidia option, not an ATI one.

Filed under: Linux No Comments
22Jan/060

Debian and mplayer

I finally found a good repository for Unofficial Debian Packages that includes mplayer and mencoder.
They also appear to have MythTV binaries there. I'm looking forward to checking that out, too.

Filed under: Linux No Comments
17Jan/060

Unique items in xsl:for-each

xsl:for-each is very useful for looping through elements, especially elements that you have grouped together using the Muenchian Method (BTW, name dropping here, I used to work with Steve Muench, and he's one of the smartest, more dedicated people I've ever met - if you're just starting to develop a Java data-driven application, you owe it to yourself to try ADF, especially if you are considering similar frameworks like Spring).
There's one problem with xsl:for-each, though, it doesn't have any type of uniqueness testing. This is a problem for tasks like indexes, that need multi-level uniqueness. For example, not only do you only want to have one index entry for "validation", you only want to have one child index entry of "validation" for "SQL".
Here's an example XML snippet.
[code lang="xml"]

SQL validation

is ...

...

Validation for SQL queries

...

[/code]
and I need the index to look like this

validation
SQL 3, 7
queries 7

where the first indexterm element composes on page 3 and the second is on page 7.
If you are using RenderX XEP's extension for indexing, the resulting FO should look something like this:
[code lang="xml"]

Validation

SQL

queries

[/code]
Using grouping, I can easily ensure that I only process "validation" once. The trouble comes when I loop through all the child indexterms.
Thinking this was easy, I tried a grouping (in this example, assume $parent_term is "validation" and the result of text() is "SQL"):
[code lang="xml"]
select="key('top-level-indexterms',parent_term)/
descendant::indexterm[generate-id(key('second-level-indexterms',text())[1])=generate-id(.)">
[/code]
but that doesn't work. The key will match all top level indexterms with the value "validation", which is both top-level indexterms above. The descendant::indexterm will find the first child of that term with the value of SQL - that's true for both elements in the example above.
Clearly, I can't look at just the child indexterms of the first indexterm with the value "validation", I need to process all of the child indexterms of each indexterms with the value of "validation". Since these elements are children of different elements, I can't test test their uniqueness using generate-id(). So how do I ensure that I only process one indexterm with the value of "SQL" that is a child of an indexterm "validation"?
I tried a few other things, but I couldn't get any closer. Either I duplicated the "SQL" entry, or I lost the other child entries. Eventually I just added a second transformation step to remove duplicates.
What I'd like to see is an attribute for xsl:sort called "unique" that sorts the entries, but restricts the loop to unique occurrences. It'd be tricky (which part of the node or node-tree has to be unique?), but very valuable.
If you can help me with a solution, I'd really appreciate it. I'd hate to suggest adding to XSLT, when there's a solution already available.

17Jan/060

Feeds should be working now

Thanks to an old post on Rambling Thoughts I've figured out how to make feeds work on WordPress. If you are having problems, let me know.

Filed under: Blogging No Comments
13Jan/060

Can’t use variables in xsl:sort – Ugly

Here's what I'd like to be able to do:
[code lang="xml"]

....
[/code]
That doesn't work, though, because xsl:sort doesn't support using variables for the lang attribute. This bites for multi-language situations where you don't know the language until it's passed in at build time. To make matter worse, if the lang attribute isn't specified, the system language, not the input XML file's xml:lang attribute, is used. On top of that, you can't use a conditional, since the xsl:sort has to be immediately after the xsl:for-each!
So, if I'm on an American English computer, I can't make my Japanese index sort using xsl:sort unless I manually change the lang attribute before running the stylesheet.
Ugly.

4Jan/060

Trying to add feeds back to my site, but …

They aren't working yet, give me just a bit to work it out.

Filed under: Uncategorized No Comments
2Jan/060

New Year’s Eve and 108 Bells

On News Year's Eve, my wife and I went to the Berkeley Zen Center. There's a tradition in Buddhism to ring the bell 108 times running up to midnight. Some say each ring represents a path to enlightentment, others say each one represents a worldly desire, and that desire is driven away by the bell. Whatever the meaning, it's a lovely way to spend New Year's Eve.

Filed under: Uncategorized No Comments