Category Archives: code

Visualizing a fiery wheel.

I _love_ the designers (and programmers) over at “IconBuffet”: They recently released a dashboard widget, “ColorBurn”:, that has a new color palette each day.

They are having a “contest”: for a few more days to have the community give them some new and fresh color schemes

They way it works is this:

* come up with a color scheme of 4 colors
* take a picture of that scheme as boxes next to each other
* make a comment on the thread listing your colors, plus a link to your image
* profit.

I’m not going to come up with the next great color set, but I can make their dull view of a cool contest a bit cooler (with a little help from my friend greasemonkey):

Don’t like the black background? Click the link at the bottom to make the bg change to white.

Here is the script.

Goals, and a new project!

If you are reading this in a feed reader, I am sorry, It will keep poping up as I make changes.
Now that I know a few people read this blog, I’m going to ask them all for a favor.
I am going to write down a list of my goals, and commit to a new project. If anyone reading this sees me slacking off, just let me know – Please.
* Happiness

I am happy most of the time, but I get really down sometimes, I’d like to do things to prevent this

* Fitness

I was doing “Crossfit”: for a while, but now that I don’t belong to a gym, it is hard
Time is (of course) my least flexible resource…
Discipline is tough for me

* Projects

I want to learn Ruby, then use Ruby on Rails to make a few ideas that have been bouncing around in my head

* A new (for me) car

I need a better way to get Ellie and my future bike around – I wanted to get a used element, but A) my credit is bad, and B) they are hard to find used. I think I will pick up an older Mini Van once my credit is a bit better.

* A house

This is a further goal – but again, it is mostly for Ellie (and future dogs!)

Now for the project announcement!
The *Things I eat* project
I am going to take pictures of everything I eat, and post them to “flickr”: The point of this is to bring awareness to the things I’m eating, so I can make better descisions. As of right now, this project is new and exciting, so my first day is going to be awesome – good food choices, good portion control. But I know, that as I go on, I will slip – that is where I need people to give me a kick in the butt and get me back on track. John had a good idea – so I’ve also started a flickr group “Things I Eat” so anyone can join in the fun (both advice AND taking pictures of your own food).

I must be dumb.

It has taken me almost 10 years to “get it”. Way back in 96-97, I started with ASP(Active Server Pages), on a project for PBI(Pacific Bell Internet), written by Silknet Software. It was a really nice piece of kit that did web-based customer service. They chose ASP, well, because it was the only choice.
The part I didn’t “get” until now was the first part of MVC(Model View Controller). Their seperation of logic and layout was non-existant, but they did have what they called “Business Objects” that were COM(Component Object Model), written mostly in C and VB. The gist of the story is this — I realized how powerful it is to have all your logic in one place that is clearly apart from ANY “day to day” logic. What made me realize this? “Rails”: and thinking about how difficult it is going to be to move to our new POS system at work. I need to start making objects :/

Google Maps Redux

Welp, google has relased their Google Maps API. It’s VERY nice. The code to draw my runs has gone from about 230 lines, down to about 100. But logically, it’s MUCH better.

the only problem I’m hitting is this – before I was generating the polyline myself, so google just had to draw it. Now, however, there is a GPolyline object that draws lines for you – much easier to code for, MUCH slower.

I’m sure this is a solution, and I’ll post it here when I find it.




Turns out I was mostly being dumb. If I had red the example source more closely, I would have seen you can put the points in an array and throw that to GPolyline… duh!
Cleaner, and faster, what more can you ask for?

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" ?>
    xmlns:xsl="" 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 style='background-color:#ddd;'>
                <th>Track Name</th>
        <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: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]" />
                <xsl:when test="position() mod 2 = 1">
                    <xsl:attribute name="style">background-color: #bbb</xsl:attribute>
                    <xsl:attribute name="style">background-color: #999</xsl:attribute>
            <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>


BIG problems.

I got an email from Stewart this morning (he wrote it last night while I slept). Saying that my api key was disabled – and lo – it was!
Turns out, something got b0rked or pw3nd or any other code you’d like to call it, and I was hitting flickr‘s servers about 50x/second – NOT GOOD.

I’m still looking into the problem. Hopefully it will be resolved soon.