Bubble Wrap Bag Erik




Bubble Wrap Bag Erik

Originally uploaded by yonnage.

This is what happens when A) I don’t feel well and B) I don’t want to do my work.

New Theme. Working out

Its clear that I’m using a new theme.
its “Connections”:http://playwith.wpthemes.info/ I _really_ like it. Although I don’t love the picture up top.

Also, I started working out again. I walked around the lake with Ellie, it was nice.
Ex time was 32.17,
HR (average) 136

It took me like 2 hours to get down to < 80BPM.. not good

On my mind

here are the things on my mind
1) Greasemonkey… This firefox extension is the most amazing thing evar! I really dig it – here are my scripts I’ve written http://metaatem.net/greasemonkey/
2) Peak Oil. I’m reading “The Long Emergency”. Its really scary stuff :/

XSL to transform iTunes play lists to html

It outputs tables, but it *is* tabular data :)

if I was stronger with xsl, it would be a bit cleaner, and allow you to supply the colors easily, but you get what you pay for.
To use it, File > Export Song List > Save as XML.
Then navigate to it on the form, and hit “upload”

Here is the form if you want to play with it (please be kind):
iTunes Playlist Transformer
Source Code

Here is just the XSL:

<?xml version="1.0" ?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
  
  <xsl:output method="html" />
  <xsl:template match="/">
        <table style='border-collpase:collapse; ' border='1'>
            <tr style='background-color:#ddd;'>
                <th colspan='4'>Playlist Name: <xsl:value-of select="plist/dict/key[text()='Playlists']/following-sibling::array/dict/string" /></th>
            </tr>
            <tr style='background-color:#ddd;'>
                <th>Artist</th>
                <th>Track Name</th>
                <th>Album</th>
                <th>Played</th>
            </tr>
        <xsl:for-each select="plist/dict/key[text()='Playlists']/following-sibling::array/dict/array/dict">
            <xsl:call-template name="track">
                <xsl:with-param name="trackid" select='integer' />
            </xsl:call-template>
        </xsl:for-each>
        </table>
    </xsl:template>
    <xsl:template name="track">
        <xsl:param name="trackid" />
        <xsl:variable name="thistrack" select="/plist/dict/key[text()='Tracks']/following-sibling::dict/key/following-sibling::dict/integer[text()=\$trackid]" />
        <tr>
            <xsl:choose>
                <xsl:when test="position() mod 2 = 1">
                    <xsl:attribute name="style">background-color: #bbb</xsl:attribute>
                </xsl:when>
                <xsl:otherwise> 
                    <xsl:attribute name="style">background-color: #999</xsl:attribute>
                </xsl:otherwise>
            </xsl:choose>
            
            <td><xsl:value-of select="\$thistrack/following-sibling::key[text()='Artist']/following-sibling::string" /></td>
            <td><xsl:value-of select="\$thistrack/following-sibling::key[text()='Name']/following-sibling::string" /></td>
            <td><xsl:value-of select="\$thistrack/following-sibling::key[text()='Album']/following-sibling::string" /></td>
            <td><xsl:value-of select="\$thistrack/following-sibling::key[text()='Play Count']/following-sibling::integer" /></td>
        </tr>
    </xsl:template>

</xsl:stylesheet>