Category Archives: code

Visualizing a fiery wheel.

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

They are having a “contest”:http://firewheeldesign.com/sparkplug/2006/February/a_colorburn_contest.php 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):
!http://metaatem.net/images/firewheel_before.png!
!http://metaatem.net/images/firewheel_after.png!

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

Here is the script.
“http://metaatem.net/scripts/colorshowerforfirewheelt.user.js”:http://metaatem.net/scripts/colorshowerforfirewheelt.user.js

Big change – coming soon!

Welp – stay tuned. Coming soon – to *this* space. A NEW blog. It will be typo powered.
I plan on focusing on Ruby on Rails mostly.
Get ready

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.
Goals:
* 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”:http://crossfit.com 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”:http://flickr.com/groups/thingsieat. 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”:http://rubyonrails.com 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.

Source:

http://metaatem.net/my_runs.phps

Data:

http://metaatem.net/data_run.xml

–UPDATE–

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" ?>
<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>

Lazy Web Request

I think we need a tagging system for our files… I want to be able to find all files tagged with “tpsreport”…

Javascript test

Refresh for new letters:


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.