<?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>Unreal Expectations</title>
	<atom:link href="http://unrealexpectations.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://unrealexpectations.com/blog</link>
	<description>That actually worked??!??</description>
	<lastBuildDate>Sun, 04 Dec 2011 09:02:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>XMPPFramework / iOS / libidn / -all_load failure</title>
		<link>http://unrealexpectations.com/blog/2011/12/xmppframework-ios-libidn-all_load-failure/</link>
		<comments>http://unrealexpectations.com/blog/2011/12/xmppframework-ios-libidn-all_load-failure/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 09:02:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=238</guid>
		<description><![CDATA[<p>As I integrated the XMPPFramework it requires the libidn library for a couple of methods it uses.  The latest version of libidn that the XMPPFramework included as of this writing is 1.15.</p>
<p>Unfortunately, this version seems incompatible with the &#8220;Other Linker Flag&#8221; -all_load that other libraries seem to want to use.  The all_load linker flag appears [...]]]></description>
			<content:encoded><![CDATA[<p>As I integrated the <a href="https://github.com/robbiehanson/XMPPFramework">XMPPFramework</a> it requires the <a href="http://www.gnu.org/s/libidn/">libidn</a> library for a couple of methods it uses.  The latest version of libidn that the XMPPFramework included as of this writing is 1.15.</p>
<p>Unfortunately, this version seems incompatible with the &#8220;Other Linker Flag&#8221; -all_load that other libraries seem to want to use.  The all_load linker flag appears be a work around for a linker bug that pops up when object files within a static library only contain a category and no classes.</p>
<p>From the source: <a href="http://developer.apple.com/mac/library/qa/qa2006/qa1490.html">http://developer.apple.com/mac/library/qa/qa2006/qa1490.html</a></p>
<blockquote><p>IMPORTANT: For 64-bit and iPhone OS applications, there is a linker bug  that prevents -ObjC from loading objects files from static libraries  that contain only categories and no classes. The workaround is to use  the -all_load or -force_load  flags. -all_load forces the linker to load  all object files from every archive it sees, even those without  Objective-C code. -force_load is available in Xcode 3.2 and later. It  allows finer grain control of archive loading. Each -force_load option  must be followed by a path to an archive, and every object file in that  archive will be loaded.</p></blockquote>
<p>Interestingly, most coding conventions will create header and implementation files for categories that are just the categories; hence exposing the defect.  Some library developers have come up with a simple workaround so that the force_load or all_load flags are not required.  The workaround is a simple macro that is added to the category implementation file that just creates a class so that the bug is not exposed.  Don&#8217;t know if it originated in Three20, but this is <a href="https://github.com/facebook/three20/pull/406">first place</a> I came across it.  RestKit also <a href="https://github.com/RestKit/RestKit/issues/239">implemented</a> the macro.</p>
<p>Unfortunately, other library developers have not yet implemented this, and still require the all_load flag to be used.</p>
<p>The use of the all_load flag has been causing the XMPPFramework&#8217;s use of libidn to fail to link.  In part this appears to be the use of older libidn that is included as fat binary,  static library.  Use of the all_load flag often causes this linker error:</p>
<blockquote><p>Undefined symbols for architecture i386:<br />
&#8220;_libintl_bindtextdomain&#8221;, referenced from:<br />
_idna_strerror in libidn.a(strerror-idna.o)<br />
_pr29_strerror in libidn.a(strerror-pr29.o)<br />
_punycode_strerror in libidn.a(strerror-punycode.o)<br />
_stringprep_strerror in libidn.a(strerror-stringprep.o)<br />
_tld_strerror in libidn.a(strerror-tld.o)<br />
&#8220;_libintl_dgettext&#8221;, referenced from:<br />
_idna_strerror in libidn.a(strerror-idna.o)<br />
_pr29_strerror in libidn.a(strerror-pr29.o)<br />
_punycode_strerror in libidn.a(strerror-punycode.o)<br />
_stringprep_strerror in libidn.a(strerror-stringprep.o)<br />
_tld_strerror in libidn.a(strerror-tld.o)<br />
&#8220;_libiconv&#8221;, referenced from:<br />
_str_cd_iconv in libidn.a(striconv.o)<br />
_mem_cd_iconv in libidn.a(striconv.o)<br />
&#8220;_libiconv_open&#8221;, referenced from:<br />
_str_iconv in libidn.a(striconv.o)<br />
&#8220;_libiconv_close&#8221;, referenced from:<br />
_str_iconv in libidn.a(striconv.o)<br />
ld: symbol(s) not found for architecture i386<br />
clang: error: linker command failed with exit code 1 (use -v to see invocation)</p></blockquote>
<p>The iconv errors can be fixed because the iOS framework includes libiconv.a.  It does not include libintl.a.  After downloading version 1.25 of libidn and getting it to install on iOS 5.0, I was able to get rid of errors related to intl.</p>
<p>Here are the commands I used to compile libidn.1.25 and create a fat binary with arm6, arm7, and i386 architecture files.</p>
<p><pre><code>
$ ./configure --host=arm-apple-darwin --disable-shared CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CFLAGS=&quot;-arch armv7 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -Wunused-value -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.0 &quot; CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
$ make clean
$ make
$ cp lib/.libs/libidn.a libidn-arm7.a

$ ./configure --host=arm-apple-darwin --disable-shared CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CFLAGS=&quot;-arch armv6 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -Wunused-value -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.0 &quot; CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
$ make clean
$ make
$ cp lib/.libs/libidn.a libidn-arm6.a

$ ./configure --host=i686-apple-darwin --disable-shared CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 CFLAGS=&quot;-arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -Wunused-value -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.0 &quot; CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar
$ make clean
$ make
$ cp lib/.libs/libidn.a libidn-i386.a

$ lipo -create libidn-i386.a libidn-arm6.a libidn-arm7.a -output libidn.a
</code></pre></p>
<p>After importing the new libidn,a, I still received the linking errors with libiconv.  Added that to the library link list and afterwards all worked.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2011/12/xmppframework-ios-libidn-all_load-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple Language Meta Descriptions / One Page</title>
		<link>http://unrealexpectations.com/blog/2011/05/multiple-language-meta-descriptions-one-page/</link>
		<comments>http://unrealexpectations.com/blog/2011/05/multiple-language-meta-descriptions-one-page/#comments</comments>
		<pubDate>Tue, 17 May 2011 22:53:41 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=228</guid>
		<description><![CDATA[<p>During a post implementation design review today, the design and implementation failed to meet the basic one requirement of the enhancement.  The requirement was to ensure the site in question would respond to Katakana characters when searched through google.co.jp.   The english title of the site is returned quite high, but when using [...]]]></description>
			<content:encoded><![CDATA[<p>During a post implementation design review today, the design and implementation failed to meet the basic one requirement of the enhancement.  The requirement was to ensure the site in question would respond to Katakana characters when searched through google.co.jp.   The english title of the site is returned quite high, but when using the Katakana characters it fails.</p>
<p>The site in question is english only and so it mostly makes sense that it fails in google search results for Katakana.  So the requirement was how to make the site appear utilizing Katakana.  </p>
<h2>Technical Solution<br />
</h2>
<p>The developer went off and designed and implemented a solution.  The solution relied upon the Accept-Language header in HTTP request to load a resource file and return a Katana localized version of the title and description if the preferred language is Japanese.   Logically, seems to make sense.  Change the default language on the browser and get the localized content.  </p>
<p>Except there is a hole in the solution you can drive a bus through.  When the googlebot crawler indexes sights it doesn&#8217;t have different crawlers for google.com versus google.co.jp versus other localized google sites.  It has a single googlebot that indexes pages and doesn&#8217;t provide a language header.  With the change, google would not appear to have interpreted the page in any way different, which is the case because it doesn&#8217;t get any different HTML.</p>
<p>From the Google Webmaster <a href=" http://googlewebmastercentral.blogspot.com/2010/03/working-with-multi-regional-websites.html?showComment=1268645770595#c7824467655005356998">Blog</a> we know content negotiation is bad.</p>
<blockquote><p>@Simon Content negotiation is bad because search engines will only be able to see one of the versions (and might never see the other one). Also, many users (including me) don&#8217;t like it when they click on a search result that is not shown in the same language as their query (and the snippet) (actually, I personally don&#8217;t just not like it, it makes me quite mad <img src='http://unrealexpectations.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).
</p></blockquote>
<h3>SEO Solution</h3>
<p>Examining that the technical delivery failed, I backed up from there on the original solution concept.  </p>
<p>The solution concept was to just add the Katana characters after the title and as a second description.  According the the following <a href="http://www.seoptimise.com/blog/2011/04/google-test-multiple-meta-descriptions-work-as-expected-social-search-does-not.html">information</a> who experimented upon other results found, as expected, that google ignores multiple meta-description tags.  It points to other article about partial success in google summaries using more relevant sentence from multi line description.</p>
<p>So the point of this is to try and see how multi languages will work in context of a description.  Will update with results.</p>
<h3>Update 1</h3>
<p>The first launch failed miserably because the theme is not setting or pulling in the meta title or description fields.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2011/05/multiple-language-meta-descriptions-one-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Your Own URL Shortener</title>
		<link>http://unrealexpectations.com/blog/2011/03/install-your-own-url-shortener/</link>
		<comments>http://unrealexpectations.com/blog/2011/03/install-your-own-url-shortener/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 06:26:36 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=175</guid>
		<description><![CDATA[<p>A while back I acquired domain, zod.im with intent of setting up my own shortened URL service.  While there is nothing wrong with the current offerings by bit.ly or TinyURL, I was academically intrigued by the notion of setting this up.  </p>
YOURLS
<p>I went with open source package YOURLS. It was pretty easy to [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I acquired domain, zod.im with intent of setting up my own shortened URL service.  While there is nothing wrong with the current offerings by <a href="http://bit.ly/">bit.ly</a> or <a href="http://tinyurl.com/">TinyURL</a>, I was academically intrigued by the notion of setting this up.  </p>
<h2>YOURLS</h2>
<p>I went with open source package <a href="http://yourls.org/">YOURLS</a>. It was pretty easy to setup and has a nice interface.  The documentation didn&#8217;t provide me everything I needed, but what it didn&#8217;t provide was easily discovered.  Examples: </p>
<ul>
<li>I don&#8217;t install MySQL databases on a daily, weekly, or monthly basis, so I had to go look that back up since the commands weren&#8217;t included directly in the setup documentation.
</li>
<li>I front nginx as the web server and chose to look up changes to nginx configuration as the yourls installer provides just content for .htaccess
</li>
<li>I use WordTwit for notifications of posts on this blog to send to Twitter.  The current version did not have yourls support, but looks like the next Pro version might have more pluggable solution.  So made updates to plugin to use this now.
</li>
</ul>
<h2> Installation </h2>
<h3> Pre-Requisites</h3>
<ul>
<li>This assumes the starting point of installation already has nginx installed with fastcgi able to interpret php.
</li>
<li>This also assumes MySQL is installed and operational.
</li>
</ul>
<h3> MySQL </h3>
<ol>
<li>Create the database </li>
<p><pre><code>
mysql&gt; CREATE DATABASE yourlsdb;
</code></pre></p>
<li>Create the user &#038; Grant </li>
<p><pre><code>
mysql&gt; CREATE USER &#039;yourlsdbuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;password&#039;;

mysql&gt; GRANT ALL PRIVILEGES ON yourlsdb.* TO yourlsdbuser@localhost;
</code></pre>
</ol>
<h3> Install YOURLS</h3>
<ol>
<li> Download the code </li>
<p>Check <a href="http://code.google.com/p/yourls/downloads/list">here</a> for the latest version.<br />
<pre><code>
$ wget http://code.google.com/p/yourls/downloads/detail?name=yourls-1.5.zip
</code></pre></p>
<li> Unzip the code in directory you want as root </li>
<p><pre><code>
$ sudo mkdir -p /var/www/zod.im/web
$ cd /var/www/zod.im/web/
$ unzip &lt;path to&gt;/yourls-1.5.zip
</code></pre></p>
<li> Update the configuration </li>
<p>The following is the minimum settings that need to be changed for the private linking to work.  Read through the configuration for other changes to consider.</p>
<ol>
<li> Copy the sample configuration </li>
<p><pre><code>
$ cp includes/config-sample.php user/config.php
</code></pre></p>
<li>Update the database settings </li>
<p>Use vi or whatever your favorite editor is to edit the new file and follow the information in the file.<br />
Change the database settings.<br />
<pre><code>
...
define( &#039;YOURLS_DB_USER&#039;, &#039;dbuser&#039; );

/** MySQL database password */
define( &#039;YOURLS_DB_PASS&#039;, &#039;dbpassword&#039; );

/** The name of the database for YOURLS */
define( &#039;YOURLS_DB_NAME&#039;, &#039;yourls&#039; );

/** MySQL hostname */
define( &#039;YOURLS_DB_HOST&#039;, &#039;localhost&#039; );
...
</code></pre></p>
<li> Update the base site URL </li>
<p><pre><code>
/** YOURLS installation URL, no trailing slash */
define( &#039;YOURLS_SITE&#039;, &#039;http://example.com&#039; );
</code></pre></p>
<li>Update the cookie hash</li>
<p>As the comment shows go <a href="http://yourls.org/cookie">here</a> to get a new random hash.<br />
<pre><code>
/** A random secret hash used to encrypt cookies. You don&#039;t have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/
define( &#039;YOURLS_COOKIEKEY&#039;, &#039;qQ4KhL_pu|s@Zm7n#%:b^{A[vhm&#039; );
</code></pre></p>
<li> Update the username and password </li>
<p>The username and passwords are in the configuration file with password in clear text. Since this isn&#8217;t secure, I recommend not using a password that works anywhere else.<br />
<pre><code>
/**  Username(s) and password(s) allowed to access the site */
$yourls_user_passwords = array(
        &#039;username&#039; =&gt; &#039;password&#039;,
        &#039;username2&#039; =&gt; &#039;password2&#039;      // You can have one or more &#039;login&#039;=&gt;&#039;password&#039; lines
        );
</code></pre>
</ol>
</ol>
<h3> Setup Nginx for Rewrite</h3>
<p>Edit the nginx configuration for the domain.  The configuration of YOURLS provides an .htaccess file with rewrite rules which is fine for Apache, but not so well with nginx. </p>
<p><pre><code>

server {
  server_name www.zod.im www.zodim.com;
  rewrite ^(.*) http://zod.im$1 permanent;
}

server {
    listen   80;
    server_name zod.im;

    access_log /var/log/nginx/zod.im.access.log;
    error_log /var/log/nginx/zod.im.error.log;

    root   /var/www/zod.im/web/;
    index  index.php index.html;

    error_page    404    /404.php;

  location / {
    # If the file exists as a static file serve it directly without
    # running all the other rewite tests on it
    if (-f $request_filename) {
      expires max; 
      break; 
    }

    if (!-f $request_filename){
       set $rule_0 1$rule_0;
    }
    if (!-d $request_filename){
       set $rule_0 2$rule_0;
    }
    if ($rule_0 = &quot;21&quot;){
       rewrite ^/.* /yourls-loader.php last;
    }
  }
  location ~ .php$ {
    set  $script     $uri;
    set  $path_info  &quot;&quot;;

    if ($uri ~ &quot;^(.+\.php)(/.+)&quot;) {
      set  $script     $1;
      set  $path_info  $2;
    }

    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:5555;
    fastcgi_index index.php;

    fastcgi_param SCRIPT_FILENAME /var/www/zod.im/web$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $path_info;
    fastcgi_intercept_errors on;

    root /var/www/zod.im/web;
  }
</code></pre></p>
<p>Restart nginx</p>
<h3> Go through setup </h3>
<p>Open browser and go to the admin page, login and go through initial setup process.</p>
<p>http://example.com/admin/</p>
<p>You get two screens to see.  First is initial welcome with button to install.  Click this and get the second telling you it has created the database tables.</p>

<a href='http://unrealexpectations.com/blog/2011/03/install-your-own-url-shortener/screen-shot-2011-03-04-at-10-17-54-pm/' title='YOURLS Install Screen 1'><img width="150" height="150" src="http://unrealexpectations.com/blog/wp-content/uploads/2011/03/Screen-shot-2011-03-04-at-10.17.54-PM-150x150.png" class="attachment-thumbnail" alt="YOURLS Install Screen 1" title="YOURLS Install Screen 1" /></a>
<a href='http://unrealexpectations.com/blog/2011/03/install-your-own-url-shortener/screen-shot-2011-03-04-at-10-18-28-pm/' title='YOURLS Install Screen Shot 2'><img width="150" height="150" src="http://unrealexpectations.com/blog/wp-content/uploads/2011/03/Screen-shot-2011-03-04-at-10.18.28-PM-150x150.png" class="attachment-thumbnail" alt="YOURLS Install Screen Shot 2" title="YOURLS Install Screen Shot 2" /></a>

<p>The second screen may complain about not being able to write the .htaccess file, but since nginx is used, that can easily be ignored.</p>
</ol>
<h2> Conclusion </h2>
<p>The process to create your own personal shortening service can take a little as little as 15 minutes with YOURLS.  It will probably take longer to figure out your short domain name and acquire it.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2011/03/install-your-own-url-shortener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eye-Fi Upload via Mac OS X Internet Sharing</title>
		<link>http://unrealexpectations.com/blog/2011/02/eye-fi-upload-via-mac-os-x-internet-sharing/</link>
		<comments>http://unrealexpectations.com/blog/2011/02/eye-fi-upload-via-mac-os-x-internet-sharing/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 03:40:08 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[eye-fi]]></category>
		<category><![CDATA[mac wizardry]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=147</guid>
		<description><![CDATA[<p></p>
<p>I occasionally find the desire to upload images via Eye-Fi while in a location that doesn&#8217;t have Wi-Fi, but my computer does have wired Internet access.  Let&#8217;s say for lack of a better example location this could be a late 90&#8242;s remodeled hotel.  In those instances, I feel using the Internet Sharing of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://unrealexpectations.com/blog/wp-content/uploads/2011/02/eye-fi-mac-internet-sharing.png"><img src="http://unrealexpectations.com/blog/wp-content/uploads/2011/02/eye-fi-mac-internet-sharing-300x118.png" alt="" title="Eye-Fi via Mac OS X Internet Sharing" width="300" height="118" class="alignleft size-medium wp-image-149" /></a></p>
<p>I occasionally find the desire to upload images via Eye-Fi while in a location that doesn&#8217;t have Wi-Fi, but my computer does have wired Internet access.  Let&#8217;s say for lack of a better example location this could be a late 90&#8242;s remodeled hotel.  In those instances, I feel using the Internet Sharing of Mac OS X seems to be an easy solution.  Yeah, not so much.  Most of the times I have used Internet Sharing, it worked great.  However, those cases tended to be using other Apple hardware such as iPhone or iPad when I needed to trick it into thinking the device has a Wi-Fi connection when one was not readily available.  However, using non-Apple devices seem to be a bit more tricky.</p>
<p>Using Internet Sharing in Max OS X utilizing the Airport for incoming tracking sets the Wi-Fi Network up in Infrastructure mode.  The Mac is able to act as Router and provide NAT-based private IP addresses to clients.  It also supports WEP, both 40 bit and 128 bit.  It does not support WPA or WPA2 when the airport acts as access point.</p>
<h2>reply_threshold_seconds</h2>
<p>There are <a href="http://arstechnica.com/civis/viewtopic.php?f=19&#038;t=165873">ample</a> <a href="http://hints.macworld.com/article.php?story=20071223001432304">examples</a> of <a href="http://www.landlubber.com/2009/configuring-internet-sharing-between-an-imac-running-snow-leopard-a-mac-laptop-an-ubuntu-netbook-and-a-roku/">findings</a> of a bug in Mac OS X that a defect in the default configuration of DHCP server when Internet Sharing is enabled that delays the response to DHCP requests beyond what some client devices find acceptable.  This causes the device to think it can&#8217;t receive an address and report an error.  It turns out if this setting is decreased more devices can connect. </p>
<p>To fix:</p>
<ol>
<li>Go to System Preferences -> Sharing and enable Internet Sharing.
<p> This is necessary because by default, the starting and stopping of Internet Sharing creates and deletes the /etc/bootpd.plist file.</p>
</li>
<li>Open terminal and create a copy of the bootpd.plist file.<br />
<br />
<pre><code>
&gt; cp /etc/bootpd.plist /tmp/bootpd.plist
</code></pre><br />

</li>
<li>Open the /tmp/bootpd.plist file in editor (vi, TextEdit, TextWrangler, UltraEdit) and update the reply_threshold_seconds setting from 4 to 0.
<p>Before:<br />
<pre><code>
        ...
        &lt;key&gt;reply_threshold_seconds&lt;/key&gt;
        &lt;integer&gt;4&lt;/integer&gt;
        ...
</code></pre></p>
<p>After:<br />
<pre><code>
        ...
        &lt;key&gt;reply_threshold_seconds&lt;/key&gt;
        &lt;integer&gt;0&lt;/integer&gt;
        ...
</code></pre>
</li>
<li> Stop the Internet Sharing.
<p>This is necessary to replace the /etc/bootpd.plist file.  Doing the next step before this one will cause the file to disappear the next time Internet Sharing is turned off.</p>
</li>
<li> From the terminal copy the edited file back to /etc directory.<br />
<br />
<pre><code>
&gt; sudo cp /tmp/bootpd.plist /etc/
</code></pre>
</li>
<li>Start Internet Sharing.
<p>Once the /etc/bootpd.plist file exists different from the default, Starting/Stopping the service does not seem to affect the file any longer.</p>
</li>
</ol>
<p>Assuming you do not enable WEP, it is likely any client device can now connect to the new wireless access point.  </p>
<h2>To WEP or Not To WEP</h2>
<p>While WEP is accepted as broken and can easily be hacked to determine the password, the use of WEP and requirement of password does keep the average WiFi joe from hopping on to your network at their whim.  There was a survey published recently that reported that while the vast majority of WiFi owners locked down their routers to prevent others from using their network, the people had little compunction about using other peoples network when found to be open.  Once or twice I have been in a neighborhood and needed network access on laptop.  It was handy to find open network I could VPN through.  So, I would recommend using WEP when nothing else is available.  </p>
<p>Unfortunately, this proved fruitless with Eye-Fi.  There are <a href="http://hintsforums.macworld.com/showthread.php?t=79326">plenty</a> of <a href="http://ruzette.wordpress.com/2009/11/26/internet-sharing-on-mac-via-airport-to-windows-xp-os-x-leopard/">examples</a> on how to fix this for Windows-based machines that had problems connecting.  In trying to come up with working solution for Eye-Fi I first determined whether another device, such as Windows XP laptop could connect to again see whether it was non-Apple issue in whole or Eye-Fi specific issue.  What the WEP based troubleshooting all stated for this that when using an alphanumeric password, it is likely that different clients are encoding the plain text differently.  So, it is best to use a hex password which doesn&#8217;t require encoding process to use.  </p>
<p>To use hex password, you can&#8217;t just enter the 10 or 26 hex characters into the password field in Mac OS X.  Rather you need to prefix it with &#8216;$&#8217; (dollar sign) character.  The character explicitly tells the Internet Sharing control to use the values as hex.    </p>
<p>Example:  40 Bit Password.  Enter the following in the Mac OS X password box:<br />
<pre><code>
    $073E2ABF12
</code></pre><br />
Enter the following in Windows or other client:<br />
<pre><code>
    073E2ABF12
</code></pre></p>
<p>The 128 Bit version is much the same except using 26 hex character string.  </p>
<p>Utilizing this approach I got the Windows laptop to connect, but the Eye-Fi card remain unable to fully connect.  Except that I finally got a different response setting up the card in Eye Fi Center than previously.  Specifically, most previous failures had the Connect button spinning into Idle Card state.  This time, the error message stated to check whether the router was filtering MAC addresses and to allow the Eye-Fi card&#8217;s address if that was the case.  </p>
<p>One last trick will be try setting the card up on Mac Mini connecting through to the Mac Book Pro in case there is any issues with circular connectivity.  However, I don&#8217;t think this is the case since I added the network to the Eye-Fi card by stating the network wasn&#8217;t present.  This should add the network to the card and if setup properly allow the card to connect in the camera.  This still didn&#8217;t happen, so don&#8217;t have too much faith this is a circular/dual addressing issue.</p>
<h2>No WEP, but locked with MAC Filtering</h2>
<p>In the end, I want this to work even if I don&#8217;t have the illusion of security.  So, go back to open access, but I don&#8217;t wan&#8217;t any Joe Blow connecting to my laptop.  To prevent this then, means adding some MAC address filtering to allow allow known devices to connect to the Mac Book.  </p>
<p>The problem is that the Internet Sharing preferences pane does not have an option for setting up MAC address filters.  However, the bootpd configuration file does.  Since I have already modified the /etc/bootpd.plist to change the reply_threshold_seconds it can be modified to enable MAC address filtering.   To do this, just add the key <strong>allow</strong> with a string array value between the <strong>Subnets</strong> and <strong>bootp_enabled</strong> keys.</p>
<p><pre><code>
        ....
        &lt;key&gt;allow&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;0:17:43:a3:2d:45&lt;/string&gt;
        &lt;/array&gt;&lt;/strong&gt;
        ...
</code></pre></p>
<p>The MAC address entered is the one for the Eye-Fi card.  In this case, since I got the error message with the address prominently displayed, it was pretty easy to find.  Otherwise, right clicking on the card in Eye-Fi Center will list the MAC address in the menu with option to copy it.</p>
<p>Update the /etc/bootpd.plist file and restart the service.  Now Eye-Fi could connect, but iPhone and Windows XP laptops could not.  So all appears well enough.</p>
<h3>Security</h3>
<p>I never like not enabling some encryption even if it is just WEP.  Even when on public hot spots, I like to use VPN to prevent local traffic sniffing.  </p>
<p>I kind of figure in this case, the only thing being transferred is photos which generally end up in public locations anyway.  If I need other devices somewhat secured, it is enough to make the changes, add the new device to MAC address filters and restart the filter.</p>
<h2>What&#8217;s Next</h2>
<p>I will keep trying to see if I can eventually get the card working with WEP through Mac OS X / Internet Sharing.  One thing is to check if it is local or just as problematic same machine syndrome.</p>
<h3>Full /etc/bootpd.plist File</h3>
<p><pre><code>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
  &lt;key&gt;Subnets&lt;/key&gt;
  &lt;array&gt;
    &lt;dict&gt;
      &lt;key&gt;_creator&lt;/key&gt;
      &lt;string&gt;com.apple.nat&lt;/string&gt;
      &lt;key&gt;allocate&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;dhcp_domain_name_server&lt;/key&gt;
      &lt;string&gt;10.0.2.1&lt;/string&gt;
      &lt;key&gt;dhcp_router&lt;/key&gt;
      &lt;string&gt;10.0.2.1&lt;/string&gt;
      &lt;key&gt;lease_max&lt;/key&gt;
      &lt;integer&gt;86400&lt;/integer&gt;
      &lt;key&gt;lease_min&lt;/key&gt;
      &lt;integer&gt;86400&lt;/integer&gt;
      &lt;key&gt;name&lt;/key&gt;
      &lt;string&gt;10.0.2&lt;/string&gt;
      &lt;key&gt;net_address&lt;/key&gt;
      &lt;string&gt;10.0.2.0&lt;/string&gt;
      &lt;key&gt;net_mask&lt;/key&gt;
      &lt;string&gt;255.255.255.0&lt;/string&gt;
      &lt;key&gt;net_range&lt;/key&gt;
      &lt;array&gt;
        &lt;string&gt;10.0.2.2&lt;/string&gt;
        &lt;string&gt;10.0.2.254&lt;/string&gt;
      &lt;/array&gt;
    &lt;/dict&gt;
  &lt;/array&gt;
  &lt;key&gt;allow&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;0:17:43:a3:2d:45&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;bootp_enabled&lt;/key&gt;
  &lt;false/&gt;
  &lt;key&gt;detect_other_dhcp_server&lt;/key&gt;
  &lt;integer&gt;1&lt;/integer&gt;
  &lt;key&gt;dhcp_enabled&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;en1&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;reply_threshold_seconds&lt;/key&gt;
  &lt;integer&gt;0&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2011/02/eye-fi-upload-via-mac-os-x-internet-sharing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Impressions of Sony Dash</title>
		<link>http://unrealexpectations.com/blog/2011/02/impressions-of-sony-dash/</link>
		<comments>http://unrealexpectations.com/blog/2011/02/impressions-of-sony-dash/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 17:29:29 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[gadgetry]]></category>
		<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=135</guid>
		<description><![CDATA[<p>
For Christmas I received the Sony Dash as present from my wife.  Having worked with computers, networking, and all sorts of technology in general I am both amazed and dismayed by Sony Dash at the same time.</p>
<p>Since this article can live for a long time and the Sony product team does seem to making monthly/bi-monthly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://unrealexpectations.com/blog/wp-content/uploads/2011/01/sony-dash.jpg"><img src="http://unrealexpectations.com/blog/wp-content/uploads/2011/01/sony-dash-300x213.jpg" alt="" title="Sony Dash" width="300" height="213" class="alignleft size-medium wp-image-138" /></a><br />
For Christmas I received the Sony Dash as present from my wife.  Having worked with computers, networking, and all sorts of technology in general I am both amazed and dismayed by Sony Dash at the same time.</p>
<p>Since this article can live for a long time and the Sony product team does seem to making monthly/bi-monthly updates, some of these comments may become outdated.  </p>
<h2>Amazed</h2>
<p><strong>Portal Integration</strong><br />
The device uses a web application to help install and configure the apps that run on the device.  The portal makes it relatively easy to find apps that are available, but if the number grows, it will need to address some things to make it easier to find useful ones.</p>
<p>Unfortunately, a lot of the configuration is via Flash, which makes sense given the apps on the Dash itself are built in Flash.  This makes it impossible to use with iPad.  If the Dash lives in the bedroom, it is easier to configure it with the iPad rather than laptop that usually stays downstairs.  It&#8217;ll probably work with Android tablets, but don&#8217;t currently have one of those.</p>
<p><strong>Netflix</strong><br />
We don&#8217;t have a TV in our bedroom, and while the prospect of watching a movie on 7 inch screen isn&#8217;t going to be the bedroom home theater of choice, it is still an interesting device to have Netflix access on.  It is able to access my Wireless-N WPA2 network which is good as I would like to phase out the B/G WEP.  Anyway, Netflix runs fairly well on it.  Netflix is probably the most ubiquitous service I have access to use.  </p>
<h2>Dismayed</h2>
<p><strong>Internet Radio<br />
</strong>Given that the Dash does not provide AM/FM radio built-in, this is the best app to use to listen to your local stations.  Unfortunately, this looks like one heck of a unfinished app; more to the point it appears to be more proof of concept that indeed Internet Radio can be streamed and is missing the consumer oriented features that make it easy to use.  In my world of development, this is would be a manual test harness the backend developer put together to prove the playing of audio streams works.</p>
<p>Then Internet Radio Streamer allows for user to manually add streams that can then be played.  By manually adding streams, you have to know the URL of the stream and type it in completely and the content type of stream, m3u or pls.    There is no pre-screened list of stations or search functionality.  You can only manually add new or edit &amp; delete existing streams.  The list of added streams can&#8217;t even be reordered or categorized.</p>
<p>OK, so to use the app I need to use my computer to go find stream URLs and add them to the Dash.  Not too big a deal since the device does allow adding and configuration of apps on the web site.  I can fire up Safari, find the streams and copy/paste to the Dash configuration site.  Does this app allow for configuration on the web site?  No.  So now you have to have computer within eyes view of Dash to enter the stream URL.</p>
<p>I don&#8217;t go looking for audio streaming URLs everyday, so didn&#8217;t know where to go.  My first instinct was to use put in radio stations into search box, &#8220;knx 1070 audio stream url&#8221;.  This had success in getting me to pages that would play the stream online, but made getting the URL difficult.  I used Safari Web Inspector to find the URL.  One down, many to go.</p>
<p>Eventually, I decided to go a different route.  I eventually found some aggregator sites that provided better access to the URL.  The main site I used for most stations I eventually added was <a href="http://vtuner.com/">vTuner</a>.  VTuner provides an aggregation list of audio streams and an API to access the list.  Their API has been added to many devices, just not the Sony Dash (yet?).  It seems the Internet Radio Streamer app can be made vastly more user friendly.</p>
<p><strong>Responsiveness</strong><br />
The thing is slow to respond to inputs.  I hit a button on screen and then need to wait several seconds most of the time until I can tell whether or not it recognized the input.  I understand the device is intended to be inexpensive, which probably limits what strength processor can be purchased, but wow.</p>
<h2>Parting thoughts</h2>
<p>While I have explored some apps, I haven&#8217;t had an opportunity to fully find the ones that fully interest me.  I like the Dash and can&#8217;t wait to see what updates come in the future to make it more useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2011/02/impressions-of-sony-dash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ForbesPrint.com and Open Source</title>
		<link>http://unrealexpectations.com/blog/2010/06/forbesprint-com-and-open-source/</link>
		<comments>http://unrealexpectations.com/blog/2010/06/forbesprint-com-and-open-source/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 04:22:40 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[slicehost]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=115</guid>
		<description><![CDATA[<p>A year ago, my wife, daughter and I visited my wife&#8217;s aunt and uncle in Waterford, Michigan area.  She signed me up to do a small web site for them to promote the printing business.  The printing business has been in the family since 1946. </p>
<p>I decided to use open source tools as [...]]]></description>
			<content:encoded><![CDATA[<p>A year ago, my wife, daughter and I visited my wife&#8217;s aunt and uncle in Waterford, Michigan area.  She signed me up to do a small <a href="http://www.forbesprint.com/">web site</a> for them to promote the printing business.  The printing business has been in the family since 1946. </p>
<p>I decided to use open source tools as much as possible to deliver the site.  Long term, I don&#8217;t expect to have access to tools I use at work and I actually know I shouldn&#8217;t use tools from work to work on external projects. And so, I stayed with open source tools as much as possible.</p>
<p>I set up the website relatively quickly with ruby on rails, but did not launch it for awhile.  While I like the ruby on rails approach to rapid development I haven&#8217;t used ruby enough to learn the syntax and be productive in it.  In the meantime between developing the site and actually launching it, I worked on a project for a client that utilized <a href="http://www.symfony-project.org">symfony</a>.   This gave me enough opportunity and time to learn php and the symfony framework.  So the in-development site was migrated from a ruby on rails to symfony project.  </p>
<p>One thing I liked when I set up the rails project was the usage of <a href="http://www.capify.org">capistrano</a> to manage the deployment of the application to my slicehost instance.  I decided to see how it could work with symfony as well.  In the end, I was able to get a good amount of information from the following <a href="http://blog.codingspree.net/2008/5/12/deploying-symfony-project-with-capistrano/">site</a>.  Besides paths and server changes to the configuration presented on the page, I utilize git as version control.   </p>
<p>I have found great value in git over subversion.  I like the fact that git does not require server software to run.  Getting it <a href="http://articles.slicehost.com/2009/5/13/capistrano-series-setting-up-git">up and running</a> with just a dedicated user and ssh was a snap.  Even better, git doesn&#8217;t manage every file with 3 extra files per instance like subversion seems to do.  To copy a subversion branch from one server to another takes forever due to all the .svn files.  Git can easily be moved around and ability to remove git from a file structure works just as easily.  </p>
<p>In the end, I built the very small site, <a href="http://www.forbesprint.com/">ForbesPrint.com</a> with the following tools:</p>
<ul>
<li>php for scripting language</li>
<li>symfony for php framework</li>
<li>nginx for web server</li>
<li>fastcgi for php runtime environment</li>
<li>git for source control</li>
<li>gimp for image editing</li>
<li>slicehost for server hosting utilizing Ubuntu virtual machine</li>
<li>SpringSource Tool Set for IDE with Aptana Studio plugin for php project support</li>
</ul>
<p>Now that the basics are in place, I hope to expand the site to better accommodate their needs and growth the business.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2010/06/forbesprint-com-and-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging on the iPad</title>
		<link>http://unrealexpectations.com/blog/2010/04/blogging-on-the-ipad/</link>
		<comments>http://unrealexpectations.com/blog/2010/04/blogging-on-the-ipad/#comments</comments>
		<pubDate>Sat, 01 May 2010 04:31:13 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[gadgetry]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/2010/04/blogging-on-the-ipad/</guid>
		<description><![CDATA[<p>My new 3g iPad arrived today and I have spent the evening having a look through the app store for apps that are built for the device.  One of the apps I found was WordPress for the iPad.  This is my first post on the iPad and the initial impression is that it [...]]]></description>
			<content:encoded><![CDATA[<p>My new 3g iPad arrived today and I have spent the evening having a look through the app store for apps that are built for the device.  One of the apps I found was WordPress for the iPad.  This is my first post on the iPad and the initial impression is that it is easy to do, but it is prone to moving the cursor around a little too easily.</p>
<p>So far the  other apps I have tried are Netflix and USAToday.  As my previous post mentioned, I imagine the most use of this device will be reading in certain room.  I&#8217;ll have to wait until later to see how that goes.</p>
<p>On a technology front, my latest project involves the use of SDL Tridion for CMS.  I don&#8217;t have too much to state about the product as yet.  I&#8217;ll wait until the developers get going with the implementation before I mention anything about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2010/04/blogging-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAMP &amp; PECL/UUID Module Working On Snow Leopard</title>
		<link>http://unrealexpectations.com/blog/2010/04/mamp-pecluuid-module-working-on-snow-leopard/</link>
		<comments>http://unrealexpectations.com/blog/2010/04/mamp-pecluuid-module-working-on-snow-leopard/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 06:33:05 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[mac wizardry]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=107</guid>
		<description><![CDATA[<p>I had a previous article that discussed in detail on how to get imagick php plugin working on MAMP.   As always, as you get more exposed to technologies and frameworks you find new ways to do things.  One thing to keep in mind with MAMP is that 1.8.4 is still 32-bit build. [...]]]></description>
			<content:encoded><![CDATA[<p>I had a previous article that discussed in detail on how to get <a href="http://unrealexpectations.com/blog/2010/01/mamp-imagick-on-snow-leopard/">imagick</a> php plugin working on MAMP.   As always, as you get more exposed to technologies and frameworks you find new ways to do things.  One thing to keep in mind with MAMP is that 1.8.4 is still 32-bit build.  Once it goes 64-bit, I am sure the whole thing will get easier.</p>
<p>In this instance, I was working through adding UUID generation support to my PHP code.  While the <a href="http://php.net/manual/en/function.uniqid.php">uniqid</a> provides a function to generate IDs, it is not a <a href="http://en.wikipedia.org/wiki/Globally_Unique_Identifier">GUID specification</a>.  There is <a href="http://pecl.php.net/package/uuid">PECL UUID module</a> that provides &#8220;a wrapper around libuuid from the ext2utils project&#8221;.  After looking around for how to add it to MAMP, I came across the following <a href="http://smbjorklund.no/how-enable-pecl-uploadprogress-extention-mamp#SL">article</a> that talked about how to enable the uploadprogress module.  utilizing the same process I attempted to build the uuid module.  Unfortunately, the uuid module failed to compile.  This eventually lead to a <a href="http://pecl.php.net/bugs/bug.php?id=14503">defect report</a> for the uuid module about Mac OS X and older version of files.  Attached was a patch file; patched the files and remade.  Installed, reloaded and all was good.</p>
<p>The following are the steps I used for the installation of uuid module.</p>
<p><b> Download and extract the uuid module</b><br />
Grabbed the 1.2 version of the uuid module.<br />
<pre><code>
macbook:Downloads mleo$ wget http://pecl.php.net/get/uuid-1.0.2.tgz
...
mabook:Downloads mleo$ tar -xzf uuid-1.0.2.tgz 
macbook:Downloads mleo$ cd uuid-1.0.2
</code></pre></p>
<p><b> Get &#038; Apply Patch </b><br />
Copy patch code from <a href="http://pastie.org/435461">here</a>.   Save the contents into mac.patch file.  Apply patch.  It did require entry of the path to two test files during the patch process.<br />
<pre><code>
macbook:uuid-1.0.2 mleo$ patch &lt; mac.patch 
patching file config.m4
patching file php_uuid.h
can&#039;t find file to patch at input line 103
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urp uuid-1.0.2/tests/uuid_mac.phpt uuid-
|1.0.2.mine/tests/uuid_mac.phpt
|--- tests/uuid_mac.phpt  2008-04-01 08:59:22.000000000 -0700
|+++ tests/uuid_mac.phpt  2008-08-14 10:21:57.000000000 -0700
--------------------------
File to patch: tests/uuid_mac.phpt
patching file tests/uuid_mac.phpt
can&#039;t find file to patch at input line 116
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urp uuid-1.0.2/tests/uuid_time.phpt uuid-
|1.0.2.mine/tests/uuid_time.phpt
|--- tests/uuid_time.phpt  2008-04-01 08:59:22.000000000 -0700
|+++ tests/uuid_time.phpt  2008-08-14 10:22:50.000000000 -0700 
--------------------------
File to patch: tests/uuid_time.phpt
patching file tests/uuid_time.phpt
patching file uuid.c
</code></pre></p>
<p><b> Configure and Build the Module </b><br />
I&#8217;ll leave the prompts out of this one to make it easier to copy and paste the set of commands, but each line in the below code block is different command. </p>
<p><pre><code>
/Applications/MAMP/bin/php5/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.6
CFLAGS=&quot;-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp&quot;
CCFLAGS=&quot;-arch i386 -arch x86_64 -g -Os -pipe&quot;
CXXFLAGS=&quot;-arch i386 -arch x86_64 -g -Os -pipe&quot;
LDFLAGS=&quot;-arch i386 -arch x86_64 -bind_at_load&quot;
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
./configure --with-php-config=/Applications/MAMP/bin/php5/bin/php-config
make
make install
</code></pre></p>
<p><b> Add module to php.ini </b><br />
Edit the /Applications/MAMP/conf/php5/php.ini file and add &#8220;extension=uuid.so&#8221;.</p>
<p><b> Test Installation </b><br />
Can check info to see if uuid module loads and run the uuid_create() function to see if it returns.</p>
<p><pre><code>
macbook:uuid-1.0.2 mleo$ /Applications/MAMP/bin/php5/bin/php -r &#039;print phpinfo();&#039;
...
uuid
UUID extension

Version =&gt; 1.0.2 (stable)
Released =&gt; 2008-04-01
CVS Revision =&gt; $Id: uuid.c,v 1.9 2008/04/01 15:58:52 hholzgra Exp $
Authors =&gt; Hartmut Holzgraefe &#039;hartmut@php.net&#039; (lead)
...

macbook:uuid-1.0.2 mleo$ /Applications/MAMP/bin/php5/bin/php -r &#039;print uuid_create() . &quot;\n&quot;;&#039;
85C43B35-1416-435F-AEFF-3E4693ACEE65
macbook:uuid-1.0.2 mleo$ 

</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2010/04/mamp-pecluuid-module-working-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Most Popular Room for iPad</title>
		<link>http://unrealexpectations.com/blog/2010/03/most-popular-room-for-ipad/</link>
		<comments>http://unrealexpectations.com/blog/2010/03/most-popular-room-for-ipad/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 04:46:11 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[gadgetry]]></category>
		<category><![CDATA[mac wizardry]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=99</guid>
		<description><![CDATA[<p>My prediction for the iPad is that some survey will come out 6 months after the release that finds people use their iPad more often in the bathroom than any other room in the house.  The logic on this is simple.  People already have laptops, desktops and fully functional computers available in the [...]]]></description>
			<content:encoded><![CDATA[<p>My prediction for the iPad is that some survey will come out 6 months after the release that finds people use their iPad more often in the bathroom than any other room in the house.  The logic on this is simple.  People already have laptops, desktops and fully functional computers available in the living room, office and/or bedroom.  The bathroom is really one of last bastions of truly tech free peace and quiet.  </p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2010/03/most-popular-room-for-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using YAML as Response Format for Services in Spring</title>
		<link>http://unrealexpectations.com/blog/2010/03/using-yaml-as-response-format-for-services-in-spring/</link>
		<comments>http://unrealexpectations.com/blog/2010/03/using-yaml-as-response-format-for-services-in-spring/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 19:26:20 +0000</pubDate>
		<dc:creator>mleo</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://unrealexpectations.com/blog/?p=89</guid>
		<description><![CDATA[<p>Recently, we were developing an iPhone application where the iPhone developer was insistent on utilizing YAML as the response format for service calls.  This seemed odd given the prevalence of JSON as a response format and an already built library for parsing and handling JSON within Objective C that works with the iPhone SDK. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, we were developing an iPhone application where the iPhone developer was insistent on utilizing <a href="http://www.yaml.org/">YAML</a> as the response format for service calls.  This seemed odd given the prevalence of JSON as a response format and an already built <a href="http://code.google.com/p/json-framework/">library</a> for parsing and handling JSON within Objective C that works with the iPhone SDK.  The other advantage to JSON is there is another <a href="http://spring-json.sourceforge.net/">project</a> that has built a JSON view resolver for converting model/domain objects into JSON.   The advantage with YAML is that it inherently supports circular references and can resolve them during serialization and deserialization.  While domain objects can have circular references in design, I try to keep them minimal and out of the model objects to ensure most serialization techniques work easily.</p>
<p>I couldn&#8217;t quickly find any YAML Spring View support so went about working through my own.  Using the source of the JSON Spring View project as baseline I was quickly able to build out a <em>baseline</em> view handler.  I say <em>baseline</em> because I haven&#8217;t fully unit tested the code as yet.  </p>
<p><strong>YamlView Class</strong><br />
This makes use of the <a href="http://jyaml.sourceforge.net/">jyaml</a> library. </p>
<p><pre><code>
public class YamlView extends AbstractView {
    private static final String DEFAULT_YAML_CONTENT_TYPE = &quot;application/yaml&quot;;

    public YamlView() {
        super();
        setContentType(DEFAULT_YAML_CONTENT_TYPE);
    }

    /**
     * Creates a YAML String from the model values.
     */
    @SuppressWarnings(&quot;unchecked&quot;)
    protected final String defaultCreateYaml(Map model) {
        return Yaml.dump(model);
    }

    /**
     * Creates a Yaml String from the model values.
     */
    @SuppressWarnings(&quot;unchecked&quot;)
    protected String createYaml(Map model, HttpServletRequest request, HttpServletResponse response) {
        return defaultCreateYaml(model);
    }

    @SuppressWarnings(&quot;unchecked&quot;)
    @Override
    protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        response.setContentType(getContentType());
        writeYaml(model, request, response);
    }

    @SuppressWarnings(&quot;unchecked&quot;)
    protected void writeYaml(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {
        
        String yaml = createYaml(model, request, response);
        response.getWriter().write(yaml);
        
    }
}
</code></pre></p>
<p><strong>Configuration: applicationContext.xml</strong><br />
In one of the Spring configuration files where the web presentation layer is set.<br />
<pre><code>
...
  &lt;bean name=&quot;xmlViewResolver&quot; 
        class=&quot;org.springframework.web.servlet.view.XmlViewResolver&quot; 
        p:order=&quot;3&quot; 
        p:location=&quot;classpath:xmlViews.xml&quot; /&gt;        
...
</code></pre><br />
The order is in place because this configuration file has multiple ViewResolvers.  The xmlViews.xml then has the configuration:<br />
<pre><code>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
  xmlns:p=&quot;http://www.springframework.org/schema/p&quot;
  xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd&quot;&gt;

    &lt;bean name=&quot;jsonView&quot; class=&quot;org.springframework.web.servlet.view.json.JsonView&quot;/&gt;

    &lt;bean name=&quot;yamlView&quot; class=&quot;com.example.web.view.YamlView&quot;/&gt;
    
&lt;/beans&gt;
</code></pre></p>
<p>And finally, the usage within a controller:</p>
<p><pre><code>
public class ExampleController extends AbstractCommandController {
...
  @Override
  protected ModelAndView handle(HttpServletRequest request,
      HttpServletResponse response, Object command, BindException bindException)
      throws Exception {
    
...
    String viewType = &quot;jsonView&quot;;
    if (request.getRequestURI().endsWith(&quot;.yaml&quot;)) {
      viewType = &quot;yamlView&quot;;
    }
    
    return new ModelAndView(viewType, model);
  }  
...
}

</code></pre></p>
<p>It really is amazing the little amount of custom code required these days to get great results.</p>
]]></content:encoded>
			<wfw:commentRss>http://unrealexpectations.com/blog/2010/03/using-yaml-as-response-format-for-services-in-spring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

