Affecting your situation

2008-12-18 1 min read Cello Classical Music Eddie

I don’t typically link to other blogs/articles, nor do I mention classical music particularly often, but I found this article and blog entry so interesting and thought-provoking that they deserve a re-post.

First, a moving blog entry from David Finlayson, trombonist in the New York Philharmonic, and second, the New York Times article describing the background, as well as referencing the blog post.

While I’ve never had a specifically parallel experience, I can relate to the concepts of “fakes” in a particular industry. I find Mr. Finlayson’s reaction (that all musicians must take responsibility and blame for the situation) to be both bold, yet… well, correct. It takes a strong person to identify a stormy situation clearly and react in an appropriate fashion. I only hope that I would react the same way given the circumstanses.

Advantages of push-style XSLT over pull-style

2008-11-25 3 min read Programming Xslt Eddie

Working with more than a few new-hires over the last few weeks, I’ve noticed that new XSLT developers often write pull-style XSLTs by default. However, this tends to defy XSLT’s functional heritage, and is not as useful as the opposite form, push-style XSLTs.

Pull-style XSLTs reach into the source document and pull out the data they need to transform. The pull-style is similar to template systems like those found in Rails or Django, or inserting PHP commands between HTML elements. For example, given the trivial input:

<?xml version="1.0" encoding="UTF-8"?>
<books>
    <book>
        <title>The Scheme Programming Language</title>
        <author>R. Kent Dybvig</author>
    </book>
    <book>
        <title>Essentials of Programming Languages</title>
        <author>Daniel P. Friedman</author>
    </book>
    <book>
        <title>An Introduction to Information Theory</title>
        <author>John R. Pierce</author>
    </book>
</books>

an XSLT novice will produce a stylesheet like the following (note lines 11 and 12 which reach into the source and grab the data):

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <html>
            <head>
                <title>books</title>
            </head>
            <body>
                <dl>
                    <xsl:for-each select="books/book">
                        <dt><xsl:value-of select="title"/></dt>
                        <dd><xsl:value-of select="author"/></dd>
                    </xsl:for-each>
                </dl>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

which transforms into:

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title>books</title>
   </head>
   <body>
      <dl>
         <dt>The Scheme Programming Language</dt>
         <dd>R. Kent Dybvig</dd>
         <dt>Essentials of Programming Languages</dt>
         <dd>Daniel P. Friedman</dd>
         <dt>An Introduction to Information Theory</dt>
         <dd>John R. Pierce</dd>
      </dl>
   </body>
</html>

The real power of XSLT, however, is defining templates for the elements found within the source document. These are push-style XSLTs. They have two main advantages. First, push-style gracefully handles complex source structures, including recursively nested elements. It would be near impossible to handle the following source document using pull-style,

<pre lang="xml">
<div><div><div>a</div></div></div>

if you didn’t know how deep the recursive divs would go. A push-style solution, though, is incredibly simple.

<pre lang="xml">
<template match="div">
     * <apply-templates></apply-templates> *
</template>

Will transform the previous source into the following.

* * * a * * *

In addition to handling complex source structures, push-style allows code reuse. This is of course an ideal of any programming language. Push-style XSLTs have a greater ability to be reused, because the individual templates can be reused. When you only have one template, it is quite difficult to make it general without resorting to numerous choose-when statements. Here is an example of code reuse, where we extend a previously written template with the xsl:apply-imports rule.

Given the input,

<images>
    <image>
        <url>http://www.filmjunkie.com/drinks/blixa/blixa.jpg</url>
        <alt>Blixa!</alt>
    </image>
</images>

and the XSLTs,

    <xsl:import href="imageformat.xsl"/>
 
    <xsl:template match="image">
        <div class="wrapper">
            <xsl:apply-imports/>
        </div>
    </xsl:template>

and the rule in “imageformat.xsl” (the template being extended in this case),

Continue reading

Horror Movies, Final installment

2008-11-11 2 min read Movies Eddie

The final installment… a little late.

  • Amityville Horror – (The OLD one, not the new one.) I’d watched this before, but it was so much better than I remember it. In fact, I felt it was the scariest movie that I ended up watching. The scene at the beginning where the priest goes into the house was totally blood chilling.
  • House of 1000 Corpses – I waited for years to see this movie, only to end up kinda disappointed. I figured Rob Zombie had to know what he was doing with a horror movie, but the plot was so off-the-wall that I couldn’t believe anything, resulting in my rather ambivalent feeling towards it. Too many characters killing too many other characters. The creepy clown was the only interesting/memorable character.
  • The Devil’s Rejects – I also waited a number of years to see this movie, but was prevented under the reasoning that I had to see House of 1000 Corpses first. With that finally out of the way, I was now allowed, but I was wary… especially after the last film. For the Devil’s Rejects, Rob Zombie took the large number of characters and un-realistic plot from the first movie, and turned it on it’s head… keeping the cast numbers low and keeping the entire movie realistic. Zombie made the 3 bad guys out to be quasi-good guys, and the cop into a revenge obsessed bad guy. The result was a really good character study of some truly bizarre people. This movie wasn’t particularly scary, but it was quite good.
  • Carrie – One of the best scary movies ever… my favorite part is at the end where Carrie’s hand… well, you know.
  • The Exorcist – I LOVE this movie. I saved this pick until Halloween night. I love Max von Sydow, the early scenes in the desert, Father Damien, the fact that the movie is based on something that happened in a part of Maryland I frequent, that the movie’s steps are right down the street from where I used to work in Georgetown. My favorite.

Next-to-last Horror Movies

2008-10-30 1 min read Movies Eddie

Latest installment…

  • The Blob – Pure 60’s cheese (well, technically 1958, but close enough). Not scary, more silly than anything else. I was amazed that at one point, there was 24 minutes of no blobbing. Instead, we were shown a nearly 30 year old McQueen pretending to be a high schooler. At least I can say I’ve seen it once.
  • Hellbound: Hellraiser II – I had heard (multiple times) that this lived up to, if not surpassed, the original. I didn’t quite think that was true. [spoiler] I didn’t like Pinhead reverting to a human and dying. A hero has an air of invincibility, and a super-villain (from hell no less) should be the same. The plot set him up against the true villain of this movie, and Pinhead lost. What a shame. That said, it was immensely psychological, and quite a captivating movie (we were all watching with baited breath throughout). I thought it was terrific, just not as good as the first.
  • Dead Alive – What can you say about a movie like that? Tons of gore and grossness, with only a hint of a plot. It is indeed a “classic.” Did I like it? Ehh, it was ok… but I can appreciate it, especially viewed through the eyes of others.

More October Horror Movies

2008-10-26 2 min read Movies Eddie

Continuing the reviews of my house’s October horror movie film-fest:

  • 28 Days Later – Rick told me that this was among the most realistic zombie movies ever made. While it had a realistic look and feel, I had a problem with the unrealistic (and porous) plot line. Of the 4 or so main characters, the supporting father and daughter roles were sympathetic, but I cared nothing for the main male and female leads. That would be fine, if I didn’t also have to care about the weak plot (and yes, I know we’re talking about a zombie movie, but still!). I didn’t dislike the movie, but it wasn’t my favorite.
  • Hellraiser – I’ve been excited about watching this ever since I first heard the (rejected) soundtrack by Coil. It was well worth it. The movie’s imagery was pure 80’s (a compliment) and quite realistic, compared to the only-special-effects imagery I’m used to after watching modern movies. I won’t soon forget the rats nailed to the walls. Hoping I can sneak Hellraiser II in before Halloween.
  • The Shining – I’m sure I don’t need to mention how this movie helps to define the horror genre. It’s spooky, creepy, and maintains the feeling that things are about to descend into total chaos for so long that you’re exhausted by the end. My only problem is that the Simpson’s parody is so good that’s all I could think of at times. Teriffic movie.
  • Feast – Ok, I didn’t get all the way through this last night, but I’ve seen it (a few times) before. It doesn’t take itself too seriously, and is a quintessential example of a trashy, gorey, funny horror movie. You’d think the end woud be a let-down after how front-heavy the action is, but you’d be wrong.
Older posts Newer posts