<?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>Peter Krantz &#187; PHP</title>
	<atom:link href="http://www.peterkrantz.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peterkrantz.com</link>
	<description>A blog about technology, visualization, music and unmanned vehicle experiments</description>
	<lastBuildDate>Mon, 12 Jul 2010 14:47:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Synchronizing RDF data from files with the ARC triple store</title>
		<link>http://www.peterkrantz.com/2008/arc-filesync-plugin1/</link>
		<comments>http://www.peterkrantz.com/2008/arc-filesync-plugin1/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 17:35:38 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[RDF]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/arc-filesync-plugin1/</guid>
		<description><![CDATA[I have been playing with the excellent ARC framework for a small legal information project (more on that soon). I am beginning to think that many RDF usage scenarios involve data in files (stored in a file system) combined with a triple store that preferrably should be kept in sync with the files. Inspired by [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing with the excellent <a href="http://arc.semsol.org/">ARC framework</a> for a small legal information project (more on that soon). I am beginning to think that many RDF usage scenarios involve data in files (stored in a file system) combined with a triple store that preferrably should be kept in sync with the files. Inspired by Niklas Lindström&#8217;s Oort I wrote a small plugin to do that in ARC.</p>
<p>The plugin extends the ARC2_Store class with a sync_with_folder($path_to_folder) method. Here is the <a href="http://www.peterkrantz.com/wp-content/uploads/2008/02/arc2_filesystemsynchronizerpluginphp.txt">source code for the initial version</a> if you want to play with it. Rename the file to ARC2_FilesystemSynchronizerPlugin.php ansd save in the ARC plugin folder.</p>
<p>By popular request, here is a simple usage example:</p>
<p> //Include ARC and configuration<br />
include_once(&#8216;path/to/arc/ARC2.php&#8217;);<br />
include_once(&#8216;path/to/arc/config.php&#8217;);</p>
<p>$store = ARC2::getComponent(&#8216;FileSystemSynchronizerPlugin&#8217;, $config);<br />
$store-&gt;sync_with_folder(&#8220;/root/path/to/file/store&#8221;);</p>
<p>Save the above code to a file called sync.php and run from the command line with <kbd>php sync.php</kbd></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.peterkrantz.com%2F2008%2Farc-filesync-plugin1%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" title="I like this" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/arc-filesync-plugin1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Intricacies of PHP compared to Ruby</title>
		<link>http://www.peterkrantz.com/2008/php-for-beginners/</link>
		<comments>http://www.peterkrantz.com/2008/php-for-beginners/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 09:25:19 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/php-for-beginners/</guid>
		<description><![CDATA[Via Tim Bray’s blog I found zestyping’s “Why PHP should never be taught”. In it he provides some interesting PHP code that will be difficult for beginners to understand.]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://www.tbray.org/ongoing/When/200x/2007/12/31/Year-Sweep-Tech">Tim Bray&#8217;s blog</a> I found <a href="http://zestyping.livejournal.com/124503.html">zestyping&#8217;s &#8220;Why PHP should never be taught&#8221;</a>. In it he provides some interesting PHP code that will be difficult for beginners to understand:</p>
<pre>
$a = 0;
$b = "eggs";
$c = "spam";
</pre>
<p>yields:</p>
<pre>
a == b
b != c
a == c
a == d
b != d
c != d
</pre>
<p>(Please note that d hasn&#8217;t been defined). In the comments, people freak out and tell him that this behaviour is defined in the documentation. I guess that makes it even worse. </p>
<p>Trying the same thing in Ruby:</p>
<p>a = 0<br />
b = &#8220;eggs&#8221;<br />
c = &#8220;spam&#8221;</p>
<p>a == b<br />
=> false</p>
<p>b == c<br />
=> false</p>
<p>a == c<br />
=> false</p>
<p>a == d<br />
NameError: undefined local variable or method &#8216;d&#8217; for main:Object from (irb):7</code></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.peterkrantz.com%2F2008%2Fphp-for-beginners%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" title="I like this" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/php-for-beginners/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
