<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://think.random-stuff.org/wp-atom.php">
	<title type="text">think</title>
	<subtitle type="text" />

	<updated>2011-05-25T20:37:48Z</updated>

	<link rel="alternate" type="text/html" href="http://think.random-stuff.org" />
	<id>http://think.random-stuff.org/feed/atom</id>
	

	<generator uri="http://wordpress.org/" version="3.1">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/random-stuff/atom" /><feedburner:info uri="random-stuff/atom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Remotely boot your iPad and launch an app]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/TV9L9qGRnFY/remotely-boot-your-ipad" />
		<id>http://think.random-stuff.org/?p=224</id>
		<updated>2011-05-25T20:37:48Z</updated>
		<published>2011-05-25T20:22:02Z</published>
		<category scheme="http://think.random-stuff.org" term="kiosk" /><category scheme="http://think.random-stuff.org" term="Museum" />		<summary type="html"><![CDATA[I&#8217;m one step further along on the quest for the Holy Grail of kiosk displays. We use a lot of iPads here at the museum, most of them are either in Lab Shield brackets or built into cabinets. The whole idea behind building a kiosk is to make it hard for people to break into [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/remotely-boot-your-ipad">&lt;p&gt;I&amp;#8217;m one step further along on the quest for the Holy Grail of kiosk displays. We use a lot of iPads here at the &lt;a href="http://web.mit.edu/museum/"&gt;museum&lt;/a&gt;, most of them are either in &lt;a href="http://labshield.com/"&gt;Lab Shield brackets&lt;/a&gt; or built into cabinets. The whole idea behind building a kiosk is to make it hard for people to break into your device, so naturally the power and home buttons are behind lock and key.&lt;/p&gt;
&lt;p&gt;The trouble is, there are a few quirks in the iPads. One is that after running for a few days, the display seems to lose its sensitivity to touch. The only way so far to deal with that seems to be to open the bracket, hit the power button to make it sleep, then hit it again to make it wake up. Then launch the app again and lock the whole thing back up. Not something the visitor services people want to do a lot. Nor I.&lt;/p&gt;
&lt;p&gt;Sometimes visitors also break out of the kiosk app (we&amp;#8217;re using &lt;a href="http://www.icab.de/mobile.html"&gt;iCab Mobile&lt;/a&gt;, an absolutely fantastic app, by the way). I have no idea how, but sometimes the iPad will be doing something completely different. One of ours now has a spiffy new home screen background thanks to someone who got in.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m very hopeful that my newly found method of remote booting/app launching will help at least take some of the pain out of the reset process.  Here&amp;#8217;s how:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.iphonehacks.com/2011/04/how-to-jailbreak-ipad-1-on-ios-4-3-2-using-redsn0w-windows-mac.html"&gt;Jailbreak&lt;/a&gt; the iPad (only works on iPad 1&amp;#8242;s for now)&lt;/li&gt;
&lt;li&gt;Install &lt;a href="http://www.google.com/search?q=cydia+openssh"&gt;OpenSSH&lt;/a&gt; (I installed the whole BigBoss Recommended Tools suite)&lt;/li&gt;
&lt;li&gt;Install &lt;a href="http://rpetri.ch/cydia/activator/"&gt;Activator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Determine the IP address of the iPad&lt;/li&gt;
&lt;li&gt;ssh in as root, change the password right away!&lt;/li&gt;
&lt;li&gt;Set up Activator to launch whatever app (e.g. iCabMobile) you want to have start up at boot time. Hook the app to the &amp;#8220;Anywhere -&amp;gt; Power -&amp;gt; Connected&amp;#8221; event.&lt;/li&gt;
&lt;li&gt;If you&amp;#8217;re still ssh&amp;#8217;ed in from step 5, type &amp;#8216;reboot&amp;lt;return&amp;gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Voilá. Your iPad will reboot, and if you&amp;#8217;re crossing your fingers just right, the app will launch after it boots. It seems to do this pretty reliably unless you do it too many times in too short a time.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve set up ssh keys for the iPad so that I can run a command like this from my desktop machine:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="bash" style="font-family:monospace;"&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;ssh&lt;/span&gt; &lt;span style="color: #660033;"&gt;-i&lt;/span&gt; .ssh&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;id_rsa_ipadkiosk root&lt;span style="color: #000000; font-weight: bold;"&gt;@&lt;/span&gt;192.168.1.52 reboot&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next up on my list is to build a web app that lets us reboot any iPad. Then we can carry around an iPad running the web app, and reboot troublesome exhibits with the swipe of a finger.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I should note that for this to work, the iPad has to be plugged in to a power source. During the boot sequence the hardware must sense the power source and generate the same event that gets generated if you plug it in after it&amp;#8217;s booted.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/TV9L9qGRnFY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/remotely-boot-your-ipad#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/remotely-boot-your-ipad/feed/atom" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/remotely-boot-your-ipad</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Mac OS X user idle time in Python]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/iPOMHBgeF_E/mac-os-x-user-idle-time-in-python" />
		<id>http://think.random-stuff.org/?p=206</id>
		<updated>2011-05-25T20:23:05Z</updated>
		<published>2011-03-04T01:40:40Z</published>
		<category scheme="http://think.random-stuff.org" term="kiosk" /><category scheme="http://think.random-stuff.org" term="Mac" /><category scheme="http://think.random-stuff.org" term="Museum" />		<summary type="html"><![CDATA[I&#8217;m still on the quest for the perfect free kiosk app for Mac OS X. I&#8217;ve used Plainview to good effect in several exhibits. I&#8217;ve used Opera in one, and I&#8217;m using Firefox with R-Kiosk in another. Which program to use depends a lot on the nature of the web page(s) to be displayed in [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/mac-os-x-user-idle-time-in-python">&lt;p&gt;I&amp;#8217;m still on the quest for the perfect free kiosk app for Mac OS X. I&amp;#8217;ve &lt;a href="http://think.random-stuff.org/posts/building-a-kiosk"&gt;used&lt;/a&gt; &lt;a href="http://barbariangroup.com/software/plainview"&gt;Plainview&lt;/a&gt; to good effect in several exhibits. I&amp;#8217;ve used Opera in one, and I&amp;#8217;m using Firefox with &lt;a href="https://addons.mozilla.org/en-us/firefox/addon/r-kiosk/"&gt;R-Kiosk&lt;/a&gt; in another. Which program to use depends a lot on the nature of the web page(s) to be displayed in the kiosk and the way the user expects to interact with the kiosk.&lt;/p&gt;
&lt;p&gt;For the Firefox kiosk, I needed a sure-fire way to reload the home page after a certain amount of idle time. The trouble is that Firefox doesn&amp;#8217;t lend itself to be controlled via AppleScript. A lot of poking around led me to learn about AppleScript System Events being able to simulate a keypress, that Option-Home will make Firefox load the home page, and that there&amp;#8217;s a really handy little application called &lt;a href="http://softwares.bajram.com/utilities/#Full_Key_Codes"&gt;Full Key Codes&lt;/a&gt; that tells you what the key code is for any key you press on a Mac.&lt;/p&gt;
&lt;p&gt;That let me put together this handy little Python script that watches how long it&amp;#8217;s been since a user has done something. First it waits until there&amp;#8217;s been any user activity at all, then it waits until there&amp;#8217;s been no activity for 90 seconds. Then it uses osascript to run a little bit of AppleScript that sends Option-Home (key code 115) to Firefox.&lt;/p&gt;
&lt;p&gt;I suspect there&amp;#8217;s a way to eliminate the osascript by using the Python objc module, but this is good enough for me&amp;#8230;&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="python" style="font-family:monospace;"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;#!/usr/bin/env python&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #808080; font-style: italic;"&gt;#========================================================================&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# idle.py - makes Firefox load home page after user inactivity&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#       Set the value of 'timeout' to the number of seconds of idle&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#       time you want to allow before reloading the home page&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#       Comment out the calls to status() if you don't want to see any&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#       messages&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;#========================================================================&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;subprocess&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; Popen
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;time&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; sleep
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; Quartz.&lt;span style="color: black;"&gt;CoreGraphics&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;*&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #808080; font-style: italic;"&gt;# From /System/Library/Frameworks/IOKit.framework/Versions/A/Headers/hidsystem/IOLLEvent.h&lt;/span&gt;
NX_ALLEVENTS = &lt;span style="color: #008000;"&gt;int&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;4294967295&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;  &lt;span style="color: #808080; font-style: italic;"&gt;# 32-bits, all on.&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #808080; font-style: italic;"&gt;# Set this value to the number of seconds of idle time before&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# resetting Firefox&lt;/span&gt;
timeout = &lt;span style="color: #ff4500;"&gt;90.0&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; status&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;state, last, idle&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;Print out some info about where we are &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;print&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;&amp;quot;%10s %.1f %.1f&amp;quot;&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;%&lt;/span&gt; &lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;state, last, idle&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; getIdleTime&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;Get number of seconds since last user input&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    idle = CGEventSourceSecondsSinceLastEventType&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;, NX_ALLEVENTS&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; idle
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; doReset&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;:
    &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;Use osascript to tell Firefox to reload the home page&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    reset = &lt;span style="color: #483d8b;"&gt;&amp;quot;&amp;quot;&amp;quot;/usr/bin/osascript &lt;span style="color: #000099; font-weight: bold;"&gt;\&lt;/span&gt;
        -e 'tell application &amp;quot;Firefox&amp;quot;' &lt;span style="color: #000099; font-weight: bold;"&gt;\&lt;/span&gt;
        -e ' activate' &lt;span style="color: #000099; font-weight: bold;"&gt;\&lt;/span&gt;
        -e 'end tell' &lt;span style="color: #000099; font-weight: bold;"&gt;\&lt;/span&gt;
        -e 'tell application &amp;quot;System Events&amp;quot;' &lt;span style="color: #000099; font-weight: bold;"&gt;\&lt;/span&gt;
        -e ' key code 115 using option down' &lt;span style="color: #000099; font-weight: bold;"&gt;\&lt;/span&gt;
        -e 'end tell' &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    Popen&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;reset, shell=&lt;span style="color: #008000;"&gt;True&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    sleep&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;                    &lt;span style="color: #808080; font-style: italic;"&gt;# Prevent osascript keypress from triggering below&lt;/span&gt;
&amp;nbsp;
last = &lt;span style="color: #ff4500;"&gt;0.0&lt;/span&gt;
idle = &lt;span style="color: #ff4500;"&gt;0.0&lt;/span&gt;
&amp;nbsp;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;while&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;:
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;# These two lines can also be at the very end if you don't want to&lt;/span&gt;
    &lt;span style="color: #808080; font-style: italic;"&gt;# load the home page once when the program starts&lt;/span&gt;
    status&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'--- RESET'&lt;/span&gt;, last, idle&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    doReset&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    idle = getIdleTime&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
    last = idle
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;# Wait for user activity&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;while&lt;/span&gt; idle &lt;span style="color: #66cc66;"&gt;&amp;gt;&lt;/span&gt;= last:
        status&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'wait'&lt;/span&gt;, last, idle&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        sleep&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        idle = getIdleTime&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span style="color: #808080; font-style: italic;"&gt;# Wait for idle to become bigger than timeout&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;while&lt;/span&gt; idle &lt;span style="color: #66cc66;"&gt;&amp;lt;&lt;/span&gt; timeout:
        status&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'triggered'&lt;/span&gt;, last, idle&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        sleep&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;
        idle = getIdleTime&lt;span style="color: black;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/iPOMHBgeF_E" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/mac-os-x-user-idle-time-in-python#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/mac-os-x-user-idle-time-in-python/feed/atom" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/mac-os-x-user-idle-time-in-python</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Spotlight for coders]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/iQb4o9-M4ww/spotlight-for-coders" />
		<id>http://think.random-stuff.org/?p=199</id>
		<updated>2011-03-01T16:40:10Z</updated>
		<published>2011-03-01T16:40:10Z</published>
		<category scheme="http://think.random-stuff.org" term="Mac" /><category scheme="http://think.random-stuff.org" term="Random" />		<summary type="html"><![CDATA[Apologies to everyone who already knew this&#8230; I just discovered something very cool. As an only occasional coder (Python, mostly, when I get the chance to write code), I don&#8217;t have a very good grasp of where all the header files for Mac OS X frameworks live. Let&#8217;s say that you want to know where CGEventSourceSecondsSinceLastEventType [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/spotlight-for-coders">&lt;p&gt;Apologies to everyone who already knew this&amp;#8230;&lt;/p&gt;
&lt;p&gt;I just discovered something very cool. As an only occasional coder (Python, mostly, when I get the chance to write code), I don&amp;#8217;t have a very good grasp of where all the header files for Mac OS X frameworks live.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s say that you want to know where &lt;strong&gt;&lt;span style="color: #808080;"&gt;CGEventSourceSecondsSinceLastEventType&lt;/span&gt;&lt;/strong&gt; is defined. Just hunt for it in Spotlight and it will turn up all the places it shows up in header files.&lt;/p&gt;
&lt;p&gt;E.g.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #808080;"&gt;/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs /iPhoneSimulator3.2.sdk/System/Library/Frameworks/ApplicationServices.framework /Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color: #808080;"&gt;/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks /IOKit.framework/Versions/A/Headers/hidsystem&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Clicking on the Spotlight results opens the file in Xcode.&lt;/p&gt;
&lt;p&gt;Who knew?&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/iQb4o9-M4ww" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/spotlight-for-coders#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/spotlight-for-coders/feed/atom" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/spotlight-for-coders</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[WordPress client IP address, behind a proxy]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/bIO8nGBBGyQ/wordpress-client-ip-address-behind-a-proxy" />
		<id>http://think.random-stuff.org/?p=191</id>
		<updated>2011-03-01T03:13:37Z</updated>
		<published>2011-03-01T03:13:37Z</published>
		<category scheme="http://think.random-stuff.org" term="Museum" /><category scheme="http://think.random-stuff.org" term="Wordpress" />		<summary type="html"><![CDATA[At the museum, we&#8217;re running a site where we want people to comment but where we&#8217;re also sitting ducks for spam comments. Trouble is, the site is running behind a web proxy. That means that all the comments are seemingly from the same IP address, namely that of the proxy host. That, in turn prevents [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/wordpress-client-ip-address-behind-a-proxy">&lt;p&gt;At the &lt;a href="http://web.mit.edu/museum"&gt;museum&lt;/a&gt;, we&amp;#8217;re running a &lt;a href="http://museum.mit.edu/150"&gt;site&lt;/a&gt; where we want people to comment but where we&amp;#8217;re also sitting ducks for spam comments. Trouble is, the site is running behind a web proxy. That means that all the comments are seemingly from the same IP address, namely that of the proxy host. That, in turn prevents any meaningful spam detection.&lt;/p&gt;
&lt;p&gt;I poked around the web a while, looking for a way to get the real IP addresses, and finally rolled my own solution.&lt;/p&gt;
&lt;p&gt;It boils down to this. If you&amp;#8217;re running behind an up-to-date apache server that&amp;#8217;s doing the proxying for you, all of the incoming HTTP requests should have the X-Fowarded-For header set to the originating client&amp;#8217;s IP address.&lt;/p&gt;
&lt;p&gt;Once I verified that this is the case, I put this snippet of code into my functions.php file.&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="php" style="font-family:monospace;"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;function&lt;/span&gt; m150_ip_fixup&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000088;"&gt;$s&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
  &lt;span style="color: #000088;"&gt;$headers&lt;/span&gt; &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #990000;"&gt;apache_request_headers&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&amp;nbsp;
  &lt;span style="color: #b1b100;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #339933;"&gt;!&lt;/span&gt;&lt;span style="color: #990000;"&gt;empty&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt;&lt;span style="color: #000088;"&gt;$headers&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;quot;X-Forwarded-For&amp;quot;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt; &lt;span style="color: #009900;"&gt;&amp;#123;&lt;/span&gt;
    &lt;span style="color: #000088;"&gt;$_SERVER&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;quot;REMOTE_ADDR&amp;quot;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt; &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #000088;"&gt;$headers&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;quot;X-Forwarded-For&amp;quot;&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
  &lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;
  &lt;span style="color: #b1b100;"&gt;return&lt;/span&gt; &lt;span style="color: #000088;"&gt;$s&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
add_action&lt;span style="color: #009900;"&gt;&amp;#40;&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;'pre_comment_on_post'&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;'m150_ip_fixup'&lt;/span&gt;&lt;span style="color: #009900;"&gt;&amp;#41;&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, comments get tagged with their original IP address.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/bIO8nGBBGyQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/wordpress-client-ip-address-behind-a-proxy#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/wordpress-client-ip-address-behind-a-proxy/feed/atom" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/wordpress-client-ip-address-behind-a-proxy</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Coming up with a question is also creation]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/z8bu3pfs77s/coming-up-with-a-question-is-also-creation" />
		<id>http://think.random-stuff.org/?p=181</id>
		<updated>2010-09-30T22:30:01Z</updated>
		<published>2010-09-30T22:25:49Z</published>
		<category scheme="http://think.random-stuff.org" term="Museum" /><category scheme="http://think.random-stuff.org" term="Random" />		<summary type="html"><![CDATA[To create is not just to produce objects or phenomena. Coming up [with] a question is also creation. In fact, a question that has a huge receptive capacity doesn&#8217;t even need a definitive answer. The very essence of a question is its power to elicit the possibilities or reply, to trigger a variety of thoughts. [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/coming-up-with-a-question-is-also-creation">&lt;p&gt;&lt;em&gt;To create is not just to produce objects or phenomena.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Coming up &lt;/em&gt;&lt;span style="color: #808080;"&gt;[with]&lt;/span&gt;&lt;em&gt; a question is also creation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;In fact, a question that has a huge receptive capacity doesn&amp;#8217;t even need a definitive answer.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The very essence of a question is its power to elicit the possibilities or reply, to trigger a variety of thoughts.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Questioning is emptiness.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The total quantity of thoughts triggered by questioning is what matters most.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I entreat you not to produce more but to think more.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I believe that the richness of that thinking may very well be the critical resources to giving this world a future.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8211; &lt;a href="http://www.youtube.com/watch?v=PG4uRmTJUU8#t=51m25s"&gt;Kenya Hara at Google&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Found via &lt;a href="http://www.core77.com/blog/object_culture/japanese_rooms_the_meaning_of_mu_and_kenya_hara_on_emptiness_17529.asp"&gt;Core77&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/z8bu3pfs77s" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/coming-up-with-a-question-is-also-creation#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/coming-up-with-a-question-is-also-creation/feed/atom" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/coming-up-with-a-question-is-also-creation</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Mac OS X ssh quickie]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/wVn-3YJqS4Y/mac-os-x-ssh-quickie" />
		<id>http://think.random-stuff.org/?p=174</id>
		<updated>2010-08-07T15:49:59Z</updated>
		<published>2010-08-06T16:49:33Z</published>
		<category scheme="http://think.random-stuff.org" term="Mac" /><category scheme="http://think.random-stuff.org" term="Random" />		<summary type="html"><![CDATA[Are you getting these messages in your console log when you make a new user on Mac OS X and then try to ssh in to the computer with that new user name? Aug  6 12:33:25 example sshd[7296]: in pam_sm_authenticate(): Failed to determine Kerberos principal name Aug  6 12:33:29 example sshd[7294]: error: PAM: authentication error [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/mac-os-x-ssh-quickie">&lt;p&gt;Are you getting these messages in your console log when you make a new user on Mac OS X and then try to ssh in to the computer with that new user name?&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="text" style="font-family:monospace;"&gt;Aug  6 12:33:25 example sshd[7296]: in pam_sm_authenticate(): Failed to determine Kerberos principal name
Aug  6 12:33:29 example sshd[7294]: error: PAM: authentication error for user from example.com via 192.168.0.1
Aug  6 12:33:29 example sshd[7297]: in pam_sm_authenticate(): Failed to determine Kerberos principal name.
Aug  6 12:33:32 example sshd[7294]: error: PAM: user account has expired for user from example.com via 192.168.0.1&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then don&amp;#8217;t do what I did. After &lt;a href="http://www.google.com/search?q=pam_sm_authenticate():+Failed+to+determine+Kerberos+principal+name"&gt;googling to no avail&lt;/a&gt;, I went so far as to completely reinstall Mac OS X. No good.&lt;/p&gt;
&lt;p&gt;[Update: Actually, what I did was clone a different system that I had recently set up and used it as the "new installation". Had I done a total, from DVD reinstallation, it would have fixed the problem but I wouldn't have discovered the cause.]&lt;/p&gt;
&lt;p&gt;The answer? Make sure you didn&amp;#8217;t set the Remote Login preferences in System Preferences/Sharing to &amp;#8220;Only these users&amp;#8221; and then forget to add the new user to the list!&lt;/p&gt;
&lt;p&gt;D&amp;#8217;oh.&lt;/p&gt;
&lt;p&gt;Hopefully this will help the next person who&amp;#8217;s looking for the answer.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/wVn-3YJqS4Y" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/mac-os-x-ssh-quickie#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/mac-os-x-ssh-quickie/feed/atom" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/mac-os-x-ssh-quickie</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Review: Rubbermaid 12-Slot Organizer as a Mac mini server rack]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/A6ADMnIAon0/mac-mini-server-rack" />
		<id>http://think.random-stuff.org/?p=155</id>
		<updated>2010-07-13T00:18:40Z</updated>
		<published>2010-07-13T00:18:40Z</published>
		<category scheme="http://think.random-stuff.org" term="Mac" /><category scheme="http://think.random-stuff.org" term="Museum" />		<summary type="html"><![CDATA[I needed to do something about the Mac minis that were accumulating on the table in my office. Digging around, I found this Rubbermaid organizer on Amazon. It turns out to be nearly perfect. The unit is very sturdy, was easy to put together, and the shelf height is just right. There&#8217;s enough clearance for [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/mac-mini-server-rack">&lt;p&gt;&lt;a href="http://think.random-stuff.org/wp-content/uploads/2010/07/IMG_0796.jpg"&gt;&lt;img class="alignleft size-medium wp-image-160" title="IMG_0796" src="http://think.random-stuff.org/wp-content/uploads/2010/07/IMG_0796-225x300.jpg" alt="" width="225" height="300" /&gt;&lt;/a&gt;I needed to do something about the Mac minis that were accumulating on the table in my office. Digging around, I found this &lt;a href="http://www.amazon.com/Rubbermaid-12-Slot-Organizer-Black-1738583/dp/B00125O3ZA"&gt;Rubbermaid organizer&lt;/a&gt; on Amazon.&lt;/p&gt;
&lt;p&gt;It turns out to be nearly perfect. The unit is very sturdy, was easy to put together, and the shelf height is just right. There&amp;#8217;s enough clearance for airflow but not so much that you feel space is being wasted.&lt;/p&gt;
&lt;p&gt;I used self-stick cable tie anchors and cable ties to mount the power bricks and used double-stick mounting tape as stops to keep things in place. The old-style minis are heavy enough and are pretty non-slip, so I just put some tape at the front of the shelf to keep them from sliding off. The one new-style mini was pretty slippery so I used the tape to actually stick the base to the shelf.&lt;a href="http://think.random-stuff.org/wp-content/uploads/2010/07/IMG_0797.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The unit came with vertical rods that go in the back of each column of shelves to keep them from sliding out the back, but I decided to leave those out. That way I can slide each shelf forward to get DVDs into the mini, or back to get at the connectors.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://think.random-stuff.org/wp-content/uploads/2010/07/IMG_0793.jpg"&gt;&lt;img class="alignleft" title="IMG_0793" src="http://think.random-stuff.org/wp-content/uploads/2010/07/IMG_0793-300x225.jpg" alt="" width="189" height="142" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The weak spot of the minis is the power cord (at least on the pre-2010 models) which comes out quite easily. I tied those down as well and am pretty sure they won&amp;#8217;t jiggle their way out. I have four minis in the rack right now along with a Drobo with 10TB of disk. I&amp;#8217;m going to be adding a 5th mini with a stackable disk drive, that&amp;#8217;s why there&amp;#8217;s double-high slot  still open on the mini side of the rack.&lt;/p&gt;
&lt;p&gt;Cable management is an issue, mostly because of the power bricks long cables. I may fiddle with how I fold the cables into the shelves a bit more.&lt;/p&gt;
&lt;p&gt;The whole thing plus a UPS and monitor/keyboard/mouse sits nicely on some steel shelves in our A/V equipment room at the museum. I still need to time how long the UPS runs. I&amp;#8217;m only going to have the public web site minis on it.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/A6ADMnIAon0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/mac-mini-server-rack#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/mac-mini-server-rack/feed/atom" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/mac-mini-server-rack</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[Old bits slipping away]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/x-SdKjtJ-Kg/old-bits-slipping-away" />
		<id>http://think.random-stuff.org/?p=150</id>
		<updated>2010-07-10T13:42:07Z</updated>
		<published>2010-07-10T13:42:07Z</published>
		<category scheme="http://think.random-stuff.org" term="Random" />		<summary type="html"><![CDATA[I moved this blog from one of the Mac minis in my basement to the other (I&#8217;m trying to put everything on the newer one to free the other one up) yesterday. Originally I had been blogging using Plone (from about 2005-2007) and then moved to WordPress. Moving the Plone part seemed like it was [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/old-bits-slipping-away">&lt;p&gt;I moved this blog from one of the Mac minis in my basement to the other (I&amp;#8217;m trying to put everything on the newer one to free the other one up) yesterday. Originally I had been blogging using Plone (from about 2005-2007) and then moved to WordPress. Moving the Plone part seemed like it was more work than I wanted to put in, so it&amp;#8217;s goodbye to those posts.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/x-SdKjtJ-Kg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/old-bits-slipping-away#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/old-bits-slipping-away/feed/atom" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/old-bits-slipping-away</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[OGC (re)discovers URLs, but let&#8217;s tighten up the terminology a bit]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/Ma_NP-qjUnY/ogc-rediscovers-urls-but-lets-tighten-up-the-terminology-a-bit" />
		<id>http://think.random-stuff.org/?p=146</id>
		<updated>2010-07-07T13:14:17Z</updated>
		<published>2010-07-02T17:17:31Z</published>
		<category scheme="http://think.random-stuff.org" term="Geo" />		<summary type="html"><![CDATA[I had seen this tidbit that Sean Gillies writes about in the recent OGC newsletter. My thoughts were along the lines of Sean&#8217;s. I never understood the big deal behind URNs. EDIT: Forget the semi-rant, see the comments, and then go read about URI&#8230; But in re-reading Sean&#8217;s post and the OGC news coming out [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/ogc-rediscovers-urls-but-lets-tighten-up-the-terminology-a-bit">&lt;p&gt;I had seen this tidbit that Sean Gillies &lt;a href="http://sgillies.net/blog/1039/http-ftw"&gt;writes about &lt;/a&gt;in the recent OGC newsletter. My thoughts were along the lines of Sean&amp;#8217;s. I never understood the big deal behind URNs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT: Forget the semi-rant, see the comments, and then go read about URI&amp;#8230;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But in re-reading Sean&amp;#8217;s post and the &lt;a href="http://www.ogcnetwork.net/node/1469"&gt;OGC news coming out of the June 2010 meetings&lt;/a&gt;, I think the terminology is a bit imprecise. Too bad the source document, 10-124r1 isn&amp;#8217;t available on the OGC web site (promised for mid-July, I see) to see if the issue is in the document or in the news page. Here&amp;#8217;s the news page version:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;OGC Identifiers – the case for http URIs’&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The OGC Members approved release of ‘OGC Identifiers – the case for http URIs’ [OGC 10- 124r1] as an OGC Whitepaper. .According to the current OGC policy either URNs or http URIs may be used in OGC standards. However, the use of http URIs (a) resolves some deployment challenges and (b) provides an opportunity for easier engagement with broader communities. So OGC should now consider taking the next step, and mandate the use of http URIs for persistent identifiers in OGC specifications. This whitepaper canvasses a number of issues around this proposal.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;http URI Policy&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The OGC Members approved the following as official OGC policy to be included in the OGC Policies related to OGC standards [OGC 06- 135rN]:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OGC TC directs the OGC-NA that all new OGC identifiers issued for persistent public OGC resources shall be http URIs, instead of URNs&lt;/li&gt;
&lt;li&gt;New standards and new major versions of existing standards shall use http URIs for persistent public OGC resources to replace OGC URN identifiers defined in previous standards and versions, unless OGC- NA approves an exception&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Operational Implications: OGC should carefully manage (maintain for the long term) the &lt;strong&gt;http://www.opengis.net &lt;/strong&gt;domain and identifiers in this domain&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So what&amp;#8217;s wrong? Refer to &lt;a href="http://www.ietf.org/rfc/rfc3986.txt"&gt;RFC3986&lt;/a&gt; (or the &lt;a href="http://tools.ietf.org/html/rfc3986"&gt;html version&lt;/a&gt;). &lt;a href="http://tools.ietf.org/html/rfc3986#section-1.1.3"&gt;Section 1.1.3&lt;/a&gt; talks about URI, URL, and URN:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;A URI can be further classified as a locator, a name, or both.  The    term &amp;#8220;Uniform Resource Locator&amp;#8221; (URL) refers to the subset of URIs    that, in addition to identifying a resource, provide a means of    locating the resource by describing its primary access mechanism    (e.g., its network &amp;#8220;location&amp;#8221;).  The term &amp;#8220;Uniform Resource Name&amp;#8221;    (URN) has been used historically to refer to both URIs under the    &amp;#8220;urn&amp;#8221; scheme [RFC2141], which are required to remain globally unique    and persistent even when the resource ceases to exist or becomes    unavailable, and to any other URI with the properties of a name.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;A URN is a kind of URI. What is called an &amp;#8220;http URI&amp;#8221; is really a &amp;#8220;just&amp;#8221; a URL in RFC3986. And, a URN need not (or I should say &amp;#8220;need no longer&amp;#8221;) be something with &amp;#8220;urn:&amp;#8221; in the scheme. A URL could be a URN based on the last part of the definition above, &amp;#8220;any other URI with the properties of a name&amp;#8221;&lt;/p&gt;
&lt;p&gt;Therefore, an &amp;#8220;http URI&amp;#8221; (from the OGC wording) can be either a URL or a URN, based on section 1.1.3 of RFC3986. Of course, the URN is really a URL with the additional uniqueness and persistence properties. So let&amp;#8217;s just call OGC&amp;#8217;s newly mandated URIs URLs.&lt;/p&gt;
&lt;p&gt;There are two primary motivations for using &lt;a href="http://tools.ietf.org/html/rfc2141"&gt;RFC2141&lt;/a&gt; URNs. One is as a globally unique name managed by some authority. The other is as a persistent identifier, sometimes used to map onto a URL with a resolver. The trouble with the latter is that URLs really work better in the first place, and I&amp;#8217;m guessing that&amp;#8217;s what 10-124r1 says.&lt;/p&gt;
&lt;p&gt;So here&amp;#8217;s what I think they should have said in the TC:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;URI Policy&lt;/p&gt;
&lt;p&gt;The OGC Members approved the following as official OGC policy to be included in the OGC Policies related to OGC standards [OGC 06- 135rN]:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OGC TC directs the OGC-NA that all new OGC identifiers issued for persistent public OGC resources shall be http URLs, instead of RFC2141 URNs&lt;/li&gt;
&lt;li&gt;New standards and new major versions of existing standards shall use http URLs for persistent public OGC resources to replace OGC RFC2141 URN identifiers defined in previous standards and versions, unless OGC- NA approves an exception&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sorry to be so pedantic. Back in the day, there would have been half a dozen people at any given TC who would have been able to argue the finer points of this for hours&amp;#8230;.&lt;/p&gt;
&lt;p&gt;(And I just figured out what the OGC-NA is. I guess it&amp;#8217;s the &amp;#8220;Naming Authority&amp;#8221;.)&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/Ma_NP-qjUnY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/ogc-rediscovers-urls-but-lets-tighten-up-the-terminology-a-bit#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/ogc-rediscovers-urls-but-lets-tighten-up-the-terminology-a-bit/feed/atom" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/ogc-rediscovers-urls-but-lets-tighten-up-the-terminology-a-bit</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Allan</name>
						<uri>http://think.random-stuff.org</uri>
					</author>
		<title type="html"><![CDATA[QR Codes in exhibits]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/random-stuff/atom/~3/VBIoKdsuMyg/qr-codes-in-exhibits" />
		<id>http://think.random-stuff.org/?p=135</id>
		<updated>2010-04-12T19:00:37Z</updated>
		<published>2010-04-12T18:59:52Z</published>
		<category scheme="http://think.random-stuff.org" term="Museum" />		<summary type="html"><![CDATA[We&#8217;ve put our first QR Code up at the museum as an experiment. This seems like one way to deal with &#8220;nth level&#8221; information that might be interesting to some visitors but not to others. And it&#8217;s a way to make it easy for visitors to bookmark information for themselves. Generating the QR Code isn&#8217;t [...]]]></summary>
		<content type="html" xml:base="http://think.random-stuff.org/posts/qr-codes-in-exhibits">&lt;p&gt;&lt;a href="http://think.random-stuff.org/wp-content/uploads/2010/04/photo.jpg"&gt;&lt;img class="alignleft size-thumbnail wp-image-137" title="QR Code - panel" src="http://think.random-stuff.org/wp-content/uploads/2010/04/photo-150x150.jpg" alt="" width="150" height="150" /&gt;&lt;/a&gt; We&amp;#8217;ve put our first &lt;a href="http://en.wikipedia.org/wiki/QR_Code"&gt;QR Code&lt;/a&gt; up at the &lt;a href="http://web.mit.edu/museum/"&gt;museum&lt;/a&gt; as an experiment. This seems like one way to deal with &amp;#8220;nth level&amp;#8221; information that might be interesting to some visitors but not to others. And it&amp;#8217;s a way to make it easy for visitors to bookmark information for themselves.&lt;/p&gt;
&lt;p&gt;Generating the QR Code isn&amp;#8217;t hard. Google&amp;#8217;s Chart api can do it. Basically, anything you put fullowing the &amp;#8220;chl=&amp;#8221; part of the URL here will generate a code: &lt;a href="http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=350x350&amp;amp;chl=http://think.random-stuff.org/"&gt;http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=350&amp;#215;350&amp;amp;chl=http://think.random-stuff.org/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#8217;ve set aside a specific URL space for our codes to send people to. Each link will first take you to a short URL which will then redirect you to the actual URL relevant to the exhibit. The advantage of this is that we can also put up short, &amp;#8220;human readable&amp;#8221; links on the exhibits.  That will let us track how often the links are getting used and what mobile devices people are using. We&amp;#8217;ve also put an &lt;a href="http://web.mit.edu/museum/links/"&gt;explanatory page&lt;/a&gt; at the top level of that space.&lt;/p&gt;
&lt;p&gt;There was a little debate about how much we should try to explain QR Codes on the exhibit itself. You can see what we wound up with in the detail photo. Basically we&amp;#8217;ve decided that visitors will either (a) recognize the code and know what to do with it, (b) not recognize it and skip over it, or (c) ask someone. The &amp;#8220;c&amp;#8221; people can be given a printout of the explanatory page.&lt;a href="http://think.random-stuff.org/wp-content/uploads/2010/04/photo-1.jpg"&gt;&lt;img class="alignright size-thumbnail wp-image-136" title="QR Code - closeup" src="http://think.random-stuff.org/wp-content/uploads/2010/04/photo-1-150x150.jpg" alt="" width="150" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#8217;ve decided to introduce the codes slowly and in a way that hopefully doesn&amp;#8217;t get in the way of people who don&amp;#8217;t know what they are or don&amp;#8217;t choose to use them.&lt;/p&gt;
&lt;p&gt;Another question was whether we should format the linked pages in a phone-friendly format. The easy answer (because it requires no additional resources&amp;#8230;) was not to do that. Phones are getting pretty good at reading full-blown web pages.&lt;/p&gt;
&lt;p&gt;For further reading, here&amp;#8217;s a March 2009 article titled &lt;a href="http://www.powerhousemuseum.com/dmsblog/index.php/2009/03/05/qr-codes-in-the-museum-problems-and-opportunities-with-extended-object-labels/"&gt;QR codes in the museum – problems and opportunities with extended object labels&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What QR Code app am I using? Right now on my iPhone 3G, I&amp;#8217;ve got &lt;a href="http://itunes.apple.com/us/app/barcodes/id292197557?mt=8"&gt;Barcodes&lt;/a&gt;. It&amp;#8217;s got a huge number of one-star, negative comments but it works for me. The critical thing you need to know is that it only works on QR Codes, not regular barcodes, and at least with the 3G, you have to take the photo from about 18&amp;#8243; away and then use the app to zoom it to the right size.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/random-stuff/atom/~4/VBIoKdsuMyg" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://think.random-stuff.org/posts/qr-codes-in-exhibits#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://think.random-stuff.org/posts/qr-codes-in-exhibits/feed/atom" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://think.random-stuff.org/posts/qr-codes-in-exhibits</feedburner:origLink></entry>
	</feed>

