<?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>Creating With Code</title>
	<atom:link href="http://creatingwithcode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://creatingwithcode.com</link>
	<description>A blog by Robert (Marty) McGuire</description>
	<lastBuildDate>Wed, 17 Feb 2010 02:02:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automatic MakerBot Camera Pt. 2 &#8211; Wiring it up!</title>
		<link>http://creatingwithcode.com/howto/makerbot-cam-2-wiring/</link>
		<comments>http://creatingwithcode.com/howto/makerbot-cam-2-wiring/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 01:44:52 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[chdk]]></category>
		<category><![CDATA[makerbot]]></category>
		<category><![CDATA[makerbot 131]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=83</guid>
		<description><![CDATA[Recently (thanks to the Internet), I figured out how to remote control a digital camera over USB using CHDK. However, if I wanted my MakerBot to be able to automatically control that camera, I needed a way to wire it up!
CHDK&#8217;s remote USB trigger functionality works by detecting when it receives power over USB.  This [...]]]></description>
			<content:encoded><![CDATA[<p>Recently (thanks to the Internet), I figured out how to <a href="http://creatingwithcode.com/howto/makerbot-cam-1-chdk/">remote control a digital camera over USB using CHDK</a>. However, if I wanted my MakerBot to be able to automatically control that camera, I needed a way to wire it up!</p>
<p>CHDK&#8217;s remote USB trigger functionality works by detecting when it receives power over USB.  This happens when two wires inside the <a href="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Delectronics&amp;field-keywords=usb+mini+b">USB mini-B</a> cable are connected to power: the red wire gets 5 volts, and the black wire gets connected to ground.</p>
<p><a href="http://reprap.org/bin/view/Main/Extruder_Controller_2_2#Servo_Headers"><img class="alignright" style="margin-left: 5px; float: right" title="Free I/O pins 9 and 10 on the extruder controller board" src="http://farm4.static.flickr.com/3484/3457207368_f7f6af91c0.jpg" alt="" width="300" height="225" /></a>So, I chose to find somewhere on the MakerBot&#8217;s electronics to hook up these power and ground wires such that the MakerBot could control when the red wire receives 5V.  The MakerBot uses <a href="http://store.makerbot.com/electronics/assembled-electronics/generation-3-electronics-mostly-assembled.html">RepRap Generation 3 electronics</a>, and let me tell you, the <a href="http://dev.www.reprap.org/bin/view/Main/Generation3Electronics">gen 3 electronics documentation</a> is fantastic!  Unfortunately, the <a href="http://reprap.org/bin/view/Main/Motherboard_1_2">docs for the main motherboard</a> reveal that there are some <a href="http://reprap.org/bin/view/Main/Motherboard_1_2#I2C_Headers">free I2C headers</a> for connecting serial devices, but no free general I/O pins.</p>
<p>Luckily, the <a href="http://reprap.org/bin/view/Main/Extruder_Controller_2_2#Servo_Headers">extruder controller docs</a> show two free digital pins, conveniently broken out with 5V and ground connections next to them.  These are digital pins D9 and D10.  According to the docs, they are intended for hooking up servo motors, but they would absolutely work for my purposes!</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2010/02/camera_cable.jpg"><img class="size-medium wp-image-88 alignleft" style="margin-right: 5px; float: left" title="Camera cable with ultra-fancy labeling" src="http://creatingwithcode.com/wp-content/uploads/2010/02/camera_cable-300x184.jpg" alt="" width="300" height="184" /></a>The layout for pins D9 and D10 goes (from left to right): I/O pin, 5V, ground.  Since I wanted the data pin itself to provide the 5V, I chose to make a cable using a 3-pin piece of female header, soldering the red wire connecting to the I/O pin (on the left) and the black wire connecting to the ground pin (on the right).  The center pin has no connection.  You can see my &#8220;super fancy&#8221; cable on the left.</p>
<p>I know this post isn&#8217;t particularly about code, so stay tuned for the next parts of this series:</p>
<ul>
<li><a href="http://creatingwithcode.com/howto/makerbot-cam-1-chdk/">Part 1: Remote control camera with CHDK</a></li>
<li>Part 2: Wiring it up! [YOU ARE HERE]</li>
<li>Part 3: Updating the MakerBot Firmware</li>
<li>Part 4: Updating ReplicatorG</li>
<li>Part 5: Updating Skeinforge</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/makerbot-cam-2-wiring/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automatic MakerBot Camera Pt. 1 &#8211; Remote control camera with CHDK</title>
		<link>http://creatingwithcode.com/howto/makerbot-cam-1-chdk/</link>
		<comments>http://creatingwithcode.com/howto/makerbot-cam-1-chdk/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 02:11:22 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[chdk]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[makerbot 131]]></category>
		<category><![CDATA[point-and-shoot]]></category>
		<category><![CDATA[sd300]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=64</guid>
		<description><![CDATA[One problem with making time-lapse videos of MakerBot prints is the fact that the MakerBot works by moving the build platform (and therefore the object being built) around in the XY plane, resulting in an unwatchable blur.
It recently occurred to me that, since the MakerBot is such a hackable platform, I could probably make nice [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://camura.com/s/Be2"><img class="alignright" style="margin-left: 10px; margin-bottom: 2px; float: right;" title="SD300 running CHDK with Remote Control" src="http://static.camura.com/media/images/m/ddb3ff73f26e44cb02c79434d0fd1aed.jpg" alt="" width="240" height="180" /></a>One problem with making <a href="http://www.youtube.com/watch?v=ox_Ng9gDgVE">time-lapse videos</a> of <a href="http://www.youtube.com/watch?v=mcn8Hu8c7qU">MakerBot prints</a> is the fact that the MakerBot works by moving the build platform (and therefore the object being built) around in the XY plane, resulting in an unwatchable blur.</p>
<p>It recently occurred to me that, since the MakerBot is such a hackable platform, I could probably make nice time-lapse videos by taking a picture of each layer.  The idea is to have the MakerBot pose the object after each layer, and trigger a camera to take a snapshot.</p>
<p>When discussing this idea with fellow <a href="http://hackpittsburgh.org/">HackPittsburgh</a> member <a href="http://cibomahto.com/">Matt Mets</a>, he recommended I try out a Canon camera with the <a href="http://chdk.wikia.com/wiki/CHDK">Canon Hack Development Kit (CHDK)</a>.  Making a quick stop on eBay, I soon had an <a href="http://chdk.wikia.com/wiki/SD300">SD300</a> in my hands, ready to be hacked!</p>
<p>I started by <a href="http://chdk.wikia.com/wiki/FAQ#Q._How_can_I_get_the_original_firmware_version_number_of_my_camera.3F">figuring out which firmware my SD300 was running</a>, which told me which <a href="http://mighty-hoernsche.de/bins/ixus40_sd300-100k-0.9.9-872-full.zip">version of CHDK to download</a> for my camera&#8217;s particular model/firmware combo.  Using an SD card reader, I copied the contents of the CHDK zip file onto my camera&#8217;s SD card and followed the instructions to <a href="http://chdk.wikia.com/wiki/FAQ#Q._How_can_I_make_the_CHDK_program_load_automatically_at_startup.3F">make CHDK auto-load</a> when the camera starts up.  I also changed my <a href="http://chdk.wikia.com/wiki/CHDK_firmware_usage">CHDK firmware settings</a> to set &#8220;Disable LCD off&#8221; to &#8220;[Script]&#8220;, so the camera wouldn&#8217;t shut down on its own.</p>
<p>Once CHDK was loaded and configured, I followed the <a href="http://chdk.wikia.com/wiki/USB_Remote_Cable">USB Remote Cable instructions</a> from the CHDK wiki.  The basic idea is to set Enable Remote to on, and load a script that is ready to handle USB remote events.  The one on the wiki page didn&#8217;t work as-is for me, presumably because my camera has half-shoot (i.e. focus and charge flash) and full-shoot (take picture) settings.  Here is the result that worked for me:</p>
<script src="http://gist.github.com/292276.js"></script>
<p>As the script says, I now turn the camera on in record mode, disable the flash, and start the script.  After that, the camera will automatically take a photo whenever I plug in the USB to my computer.</p>
<p>Next steps for this:</p>
<ul>
<li>Hack a USB cable so a microcontroller can trigger the camera</li>
<li>Figure out a way to mount the camera to the bot</li>
<li>Hack the bot firmware (and maybe skeinforge and maybe ReplicatorG) to:
<ul>
<li>Pose the build platform</li>
<li>Trigger the camera</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/makerbot-cam-1-chdk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Face Detection in Static Images with Python</title>
		<link>http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/</link>
		<comments>http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 21:31:22 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[face detection]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[static image]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=16</guid>
		<description><![CDATA[One of the things I&#8217;ve been longing to do with my mobile photo-sharing site Camura is to offer image annotations, like objects and faces.  Over the last couple of years I have been increasingly frustrated by the appearance of face tagging on services like Facebook, and the recent addition of face recognition to iPhoto has [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I&#8217;ve been longing to do with my mobile photo-sharing site <a href="http://camura.com/">Camura</a> is to offer image annotations, like objects and faces.  Over the last couple of years I have been increasingly frustrated by the appearance of face tagging on services like Facebook, and the recent <a href="http://www.apple.com/ilife/iphoto/#faces">addition of face recognition to iPhoto</a> has brought this frustration to the surface once again.  I don&#8217;t even want to do something as complex as face recognition &#8211; I just want to find faces in an image.</p>
<p>Googling for things like &#8220;open source face detector&#8221; doesn&#8217;t come up with much.  The landscape seems to be comprised of mostly expensive for-pay libraries written for Windows, abandoned research projects, and lots of research papers full of equations &#8212; but no code that I could get to run.</p>
<p>To make a long post short, it turns out that Intel&#8217;s <a href="http://sourceforge.net/projects/opencvlibrary/">OpenCV</a> computer vision library comes with a <a href="http://opencv.willowgarage.com/wiki/FaceDetection">face detector</a> example that should work out of the box.  Better yet, there are now some decent <a href="http://wwwx.cs.unc.edu/~gb/wp/blog/2007/02/04/python-opencv-wrapper-using-ctypes/">Python bindings</a> for OpenCV that come pre-packaged with OpenCV for Ubuntu and Debian.  You can install them with:<br />
<code><br />
    $ sudo apt-get install python-opencv<br />
</code></p>
<p>Now, it seems that most OpenCV <a href="http://blog.jozilla.net/2008/06/27/fun-with-python-opencv-and-face-detection/">face detector examples</a> are meant to be run &#8220;live&#8221;, usually taking the image from a webcam and highlighting faces with a red box in real-time.  However, I have a large database of static images that I want to consider individually, and I simply want to save the face coordinates for later use, rather than altering the picture.</p>
<p>So, with a bit more Googling, I found a Python script that I could chop up and use for this purpose, and here is what I came up with:</p>
<script src="http://gist.github.com/67044.js"></script><noscript><code class="gist"><pre></p>
<pre>#!/usr/bin/python

# face_detect.py

# Face Detection using OpenCV. Based on sample code from:
# http://python.pastebin.com/m76db1d6b

# Usage: python face_detect.py &lt;image_file&gt;

import sys, os
from opencv.cv import *
from opencv.highgui import *

def detectObjects(image):
  """Converts an image to grayscale and prints the locations of any
     faces found"""
  grayscale = cvCreateImage(cvSize(image.width, image.height), 8, 1)
  cvCvtColor(image, grayscale, CV_BGR2GRAY)

  storage = cvCreateMemStorage(0)
  cvClearMemStorage(storage)
  cvEqualizeHist(grayscale, grayscale)
  cascade = cvLoadHaarClassifierCascade(
    '/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml',
    cvSize(1,1))
  faces = cvHaarDetectObjects(grayscale, cascade, storage, 1.2, 2,
                             CV_HAAR_DO_CANNY_PRUNING, cvSize(50,50))

  if faces:
    for f in faces:
      print("[(%d,%d) -&gt; (%d,%d)]" % (f.x, f.y, f.x+f.width, f.y+f.height))

def main():
  image = cvLoadImage(sys.argv[1]);
  detectObjects(image)

if __name__ == "__main__":
  main()</pre>
<p></pre></code></noscript>
<p>An example run of the script looks something like this:<br />
<code><br />
    $ python face_detect.py marty_mcguire.jpg<br />
    [(50,36) -&gt; (115,101)]<br />
</code></p>
<p>You can overlay that rectangle on an output image with ImageMagick&#8217;s &#8220;convert&#8221;:<br />
<code><br />
    $ convert marty_mcguire.jpg -stroke red -fill none -draw "rectangle 50,36 115,101" output.jpg<br />
</code></p>
<p>And the output might look something like this:</p>
<p><a href="http://creatingwithcode.com/wp-content/uploads/2009/02/output.jpg"><img class="size-medium wp-image-18" title="My face: detected!" src="http://creatingwithcode.com/wp-content/uploads/2009/02/output.jpg" alt="My face, it has been detected." width="180" height="240" /></a></p>
<p>Pretty fun stuff!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Getting the Boarduino working with OS X Leopard</title>
		<link>http://creatingwithcode.com/howto/getting-the-boarduino-working-with-os-x-leopard/</link>
		<comments>http://creatingwithcode.com/howto/getting-the-boarduino-working-with-os-x-leopard/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 23:57:01 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[boarduino]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=13</guid>
		<description><![CDATA[I&#8217;ve been into hardware hacking on and off for much of my life, but I&#8217;ve never really had the time and confidence to design and build my own hardware.  In recent years, projects like the open source Arduino have been slowly convincing me that I just might be able to do this stuff.
When a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been into hardware hacking on and off for much of my life, but I&#8217;ve never really had the time and confidence to design and build my own hardware.  In recent years, projects like the open source <a href="http://arduino.cc/">Arduino</a> have been slowly convincing me that I just might be able to do this stuff.</p>
<p>When a recent <a href="http://blog.makezine.com/archive/2008/06/build_make_a_boarduino.html">Make blog article</a> showed nearly step-by-step instructions for building a breadboard-friendly Arduino clone called the <a href="http://ladyada.net/make/boarduino/index.html">Boarduino</a>, I felt compelled to order one and try to get it working with my new MacBook.</p>
<p>I ordered the DC Boarduino kit from <a href="http://www.adafruit.com/index.php?main_page=index&#038;cPath=19">LadyAda&#8217;s website</a>, along with the USB TTL-232 cable that would connect to my laptop&#8217;s USB port.  I also ordered the 9V power supply on the site to power the Boarduino.</p>
<p>I found building the Boarduino to be pretty easy (=ahem= with only one screwup on my part) thanks to <a href="http://www.ladyada.net/make/boarduino/solder.html">LadyAda&#8217;s detailed instructions</a>.  It was the first soldering project I had done in awhile, so I am happy that it went so well.</p>
<p>I next looked to the <a href="http://www.arduino.cc/en/Guide/MacOSX">Arduino OS X</a> guide for the software download and installation instructions.  I ended up grabbing version 11 of the Arduino software.  After unpacking the .zip file from the site, I installed the FTDI driver and rebooted, then plugged in the Boarduino&#8217;s power and connected it to the laptop via USB.</p>
<p>Next, I double-clicked the Arduino application to start it, and nothing happened.  After messing around with it on the command line for awhile, I determined that it didn&#8217;t like the version of Java I&#8217;m using (I have the 64-bit version of Java 6 as my default).</p>
<p>So, to run the Arduino software, I had to temporarily set my preferred Java version to 5.0 via the Java Preferences panel in /Applications/Utilities/Java/.  Once I had changed my Java version, the Arduino app started right up with a double-click.  Once I was done with the app, I could set my Java preferences back to Java 6.</p>
<p>In the Arduino app, I set it up to communicate with the Boarduino by selecting &#8220;Arduino NG or older w/ ATmega168&#8243; under the Tools | Board menu.  I then opened up the Blink test program under File | Sketchbook | Examples | Digital | Blink.  To load the program onto the Boarduino, I pressed its reset button, then quickly clicked the &#8220;Upload to I/O Board&#8221; button on the interface.</p>
<p>The red LED on the Boarduino blinked rapidly as data was received, then it started blinking slowly as it ran the Blink program!  Hooray!</p>
<p>I&#8217;m excited that it&#8217;s so easy to get something as powerful and versatile as the Boarduino up and running in just a couple of hours.  I&#8217;m going to try and think of a couple of projects for it.  Whatever I do, I&#8217;ll be sure to post about it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/getting-the-boarduino-working-with-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A couple of Leopard configuration tricks</title>
		<link>http://creatingwithcode.com/howto/a-couple-of-leopard-configuration-tricks/</link>
		<comments>http://creatingwithcode.com/howto/a-couple-of-leopard-configuration-tricks/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 23:28:30 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[java 6]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[preferences]]></category>
		<category><![CDATA[tab]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=14</guid>
		<description><![CDATA[I find Google to be a more and more valuable resource as time goes on, especially when seeking knowledge about how to make this new MacBook act like I want it to.
One thing I noticed early on was that pressing Tab to move around various interfaces, from Finder dialogs to web pages, would only tab [...]]]></description>
			<content:encoded><![CDATA[<p>I find Google to be a more and more valuable resource as time goes on, especially when seeking knowledge about how to make this new MacBook act like I want it to.</p>
<p>One thing I noticed early on was that pressing Tab to move around various interfaces, from Finder dialogs to web pages, would only tab to text entry fields.  Coming from a primarily Windows background, I am used to tabbing my way to checkboxes, dropdowns, and buttons in my interfaces, so this crippled Tab navigation quickly became annoying.</p>
<p>Thanks to <a href="http://www.mactips.org/archives/2008/04/30/tab-through-checkboxes-and-radio-buttons-in-safari/">this blog post</a>, I found the option to make Tab move through &#8220;All Controls&#8221; in <span style="font-style: italic;">System Preferences  | Keyboard &amp; Mouse | Keyboard Shortcuts</span></p>
<p>Another big issue I came up against is the weird Java support that comes with OS X.  Because Apple releases their own versions of Java, we OS X users are kind of at their mercy with respect to what we can use and how we can configure it.  You can install Java 6 from <a href="http://developer.apple.com/java/">Apple&#8217;s download page</a>, but Java 1.5 will still run by default.</p>
<p>Apple provides a &#8220;Java Preferences&#8221; configuration utility in /Applications/Utilities/Java/ which lets you change the default version of Java that will be used in browsers and when double-clicking to launch Java apps.  However, this utility doesn&#8217;t change which version of Java will be found by command-line apps in the terminal, such as <a href="http://ant.apache.org/">Apache Ant</a>.</p>
<p>Another blog post <a href="http://www.docuverse.com/blog/donpark/2008/05/01/java-6-on-leopard">to the rescue</a>!  It turns out that you can change your default version of Java for command line apps freely by changing the <code>CurrentJDK</code> and <code>Current</code> symlinks in <code>/System/Library/Frameworks/JavaVM.framework/Versions/.</code> For example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>JavaVM.framework<span style="color: #000000; font-weight: bold;">/</span>Versions
    <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-fhsv</span> <span style="color: #000000;">1.6</span> CurrentJDK
    <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-fhsv</span> <span style="color: #000000;">1.6</span> Current</pre></div></div>

<p>Hopefully this post will be able to help others (or at least my future self).</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/a-couple-of-leopard-configuration-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up Rails and MySQL on OS X Leopard</title>
		<link>http://creatingwithcode.com/howto/setting-up-rails-and-mysql-on-os-x-leopard/</link>
		<comments>http://creatingwithcode.com/howto/setting-up-rails-and-mysql-on-os-x-leopard/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 23:08:07 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=12</guid>
		<description><![CDATA[I recently purchased a MacBook to use as my primary development system.  One of my first plans was to get up and running with Rails on this new machine.  Given that Leopard (OS X 10.5) comes with Ruby version 1.8.6 and RubyGems 1.0.1, I thought I would be in good shape, but there [...]]]></description>
			<content:encoded><![CDATA[<p>I recently purchased a MacBook to use as my primary development system.  One of my first plans was to get up and running with Rails on this new machine.  Given that Leopard (OS X 10.5) comes with Ruby version 1.8.6 and RubyGems 1.0.1, I thought I would be in good shape, but there were a couple of snags.  Thanks to the power of Google and other people with similar problems, I was able to get it sorted out.  Here&#8217;s what I did:</p>
<ol>
<li>Updated rubygems to 1.1.1 with <code>sudo gem update --system</code></li>
<li>Installed the 32-bit (x86, NOT x86_64) version of MySQL (community edition, of course) via the installer on the <a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads">MySQL download page</a>.</li>
<li>Installed the native MySQL driver for Ruby (this was tricky, see below)</li>
<li>Finished by installing Rails and its friends via <code>gem install rails</code></li>
</ol>
<p>Getting the speedier native MySQL driver for Ruby installed was tricky for two reasons.  It seems that by default the installer attempts to compile for 4 architectures, so you have to set an environment variable and pass along a parameter to point to the installed copy of MySQL when calling <code>gem</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">env</span> <span style="color: #007800;">ARCHFLAGS</span>=”-arch i386” \
   gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql <span style="color: #660033;">--</span> \
   <span style="color: #660033;">--with-mysql-config</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config</pre></div></div>

<p>If you&#8217;ve never seen it before, the &#8216;&#8211;&#8217; after &#8216;gem install mysql&#8217; means that gem should pass along the next arguments to the programs it uses to build the driver.</p>
<p>The reason for installing the 32-bit version of MySQL (on your fancy 64-bit OS and machine!) is that the version of Ruby that ships with Leopard is apparently 32-bit only.  Yikes.</p>
<p>I&#8217;ve noticed several little annoying details like this in getting other things to work &#8220;like I like&#8221; on OS X.  I&#8217;ll probably end up posting more about them in the next couple of posts.</p>
<p>I know that &#8220;how to&#8221; posts of the form &#8220;I wanted to do X, but Y happened.  Finally I fixed it by Z,&#8221; are pretty boring.  Still, I hope they are useful for preserving the knowledge of how to work around these problems, both for myself and for others.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/setting-up-rails-and-mysql-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Podcast 3: Are we getting better at this, yet?</title>
		<link>http://creatingwithcode.com/podcasting/podcast-3-are-we-getting-better-at-this-yet/</link>
		<comments>http://creatingwithcode.com/podcasting/podcast-3-are-we-getting-better-at-this-yet/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 23:01:42 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[Podcasting]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[cloud-computing]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[google appengine]]></category>
		<category><![CDATA[google earth]]></category>
		<category><![CDATA[google i/o]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[web-video]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=11</guid>
		<description><![CDATA[I have acquired a fancy microphone to match Loren&#8217;s, and we have created another podcast.  We started with a list of topics to talk about this time, though of course we used those items more as suggestions than as guidelines. Here are some things we talked about this week along with a bundle of [...]]]></description>
			<content:encoded><![CDATA[<p>I have acquired a <a title="Blow Snowball" href="http://www.bluemic.com/modules.php?op=modload&amp;name=Products&amp;file=index&amp;prod_id=18">fancy microphone</a> to match Loren&#8217;s, and we have created another podcast.  We started with a list of topics to talk about this time, though of course we used those items more as suggestions than as guidelines. Here are some things we talked about this week along with a bundle of links to keep you busy:</p>
<ul>
<li>Cheap beer seems to follow us around for some reason, but we drink it anyway.</li>
<li><a href="http://code.google.com/events/io/">Google&#8217;s I/O Conference</a> happened this week, and many interesting (though not life-changing) announcements were made, including
<ul>
<li> A new <a href="http://code.google.com/apis/earth/">Google Earth API/Plugin</a> which integrates with their existing Maps API and brings all of those <a href="http://code.google.com/apis/kml/documentation/">KML files</a> and third-party 3D models and data to the web.</li>
<li><a href="http://googleappengine.blogspot.com/2008/05/announcing-open-signups-expected.html">Google AppEngine</a> went ahead and let everyone in from the waitlist, announced new pricing competitive with <a href="http://aws.amazon.com/ec2">Amazon&#8217;s EC2</a>, and a new <a href="http://code.google.com/appengine/docs/memcache/">Memcache API</a> which should allow for faster (and cheaper!) performance.  There doesn&#8217;t seem to be any improvement to ease of development, however.</li>
</ul>
</li>
<li>Adobe <a href="http://labs.adobe.com/technologies/flashplayer10/releasenotes.html">has announced</a> 3D hardware support in Flash 10, but it&#8217;s Windows-only at the moment.  For a &#8220;universal&#8221; platform like Flash, what will come of this feature and other Flash 3D engines like <a href="http://papervision3d.org/">Papervision3D</a>?</li>
<li>Loren has finally upgraded many of his projects to <a href="http://weblog.rubyonrails.org/2007/12/17/rails-2-0-2-some-new-defaults-and-a-few-fixes">Rails 2.0</a>, encountering a few challenges</li>
<li>I&#8217;ve been exploring lots of Rails deployment options (such as <a href="http://wiki.codemongers.com/Main">Nginx</a>, <a href="http://mongrel.rubyforge.org/">Mongrel</a>, and <a href="http://code.macournoyer.com/thin/">Thin</a>) but  I&#8217;m most excited about using the new <a href="http://www.modrails.com/">Passenger (a.k.a. mod_rails)</a> plugin for <a href="http://httpd.apache.org/">Apache</a>.  <a href="http://blog.dreamhost.com/2008/05/13/passenger-for-ruby-on-rails/">Dreamhost seems pretty excited, too</a>.</li>
<li>Loren has upgraded his video-on-the-web service from <a href="http://www.justin.tv/">Justin.TV</a> to <a href="http://www.stickam.com/">Stickam</a>, and has been working on new ways of bringing video to his investment club, <a href="http://benhurinvestments.com/">Ben Hur Investments</a>.  Look for them, soon!</li>
<li>Embedding and remixing are becoming new themes for text, audio, and video on the web.  We talk about several services their impacts including RSS, <a href="http://pipes.yahoo.com/pipes/">Yahoo! Pipes</a>, and <a href="http://twitter.com/">Twitter</a>, and discuss how Loren is using these tools to create a new service to track the Atlanta web entrepreneur community.  We also talk a bit about Twitter&#8217;s recent service &#8220;brownouts&#8221;, and what they might mean for the community.</li>
</ul>
<p>We&#8217;re still sticking with an under-the-radar, links-on-blogs format for sharing this podcast, so you may download this week&#8217;s episode <a href="http://static.schmarty.net/A-Podcast-2008-06-01.mp3">here</a>, or listen below:</p>
<p style="text-align: center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="470" height="20" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="height=20&amp;width=470&amp;file=http://static.schmarty.net/A-Podcast-2008-06-01.mp3" /><param name="src" value="http://static.schmarty.net/mediaplayer.swf" /><embed type="application/x-shockwave-flash" width="470" height="20" src="http://static.schmarty.net/mediaplayer.swf" flashvars="height=20&amp;width=470&amp;file=http://static.schmarty.net/A-Podcast-2008-06-01.mp3"></embed></object></p>
<p style="text-align: left;">Please leave us some feedback, either in the comments here or on Loren&#8217;s post for this episode.  We look forward to hearing your thoughts!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/podcasting/podcast-3-are-we-getting-better-at-this-yet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extracting projects from a shared Subversion repository</title>
		<link>http://creatingwithcode.com/howto/extracting-projects-from-shared-svn/</link>
		<comments>http://creatingwithcode.com/howto/extracting-projects-from-shared-svn/#comments</comments>
		<pubDate>Thu, 29 May 2008 02:40:53 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnadmin]]></category>
		<category><![CDATA[svndumpfilter]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=10</guid>
		<description><![CDATA[I recently had the need to migrate a project from a Subversion (SVN) repository that was shared among many other projects and groups to a fresh repository where it would be the first of many projects.
My first instinct was to simply use svnadmin dump to dump out the contents of the whole shared repository, transfer [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the need to migrate a project from a <a title="http://subversion.tigris.org/" href="http://subversion.tigris.org/">Subversion</a> (SVN) repository that was shared among many other projects and groups to a fresh repository where it would be the first of many projects.</p>
<p>My first instinct was to simply use <code>svnadmin dump</code> to dump out the contents of the whole shared repository, transfer that to the new machine, use <code>svnadmin load</code> to load the data into the new repository, and then delete out the projects that I did not want.</p>
<p>The first pass at this created a 2.5GB dump file, something which I did not want to send over the network!  After poking around at the options for <code>svnadmin dump</code>, I found that I could shrink this down to about 1GB by using the <code>--deltas</code> flag, which saves space by dumping only the differences between each revision in the repository.  1GB was still pretty big, but we have a fast network, so it wasn&#8217;t that painful.  I transferred it to the new server, created a new repository, and ran <code>svnadmin load</code> to load the dump into the repository.</p>
<p>All I had to do next was delete the directories from the repository that I didn&#8217;t want.  I knew this would be a little tricky because I didn&#8217;t want to keep <em>any</em> code from those projects around, and simply running <code>svn delete</code> on each directory would have kept the other projects in the repository&#8217;s history.</p>
<p>As it turns out, <a href="http://subversion.tigris.org/faq.html#removal">you can&#8217;t just remove all traces of something from a Subversion repository</a>.  The reasons for this are many, but they simply haven&#8217;t gotten around to implementing <code>svn oblitherate</code>, yet.  The current solution is to create a dump with <code>svnadmin dump</code>, and then process that file with a tool called <code>svndumpfilter</code>.</p>
<p>The docs for <a href="http://svnbook.red-bean.com/en/1.0/ch05s03.html#svn-ch-5-sect-3.1.3"><code>svndumpfilter</code></a> are pretty straightforward, so I tried using it on the dump file I had already created, but no matter what I did I kept getting this error:</p>
<pre>svndumpfilter: Unsupported dumpfile version: 3</pre>
<p>What the docs (and error message) don&#8217;t tell you is that <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=2760"><code>svndumpfilter</code> only works on full dump files</a>, and doesn&#8217;t support dump files made with the <code>--deltas</code> flag.</p>
<h3>Long Story Short (Too Late)</h3>
<p>In the end, what I wanted was simple, but not obvious.  On the original server, I ran:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>original<span style="color: #000000; font-weight: bold;">/</span>repository <span style="color: #000000; font-weight: bold;">|</span> \
    <span style="color: #c20cb9; font-weight: bold;">svndumpfilter</span> include my_project \
               <span style="color: #660033;">--drop-empty-revs</span> \
               <span style="color: #660033;">--renumber-revs</span> <span style="color: #000000; font-weight: bold;">&gt;</span> dump_file</pre></div></div>

<p>I was then able to copy the resulting (much, much smaller!) dump file to the new machine, blow away and re-create the new repository, and load it with <code>svnadmin load</code>.</p>
<p>And now maybe you can learn from this example instead of having to figure it out yourself through trial-and-error!</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/howto/extracting-projects-from-shared-svn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Podcasting about the cloud</title>
		<link>http://creatingwithcode.com/podcasting/podcasting-about-the-cloud/</link>
		<comments>http://creatingwithcode.com/podcasting/podcasting-about-the-cloud/#comments</comments>
		<pubDate>Mon, 26 May 2008 01:58:24 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[Podcasting]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[backnoise]]></category>
		<category><![CDATA[cloud-computing]]></category>
		<category><![CDATA[dash]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[friendconnect]]></category>
		<category><![CDATA[web-video]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=9</guid>
		<description><![CDATA[Despite a lack of comments from the peanut gallery, Loren and I have created another podcast.  You can download it here (~11.4MB) or listen below:

We did this podcast with a little less preparation, so the topics wander a little bit more.  Some things you can expect to hear:

Justin.tv is great, but it may [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Despite a lack of comments from the peanut gallery, Loren and I have created another podcast.  You can download it <a title="http://static.schmarty.net/A-Podcast-2008-05-25.mp3" href="http://static.schmarty.net/A-Podcast-2008-05-25.mp3">here (~11.4MB)</a> or listen below:</p>
<p style="text-align:center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="350" height="20" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="height=20&amp;width=350&amp;file=http://static.schmarty.net/A-Podcast-2008-05-25.mp3" /><param name="src" value="http://static.schmarty.net/mediaplayer.swf" /><embed type="application/x-shockwave-flash" width="350" height="20" src="http://static.schmarty.net/mediaplayer.swf" flashvars="height=20&amp;width=350&amp;file=http://static.schmarty.net/A-Podcast-2008-05-25.mp3"></embed></object></p>
<p style="text-align: left;">We did this podcast with a little less preparation, so the topics wander a little bit more.  Some things you can expect to hear:</p>
<ul>
<li><a title="http://justin.tv/" href="http://justin.tv/">Justin.tv</a> is great, but it may not be the be-all for live web video broadcasting because of the way it prevents you from embedding &#8220;episodes&#8221; and live chat in your own pages. Given alternatives like <a title="http://ustream.tv/" href="http://ustream.tv/">Ustream</a> and <a href="http://www.stickam.com/">Stickam</a>, and thanks to the power of embeddable apps, like <a title="http://backnoise.com/" href="http://backnoise.com/">Backnoise</a>, will it matter what Justin.tv does and doesn&#8217;t support?</li>
<li>Features aside, content on Justin.tv is crazy!   Loren and friends spent Saturday broadcasting themselves brewing beer, playing games, and getting rowdy all on <a title="http://lorennorman.com/come-watch/" href="http://lorennorman.com/come-watch/">Loren&#8217;s &#8220;come watch&#8221; page</a> where their friends could play along via chat provided by Backnoise.  Also, Marty missed the first game of the Pens vs. Red Wings game, but apparently <a title="http://burghreport.blogspot.com/2008/05/dont-haz-cable.html" href="http://burghreport.blogspot.com/2008/05/dont-haz-cable.html">could have caught it from Justin.tv</a>!</li>
<li>Google announced <a title="http://www.google.com/friendconnect/" href="http://www.google.com/friendconnect/">FriendConnect</a>, with exciting demos and no other documentation to speak of.  Is it vaporware?  Is it evil?</li>
<li>I talk in way too much detail about my experiences playing with the <a title="http://appengine.google.com/" href="http://appengine.google.com/">Google App Engine</a> and its (lack of) support for the excellent Python web framework <a title="http://www.djangoproject.com/" href="http://www.djangoproject.com/">Django</a>.  Long story short: it&#8217;s great if you&#8217;re willing to write a bunch of infrastructure yourself, but lousy for banging out a weekend project.</li>
<li>Also, there&#8217;s this new thing called the <a title="http://www.dash.net/" href="http://www.dash.net/">Dash</a>, an always-connected GPS unit built on the <a title="http://wiki.openmoko.org/wiki/Main_Page" href="http://wiki.openmoko.org/wiki/Main_Page">OpenMoko</a> Linux-based cell phone platform.  They did a media blitz this week and Loren met them at <a title="http://startupriot.com/" href="http://startupriot.com/">startupriot</a> just before it happened.</li>
</ul>
<p>Please have a listen and give us some feedback!  What&#8217;s interesting?  What&#8217;s not?  What would you like to hear us talk about?  Or tell us we&#8217;re wrong about?  Leave comment here or on <a title="http://lorennorman.com/podcasting/podcast-2-more-cloud-computing-and-live-video-talk/" href="http://lorennorman.com/podcasting/podcast-2-more-cloud-computing-and-live-video-talk/">Loren&#8217;s post for this entry</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/podcasting/podcasting-about-the-cloud/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://static.schmarty.net/A-Podcast-2008-05-25.mp3" length="11400000" type="audio/mpeg" />
<enclosure url="http://static.schmarty.net.s3.amazonaws.com/A-Podcast-2008-05-17.mp3" length="10803726" type="audio/mpeg" />
		</item>
		<item>
		<title>A minor example of podcasting</title>
		<link>http://creatingwithcode.com/podcasting/a-minor-example-of-podcasting/</link>
		<comments>http://creatingwithcode.com/podcasting/a-minor-example-of-podcasting/#comments</comments>
		<pubDate>Wed, 21 May 2008 01:37:37 +0000</pubDate>
		<dc:creator>Robert McGuire</dc:creator>
				<category><![CDATA[Podcasting]]></category>
		<category><![CDATA[pamela]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://creatingwithcode.com/?p=7</guid>
		<description><![CDATA[I&#8217;ve recently become interested in forms of &#8220;live&#8221; online media such as podcasting.  Specifically, I am interested in trying to extract the maximum possible value out of podcasts, such as transcripts, time-based tags and links, excerpts, etc.  This interest, along with a recent outpouring of Internet media from my friends over at Snowcap [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently become interested in forms of &#8220;live&#8221; online media such as podcasting.  Specifically, I am interested in trying to extract the maximum possible value out of podcasts, such as transcripts, time-based tags and links, excerpts, etc.  This interest, along with a recent outpouring of Internet media from my friends over at <a title="http://snowcaplabs.com/blog/" href="http://snowcaplabs.com/blog/">Snowcap Labs</a>, has convinced me to take a look at creating a &#8220;podcasting hub&#8221; with tools for letting podcasters and their listeners to easily create, share, and link this information.</p>
<p>As a first step into understanding this problem, my friend <a title="http://lorennorman.com/" href="http://lorennorman.com/">Loren</a> and I have decided to try creating our own podcast.  Namely, we recorded an episode of an as-yet-unnamed podcast which you can listen to here:</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="350" height="20" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="height=20&amp;width=350&amp;file=http://static.schmarty.net/A-Podcast-2008-05-17.mp3" /><param name="src" value="http://static.schmarty.net/mediaplayer.swf" /><embed type="application/x-shockwave-flash" width="350" height="20" src="http://static.schmarty.net/mediaplayer.swf" flashvars="height=20&amp;width=350&amp;file=http://static.schmarty.net/A-Podcast-2008-05-17.mp3"></embed></object></p>
<p style="text-align: left;">Using the free version of the <a title="http://pamela-systems.com/" href="http://pamela-systems.com/">Pamela Call Recorder</a> for Skype, we recorded 3 15-minute segments to create a 45 minute podcast.  During that time we talked about many things, from the ins and outs of getting started with podcasting tools to discussing the opportunities and challenges that come with putting oneself online &#8220;live&#8221; to the power that technology gives us to make meaningful artifacts from our lives.  You can read <a title="http://lorennorman.com/podcasting/new-podcast-you-must-listen/" href="http://lorennorman.com/podcasting/new-podcast-you-must-listen/">Loren&#8217;s description of the podcast</a> on his blog.</p>
<p style="text-align: left;">Give it a listen if you have a chance.  You can listen via the embedded Flash player above, or you can download the ~10.8MB mp3 file <a title="http://static.schmarty.net/A-Podcast-2008-05-17.mp3" href="http://static.schmarty.net/A-Podcast-2008-05-17.mp3">here</a>.</p>
<p style="text-align: left;">If you do listen, please leave us some feedback!  I am interested to know your thoughts on the podcast itself, on what you&#8217;d like to see from a &#8220;podcast hub&#8221; site, on what information we talked about in the podcast you&#8217;d like to see made easily accessible (such as links or products that we mention), or parts you&#8217;d like to see excerpted (if any).  Please remember that this is a rough &#8220;one-off&#8221; recording.  After another episode or two we will want to try and choose a name and a general direction for the podcast before we go syndicating ourselves with RSS feeds, Atom feeds, and iTunes subscriptions.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatingwithcode.com/podcasting/a-minor-example-of-podcasting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://static.schmarty.net/A-Podcast-2008-05-17.mp3" length="10803726" type="audio/mpeg" />
<enclosure url="http://static.schmarty.net.s3.amazonaws.com/A-Podcast-2008-05-17.mp3" length="10803726" type="audio/mpeg" />
		</item>
	</channel>
</rss>
