A project.
June 15th, 2009
I think I’ve finally found a project to throw myself into. We went–like we usually do–to the farmer’s market in Takoma Park a couple weeks ago and I struck up a brief conversation with one of the folks in a plant booth about why I might be having problems with my indeterminate tomatoes. We came to the conclusion that they just weren’t getting enough light.
Our apartment building is shaped like a “U.” All of the windows in our apartment face the interior of the “U.” I’m not sure what direction the windows look out on but it doesn’t really matter, our plants get 2 hours tops of direct sunlight each morning. It’s bright all day, but the direct light is lacking.
I’d probably just throw my hands in the air and toss the plants out, but we’ve already spent so much time and money harvesting/buying seed and supplies… So I went off to do some research about artificial light sources. I hit a couple websites before realizing that I could probably pull off a simple project like this with my limited knowlege of hobbyist electronics. I dashed to Makezine.com and instructables to pull up whatever information I could find on the subject.
I quickly gathered a couple things:
a. LEDs would be the most energy efficient method of grow-lighting. They also appear to be the latest trend. Works for me, they’re cheap as hell.
b. Plants absorb mostly the red and blue parts of the spectrum for photosynthesis. Red LEDs around 640-680nm in wavelength and blues around 440nm. A mix of anywhere from 70/30 red to blue seems to be the popular choice, thought some places offer you up to 100% red.
c. by pulsing the LEDs you can 1. save electricity and 2. increase plant growth.
SO… I quickly grabbed all my gear out of the closet to do a quick survey of what parts I had lying around. I found a boat load of transistors and resistors with a healthy amount of capacitors thrown in the mix. (all of these parts were from my senior thesis.) I only found 3 red LEDs and 1 yellow. (I used them as indicators that the breadboards my project was built on had power.) My arduino board looks to be in fine shape, though I don’t know that I’m going to initially tackle the whole pulsing thing, so I may not need it til I do.
Anyway, I’m going to try and update here when there’s more to report. For right now I’m digging through part catalogs to find the cheapest, brightest LEDs that I can.
New on Autumnrayne.net
May 14th, 2009
Just started a blog focused on gaming at: http://aether.autumnrayne.net
Just added…
April 14th, 2009
I just added my senior thesis, Reflections, to the portfolio page. Check it out. More stuff still to come.
Getting YouTube Group Videos into Excel.
April 14th, 2009
You might have heard about the singing contest that just closed at the National Museum of American History. We charged America to sing the Star-spangled Banner and post it to our YouTube group from where we would select a group of semi-finalists to be judged by a celebrity panel (think American Idol). We had a fantastic response and got 866 submissions. During the first few weeks of the competition we watched the pool of videos grow past 50… 100… 200… and began to fear the task of trying to gather all the data we needed to choose the semifinalists. The rules stated:
Overall Appeal of Vocal Performance, Originality, Accuracy of Lyric, and Community Popularity during the Round 1 Judging Period (measured by YouTube views, ratings, and favorite statistics).
How do you get:

into:

The general feeling was that we’d spend a week or two copy/pasting information into an excel sheet. Since we’re always looking for ways to “work smarter, not harder” I got into researching what might be able to be accomplished with the YouTube API.
I have limited experience messing with all these new APIs for sites. The most obvious one is up on top of this page where it pulls in my twitter status. YouTube’s API is daunting. I spent the better part of a day trying to find documentation on how to pull information on group videos before getting frustrated and sending a call out on twitter for “YouTube API ninjas.” Stephanie Liu, who works for google got back to me and confirmed my growing suspicion that there was no way to access the group data via the API–we were back to square one.
Not quite willing to suffer the fate of doing all of this by hand I continued to look for ways other people had gotten around this problem. I was trying to come up with a new way to google the problem when it struck me. I could put all of the videos into a playlist and access that via the API.
I threw a couple dozen videos into a quicklist and then dropped that into a new playlist. It worked like a charm except it didn’t pull everything I had added. I shrugged this off as a minor thing that was probably the result of pressing the wrong button somewhere.
In addition to getting the data, I needed to find a way to freeze it in time at 12am April 13, 2009. Part of the first round of judging was based on the views and rating of the video on YouTube, we didn’t want any views or ratings after the end of the contest to count. This ended up being the easiest problem to solve. Instead of calling the YouTube API everytime I wanted the information, I simply dropped the address into my browser and saved the XML to my desktop. Some browsers rendered the XML like an RSS feed, but simply viewing the source let me copy the raw data to a text file. It’s worth noting here that you can only return 50 entries at a time this way. It defaults to 25, but by adding “?max-results=50″ to the URL you can get 50. If you have more than 50 in a playlist you can grab the first 50 and then add “?start-index=51&max-results=50″ to the URL to grab the second set. You can see this data for my awesome jazz playlist here.
Now that I have some XML to work with, I went about setting up a page to organize the whole thing. The easiest way for me to do this was in Adobe’s Spry framework which wasn’t something I had a huge amount of experience in, but had gotten to work on a couple projects in the past. One limitation I wasn’t able to get around was the inability for spry to read the children of children of the parent node. In simpler terms it wouldn’t read the grandchildren of the parent element:
Parent
- child
- grandchild
- grandchild
- child
Unfortunately this is where a lot of the most useful information lives… like the URL of the video. To get around this I added a second dataset from the same source that selected the child node from above to be the parent. Here’s my source:
<script src=”SpryAssets/xpath.js” type=”text/javascript”></script>
<script src=”SpryAssets/SpryData.js” type=”text/javascript”></script><script type=”text/javascript”>
<!–
var ds2 = new Spry.Data.XMLDataSet(”video1.xml”, “feed/entry/media:group”);
var ds1 = new Spry.Data.XMLDataSet(”video1.xml”, “feed/entry”);
ds1.setColumnType(”yt:statistics/@favoriteCount”, “number”);
ds1.setColumnType(”yt:statistics/@viewCount”, “number”);
ds1.setColumnType(”gd:rating/@average”, “number”);
ds1.setColumnType(”gd:rating/@numRaters”, “number”);
//–>
</script>
</head><body>
<div spry:region=”ds1 ds2″>
<table border=”1″ style=”float:left;”>
<tr bgcolor=”#CCCCCC”>
<th>id:</th>
<th>Title:</th>
<th >Views:</th>
<th>Favorites:</th>
<th >Rating:</th>
<th >#Raters:</th></tr>
<tr spry:repeat=”ds1″>
<td>{ds1::ds_RowID}</td>
<td>{title}</td>
<td>{yt:statistics/@viewCount}</td>
<td spry:if=”‘{yt:statistics/@favoriteCount}’ > 0″>{yt:statistics/@favoriteCount}</td>
<td spry:if=”‘{yt:statistics/@favoriteCount}’ == ‘undefined’”>0</td>
</td>
<td>{gd:rating/@average}</td>
<td>{gd:rating/@numRaters}</td>
</tr>
</table>
<table border=”1″>
<tr bgcolor=”#CCCCCC”>
<th>Link:</th>
<th>Length (seconds):</th>
<th>Uploaded:</th>
<!–<th>ID:</th>–>
</tr>
<tr spry:repeat=”ds2″>
<!–<td>{ds2::ds_RowID}–>
<td>{ds2::media:player/@url}</td>
<td>{ds2::yt:duration/@seconds}</td>
<td>{ds2::yt:uploaded}</td>
</tr>
</table>
</div>
So all this is doing is iterating through the XML and picking out all the nodes I tell it to and dropping them into table cells. (its tabular data, don’t get all “ewww tables” on me–I’m on your side.) This is really rough and I’m sure there are spry wizards out there who are shuddering and convulsing and moaning about bloated code, and whatever other idiotic things I did, but it works and I was able to hack it together in a short amount of time which was the goal.
When the contest closed I copied all of the XML into a single file. The file was something like 40,000+ lines long and weighed in at a whopping 3.6Mb. At that point I understood why YouTube restricts the max number of results you can call at once. I uploaded everything and prayed it would work.
Clearly, it didn’t.
I let it sit and run for 30 minutes and no data ever showed up. Since we got 866 entries I had 9 playlists and 18 XML documents. (50 entries per XML document, 100 entries per playlist.) Rather than fuss around I merged the XML into 9 documents and fed them to the Spry one at a time. A little copy/paste special later and all of the videos and their relevant informations were in Excel for the judges to sort and use.
If you’re looking to do the same thing, here’s the instructions without any of the story. I assume that you have a video group.
1. Add all of your videos to a quicklist and create playlists from your quicklists.
2. Note the ID of your playlists. This is the 16 character alphanumeric number that shows up last in the URL of your playlist when you view it.
http://www.youtube.com/my_playlists?pi=0&ps=20&sf=&sa=0&sq=&dm=0&p=ED20C1703BD97D2B
3. Direct your browser to: http://gdata.youtube.com/feeds/api/playlists/**PLAYLIST ID HERE**
- to get more than 25 results you need to add “?max-results=50″ to your URL
- to get more than 50 results you need to save the first 50 and then add “?start-index=51&max-results=50″ to the URL.
4. Use the HTML above, or write your own that will read and filter the XML. This page really helped me.
5. Your output should be easily copied into Excel or another program of your choice. OR you could do a better job writing the spry than I did and just leave it there!
Hope this helps all those other people out there that are struggling with this problem. Feel free to use anything you see here, or email me for more information.
update: right after publishing this, i realized that the twitter status referenced in this post had stopped working. I’m in the process of tracking down the issue, but it has been removed for the time being.
You might have noticed…
April 3rd, 2009
you might have noticed that some posts disappeared. Rather than turn this blog into some sort of chore or diary, I’m going to subscribe to the “slow-blogging” movement and really only write something when I have a meaningful message. Those posts are going to be focused around: technology, usability, museums in a web2.0 world, and possibly some gardening, cooking, or crossposts from my fiance’s blog.
On an unrelated note, I host a few of my friends here on mediatemple as a part of my package and just put up thecrowandthewolf.com this morning. While there isn’t much there yet, you should check out their old site. They’re a community arts initiative in San Francisco that’s planning on creating a mobile exhibition.
portfolio added
March 13th, 2009
ooo hey look at that, I get myself all excited and I’m off again. Check out the few pieces I’ve got up in the portfolio section. I’ll work on getting more things added, and try to find a good way to add source code to those projects that are code-based.
gotchya
March 13th, 2009
I caught myself this time. This is that pivotal moment where I’ll stop updating this site and let it fall to the wayside, come back in six months and delete everything on the server and start over. So this week there will be a post every single day. They will all probably be lame and no one but my brother-in-law will read them, but they will be there. I’d like to return to explaining my facebook application process, I think that in particular would be worthwhile. Even if it just ends up being documentation for myself. (we never did end up using the app, but it was a good experience.) Maybe I should set a goal to get something into the portfolio part of the site… a lot of good that does me with nothing in it.
stuff’s coming, stay tuned!
google apps for your domain.
February 26th, 2009
Looks like the simplest solution for the problems I was looking to solve by installing OS X server at home is offered by the company I was looking to emulate. Enter google apps. I had looked at this before but only seen a subscription-based service. After looking more closely you can set up a calendar, email, documents, etc. on your domain for free. There’s a storage restriction, but for a personal account I don’t foresee any problems keeping my email under 7GB. especially considering that I don’t use my domain for email, just my Gmail account. We’ll see what applications Elena and I can come up with for this, I forsee the documents and calendaring feature being pretty useful. The calendar will be great if we can figure out a way to push information from ical/outlook/our iphones. Thanks to @foundhistory and @dancohen for piquing my interest.
oh my gmail, what confusing buttons you have…
February 24th, 2009
…All the better to spam you with!
Exhibit A:

note where the delete button is here
Exhibit B:

Now where is it?
So we have a delete button that starts on one side of the “action bar” and migrates to the complete opposite side once I’m in my spam folder?
Who signed off on that one? Its bold and big so I’m supposed to read it, I guess–but I don’t. This results in me constantly moving messages back into my inbox that are about all sorts of things that would make my grandmother blush.
edit: ok, I thought about this for a little bit longer and it looks like they’re equating the act of archiving an email message to deleting spam permanently. They assume that these are the default actions that you’re going to take in each separate view. However, most people I know function out of their inbox. The archive is great, and is certianly one of the best features of gmail but I think that of all the inboxes I’ve seen the email just stays there. I myself had almost 18000 messages in my inbox until but 4 or 5 months ago when I set it to archive anything that got downloaded by my computer.
In this light, I think the move makes sense, but assuming that people would rather archive than delete as a default action in their inbox should be the subject of a lot of study and scrutiny. I suppose I could archive the 6 emails I got (and are displayed above) from the freecycle group that I signed up for. Or I could just delete them and check the website if I needed to refer to anything in them again. Same goes for my daily emails from graphjam, storypeople… etc. The rest can just sit there, I can search through them so effectively that I find no need to archive them or move them around.
update on os x server @ home:
February 22nd, 2009
After reinstalling the system around 3 or 4 times I’ve given up. I’m not sure what I’m gaining from the server apart from a couple cool little things that would make my life marginally easier. It also seemed to grind our network’s speed to a halt. I tried to download quicktime so that I could put itunes on the server box and it was running at a whopping 7kbps. 2 hours to download quicktime? No thanks.
I’ve got leopard (the normal version) up and running now. We’ll see if i can find any tips or tricks that would let me backup via wireless to the tower’s 600GBs of storage.