<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>New Media Initiatives &#187; Source Code</title>
	<atom:link href="http://blogs.walkerart.org/newmedia/category/source-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.walkerart.org/newmedia</link>
	<description>Just another Walker Blogs weblog</description>
	<lastBuildDate>Thu, 12 Nov 2009 20:27:13 +0000</lastBuildDate>
	<generator>walker_blogs</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Build a bridging firewall (cheap!)</title>
		<link>http://blogs.walkerart.org/newmedia/2009/06/22/build-a-bridging-firewall-cheap/</link>
		<comments>http://blogs.walkerart.org/newmedia/2009/06/22/build-a-bridging-firewall-cheap/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 18:07:12 +0000</pubDate>
		<dc:creator>Nate Solas</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blogs.walkerart.org/newmedia/?p=862</guid>
		<description><![CDATA[New Media has a number of development servers located in-house where we get stuff done before releasing it out into the wild.  Until last week these were protected by an aging OpenBSD firewall running packet filter and all was well until midweek when the motherboard failed.  Not having a spare on hand, I was scrambling [...]]]></description>
			<content:encoded><![CDATA[<p>New Media has a number of development servers located in-house where we get stuff done before releasing it out into the wild.  Until last week these were protected by an aging OpenBSD firewall running <a href="http://en.wikipedia.org/wiki/PF_(firewall)">packet filter</a> and all was well until midweek when the motherboard failed.  Not having a spare on hand, I was scrambling for a solution.</p>
<div class="wp-caption alignright" style="width: 260px"><a href="http://en.wikipedia.org/wiki/Linksys_WRT54G_series"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/e/ee/Linksys_WRT54G_V1.jpg/250px-Linksys_WRT54G_V1.jpg" alt="Linksys wireless router" width="250" height="188" /></a><p class="wp-caption-text">Linksys wireless router</p></div>
<p>Being familiar with the <a href="http://www.dd-wrt.com/">dd-wrt project</a>, I was pretty sure I could build a firewall out of a <a href="http://en.wikipedia.org/wiki/Linksys_WRT54G_series">Linksys router</a>.  We went with the WRT54GL, currently as cheap as $50 on Amazon.  (We bought local so we&#8217;d have it sooner, and it was a bit more).</p>
<p>The first step after flashing the firmware with the latest dd-wrt build (v24-sp2) was to take off the antennas and turn off the radio.  The last thing I want for the firewall is to be broadcasting an SSID and allow wireless associations.  This actually requires a startup script on the router, with a line to remove the wireless module so it won&#8217;t try to reenable itself:</p>
<pre style="padding-left: 30px">wl radio off
wl down
rmmod wl</pre>
<p>Good start.  Next I needed to bridge the WAN port with the LAN ports, which ended up being a struggle until I found the easy options in the dd-wrt GUI.  First, set the LAN to use a static IP and make sure you can connect via another machine to configure it.  You&#8217;ll also need to enable SSH access and remote configuration &#8211; but be sure to lock this down once the firewall is running!</p>
<p>Once you have the LAN configured, you need to set the WAN connection type to &#8220;disabled&#8221;.  This will give you a checkbox to bridge the LAN and WAN:  &#8220;Assign WAN port to switch&#8221;.  Lastly, under Advanced Routing set the Operating Mode to &#8220;Router&#8221; so it stops trying to do NAT.  Apply these settings, and you&#8217;ll basically have an expensive dumb switch &#8211; all traffic shows up on every port, and there&#8217;s no logic at all.  We&#8217;re halfway there.</p>
<p>Being unfamiliar with iptables (we use OpenBSD and pf for firewalls around here), I was under the impression that iptables rules would work in a bridging environment.  This is not the case: bridged packets don&#8217;t reach iptables at all!  The best I could do was block everything (manual restart needed), or otherwise blow up the configuration (manual restart needed) as I tried to mess with the bridge.  This was an incredibly frustrating learning curve as everything I could find made it sound like this was the way to configure a firewall in Linux, but it just wasn&#8217;t working.</p>
<p>Note to keep you sane: don&#8217;t do any of this testing in the startup scripts or you&#8217;ll brick your router, guaranteed.  Do it all from the command line with a known-good startup.  That way it&#8217;s a simple (but annoying) power cycle to get things back up.</p>
<p>The trick, it turns out, is a kernel module called ebtables.  Luckily, this is included in the dd-wrt build, but it&#8217;s not turned on by default!  Add this to your startup script:</p>
<pre style="padding-left: 30px">insmod ebtables
insmod ebtable_filter
insmod ebt_ip.o</pre>
<p>And, ta-da, all your iptables rules will start impacting packets!  Now it&#8217;s just a matter of configuring the firewall rules.  We&#8217;re using something like this:  (vlan0 represents the LAN ports, and vlan1 is the WAN port)</p>
<pre style="padding-left: 30px"># drop everything by default:
iptables -P FORWARD DROP
# clear the old rules:
iptables -F FORWARD
# forward stuff that's established already
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# let connections out:
iptables -A FORWARD -i vlan0 -m state --state NEW -j ACCEPT

# firewall access rules
iptables -F INPUT
# WAC ips can get to fw:
iptables -A INPUT -p tcp -d 1.2.3.4 -s 4.3.2.1/24 -j ACCEPT
# drop everything else!
iptables -A INPUT -p tcp -d 1.2.3.4 -j DROP

# ... snipped all the actual access rules and packet flood protection ...</pre>
<p>The only trick here is the last few lines which limit access to the firewall machine itself.  We can&#8217;t use the FORWARD rules since these packets are destined for the internal hardware and not forwarded, but we do need to limit access via the INPUT chain.  In this example the firewall has IP 1.2.3.4 and the network I want to access it from has 4.3.2.x.  That way I can leave the firewall&#8217;s remote access turned on and limit it to our network.  (because there&#8217;s no terminal access you can&#8217;t make it a truly transparent bridge or you&#8217;d never be able to change the config!)</p>
<p>I admit I&#8217;m a bit nervous posting some of this in case there&#8217;s a glaring security hole, but it seems good to me.  Anyone see anything they&#8217;d like to warn me about before we get hacked?</p>
<p>And there you have it!  For the cost of a cheap router and some time (not much, since you can just follow these notes!) you have a full-featured bridging firewall running on dedicated hardware.  With a little extra work it would be easy to get VPN running and much more&#8230;  I&#8217;m hoping for years of service from this little guy!</p>
<p><span style="font-size: xx-small">( Hat tip another <a href="http://slagwerks.com/blog/index.php/2008/10/10/openbsd-firewall-on-soekris-4501/">DIY firewall solution</a> that I&#8217;d really like to try someday. )</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2009/06/22/build-a-bridging-firewall-cheap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Facebook app for My Yard Our Message</title>
		<link>http://blogs.walkerart.org/newmedia/2008/05/29/facebook-app-yard-message/</link>
		<comments>http://blogs.walkerart.org/newmedia/2008/05/29/facebook-app-yard-message/#comments</comments>
		<pubDate>Thu, 29 May 2008 19:54:10 +0000</pubDate>
		<dc:creator>Justin Heideman</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Social Networking]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blogs.walkerart.org/newmedia/2008/05/29/facebook-app-for-my-yard-our-message/</guid>
		<description><![CDATA[Tuesday I posted some of the technical details for My Yard Our Message. Since then, I&#8217;ve been working on putting together a Facebook App to let people show the signs on their profiles. It is done, or done enough to be used.
I&#8217;ve played around with building a Facebook app before, but never had a clear [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.facebook.com/apps/application.php?id=13913639097" title="My Yard Our Message Facebook App"><img src="http://blogs.walkerart.org/newmedia/files/2008/05/myomfacebook1.jpg" alt="My Yard Our Message Facebook App" align="right" height="267" width="247" /></a>Tuesday I posted <a href="http://blogs.walkerart.org/newmedia/2008/05/27/building-yard-message-django/">some of the technical details</a> for <a href="http://myyardourmessage.com/">My Yard Our Message</a>. Since then, I&#8217;ve been working on putting together a <a href="http://www.facebook.com/apps/application.php?id=13913639097">Facebook App to let people show the signs on their profiles</a>. It is done, or done enough to be used.</p>
<p>I&#8217;ve played around with building a Facebook app before, but never had a clear strategic need to build one. I found <a href="http://www.howtoforge.com/rss_facebook_app_php">this tutorial</a> very helpful on getting my feet wet. For the moment, the app is written and PHP and talks to the actual My Yard Our Message site via json, rather than rss.</p>
<p>One of the things I am evaluating is whether or not I can set up a system to let people vote on signs directly from Facebook. Obviously, this would tremendously expand our pool of eligible voters, and would eliminate the need to force people to register for an account just to vote. During the building of the app, I went back and forth on the necessity of registration to vote, but ultimately decided it was necessary and laid the structural groundwork. However, I think I can get enough information about Facebook users to know they&#8217;re unique, track them, and prevent them from voting more than once.</p>
<p>This would require re-writing the Facebook app at that point, most likely in python and django for closer integration with the authentication and verification processing. There is some initial <a href="http://wiki.developers.facebook.com/index.php/PythonPyFacebookTutorial">work done</a> on a <a href="http://code.google.com/p/pyfacebook/">Facebook client API for python and django</a> that looks promising as well.</p>
<p><strong>Aside about Facebook pages</strong></p>
<p>I&#8217;ve always been frustrated with Facebook apps that don&#8217;t work on Pages (as opposed to Profiles). After building an app, I have a new found appreciation for the applications that don&#8217;t work. Getting an app to work with pages isn&#8217;t really that hard, but it sure is confusing, mostly because of the lack of documentation. The only real documentation is a <a href="http://wiki.developers.facebook.com/index.php/Facebook_Pages">chat log in the Facebook developer wiki</a> (no, I am not making this up):</p>
<p><code> </code></p>
<pre>

(03:02:02 AM) swombat: ok, so basically, "Facebook pages is all transparent uses fbml blah blah blah"

                       "Oh but btw you need to build a completely different piece of code to handle this new type of user"

(03:02:18 AM) swombat: (not angry at you btw :-P)

(03:02:43 AM) fiveofoh: Yeah pretty much

(03:02:46 AM) swombat: this sounds really quite tedious and error-prone though

(03:02:50 AM) fiveofoh: Yeah it does

(03:02:56 AM) fiveofoh: Which is why I haven't done it on my app yet :P</pre>
<p>So instead of just this:</p>
<p><code> </code></p>
<pre>

$facebook-&gt;api_client-&gt;profile_setFBML('', $user);

$facebook-&gt;api_client-&gt;fbml_refreshRefUrl($process_url);
</pre>
<p>you use this:</p>
<p><code> </code></p>
<pre>

if (isset($_GET['fb_page_id'])){

	$facebook-&gt;api_client-&gt;profile_setFBML('', $_GET['fb_page_id']);

} else {

	$facebook-&gt;api_client-&gt;profile_setFBML('', $user);

}

$facebook-&gt;api_client-&gt;fbml_refreshRefUrl($process_url);
</pre>
<p>Where $process_url is the page that spits out the markup to be shown on Facebook.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2008/05/29/facebook-app-yard-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Party People Tech Details</title>
		<link>http://blogs.walkerart.org/newmedia/2007/02/23/party-people-tech-details/</link>
		<comments>http://blogs.walkerart.org/newmedia/2007/02/23/party-people-tech-details/#comments</comments>
		<pubDate>Fri, 23 Feb 2007 18:19:18 +0000</pubDate>
		<dc:creator>Justin Heideman</dc:creator>
				<category><![CDATA[Photobooth]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://blogs.walkerart.org/newmedia/?p=306</guid>
		<description><![CDATA[
Party People Photos was back in action at After Hours last week, and I promised more technical details of the new features. The big change this time around was automatic uploading to flickr. After each photo was taken, it was transfered, processed, uploaded and finally displayed on-screen in the lounges. I ended up re-writing all [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/walkerart/392576247/" title="Photo Sharing"><img src="http://farm1.static.flickr.com/182/392576247_be9fca93c0_m.jpg" width="240" height="160" alt="Buoyant Sultry Party People"></a></p>
<p><a href="http://blogs.walkerart.org/newmedia/?p=251">Party People Photos</a> was back in action at <a href="http://calendar.walkerart.org/afterhours/index.wac">After Hours</a> last week, and I <a href="http://blogs.walkerart.org/newmedia/?p=305">promised more technical details</a> of the new features. The big change this time around was automatic uploading to flickr. After each photo was taken, it was transfered, processed, uploaded and finally displayed on-screen in the lounges. I ended up re-writing all the transfer and processing scripts to work better, and they all functioned without problem.</p>
<p>After a photo was taken, it was saved to a folder on the capture iMac. A script started by launchd watched the folder and transfered the file via rsync to my workstation. The files were transfered to my workstation rather than directly to the display computers for two reasons.</p>
<p><strong>Photoshop</strong></p>
<p><a href='http://blogs.walkerart.org/newmedia/files/2007/02/photoshopevents1.png' title='Photoshop Events Manager'><img src='http://blogs.walkerart.org/newmedia/files/2007/02/photoshopevents1-150x150.png' alt='Photoshop Events Manager'></a> Once the files got to my workstation, another script watched the incoming folder and sent all incoming jpg files to Photoshop. We wanted the process all the images to make sure they looked their best. Cameron, one of our photographers, developed a handy action for the photos that would give them more contrast and punch. The easiest way to automate this in photoshop is to use the script events manager to run an action on every file that is opened ( File &gt;  Scripts &gt; Scripts Event Manager&#8230; ). The easiest way on OS X to get a particular application to open a file is to use the open command with the -a argument. The -a lets you specify the binary that you want to use to open the file. Otherwise, you&#8217;re at the mercy of whatever program has associated itself with jpeg files.  Here&#8217;s the script:</p>
<p><code>
<pre>

#! /bin/sh

# this script takes files from the 1_incoming directory and tells photoshop to open them

# should be called by launchd which will be watching the 1_incoming folder

# photoshop should be set to perform the action on open new document

while true; do

myls=`ls /Volumes/Patience/_after_hours/1_incoming/`

	if [ "$myls" != '' ] ; then

		for myFile in /Volumes/Patience/_after_hours/1_incoming/*.JPG

		do

			/usr/bin/open -a /Applications/Adobe\ Photoshop\ CS2/Adobe\ Photoshop\

				CS2.app/Contents/MacOS/Adobe\ Photoshop\ CS2 $myFile

			sleep 2

			mv $myFile /Volumes/Patience/_after_hours/2_incame/  2&gt;&amp;1 &gt; /dev/null

		done

	fi

	sleep 10

	#take care of pesky .DS_Store files, which can pop up from the Finder

	find /Volumes/Patience/_after_hours/ -name .DS_Store -exec rm -f {} \;

done

# added a return on the photoshop open line for clarity in the browser
</pre>
<p></code></p>
<p>Every 10 seconds, if there is a new file, and it is a jpeg, it will get sent to Photoshop. Photoshop runs the action, and saves the file to a new folder, again as a jpeg.</p>
<p>I used my workstation for this because it already had Photoshop installed, and I didn&#8217;t want to deal with licensing issues on another machine. I created another account that had photoshop set up just right and the launchd jobs start onload. When we set up PPP again for Picasso show, I&#8217;d love to be able to do post-processing via <a href="http://www.imagemagick.org/">imagemagick</a>, since it is command-line, easy to install and unencumbered by licensing issues.</p>
<p><strong>Flickr Uploading</strong></p>
<p>Photoshop has now saved the jpeg to a different folder. This folder is being watched by yet another script, similar to the last. This script does two things: copies the jpegs to our projection machines and uploads them to flickr. The copy process is mostly unchanged, though I used scp instead of rsync, since the I want to copy files one at a time. As with all the rsync or scp transfers, I just made sure I had my <a href="http://www.sshkeychain.org/mirrors/SSH-with-Keys-HOWTO/SSH-with-Keys-HOWTO-4.html#ss4.3">keys set up and authorized</a>, and it worked fine.</p>
<p>Uploading to flickr was the trickiest part of the operation, but thankfully <a href="http://www.flickr.com/services/api/">flickr provides a great API</a> and there are a lot of libraries that simplify the process. I ended up using <a href="http://phpflickr.com/">phpflickr</a>. I am pretty familiar with <a href="http://www.php.net/">php</a>, and phpflickr only requires php4, which is the version of php-cli in OS X. In order to get it working, you have to apply for an API key, giving it write permission. Using your API key and the secret, you generate a token that you can use to upload with (you need all three to upload). Phpflickr provides the scripts necessary to provide the callback URL that flickr needs, even if you&#8217;re not uploading things directly from the web. It is somewhat confusing, and I&#8217;m not entirely sure I need the callback url, but it works all the same.</p>
<p>With the tokens all set, uploading the photo is as simple as upload, add to group, add to set. To get the ID of the group and the set, I just used <a href="http://www.flickr.com/services/api/explore/?method=flickr.groups.pools.add">the API explorer</a>, which lists the groups and sets I visited. I had to create the set before I started uploading, though it is possible to create a set through the APIs. I also created a function in the upload script that used a word list to generate a title for each photo as it was uploaded to flickr. I am not a fan of seeing photos with names like IMG_4097.JPG, and this solved that and created some fun and funny juxtapositions.</p>
<p><strong>Other notes, future</strong></p>
<p>I <a href="http://www.flickr.com/help/printing/">enabled printing</a> of all our photos on flickr, so you can now get prints if you want. In the US, flickr and yahoo do the <a href="http://blog.flickr.com/flickrblog/2005/10/your_photos_on_.html">printing through Target</a>, which also happens to be a major sponsor of After Hours. Perhaps that is an opportunity for the future.</p>
<p>I still had some trouble with the camera not acting the way I wanted. Sometimes it would get into a state where it was totally locked, and the only way to reset it was to pull the power by removing the battery adapter; turning it off and on again wouldn&#8217;t do it. Due to the way that <a href="http://blogs.walkerart.org/newmedia/?p=243">gphoto2 talks to the 10D</a>, the capture command doesn&#8217;t fully finish, so I kill it after a few seconds. I think what was happening was that in some focus situations, the autofocus was taking too long and the camera hadn&#8217;t finished capturing when I kill the command. In the future, I am going to experiment with using a manual focus, which will eliminate that problem.</p>
<p>Gphoto2 was also recently updated to 2.3.0, and it now <a href="http://www.ynse.net/2006/09/10/gphoto2-on-mac-osx/">compiles without too much trickery on OS X</a>. However, it hasn&#8217;t fixed my problems with capture on the Canon 10D. I might experiment with modifying the Canon class for the 10D a bit to see if I can get it to work.</p>
<p>We also had some problems with the flash not always firing when the camera went. Unfortunately, the <a href="http://www.canon.com.au/products/cameras_lenses_accessories/speedlites/macroringlitemr14ex.html">flash we&#8217;re using</a> doesn&#8217;t have an input for a power adapter, so we were running on batteries. It also doesn&#8217;t indicate low batteries, leaving us, literally, in the dark. For the <a href="http://calendar.walkerart.org/canopy.wac?id=2735">Picasso After Hours</a>, we&#8217;re planning on jerryrigging a wired power adapter to provide the 6V it requires.</p>
<p>I&#8217;ll also be setting up Party People Photos for the <a href="http://calendar.walkerart.org/event.wac?id=3728">Free First Saturday on March 3rd</a>. I think kids will get a kick out of it. We won&#8217;t add the photos to the <a href="http://www.flickr.com/groups/walkerafterhours/pool/">After Hours Group Pool</a>, but we will put them on <a href="http://www.flickr.com/photos/walkerart/">our Flickr</a>. Watch for it (or attend, it is free).</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2007/02/23/party-people-tech-details/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>More on using Quartz Composer for digital signage</title>
		<link>http://blogs.walkerart.org/newmedia/2007/01/25/more-on-using-quartz-composer-for-digital-signage/</link>
		<comments>http://blogs.walkerart.org/newmedia/2007/01/25/more-on-using-quartz-composer-for-digital-signage/#comments</comments>
		<pubDate>Thu, 25 Jan 2007 22:28:06 +0000</pubDate>
		<dc:creator>Justin Heideman</dc:creator>
				<category><![CDATA[Dynamic Signage]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://blogs.walkerart.org/newmedia/?p=296</guid>
		<description><![CDATA[As has been mentioned here in the past, I have been tinkering with quartz composer for use as dynamic, digital signage. It is a good fit: extremely fast, can talk to the internet, usable on a lot of different systems. There are a growing number of locations within the museum where we&#8217;d like to apply [...]]]></description>
			<content:encoded><![CDATA[<p>As has been mentioned here in the past, I have been tinkering with quartz composer for use as dynamic, digital signage. It is a good fit: extremely fast, can talk to the internet, usable on a lot of different systems. There are a growing number of locations within the museum where we&#8217;d like to apply dynamic signage, but off the shelf systems to do it are often convoluted and proprietary, not to mention expensive. Currently in the Walker Cinema, we use a DVD that I render in After Effects and update periodically. This affords a lot of control, but also takes a fair amount of labor to update.</p>
<p>It is this kind of an application where Quartz Composer can work well. Any quartz composer movie can be saved as a quicktime movie, but there are some <a href="http://developer.apple.com/technotes/tn2005/tn2145.html">limitations</a>:</p>
<ul>
<li>no mouse and keyboard events</li>
<li>no contents download from Internet (RSS feeds, images&#8230;)</li>
<li>edition of the input parameters of the compositions</li>
</ul>
<p>Notice that second one? That&#8217;s the doozy if you want your quartz comp quicktime movie to use an RSS feed to get the text.<span class="Apple-converted-space"> </span></p>
<p>There is a simple workaround, though, and that is to simply download the RSS feed to the local machine before you open the movie in quickitime. You simply build the composition (before saving it as a movie) to look for that file on the local drive. Here&#8217;s a quick command to grab our RSS feed and save it:</p>
<pre>/usr/bin/curl http://calendar.walkerart.org/news/today.wac &gt; /tmp/today.html</pre>
<p>And then your path for the RSS feed inside quartz is:
<pre>file://localhost/tmp/today.html</pre>
</p>
<p>Problem one solved. This lets us manually open up the quicktime movie and export it to any format quicktime can export to. Once you have it in that format, you can transform it, play it or transfer it with much more ease.</p>
<p>I&#8217;ll post about how to automate the whole process in the future, and the problems that occur when you try to deal with HD resolution screens. In the meantime, here is a short demo of what I have been able to achieve with quartz composer and our identity system (a work in progress).</p>
<p><a id="p297" href="wp-content/uploads/2007/01/qtz_sign_sm_demo.mov" title="qtz_sign_sm_demo.mov"><img src="http://blogs.walkerart.org/newmedia/files/2007/01/qtz_sign_sm_demo1.jpg" alt="qtz_sign_sm_demo.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2007/01/25/more-on-using-quartz-composer-for-digital-signage/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Testing regular expressions</title>
		<link>http://blogs.walkerart.org/newmedia/2006/12/06/testing-regular-expressions/</link>
		<comments>http://blogs.walkerart.org/newmedia/2006/12/06/testing-regular-expressions/#comments</comments>
		<pubDate>Wed, 06 Dec 2006 21:42:05 +0000</pubDate>
		<dc:creator>Nate Solas</dc:creator>
				<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blogs.walkerart.org/newmedia/?p=263</guid>
		<description><![CDATA[Today I&#8217;ve got two good tools for web developers.
Lately I&#8217;ve had to write a number of regular expressions for the upcoming mnartists.org calendar &#8211; most in Java, and a few in Javascript. In theory a regexp is a regexp no matter the language, but in practice that&#8217;s rarely the case.  Between these subtle differences [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve got two good tools for web developers.</p>
<p>Lately I&#8217;ve had to write a number of regular expressions for the upcoming <a href="http://mnartists.org/">mnartists.org</a> calendar &#8211; most in Java, and a few in Javascript. In theory a regexp is a regexp no matter the language, but in practice that&#8217;s rarely the case.  Between these subtle differences and the maddening wait for compiling or reloading a page, it&#8217;s clear some sort of live testing environment is useful:</p>
<ul>
<li><a href="http://www.regular-expressions.info/javascriptexample.html">Javascript tester</a> &#8211; allows replacement testing as well</li>
<li><a href="http://www.fileformat.info/tool/regex.htm">Java tester</a> &#8211; really nice in that it gives accurate feedback on your regexp errors and even helps you format the matching text as a java String</li>
</ul>
<p>If you&#8217;re a developer messing with Java or Javascript regular expressions, IMHO it&#8217;s worth bookmarking those two pages.</p>
<p>Here&#8217;s a Java one &#8211; looks complicated, actually pretty straightforward.  Anyone care to take a stab at what it does?  :)</p>
<p><font face="courier">line = line.replaceAll(&#8221;\[([bi])\]([^\[]*)\[/\1\]&#8220;,&#8221;&lt;$1&gt;$2&lt;/$1&gt;&#8221;);</font></p>
<p>(or can you do it better?  I get by, but I know my regexps are sometimes clunky at best&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2006/12/06/testing-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Still images triggered by a computer</title>
		<link>http://blogs.walkerart.org/newmedia/2006/09/25/still-images-triggered-by-a-computer/</link>
		<comments>http://blogs.walkerart.org/newmedia/2006/09/25/still-images-triggered-by-a-computer/#comments</comments>
		<pubDate>Mon, 25 Sep 2006 22:55:21 +0000</pubDate>
		<dc:creator>Justin Heideman</dc:creator>
				<category><![CDATA[Photobooth]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">http://blogs.walkerart.org/newmedia/?p=243</guid>
		<description><![CDATA[For an upcoming project, we want to capture high resolution digital still images onto a computer from a camera. This is a technique used quite often in stop motion animation. A digital still camera is a very inexpensive way to capture images that are many, many times higher resolution than the HD video they will [...]]]></description>
			<content:encoded><![CDATA[<p>For an upcoming project, we want to capture high resolution digital still images onto a computer from a camera. This is a technique used quite often in stop motion animation. A digital still camera is a very inexpensive way to capture images that are many, many times higher resolution than the HD video they will eventually be a part of. A simple method would be to capture a large amount of images onto a camera&#8217;s storage card, download them, and them import and compose them in a compositing program such as After Effects.</p>
<p>However, for this project, we need the image capture to be triggered not by the button on the camera, but by the computer the camera is connected to. I initially looked at both FrameTheif and iStopMotion because they support digital still cameras and have an applescript library. However, both have spotty support for remote capture and would want to grab onto any other cameras connected to the system (such as a dv cam). Eventually, I found the <a href="http://gphoto.org/">gphoto project</a> on sourceforge.</p>
<p><span id="more-217"></span>Gphoto is an offshoot of an earlier project and is intended for linux users who want a way to download images from their camera to their computer. Evidently, there isn&#8217;t or hasn&#8217;t always been a standard for this kind of thing. Most cameras today use the <a href="http://en.wikipedia.org/wiki/Picture_Transfer_Protocol">ptp protocol</a> to transfer images, but my research indicates that support for all but the most basic features of the ptp protocol are horribly broken on many cameras. Canon cameras have their own protocol that many of the people working on the gphoto project have reverse engineered. Thankfully, the 10D, which I&#8217;m using, is old enough to have some support. Oddly enough, the Canon supplied remote capture application doesn&#8217;t work in OS X 10.4.</p>
<p>An OS X version of gphoto can be found in <a href="http://darwinports.opendarwin.org/">DarwinPorts</a>. The version on the project page does not, though there is some talk on the gphoto-devel list that it could sort-of work. While I was looking into this, I got some help from <a href="http://ynse.pl/">Pawe&#322; Szcz&#281;sny</a> who posted about <a href="http://ynse.pl/">gphoto2 on OSX</a> on his <a href="http://www.ynse.net/">Night Photography</a> Blog.</p>
<p>Using gphoto, I can capture using the &#8211;capture-image command. However, the command times out after the shot is taken. I think it is supposed to download the image or at least stop, but it does not seem to do anything. Using a small shell script wrapper, the capture can be triggered, communication with the camera aborted, and the new image downloaded from the card. I&#8217;ve posted my hack of a script below:</p>
<p><code> #!/bin/sh</p>
<p>gphoto2 --capture-image --quiet &amp;</p>
<p>JOBNUM=`ps auxww | grep gphoto | grep -v grep | awk '{print $2}'`</p>
<p>sleep 8</p>
<p>kill $JOBNUM</p>
<p>sleep 2</p>
<p>gphoto2 -P --new</p>
<p>exit 0</p>
<p></code>Clearly, the shell script is horrible kludge. It won&#8217;t deal with any kind of errors at all. I am triggering it under very controlled circumstances, so it will work fine for my purposes.</p>
<p>In a future entry, I&#8217;ll talk about how I&#8217;m using this and what other applications glue it all together.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2006/09/25/still-images-triggered-by-a-computer/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Accelerated Development: Art on Call</title>
		<link>http://blogs.walkerart.org/newmedia/2005/02/28/accelerated-development-art-on-call/</link>
		<comments>http://blogs.walkerart.org/newmedia/2005/02/28/accelerated-development-art-on-call/#comments</comments>
		<pubDate>Mon, 28 Feb 2005 15:47:13 +0000</pubDate>
		<dc:creator>Nate Solas</dc:creator>
				<category><![CDATA[Art on Call]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">/?p=14</guid>
		<description><![CDATA[Last time we checked in on Art on Call, the Walker&#8217;s upcoming cellphone-based audio tour project, we were still fleshing out the API and locking down features &#8211; and dreaming of iPod integration.  Last week I started more intensive design on the actual classes, data structure, and the web-based app to enter data into [...]]]></description>
			<content:encoded><![CDATA[<p>Last time we checked in on Art on Call, the Walker&#8217;s upcoming cellphone-based audio tour project, we were still fleshing out the API and locking down features &#8211; and dreaming of <a href="http://blogs.walkerart.org/newmedia/index.php?p=8">iPod integration</a>.  Last week I started more intensive design on the actual classes, data structure, and the web-based app to enter data into the system.  Coding began Thursday morning, and I&#8217;m happy to announce I have working versions (I think) of all the basic classes and data abstraction layer.  Because of the need for speed I seriously considered some pre-packaged data modeler tool like <a href="http://www.alzabo.org/">Alzabo</a>, which the Walker has previously used with good success, but I was unfamiliar with.</p>
<p>I opted instead to write the classes largely from scratch &#8211; I felt good enough about my design work and data structures that I wanted to streamline things and really push the inheritence aspect of the classes.  (Probably this could have been done with Alzabo, but I didn&#8217;t think I had time to learn a new tool.)</p>
<p>Sure, there&#8217;s a million pieces still to write and test, but a big chunk of the code is written&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2005/02/28/accelerated-development-art-on-call/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSL Example List</title>
		<link>http://blogs.walkerart.org/newmedia/2005/02/11/xsl-example-list/</link>
		<comments>http://blogs.walkerart.org/newmedia/2005/02/11/xsl-example-list/#comments</comments>
		<pubDate>Fri, 11 Feb 2005 15:42:38 +0000</pubDate>
		<dc:creator>eric ishii eckhardt</dc:creator>
				<category><![CDATA[Source Code]]></category>

		<guid isPermaLink="false">/?p=6</guid>
		<description><![CDATA[While i was cleaning up some of my XSL for the new homepage i documented a couple of the neat XSL things I used on our the WIKI.
]]></description>
			<content:encoded><![CDATA[<p>While i was cleaning up some of my XSL for the new homepage i documented a couple of the <a href="http://newmedia.walkerart.org/nmiwiki/pmwiki.php/Main/XSLExamples">neat XSL things</a> I used on our the WIKI.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.walkerart.org/newmedia/2005/02/11/xsl-example-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
