<?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>Paul Osman</title>
	<atom:link href="http://blog.eval.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eval.ca</link>
	<description>Thoughts on Software and Other Things</description>
	<lastBuildDate>Tue, 23 Feb 2010 02:37:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>#OpenWebTO Meetup</title>
		<link>http://blog.eval.ca/2010/02/23/openwebto-meetup/</link>
		<comments>http://blog.eval.ca/2010/02/23/openwebto-meetup/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 02:37:38 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Open Web]]></category>

		<guid isPermaLink="false">http://blog.eval.ca/?p=282</guid>
		<description><![CDATA[On Tuesday, March 2nd at 7pm, I&#8217;ll be hosting the first #OpenWebTO Meetup at the Centre for Social Innovation. My goal is to get a group of people interested in open web tech together to present, chat, and share ideas. The first meeting will be focused on figuring out what people want out of such [...]]]></description>
			<content:encoded><![CDATA[<p>On Tuesday, March 2nd at 7pm, I&#8217;ll be hosting the first #OpenWebTO Meetup at the Centre for Social Innovation. My goal is to get a group of people interested in open web tech together to present, chat, and share ideas. The first meeting will be focused on figuring out what people want out of such a gathering, and what topics in particular are popular. I&#8217;m going to do a quick presentation on how I see the current landscape of open web tech and hopefully get some discussion going. Open web technology is a pretty broad topic, so it&#8217;s probably helpful to say that I&#8217;m thinking specifically of protocols like OpenID, OAuth, Portable Contacts, WebFinger, Webhooks / PubSubHubbub, Activity Streams, and similar. </p>

<p>The more the merrier of course, so if you&#8217;re in the Toronto area and have an interest in open web technologies, come on out and join us! Details are on <a href="http://guestlistapp.com/events/14898">Guestlist</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2010/02/23/openwebto-meetup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Webfinger</title>
		<link>http://blog.eval.ca/2010/02/01/google-webfinger/</link>
		<comments>http://blog.eval.ca/2010/02/01/google-webfinger/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 12:43:16 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Open Web]]></category>
		<category><![CDATA[Social Tech]]></category>

		<guid isPermaLink="false">http://blog.eval.ca/?p=267</guid>
		<description><![CDATA[This is pretty old news, but I missed the original announcement and I think it&#8217;s pretty interesting.

Google have implemented an alpha of the WebFinger protocol.  If you have a Google profile, click on &#8220;Edit your profile&#8221; and add &#8216;webfingeralpha&#8217; as an interest. Congrats, your gmail address is now a WebFinger identifier and will resolve [...]]]></description>
			<content:encoded><![CDATA[<p>This is <a href="http://groups.google.com/group/webfinger/browse_thread/thread/46fe84c1e38ab715/fa625d20f4d963e4">pretty old news</a>, but I missed the original announcement and I think it&#8217;s pretty interesting.</p>

<p>Google have implemented an alpha of the <a href="http://code.google.com/p/webfinger/">WebFinger protocol</a>.  If you have a Google profile, click on &#8220;Edit your profile&#8221; and add &#8216;webfingeralpha&#8217; as an interest. Congrats, your gmail address is now a WebFinger identifier and will resolve to an XRD file containing information about services you use (if you&#8217;ve included that information in your Google profile).</p>

<p>This is pretty fun to play around with. Given an email-like identifier, such as evalpaul@gmail.com, get the host-meta XRD file for the domain:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">paul<span style="color: #000000; font-weight: bold;">@</span>knuth ~ $ curl <span style="color: #660033;">-i</span> http:<span style="color: #000000; font-weight: bold;">//</span>gmail.com<span style="color: #000000; font-weight: bold;">/</span>.well-known<span style="color: #000000; font-weight: bold;">/</span>host-meta
HTTP<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.1</span> <span style="color: #000000;">200</span> OK
Content-Type: application<span style="color: #000000; font-weight: bold;">/</span>xrd+xml
Transfer-Encoding: chunked
Date: Mon, 01 Feb <span style="color: #000000;">2010</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">36</span>:<span style="color: #000000;">47</span> GMT
Expires: Mon, 01 Feb <span style="color: #000000;">2010</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">36</span>:<span style="color: #000000;">47</span> GMT
Cache-Control: private, max-age=<span style="color: #000000;">0</span>
X-Content-Type-Options: nosniff
X-XSS-Protection: <span style="color: #000000;">0</span>
X-Frame-Options: SAMEORIGIN
Server: GFE<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.0</span>
...</pre></div></div>





<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'UTF-8'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- NOTE: this host-meta end-point is a pre-alpha work in progress.   Don't rely on it. --&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- Please follow the list at http://groups.google.com/group/webfinger --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;XRD</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://docs.oasis-open.org/ns/xri/xrd-1.0'</span> </span>
<span style="color: #009900;">     <span style="color: #000066;">xmlns:hm</span>=<span style="color: #ff0000;">'http://host-meta.net/xrd/1.0'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hm:Host</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://host-meta.net/xrd/1.0'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>gmail.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hm:Host<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'lrdd'</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">template</span>=<span style="color: #ff0000;">'http://www.google.com/s2/webfinger/?q={uri}'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Resource Descriptor<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Link<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/XRD<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>




<p>Now that you have the URI template, get the XRD file for the specific user:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl <span style="color: #ff0000;">&quot;http://www.google.com/s2/webfinger/?q=acct%3Aevalpaul%40gmail.com&quot;</span></pre></div></div>





<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;XRD</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://docs.oasis-open.org/ns/xri/xrd-1.0'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Subject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>acct:evalpaul@gmail.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Subject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.google.com/profiles/evalpaul<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://portablecontacts.net/spec/1.0'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www-opensocial.googleusercontent.com/api/people/'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://webfinger.net/rel/profile-page'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/profiles/evalpaul'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://microformats.org/profile/hcard'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/profiles/evalpaul'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://gmpg.org/xfn/11'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/profiles/evalpaul'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://specs.openid.net/auth/2.0/provider'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/profiles/evalpaul'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'describedby'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/profiles/evalpaul'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'describedby'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://s2.googleusercontent.com/webfinger/?q=evalpaul%40gmail.com&amp;amp;fmt=foaf'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/rdf+xml'</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/XRD<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>




<strong>EDIT:</strong> Google have since rolled out WebFinger support for everyone with a Google Profile. You no longer need to add &#8216;webfingeralpha&#8217; to your interests.
]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2010/02/01/google-webfinger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Social Web Workshop</title>
		<link>http://blog.eval.ca/2009/10/26/social-web-workshop/</link>
		<comments>http://blog.eval.ca/2009/10/26/social-web-workshop/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 04:09:24 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Open Web]]></category>
		<category><![CDATA[Social Tech]]></category>

		<guid isPermaLink="false">http://blog.eval.ca/?p=220</guid>
		<description><![CDATA[Chris Messina was in Toronto last week and ran a full day workshop on social web technologies at the Centre for Social Innovation. He had delivered a talk the night before called &#8220;Identity is the Platform&#8221; (slides) and the workshop focused on many of the same topics. The simplest way that I can think of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.factoryjoe.com">Chris Messina</a> was in Toronto last week and ran a full day workshop on social web technologies at the <a href="http://socialinnovation.ca/">Centre for Social Innovation</a>. He had delivered a talk the night before called &#8220;Identity is the Platform&#8221; (<a href="http://www.scribd.com/doc/20475401/Identity-is-the-Platform">slides</a>) and the workshop focused on many of the same topics. The simplest way that I can think of to explain the premise of both is: 1) The web is becoming more social and 2) The data you create on the web has value.</p>

<p>The workshop was fairly interactive with people from the audience asking questions or raising points every so often. It was a pretty diverse group professionally speaking, made up mostly of software developers, technologists, designers and some marketing people. The material wasn&#8217;t very technical, which I found disappointing, but given the crowd it was the only thing that made sense (I guess for some reason I expected more developers).</p>

<p>The real take-away of the workshop was an overview of various open standards and protocols that can be used together as a sort of Open Web stack. The usual suspects were discussed: <a href="http://openid.net">OpenID</a>, <a href="http://oauth.net">OAuth</a>, <a href="http://pubsubhubbub.googlecode.com/">PubSubHubub</a> and a few that were fairly new to me: <a href="http://portablecontacts.net/">Portable Contacts</a>, <a href="http://activitystrea.ms/">Activity Streams</a> and the <a href="http://www.salmon-protocol.org/">Salmon Protocol</a>. Chris also spoke a bit about the <a href="https://wiki.mozilla.org/drumbeat">Mozilla Drumbeat</a> project which certainly looks interesting.</p>

<p>At the end of the workshop we got into groups and brainstormed about how social web technologies could be used to create a better web. I co-opted my group to talk about how <a href="http://www.freshbooks.com">FreshBooks</a> (my employer) could be made more social. Some really interesting ideas were brought up and I think it&#8217;s a great case study for working with a community that already exists (as opposed to building a community for a new social application).</p>

<p>The workshop was great. I&#8217;m glad I had the opportunity to participate and I definitely came away with a few thoughts and ideas. For one, it could be a worthwhile project to document existing or create new open source projects that use open web technologies. Often it&#8217;s easy to find sample code, but it&#8217;s usually stripped down and not very useful. Real, concrete examples from open source projects could be extremely useful for developers looking to implement support for open technologies and protocols.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2009/10/26/social-web-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wrapping C++ Classes in a PHP Extension</title>
		<link>http://blog.eval.ca/2009/04/21/wrapping-c-classes-in-a-php-extension/</link>
		<comments>http://blog.eval.ca/2009/04/21/wrapping-c-classes-in-a-php-extension/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 13:51:33 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://eval.ca/?p=91</guid>
		<description><![CDATA[I have a tutorial at the Zend Developer Zone called Wrapping C++ Classes in a PHP Extension. It walks you through writing a simple PHP extension that wraps a class written in C++. This is a useful thing to be able to do, especially when exposing an already existing library&#8217;s API to PHP userland scripts, [...]]]></description>
			<content:encoded><![CDATA[<p>I have a tutorial at the <a href="http://devzone.zend.com">Zend Developer Zone</a> called <a href="http://devzone.zend.com/article/4486-Wrapping-C-Classes-in-a-PHP-Extension">Wrapping C++ Classes in a PHP Extension</a>. It walks you through writing a simple PHP extension that wraps a class written in C++. This is a useful thing to be able to do, especially when exposing an already existing library&#8217;s API to PHP userland scripts, which seems like a fairly common task.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2009/04/21/wrapping-c-classes-in-a-php-extension/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Bad Signs &#8211; PHP&#8217;s &#8220;Shut Up&#8221; (@) Operator</title>
		<link>http://blog.eval.ca/2009/01/04/bad-signs-phps-shut-up-operator/</link>
		<comments>http://blog.eval.ca/2009/01/04/bad-signs-phps-shut-up-operator/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 03:22:21 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://blog.paulosman.com/?p=40</guid>
		<description><![CDATA[Derick Rethans has a post about PHP&#8217;s &#8220;shut-up&#8221; operator (@) and why it should be avoided. He outlines a fairly common debugging scenario and gives some &#8220;under-the-hood&#8221; explanations on why that particular operator sucks. I couldn&#8217;t agree more (that it should be avoided) and I want to go further and talk about something that has [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://derickrethans.nl">Derick Rethans</a> has a <a href="http://derickrethans.nl/five_reasons_why_the_shutop_operator_@_should_be_avoided.php">post</a> about PHP&#8217;s &#8220;shut-up&#8221; operator (@) and why it should be avoided. He outlines a fairly common debugging scenario and gives some &#8220;under-the-hood&#8221; explanations on why that particular operator sucks. I couldn&#8217;t agree more (that it should be avoided) and I want to go further and talk about something that has always bugged me about that operator. In my opinion, it&#8217;s a hackish, band-aid fix to a much larger, much more worrisome problem: horrendous API design.</p>

<p>First, a disclaimer. I know that there are some historical reasons for a lot of these things (i.e. Exceptions not appearing until PHP5) but that doesn&#8217;t change the current reality. Consider for instance filesystem functions in the standard extension:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$lines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/tmp/file.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>




<p>If the file &#8220;/tmp/file.txt&#8221; does not exist, depending on your php.ini settings (because display_errors should always be &#8216;Off&#8217; on production systems), you may get something similar to the following output:</p>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">Warning: file(/tmp/file.txt) [function.file]: failed to open stream: No such file or directory in /path/to/your/docroot/test.php on line 3</pre></div></div>




<p>Now the proper thing to do of course would be to verify up front that the file exists and is readable with a call to <a href="http://php.net/is_readable">is_readable()</a> or something similar, but imagine this is a case where there is no way to determine ahead of time if a warning or error will be generated (Derick mentions silencing network errors with <a href="http://php.net/stream_socket_client">stream_socket_client()</a> as one example). In this case, you might be tempted to use the shut-up operator and depend on the return value as the one true way to see if something was succesful or not.</p>

<p>Now compare this with what languages like Python (for example) do, If you were to write similar code in Python:</p>


<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">fp = <span style="color: #008000;">file</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;/tmp/file.txt&quot;</span><span style="color: black;">&#41;</span></pre></div></div>




<p>If the file did not exist, you&#8217;ll get an IOError which, if left uncaught, will result in the following being written to standard error:</p>


<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">Traceback (most recent call last):
  File &quot;test.py&quot;, line 1, in &lt;module&gt;
IOError: [Errno 2] No such file or directory: '/tmp/test.txt'</pre></div></div>




<p>The difference here of course is that an IOError can be caught, ignored or whatever best suits your needs. It&#8217;s a part of the language, the API is not just spewing out garbage to standard output or standard error. More importantly, having a function (or technically a constructor) like file() throw an exception follows a consistent design philosophy whereas PHP&#8217;s error system always leaves me guessing or consulting the docs.</p>

<p>I guess what I&#8217;m saying is that I think the shut-up operator is just one of those signs that PHP is suffering from some serious cruft and I don&#8217;t think those kinds of things bode well for a language.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2009/01/04/bad-signs-phps-shut-up-operator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What drove me away from Apple</title>
		<link>http://blog.eval.ca/2008/11/30/what-drove-me-away-from-apple/</link>
		<comments>http://blog.eval.ca/2008/11/30/what-drove-me-away-from-apple/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 17:32:39 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://blog.paulosman.com/?p=38</guid>
		<description><![CDATA[I recently replaced my Macbook Pro with a Thinkpad x200 running Arch Linux and Windows Vista. After 5 years of using Apple products I decided to switch &#8211; to borrow one of their marketing terms &#8211; because frankly, I was sick of being abused as a customer and the lock-in was making me less and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently replaced my Macbook Pro with a Thinkpad x200 running Arch Linux and Windows Vista. After 5 years of using Apple products I decided to switch &ndash; to borrow one of their marketing terms &ndash; because frankly, I was sick of being abused as a customer and the lock-in was making me less and less comfortable. Here&#8217;s a list of the things that really did it for me:</p>

<ul>
  <li>Pricing the Macbook Air so high with such low specs.</li>
  <li>Releasing an pitiful update to the air along with a nice $100 price increase.</li> 
  <li>Doing away with the matte screen option.</li>
  <li>Pulling the remotes from being included with laptops (admittedly not a huge deal, but felt like salt on a wound).</li>
</ul>

<p>Is it just me or is Apple becoming a little too arrogant? Anyway, I know Lenovo won&#8217;t be saints either, but at least in the non-Mac OS X world I can easily switch vendors down the road if I ever need to.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2008/11/30/what-drove-me-away-from-apple/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP is Lazy</title>
		<link>http://blog.eval.ca/2008/10/30/php-is-lazy/</link>
		<comments>http://blog.eval.ca/2008/10/30/php-is-lazy/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 20:10:54 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.paulosman.com/?p=36</guid>
		<description><![CDATA[Last week I started reading Extending and Embedding PHP. I really like extending scripting languages for a number of reasons, most of all because it&#8217;s a great way to learn about the more esoteric features of a language. So far I&#8217;ve discovered two neat things about PHP that made me smile, so I thought I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I started reading <a href="http://www.amazon.ca/Extending-Embedding-PHP-Sara-Golemon/dp/067232704X/ref=sr_1_1?ie=UTF8&#038;s=books&#038;qid=1225346121&#038;sr=8-1">Extending and Embedding PHP</a>. I really like extending scripting languages for a number of reasons, most of all because it&#8217;s a great way to learn about the more esoteric features of a language. So far I&#8217;ve discovered two neat things about PHP that made me smile, so I thought I&#8217;d share them here.</p>

<h3>Copy on Write</h3>
<p>In an effort to save CPU cycles, PHP uses an optimization strategy called &#8220;Copy on Write&#8221;. Basically what this means is that variable data isn&#8217;t copied until it needs to be. Using an example similar to the one found in the book:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$b</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span></pre></div></div>



<p>
At the first line, the variable $a is created and memory is allocated for it. When we set $b to equal $a however, you might think that the data in $a is copied to $b. PHP doesn&#8217;t actually copy the data until the 3rd line when $b is incremented by 5. The value in this is that data is not copied unnecessarily. If, for some reason, we took out the 3rd line and $b was never modified after the initial assignment, the data would actually never have to be copied.  
</p>

<h3>Return Value Used?</h3>

<p>The second, admittedly more surprising thing I learned was that PHP provides internal functions a parameter called <code>return_value_used</code> whose value can be inspected to determine whether the return value being prepared by the function is actually being saved or not. Imagine you have a function that does some heavy crunching to compute a return value, and a caller (for some reason beyond us) does this:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #339933;">...</span>
myextension_compute_something<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>




<p>In other words, they call the function but don&#8217;t store the return value. Well, being a thoughtful internal function author, you can check to see that <code>return_value_used</code> evaluates to false and just skip doing any work, saving CPU cycles and time, like so:
</p>


<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">PHP_FUNCTION<span style="color: #009900;">&#40;</span>myextension_compute_something<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>return_value_used<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// some fancy but expensive algorithm</span>
        <span style="color: #666666; font-style: italic;">// ...</span>
        RETURN_DOUBLE<span style="color: #009900;">&#40;</span>some_value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        RETURN_NULL<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>


]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2008/10/30/php-is-lazy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZendCon 2008 &#8211; Day 2</title>
		<link>http://blog.eval.ca/2008/09/18/zendcon-2008-day-2/</link>
		<comments>http://blog.eval.ca/2008/09/18/zendcon-2008-day-2/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 18:23:37 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zendcon08]]></category>

		<guid isPermaLink="false">http://blog.paulosman.com/?p=33</guid>
		<description><![CDATA[Harold Goldberg, the CEO of Zend Technologies, started the day off with a talk called &#8220;Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP Applications&#8221;. The talk was basically a run-down of how PHP is doing out there. (Answer: Fairly well!). There were a few case studies of larger companies using PHP (and [...]]]></description>
			<content:encoded><![CDATA[<p>Harold Goldberg, the CEO of Zend Technologies, started the day off with a talk called &#8220;Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP Applications&#8221;. The talk was basically a run-down of how PHP is doing <i>out there</i>. (<small>Answer: Fairly well!</small>). There were a few case studies of larger companies using PHP (and of course Zend products) and a few reports / surveys / etc. Nothing particularly groundbreaking but it was good to start the day feeling pumped about being a PHP programmer&#8230;</p>

<p>Later on I attended &#8220;Tiery-Eyed&#8221;, a talk given by a Zend employee, Kevin Schroeder on &#8230; you guessed it, tiered application development. It was pretty decent, Kevin walked the audience through the creation of a micro-blogging application using a variety of different backend tiers. I left with an urge to create the smallest application I could think off with one SOAP backend, one XML-RPC backend and one REST backend.</p>

<p>The highlight of the day was Sara Goleman&#8217;s talk on PHP Extension Writing. This was the most in-depth of the talks I attended and despite a few technical problems, the talk went smoothly. It was pretty broad but still managed to be quite inspiring.</p>

<p>The day ended with a reception in the exhibit hall. Free drinks and food is never a bad way to end a day&#8230;</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2008/09/18/zendcon-2008-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZendCon 2008 &#8211; Day 1</title>
		<link>http://blog.eval.ca/2008/09/16/zendcon-2008-day-1/</link>
		<comments>http://blog.eval.ca/2008/09/16/zendcon-2008-day-1/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 19:32:51 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zendcon08]]></category>

		<guid isPermaLink="false">http://blog.paulosman.com/?p=31</guid>
		<description><![CDATA[Well yesterday was day one of ZendCon 2008. Actually, the conference proper started today, yesterday was just tutorials. 


So far I&#8217;m pretty impressed. I attended the PHP Developer Best Practices tutorial in the morning and the Quality Assurance in PHP Projects tutorial in the afternoon.

The Best Practices tutorial was a little broad and most of [...]]]></description>
			<content:encoded><![CDATA[<p>Well yesterday was day one of ZendCon 2008. Actually, the conference proper started today, yesterday was just tutorials. 
</p>
<p>
So far I&#8217;m pretty impressed. I attended the <a href="http://www.zendcon.com/ZendCon08/public/schedule/detail/95">PHP Developer Best Practices</a> tutorial in the morning and the <a href="http://www.zendcon.com/ZendCon08/public/schedule/detail/204">Quality Assurance in PHP Projects</a> tutorial in the afternoon.</p>

<p>The Best Practices tutorial was a little broad and most of it was focused on topics that were pretty common / basic. I&#8217;m not sure exactly what I wanted to get out of it, but for somebody who already uses an SCM system, who already tests (although not as much as I should) and writes api documentation it wasn&#8217;t the most informative tutorial. 
</p>

<p>Sebastian Bergmann&#8217;s QA tutorial was excellent. Of course, as the primary author of <a href="http://phpunit.de/">PHPUnit</a>, I assumed Sebastian would know what he was talking about and I was right. He offered a really good, in depth look at <a href="http://phpunit.de/">PHPUnit</a> and covered some of the newer features. He also covered <a href="http://selenium.openqa.org/">Selenium</a> and specifically Selenium RC in quite a bit of detail. </p>

<p>Looking forward to more sessions&#8230; the day of tutorials was a great start, can&#8217;t wait to see what the conference proper has to offer.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2008/09/16/zendcon-2008-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using YAML with the Zend Framework</title>
		<link>http://blog.eval.ca/2008/02/18/using-yaml-with-the-zend-framework/</link>
		<comments>http://blog.eval.ca/2008/02/18/using-yaml-with-the-zend-framework/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 18:23:18 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.paulosman.com/?p=29</guid>
		<description><![CDATA[One of the many great components provided by the Zend Framework is Zend_Config. In a nutshell, this component allows you to access configuration data (from a file, array, etc) through a nested object property based interface. Out of the box, the component supports working with XML and INI files via the Zend_Config_Ini and Zend_Config_Xml Config [...]]]></description>
			<content:encoded><![CDATA[<p>One of the many great components provided by the <a href="http://framework.zend.com">Zend Framework</a> is <a href="http://framework.zend.com/manual/en/zend.config.html">Zend_Config</a>. In a nutshell, this component allows you to access configuration data (from a file, array, etc) through a nested object property based interface. Out of the box, the component supports working with XML and INI files via the <a href="http://framework.zend.com/manual/en/zend.config.adapters.ini.html">Zend_Config_Ini</a> and <a href="http://framework.zend.com/manual/en/zend.config.adapters.xml.html">Zend_Config_Xml</a> Config adapters.</p>

<p>If you&#8217;re familiar with frameworks like <a href="http://www.rubyonrails.org/">Ruby on Rails</a> or <a href="http://www.symfony-project.org/">Symfony</a> however, you may notice that <a href="http://www.yaml.org/">YAML</a> support is missing. This is mostly because there is no one YAML parsing library for PHP. If you are willing to introduce another dependency to your application however, there is a really easy way to use <a href="http://spyc.sourceforge.net/">Spyc</a> to bridge YAML and Zend_Config. One of the nice things about the Zend_Config component is that it can take data right out of a PHP array (as opposed to an XML or INI file). This gives us quite a lot of flexibility, especially considering that Spyc returns parsed YAML data as a PHP array. Armed with this knowledge, the solution becomes really, really simple:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Config.php'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'spyc.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$configFile</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;config.yml&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Config<span style="color: #009900;">&#40;</span>Spyc<span style="color: #339933;">::</span><span style="color: #004000;">YAMLLoad</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$confFile</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>




<p>Remarkably simple isn&#8217;t it? Now, given the YAML config file:</p>


<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;"> webhost: www.example.com
 database: 
     adapter: pdo_mysql
     host: db.example.com
     username: dbuser
     password: secret
     dbname: mydatabase</pre></div></div>




<p>The above PHP code will create a config object that can then be used like this:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">print</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">webhost</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;">// prints 'www.example.com'</span>
<span style="color: #b1b100;">print</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">database</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">host</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// prints 'db.example.com'</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


]]></content:encoded>
			<wfw:commentRss>http://blog.eval.ca/2008/02/18/using-yaml-with-the-zend-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
