<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>a/Caro</title>
	<atom:link href="http://acaro.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://acaro.wordpress.com</link>
	<description>Random Hacks</description>
	<lastBuildDate>Fri, 17 Jun 2011 15:12:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='acaro.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>a/Caro</title>
		<link>http://acaro.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://acaro.wordpress.com/osd.xml" title="a/Caro" />
	<atom:link rel='hub' href='http://acaro.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Clean up all inactive MacPorts package</title>
		<link>http://acaro.wordpress.com/2010/05/11/clean-all-inactive-macports-package/</link>
		<comments>http://acaro.wordpress.com/2010/05/11/clean-all-inactive-macports-package/#comments</comments>
		<pubDate>Tue, 11 May 2010 12:55:58 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/?p=40</guid>
		<description><![CDATA[Today I cleaned up all packages that MacPorts leaves behind, i.e. older package versions that not active yet installed. This is as easy as executing the following from a shell: for file in `port installed &#124; grep -v active &#124; sed -e "s/ //g"` ; do sudo port uninstall $file ; done and typing your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=40&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I cleaned up all packages that MacPorts leaves behind, i.e. older package versions that not active yet installed. This is as easy as executing the following from a shell:</p>
<p><code>for file in `port installed | grep -v active | sed -e "s/ //g"` ; do sudo port uninstall $file ; done</code></p>
<p>and typing your password. Not that bad for recovering almost 1GB in my root partition.</p>
<p>By the same token, you can get rid of all files created when building like this:</p>
<p><code>for file in `port installed | sed -e "s/^ *\([^ ]*\) .*/\1/"` ; do sudo port clean --all $file ; done</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=40&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2010/05/11/clean-all-inactive-macports-package/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Alfresco on Debian GNU/Linux</title>
		<link>http://acaro.wordpress.com/2008/08/26/installing-alfresco-on-debian-gnulinux/</link>
		<comments>http://acaro.wordpress.com/2008/08/26/installing-alfresco-on-debian-gnulinux/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 19:27:39 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/?p=32</guid>
		<description><![CDATA[Sometimes, work drives you to do things that you would never think of otherwise&#8230; well, I hope that at least the end result can be of any help to someone else&#8230; If you have troubles installing Alfresco on Debian GNU/Linux 4.0, perhaps the following notes can help&#8230; If you add &#8220;non-free&#8221; to your source.list, you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=32&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>Sometimes, work drives you to do things that you would never think of otherwise&#8230; well, I hope that at least the end result can be of any help to someone else&#8230; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </em></p>
<p>If you have troubles installing Alfresco on Debian GNU/Linux 4.0, perhaps the following notes can help&#8230;</p>
<ul>
<li>If you add &#8220;non-free&#8221; to your source.list, you will get nice packages for Sun JDK 1.5; I tried to use CGJ JDK 1.4 together with tomcat-compat, but could not get to starting up alfresco;</li>
<li>disable TOMCAT5_SECURITY setting its value to &#8220;no&#8221; in /etc/default/tomcat5.5; although setting this option to &#8220;no&#8221; should be required only for using the java-gcj-compat package, I could not have alfresco running with security enabled;</li>
<li>if you prefer manually installing MySQL and Tomcat, like I did, or you have them already installed on your system, then download just the alfresco.war package and copy it to /var/lib/tomcat5.5/webapps;</li>
<li>remember also to define the location for alfresco store, by defining the <code>dir.root</code> variable in /var/lib/tomcat5.5/webapps/alfresco/WEB-INF/ classes/alfresco/repository.properties.</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=32&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2008/08/26/installing-alfresco-on-debian-gnulinux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>Using configure to build MacOS universal binaries</title>
		<link>http://acaro.wordpress.com/2008/01/11/using-configure-to-build-macos-universal-binaries/</link>
		<comments>http://acaro.wordpress.com/2008/01/11/using-configure-to-build-macos-universal-binaries/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 16:51:56 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[configure]]></category>
		<category><![CDATA[MacOSX]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2008/01/11/using-configure-to-build-macos-universal-binaries/</guid>
		<description><![CDATA[Building universal binaries for MacOS is a snap if you use XCode. But things can get a bit trickier when you are compiling an open source project, specifically when it is not yours! Actually, the process of building universal binaries from a configure based project is very simple, in principle. The only thing you need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=30&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Building universal binaries for MacOS is a snap if you use XCode. But things can get a bit trickier when you are compiling an open source project, specifically when it is not yours!</p>
<p>Actually, the process of building universal binaries from a configure based project is very simple, in principle. The only thing you need to do is configure the project so that it will be compiled for both platforms at once. This is thoroughly described in <a href="http://developer.apple.com/technotes/tn2005/tn2137.html">Apple Technical Note 2137</a>, so I won&#8217;t go into detail about it.</p>
<p>The interesting point is that the approach described above is not universal at all and is prone to fail as soon as your project meets certain conditions. Apple&#8217;s <a href="http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix">Porting UNIX/Linux Applications to Mac OS X</a> guide offers a fairly complete introduction to the wonders of <a href="http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html">Compiling for multiple architecture</a>, so you can get an idea of the complexity of the task.</p>
<p>When all else fails, you are left with just one option: building your project once for each architecture you would like to support, then use <code>lipo</code> to create a universal binary. What follows describes in more detail that approach, along the lines of my experience trying to build a universal binary for the <a href="http://www.cs.wustl.edu/~schmidt/ACE.html">ACE</a> framework.</p>
<p>Basically, one of the reason why ACE fails to build according to Apple&#8217;s guidelines, is the fact that it contains assembler code, and which assembler code to compile is determined at configure-time, so it is correctly configured either for one platform or for the other, but not for both. </p>
<p><strong>First Step: building for your reference architecture</strong></p>
<p>The first step, then is to compile for your actual platform, say i386. It will help if you create a build_i386 directory where to collect all intermediate files and final output, then configure and make like this:</p>
<p><code>mkdir $ACE_wrappers/build_i386 2&gt;/dev/null<br />
cd $ACE_wrappers/build_i386<br />
../configure --prefix=$INSTALL_DIR --enable-static=yes --enable-shared=no --disable-debug ; make; make install<br />
</code></p>
<p>In this specific example, I am going to build a static library for ACE, no dynamic libraries, and install everything into $INSTALL_DIR (it can be what you like). $ACE_wrappers is the root of the ACE distribution or the place where you put your project files.</p>
<p><strong>Second Step: building for your alternate architecture</strong></p>
<p>The second step is building for the alternate architecture, in this case ppc. This is accomplished like this:</p>
<p><code>mkdir $ACE_wrappers/build_ppc 2&gt;/dev/null<br />
cd $ACE_wrappers/build_ppc<br />
CC="gcc -arch ppc" CXX="g++ -arch ppc"  ../configure  --host=ppc-apple-darwin -  --enable-static=yes --enable-shared=no --disable-debug; make<br />
</code></p>
<p>As you can see, there is more meat here. You&#8217;ll notice that, compared to Apple&#8217;s guidelines referenced above, here I am not simply overriding CFLAGS or CXXFLAGS and LDFLAGS. Strangely, doing that does not work for ACE, although I am pretty sure it will work in most cases. What works with ACE is overriding the definitions for you C and C++ compilers by setting CC and CXX when configuring your project. But that is not enough. One more thing that is necessary to do in the ACE case, and I guess in general, is specifying the host environment, although configure itself claims to be able to infer that information on its own when using a cross-compiler. Without that hint, however, configure will create a wrong libtool and your linking step will fail with an utterly misleading error message:</p>
<p><code>libtool: link: CURRENT '` is not a nonnegative integer not valid version information<br />
</code></p>
<p>If you are interested in the details, that failure lays with configure not being able to figure the correct value for libtool $version_type internal variable, which is then set to <code>none</code> instead of the more appropriate <code>darwin</code>. Using the <code>-host</code> option will get that under control.</p>
<p>One more thing to note is the fact that in the first step I configured my project so that it would be installed at a certain prefix, then compiled and installed it. In this way, we have a full reference installation, including documentation, header files, and binary files (for a single architecture), where we need it.</p>
<p>In the second step, on the contrary, I skipped the install phase. Indeed, what is necessary at this point is simply &#8220;converting&#8221; the binaries that were installed in the first step and make them flat multi-platform binaries.</p>
<p><strong>Third Step: the Magic of Fat-Files</strong></p>
<p>The last step is accomplished by way of <code>lipo</code>, a graciuos and very useful tool from Apple. <code>lipo</code> allows (among other things) to create a fat-file by sort of mixing two slim-files. This is exactly what I have done in order to have a fat ACE library, thanks to the command:</p>
<p>lipo -create $ACE_wrappers/build_i386/ace/.libs/libACE.a $ACE_wrappers/build_ppc/ace/.libs/libACE.a  -output $INSTALL_DIR/lib/libACE.a</p>
<p>In my case, this was an easy task, since the only binary I was interested in was the libACE.a file.</p>
<p>If you have multiple targets, you will need to identify all your binary files (which are usually installed in bin and lib directories) and lipo-ize them all. This could be made more an automated task if you install the alternate distribution in a temporary directory. Then it is simply a matter of finding all the files contained in the bin and lib directories and for each of them execute the lipo -create command. This is left as an exercise to the reader&#8230; <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The approach described here should also work for the TAO CORBA ORB, based on ACE and developed by the same group based at Washington University, and I guess in any case where the guidelines provided by Apple fall short for one reason or another.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=30&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2008/01/11/using-configure-to-build-macos-universal-binaries/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>Running VMWare on Debian etch for x86</title>
		<link>http://acaro.wordpress.com/2007/11/06/running-vmware-on-debian-etch-for-x86/</link>
		<comments>http://acaro.wordpress.com/2007/11/06/running-vmware-on-debian-etch-for-x86/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 17:25:58 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/11/06/running-vmware-on-debian-etch-for-x86/</guid>
		<description><![CDATA[Last week, I installed Debian etch on a HP x64 workstation based on an Intel Xeon processor. Debian offers an impressive support for a vast range of HW platforms, so I could readily install a 64 bit version of GNU/Linux using the netinst image. Next, I tried to install VMWare Workstation, and everything seemed to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=28&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week, I installed Debian etch on a HP x64 workstation based on an Intel Xeon processor. Debian offers an impressive support for a vast range of HW platforms, so I could readily install a 64 bit version of GNU/Linux using the <a href="http://cdimage.debian.org/debian-cd/4.0_r1/amd64/iso-cd/debian-40r1-amd64-netinst.iso">netinst</a> image.</p>
<p>Next, I tried to install VMWare Workstation, and everything seemed to go fine: kernel modules compiled (after installing the relevant kernel-headers package) and installed without problems. I could even successfully create a virtual machine, but when I tried to run it, it refused with a sad box message &#8220;Failed to connect to peer process&#8221;. <img width="400" src="http://acaro.files.wordpress.com/2007/11/sadvmware.png?w=400" alt="VMWare error message" />.</p>
<p>With some investigation, I could identify the root cause of the issue. Indeed, the vmware executable was not able to find the following libraries: <code>libX11.so.6, libXtst.so.6, libXext.so.6, libXrender.so.1, libXau.so.6, libXdcmp.so.6</code>, as a quick check with ldd showed. Actually, I was forewarned of this problem when running the vmware-config.pl script, but I downplayed that message because I was sure that those libraries were installed on my system and actually accessible.</p>
<p>Well, the problem turned into why those libraries were not recognized and how to fix that. The reason was pretty clear: vmware is a 32 bit executable needing 32 bit libraries, and those 32 libraries were not installed on my 64 bit system. A quick check in Debian site allowed me to find a package containing a set of 32 bit system libraries, so I only had to execute the command<br />
<code>sudo aptitude install ia32-libs</code><br />
and everything was fine again.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=28&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/11/06/running-vmware-on-debian-etch-for-x86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>

		<media:content url="http://acaro.files.wordpress.com/2007/11/sadvmware.png" medium="image">
			<media:title type="html">VMWare error message</media:title>
		</media:content>
	</item>
		<item>
		<title>Printing from the command line in MacOS X</title>
		<link>http://acaro.wordpress.com/2007/08/29/printing-from-the-command-line-in-macos-x/</link>
		<comments>http://acaro.wordpress.com/2007/08/29/printing-from-the-command-line-in-macos-x/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 09:10:47 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/08/29/printing-from-the-command-line-in-macos-x/</guid>
		<description><![CDATA[MacOS X offers a brilliant example of integration between a state-of-the-art windowing GUI and a traditional command line interface and you can choose the kind of interface that most suits your current needs or that makes easier the task you are at. One task that is very easily done via the Aqua user interface is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=27&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>MacOS X offers a brilliant example of integration between a state-of-the-art windowing GUI and a traditional command line interface and you can choose the kind of interface that most suits your current needs or that makes easier the task you are at. One task that is very easily done via the Aqua user interface is printing a bunch of documents on a given printer. All that you need for that is a Desktop Printer that you can drag your documents to. (Desktop printers can be created via the Printers menu in the Printer Setup Utility).</p>
<p>This is perfectly fine, where it not for the fact that I don&#8217;t like icons I use sporadically cluttering my desktop. Furthermore, when I need to print a group of documents, I am usually working from the command line &#8212; e.g., I want to print all jpeg pictures in a folder or print some html files to PDF. So the way I usually do this is thru the magic of the <em>open</em> command. Indeed, when you execute:</p>
<p><code>open -a "Printer Setup Utility" </code></p>
<p>this will print all listed files on the default printer. Of course, if you want to print to a different printer from your default one, this will not do. Fortunately, you can also set your default printer via the command line, by using the command:</p>
<p><code>lpoptions -d </code>.</p>
<p>All in all, say that you have a PDF printer driver (i.e., a program that acts like a printer driver but will &#8220;print&#8221; to a PDF file) installed with the name &#8220;PDF_Printer&#8221;. You can send documents to it to be printed by executing:</p>
<p><code><br />
$ lpoptions -d PDF_Printer<br />
$ open -a "Printer Setup Utility" */*.jpg<br />
$ lpoptions -d Color_Printer<br />
</code></p>
<p>If you have several printers and you don&#8217;t know which one was your default printer before switching to PDF_Printer, you can execute:</p>
<p><code>lpoptions -d</code></p>
<p>to read the current default printer before switching it. With all this bits, creating a shell script automating your specific workflow is a matter of minutes.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=27&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/08/29/printing-from-the-command-line-in-macos-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>A new blog about RubyCocoa</title>
		<link>http://acaro.wordpress.com/2007/08/15/a-new-blog-about-rubycocoa/</link>
		<comments>http://acaro.wordpress.com/2007/08/15/a-new-blog-about-rubycocoa/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 21:32:51 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/08/15/a-new-blog-about-rubycocoa/</guid>
		<description><![CDATA[Since I have been recently doing a lot of work with RubyCocoa, I have created a new blog where I will collect all my experiences and learnings with it. You can find it at this link. I will continue posting to this blog more general stuff.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=26&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since I have been recently doing a lot of work with RubyCocoa, I have created a new blog where I will collect all my experiences and learnings with it. You can find it at this <a href="http://rubycocoa.wordpress.com/">link</a>. I will continue posting to this blog more general stuff.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=26&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/08/15/a-new-blog-about-rubycocoa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>Free Software Foundation releases GPLv3</title>
		<link>http://acaro.wordpress.com/2007/08/15/free-software-foundation-releases-gplv3/</link>
		<comments>http://acaro.wordpress.com/2007/08/15/free-software-foundation-releases-gplv3/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 21:29:28 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/08/15/free-software-foundation-releases-gplv3/</guid>
		<description><![CDATA[Sixteen years after Richard Stallman released GPLv2, we now have GPLv3. I am not much of an expert in copyright or patent issues, so I have to believe what I read in authorative sources about its provisions to prevent any entity taking advantage of GPL in order to modify or extend a GPLv3 licensed software [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=25&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sixteen years after Richard Stallman released GPLv2, we now have <a href="http://www.gnu.org/licenses/gpl.html">GPLv3</a>. I am not much of an expert in copyright or patent issues, so I have to believe what I read in <a href="http://news.zdnet.co.uk/software/0,1000000121,39287802,00.htm">authorative sources</a> about its provisions to prevent any <em>entity</em> taking advantage of GPL in order to modify or extend a GPLv3 licensed software program from sueing developers or users of that software program on patent infringement.</p>
<p>It is definitely good news that we have now an up-to-date GPL that tries to tackle the strongest threat to the free software community. Let&#8217;s hope it is effective. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=25&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/08/15/free-software-foundation-releases-gplv3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>Core Data Persistent Packages revisited</title>
		<link>http://acaro.wordpress.com/2007/07/19/core-data-persistent-packages-revisited/</link>
		<comments>http://acaro.wordpress.com/2007/07/19/core-data-persistent-packages-revisited/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 12:36:11 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[Core Data]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[RubyCocoa]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/07/19/core-data-persistent-packages-revisited/</guid>
		<description><![CDATA[This post is a follow-up to another post I wrote on the very same subject. I am showing here the full implementation of a NSPersistentDocument based class that allows to use package documents embedding a Core Data store. I short, what this post adds to the previous one is: improved encapsulation; NSDocumentController subclass to correctly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=24&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is a follow-up to <a href="http://acaro.wordpress.com/2007/07/09/packages-and-core-data-documents/">another post</a> I wrote on the very same subject. I am showing here the full implementation of a NSPersistentDocument based class that allows to use package documents embedding a Core Data store.</p>
<p>I short, what this post adds to the previous one is:</p>
<ul>
<li> improved encapsulation;</li>
<li> NSDocumentController subclass to correctly handle the Recent Document menus;</li>
<li> fixed a problem with NSError handling, though still not doing any proper error management.</li>
</ul>
<p>Those improvements originated from a discussion with Tim Perrett in the <a href="http://lists.apple.com/archives/cocoa-dev/2007/Jul/msg00605.html">cocoa-dev</a> mailing list and from a comment by Laurent Sansonetti to my original post. Thanks to both.</p>
<p><strong>PersistentPackageDocument Class</strong></p>
<p>The PersistentPackageDocument class can be used as a base class for your document classes whenever you want them use a document package embedding the actual Core Data data store. PersistentPackageDocument derives from NSPersistentDocument and overrides four methods: <code>initWithContentsOfURL_ofType_error, writeToURL_ofType_forSaveOperation_originalContentsURL_error, readFromURL_ofType_error, displayname</code>. Here&#8217;s the code:</p>
<p><code><br />
class PersistentPackageDocument &lt; OSX::NSPersistentDocument</p>
<p>&nbsp;&nbsp;&nbsp;#-- returns the document name to display in the window title<br />
&nbsp;&nbsp;&nbsp;def displayName<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (fileURL)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentNameFromDataStoreURL(fileURL)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Untitled'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;&nbsp;#-- returns the package document path by stripping the dataStoreName component<br />
&nbsp;&nbsp;&nbsp;#-- from the data store URL; used in displayName<br />
&nbsp;&nbsp;&nbsp;def documentNameFromDataStoreURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/([^\/]+)\/?$/ =~ url.relativePath.gsub(/#{dataStoreName}$/, '')<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$1 + " - View"<br />
&nbsp;&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;&nbsp;def dataStoreURLFromPackageURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataStorePath = url.relativePath.stringByAppendingPathComponent(dataStoreName)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OSX::NSURL.fileURLWithPath(dataStorePath)<br />
&nbsp;&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;&nbsp;def readFromURL_ofType_error(url, type, errorPtr)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path=url.relativePath<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory(path, nil))<br />
#-- YOUR ERROR MANAGEMENT HERE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = super_readFromURL_ofType_error(url, type, nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!result)<br />
#--  SET ERROR INFORMATION TO BE RETURNED VIA errorPtr.assign(nserror_object)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result<br />
&nbsp;&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;&nbsp;def writeToURL_ofType_forSaveOperation_originalContentsURL_error(url, type, op, content, errorPtr)</p>
<p>#-- if content is not nil, then we are saving a newly created document<br />
#-- in this case, initWithURL is not called, so we had no chance to fix the url,<br />
#-- let's do it here.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (content == nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path = url.relativePath<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url = dataStoreURLFromPackageURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isDirectory = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!OSX::NSFileManager.defaultManager.createDirectoryAtPath_attributes(path, nil))<br />
#-- YOUR ERROR MANAGEMENT HERE, set errorPtr<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ok = super_writeToURL_ofType_forSaveOperation_originalContentsURL_error(url, type, op, content, nil)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!ok)<br />
#--  SET ERROR INFORMATION TO BE RETURNED VIA errorPtr.assign(nserror_object)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ok<br />
&nbsp;&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;&nbsp;def initWithContentsOfURL_ofType_error(url, type, errPtr)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url = dataStoreURLFromPackageURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ok, err = super_initWithContentsOfURL_ofType_error(url, type, nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!ok)<br />
#--  SET ERROR INFORMATION TO BE RETURNED VIA errorPtr.assign(nserror_object)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ok<br />
&nbsp;&nbsp;&nbsp;end</p>
<p>end<br />
</code></p>
<p>For a more detailed discussion of the rationale behind this implementation, see my previous post.</p>
<p>You should then change your MyDocument class (the one produced by XCode templates) so that it derives from <code>PersistentPackageDocument</code> instead of <code>NSPersistentDocument</code> and it adds a <code>dataStoreName</code> method that returns the data store file name for that specific document. Here an example:</p>
<p><code><br />
class MyDocument &lt; PersistentPackageDocument</p>
<p>&nbsp;&nbsp;def dataStoreName<br />
&nbsp;&nbsp;&nbsp;&nbsp;'data.xml'<br />
&nbsp;&nbsp;end</p>
<p>#-- default RubyCocoa implementation: managedObjectModel, setManagedObjectContext, windowNibName, etc.</p>
<p>end<br />
</code></p>
<p><strong>Supporting Recent Documents</strong></p>
<p>The <code>PersistentPackageDocumentClass</code> as given above is fully capable of dealing with package documents embedding a Core Data data store. Unfortunately, it alone cannot ensure that the Recent Documents menu is correctly handled in your application. To that aim, you need to override your <code>NSDocumentController</code> <code>noteNewRecentDocumentURL</code> method so that it does some juggling with the path that is stored with the recent document menus.</p>
<p>If your package document is enough rich, chances are that you are already subclassing <code>NSDocumentController</code>, so overriding <code>noteNewRecentDocumentURL</code> is a snap. Otherwise, here is a sample subclass:</p>
<p><code><br />
class PersistentPackageDocumentController &lt; OSX::NSDocumentController</p>
<p>&nbsp;&nbsp;def init<br />
&nbsp;&nbsp;&nbsp;&nbsp;super_init<br />
&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;def packageURLFromDataStoreURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;dataStoreName = currentDocument.dataStoreName<br />
&nbsp;&nbsp;&nbsp;&nbsp;OSX::NSURL.fileURLWithPath(url.relativePath.gsub(/#{dataStoreName}$/, ''))<br />
&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;def noteNewRecentDocumentURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (currentDocument)<br />
&nbsp;&nbsp;&nbsp;&nbsp;  super_noteNewRecentDocumentURL(packageURLFromDataStoreURL(url))<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end</p>
<p>end<br />
</code></p>
<p>As already mentioned, the key point is the method <code> noteNewRecentDocumentURL</code>, while <code> packageURLFromDataStoreURL</code> is just responsible for string manipulation. Note also that <code> packageURLFromDataStoreURL</code> accesses the current document to retrieve its <code>dataStoreName</code> and this forces to guard against the case when there is no current document. There are many alternative implementation of this behaviour, in particular you could define the method <code>dataStoreName</code> in the document controller class and let PersistentPackageDocument access it there. This approach has the adavantage that a &#8220;current&#8221; document controller is always there, but for presentation reasons it is not taken here.</p>
<p>Sublassing <code>NSDocumentController</code> has its own particularities. The easiest way to do it is in Interface Builder MainMenu.nib file. Just subclass and instantiate it in the nib and the above code will be used for your document shared controller. Read <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Tasks/FAQ.html#//apple_ref/doc/uid/20000954-1081791">this FAQ</a> for more information.</p>
<p><strong>Summing up</strong></p>
<p>The two classes defined above will allow you to easily integrate package documents in your Core Data application.</p>
<p>One final note: make sure you define your document classes as packages in your target properties.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=24&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/07/19/core-data-persistent-packages-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
		<item>
		<title>Automator: ExecShellCommand</title>
		<link>http://acaro.wordpress.com/2007/07/12/automator-execshellcommand/</link>
		<comments>http://acaro.wordpress.com/2007/07/12/automator-execshellcommand/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 14:42:00 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[Automator]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[RubyCocoa]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/07/12/automator-execshellcommand/</guid>
		<description><![CDATA[I find myself quite often needing executing a shell command when I am working in the Finder, say, for example, to &#8220;touch&#8221; a file in a certain folder on screen. What one needs to do in such cases is opening a Terminal window, drag and drop the folder icon on to it, preprend a &#8220;cd&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=20&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I find myself quite often needing executing a shell command when I am working in the Finder, say, for example, to &#8220;touch&#8221; a file in a certain folder on screen. What one needs to do in such cases is opening a Terminal window, drag and drop the folder icon on to it, preprend a &#8220;cd&#8221; to the folder path, and finally type the desired command.</p>
<p>All of this is readily accomplished in a very elegant way by means of the simple Automator workflow that&#8217;s described by the following snapshot (click to see it larger).</p>
<p><a href="http://acaro.files.wordpress.com/2007/07/execshellcommand.png"><img width="400" src="http://acaro.files.wordpress.com/2007/07/execshellcommand.png?w=400" alt="" /></a></p>
<p>If you create the Automator workflow depicted above, and save it as a Finder workflow (see picture below), </p>
<p><img width="300" src="http://acaro.files.wordpress.com/2007/07/execshellcommandsave.png?w=300" alt="" /></p>
<p>you will be then able to right-click on any folder, or on the Desktop, and then choose ExecuteShellCommand from the Automator menu that will be displayed.</p>
<p><img width="300" src="http://acaro.files.wordpress.com/2007/07/execshellcommandmenu.png?w=300" alt="" /></p>
<p>Thereafter, you will be asked for the command to execute. If you ran the workflow on a folder, then the command will be executes inside that folder. If you ran it on a file, then the command you specified will be passed the file as the last argument.</p>
<p>As said, this is useful when you want to carry out a one-shot operation, like touching a file (if it does not exist, you will need to run the workflow on the folder that&#8217;s going to contain it and specify the file name; if the file exists, you only need to run the workflow on that file and specify &#8220;touch&#8221; as a command to execute), opening a file with a given application (&#8220;open -a &#8220;), and so on&#8230;</p>
<p>If anyone finds interesting uses for this workflow, please let me know. Also welcome, since I am not really good at Automator <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> , are any suggestions as to better ways to implement it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=20&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/07/12/automator-execshellcommand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>

		<media:content url="http://acaro.files.wordpress.com/2007/07/execshellcommand.png" medium="image" />

		<media:content url="http://acaro.files.wordpress.com/2007/07/execshellcommandsave.png" medium="image" />

		<media:content url="http://acaro.files.wordpress.com/2007/07/execshellcommandmenu.png" medium="image" />
	</item>
		<item>
		<title>Packages and Core Data documents</title>
		<link>http://acaro.wordpress.com/2007/07/09/packages-and-core-data-documents/</link>
		<comments>http://acaro.wordpress.com/2007/07/09/packages-and-core-data-documents/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 21:18:17 +0000</pubDate>
		<dc:creator>acaro</dc:creator>
				<category><![CDATA[Core Data]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://acaro.wordpress.com/2007/07/09/packages-and-core-data-documents/</guid>
		<description><![CDATA[You all know how easy it is to create a Core Data application by using XCode and Interface Builder. Things get trickier, though, if you want to create a document-based application that uses package documents. This post will guide you through the process. A bit of context Bundles are a great way to package files [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=19&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>You all know how easy it is to create a Core Data application by using XCode and Interface Builder. Things get trickier, though, if you want to create a document-based application that uses </em>package documents<em>. This post will guide you through the process.</em></p>
<p><strong>A bit of context</strong></p>
<p>Bundles are a great way to package files in a directory structure. I won&#8217;t go into detail here about all the advantages that bundles offer and what important role they play in MacOS X. So, I will assume that the reader knows what a bundle is and simply tell my story.</p>
<p>One of the feature I wanted to implement in a simple Core Data document-based application I am developing was the possibility of using <a href="http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/DocumentBundles.html"><em>package documents</em></a> to store together all the files related to some specific sort of document.</p>
<p>After the miserable failure of my first, naive attempt at subclassing <code>NSPersistentDocument</code>, I resorted to the web for insights. My feeling that the task at hand was going to be hard, was immediately confirmed by <a href="http://www.cocoabuilder.com/archive/message/cocoa/2007/7/3/185547">this CocoaBuilder thread</a>. Indeed, <a href="http://www.cocoabuilder.com/archive/message/cocoa/2007/7/3/185582">a possible implementation</a> was proposed, based on overriding a few <code>NSPersistentDocument</code> methods, but it did not really work, since it crashed at the second attempt at saving a document. So I kept on googling around and found about a completely different approach to the problem, namely <a href="http://www.cocoadev.com/index.pl?CoreDataNSDocumentPackagesSubclass">subclassing NSDocument</a> (instead of NSPersistenDocument). That amounted to sort of reimplementing from scratch <code>NSPersistentDocument</code>, but did not work for me either. So I realized I had to go deeper down into <code>NSPersistentDocument</code> design, if I wanted to come up with anything useful, be it simply an understanding of the reason why mixing <code>NSPersistentDocument</code> and packages was possibly beyond reach.</p>
<p><strong>Design of a (Core Data) persistent package document</strong></p>
<p>If you look at Apple documents about <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPersistentDocument_Class/Reference/Reference.html"><code>NSPersistentDocument</code></a>, you&#8217;ll find a very streamlined document class, with three methods that literally scream for you to override them. They are:<br />
<code><br />
– readFromURL:ofType:error:<br />
– revertToContentsOfURL:ofType:error:<br />
– writeToURL:ofType:forSaveOperation:originalContentsURL:error:<br />
</code></p>
<p>A fourth method documented in <code>NSPersistentDocument</code>, that is relevant to our present discussion, is:<br />
<code><br />
- configurePersistentStoreCoordinatorForURL:ofType:error:<br />
</code></p>
<p>Briefly, each of the methods in the upper block is called on response to an action on the user&#8217;s part (creating a new document, saving or reverting the current document), while the fourth is called once for each document, usually when it&#8217;s first written to or read from disk.</p>
<p>In Apple document, you can further read:</p>
<p><em>&#8220;You can customize the architecture of the persistence stack by overriding the methods managedObjectModel and <code>configurePersistentStoreCoordinator:forURL:ofType:error:</code>. You might wish to do this, for example, to specify a particular managed object model, or to distribute storage of different entities among different file stores within a file wrapper.&#8221;<br />
</em></p>
<p>Actually, mixing file wrappers and <code>configurePersistentStoreCoordinator:forURL:ofType:error:</code> does not seem to work, as you can read <a href="http://lists.apple.com/archives/cocoa-dev/2005/May/msg02177.html">here</a>. So I did not even bother to try it. If you don&#8217;t use file wrappers, you will quickly hit a wall, because NSPersistentDocument swaps documents around, and if you don&#8217;t use file wrapper it will do that with the Core Data data file instead of with the whole package.</p>
<p><strong>An approach that leads nowhere</strong></p>
<p>An approach I tried out is the following. Apparently, it should be straightforward to override the above mentioned methods, so that you can:</p>
<ul>
<li>&#8220;intercept&#8221; a call to them before the url (you see, each of the methods accepts an <code>NSURL</code> as its first argument) is actually accessed by <code>NSPersistentDocument</code>;
<li>change the url on-the-fly to make it point to the actual Core Data store inside of the package document, and possibly create the directory underlying the latter;</li>
<li>call the base class implementation with the new url and return its output;
</ul>
<p>and get, hopefully, the kind of behaviour desired.</p>
<p>That was, by the way, the approach followed in the CocoaBuilder link I mentioned above, but in reality, apart from a few shortcomings of that implementation, the complex interplay going on among these methods makes things a little trickier.</p>
<p>In fact, all three methods of the above code block, apart from being called directly from NSApplicationMain, also call one another (<code>revertToContentsFromURL:</code> calls <code>readFromURL:</code>; both <code>readFromURL:</code> and <code>writeToURL:</code> call <code>configurePersistentStoreCoordinator:</code>) and you must pay attention to not &#8220;fix&#8221; your URL twice. So, either you implement different behaviours to take into account the fact that, when called from another <code>NSPersistentDocument</code> method, the url will already be pointing to the right place, or you define an idempotent method that returns the path to the inner data file.</p>
<p>If you take this approach, another point you need to consider is that <code>writeToURL:</code> has an <code>originalContentsURL:</code> argument that is not null on all calls except the first one (of course, when you firstly save a document, there is no &#8220;original content&#8221; yet). You&#8217;ll also have to deal with this url and &#8220;fix&#8221; it the same way as done with the other one.</p>
<p>Finally, you have the option of using the <code>fileURL:/setFileURL:</code> methods. Setting fileURL will make your <code>NSPersistentDocument</code> remember the actual location of the data file. So, if you call <code>setFileURL</code> in your override of <code>readFromURL:</code> (i.e., when opening a document), then successive calls to <code>writeToURL:</code> will have the url parameter already set up to point to the Core Data data file. This appears to be really handy, although it does not apply to the <code>originalContentsURL:</code> parameter. Anyhow, be consequent&#8230;</p>
<p>With all this in mind, I have tried hard to devise an implementation of a <code>NSPersistentDocument</code> subclass. However, in the end, no matter what I tried, I could not succeed in getting a reliable behaviour by following this approach. There was something that was wrong somewhere, possibly you cannot play around with the url your <code>NSPersistentDocument</code> subclass is managing from within that same class, or at least, I have not found the correct way to do it.</p>
<p><strong>A working solution</strong></p>
<p>The solution was, anyway, closer than I thought. It seemed clear to me that the right way had to do with changing how <code>NSPersistentDocument</code> was initialized. So, I overrode the <code>initWithContentsOfURL:ofType:error</code> method like this (it&#8217;s ruby, but porting back to ObjC is straightforward):</p>
<p><code><br />
&nbsp;&nbsp;def initWithContentsOfURL_ofType_error(url, type, err)<br />
&nbsp;&nbsp;&nbsp;&nbsp;url = dataFilePath(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;ok, err = super_initWithContentsOfURL_ofType_error(url, type, nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!ok)<br />
#        YOUR ERROR MANAGEMENT HERE<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;ok<br />
&nbsp;&nbsp;end<br />
</code></p>
<p>This method is executed each time you open a document, and it makes all of the other methods of the class receive and <code>NSURL</code> pointing at the right place.</p>
<p>I had still to deal with a few issues. First of all, I had to create somewhere the directory corresponding to the bundle. The right place to do this was the <code>writeToURL:</code> method.</p>
<p>Secondly, I had to consider the case of a newly created document, which calls the <code>init</code> method into action. Unfortunately, in this case the approach taken in <code> initWithContentsOfURL:ofType:error</code> would not do, since no url is specified when creating a new document. Again, the right place to tackle this was <code>writeToURL:</code>, where I needed a way to tell whether the method was called for the first time. This was ready accomplished by looking at the fact that, as mentioned above, the <code>originalDocumentsURL:</code> argument to <code>writeToURL:</code> is set to null on the very first call. This gave me the following code for <code>writeToURL:</code></p>
<p><code><br />
def writeToURL_ofType_forSaveOperation_originalContentsURL_error(url, type, op, content, error)</p>
<p>&nbsp;&nbsp;if (content == nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;path = url.relativePath<br />
&nbsp;&nbsp;&nbsp;&nbsp;url = dataStorePathFromPackageURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!OSX::NSFileManager.defaultManager.createDirectoryAtPath_attributes(path, nil))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;ok, error = super_writeToURL_ofType_forSaveOperation_originalContentsURL_error(url, type, op, content, nil)<br />
&nbsp;&nbsp;if (!ok)<br />
#    YOUR ERROR MANAGEMENT HERE<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;ok<br />
end<br />
</code></p>
<p>A few more bits to check that the package directory exists in <code>readFromURL:</code>, and it was done. There is no need to override <code>revertToContentsOfURL:</code>, but you can if you would like to do anything special when reverting a document.</p>
<p><strong>The code</strong></p>
<p><code><br />
class MyDocument &lt; OSX::NSPersistentDocument</p>
<p>&nbsp;&nbsp;def initWithContentsOfURL_ofType_error(url, type, err)<br />
&nbsp;&nbsp;&nbsp;&nbsp;url = dataFilePath(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;ok, err = super_initWithContentsOfURL_ofType_error(url, type, nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!ok)<br />
#        YOUR ERROR MANAGEMENT HERE<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;ok<br />
&nbsp;&nbsp;end</p>
<p>def writeToURL_ofType_forSaveOperation_originalContentsURL_error(url, type, op, content, error)</p>
<p>&nbsp;&nbsp;if (content == nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;path = url.relativePath<br />
&nbsp;&nbsp;&nbsp;&nbsp;url = dataStorePathFromPackageURL(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!OSX::NSFileManager.defaultManager.createDirectoryAtPath_attributes(path, nil))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end</p>
<p>&nbsp;&nbsp;ok, error = super_writeToURL_ofType_forSaveOperation_originalContentsURL_error(url, type, op, content, nil)<br />
&nbsp;&nbsp;if (!ok)<br />
#    YOUR ERROR MANAGEMENT HERE<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;ok<br />
end</p>
<p>def readFromURL_ofType_error(url, type, error)<br />
&nbsp;&nbsp;path= packagePathFromDataStoreURL(url)<br />
&nbsp;&nbsp;if (!OSX::NSFileManager.defaultManager.fileExistsAtPath_isDirectory(path, nil))<br />
&nbsp;&nbsp;result, err = super_readFromURL_ofType_error(url, type, nil)<br />
&nbsp;&nbsp;if (!result)<br />
# YOUR ERROR MANAGEMENT HERE<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;result<br />
&nbsp;&nbsp;end</p>
<p># here go the rubycocoa template generated methods<br />
# (managedObjectModel, setManagedObjectContext, windowControllerDidLoadNib)</p>
<p>end<br />
</code></p>
<p>As usual, in the code above, error management is poor to not existing. In particular, you should take care to never return false from <code>NSPersistentDocument</code> methods that returns an <code>NSError</code> without correctly ensuring that one is returned.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/acaro.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/acaro.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/acaro.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/acaro.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/acaro.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/acaro.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/acaro.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/acaro.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/acaro.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/acaro.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=acaro.wordpress.com&amp;blog=505749&amp;post=19&amp;subd=acaro&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://acaro.wordpress.com/2007/07/09/packages-and-core-data-documents/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5066e58ed8eb167b284f7c3d0481fe1f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">acaro</media:title>
		</media:content>
	</item>
	</channel>
</rss>
