<?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>LiquidFoot &#187; tips</title>
	<atom:link href="http://www.liquidfoot.com/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.liquidfoot.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 02 Jan 2012 22:56:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Disaster Averted</title>
		<link>http://www.liquidfoot.com/2012/01/02/disaster-averted/</link>
		<comments>http://www.liquidfoot.com/2012/01/02/disaster-averted/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 22:56:03 +0000</pubDate>
		<dc:creator>Wayne</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[word]]></category>
		<category><![CDATA[writing]]></category>
		<guid isPermaLink="false">http://www.liquidfoot.com/?p=396</guid>
		<description><![CDATA[Today as I was finishing chapter 10 of my forthcoming book, I ran in to a major issue. My publisher (Apress) uses Microsoft Word templates for submissions. As I was finishing the summary, the Word wheel started spinning and I was soon notified that Word couldn&#8217;t save the file. Not a big deal, I just [...]]]></description>
			<content:encoded><![CDATA[<p>Today as I was finishing chapter 10 of my forthcoming book, I ran in to a major issue. My publisher (Apress) uses Microsoft Word templates for submissions. As I was finishing the summary, the Word wheel started spinning and I was soon notified that Word couldn&#8217;t save the file. Not a big deal, I just saved it to another file name. I renamed the file and tried to open it back up and I got an error that Word could not open the file as it was larger than 32MB. Panic set in, and some swearing (ok, a lot). I looked at the file and it was a whopping 684Mb.</p>
<p>After some Googling, I ran in to some directions on how to fix the problem for Windows users. Basically you copy the file, rename it as a zip file, expand the directory, and resize the files. On my OS X box, I resized the images with <a href="http://imageoptim.pornel.net/">ImageOptim</a> (I use it when I need a quick and dirty image compressor). However, when I re-compressed the files with the Compression utility, I kept getting errors in Word that it could not open the file. Again, panic and a lot of swearing (we are talking about 30 pages here).</p>
<p>Turns out I just needed the zip utility. I just went in to the directory that had my expanded zip files and recursively zipped all the files back in:</p>
<pre class="brush: bash; title: ; notranslate">
cd ch10
zip -r ch10.zip *
mv ch10.zip ch10.docx
</pre>
<p>I opened the file back up in Word and after some complaining that the file format wasn&#8217;t correct, the file open with all the content in it! Hopefully you will never run in to this, but if you do, the fix isn&#8217;t that difficult.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.liquidfoot.com/2012/01/02/disaster-averted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add highlight link to current page in Rails</title>
		<link>http://www.liquidfoot.com/2010/09/28/add-highlight-link-to-current-page-in-rails/</link>
		<comments>http://www.liquidfoot.com/2010/09/28/add-highlight-link-to-current-page-in-rails/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 18:55:22 +0000</pubDate>
		<dc:creator>Wayne</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[urlhelper]]></category>
		<guid isPermaLink="false">http://www.liquidfoot.com/?p=361</guid>
		<description><![CDATA[I recently wanted to add a highlight link to a navigational element if the navigation was on the current page. I thought this would be pretty straight forward with Rails&#8217; link_to helper. Turns out it was a little less-than-intuitive. So, to remind myself (and show others) how to do this, I&#8217;m providing the following: In [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to add a highlight link to a navigational element if the navigation was on the current page. I thought this would be pretty straight forward with Rails&#8217; link_to helper. Turns out it was a little less-than-intuitive. So, to remind myself (and show others) how to do this, I&#8217;m providing the following:</p>
<pre class="brush: ruby; title: ; notranslate">
&lt;ul&gt;
    &lt;li&gt;
        &lt;%= link_to_unless_current &quot;Home&quot;, root_path do
link_to &quot;Home&quot;, root_path, :class =&gt; &quot;current&quot;
        end %&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>In my research, I saw different ways of going about this, but this apparently is the recommended method as it&#8217;s in the documentation (see the <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to_unless_current">URLHelper</a>).</p>
<p>I have to say this seems a bit counter-intuitive and not as &#8220;easy&#8221; as it should be. I kept expecting to be able to do something like:</p>
<pre class="brush: ruby; title: ; notranslate">
&lt;%= link_to &quot;Home&quot; {home_path}, current_page? ? (:class =&gt; 'current') : nil %&gt;
</pre>
<p>Anyway, if you want to add a highlight class, this works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.liquidfoot.com/2010/09/28/add-highlight-link-to-current-page-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtualbox 2.0</title>
		<link>http://www.liquidfoot.com/2008/09/11/virtualbox-20/</link>
		<comments>http://www.liquidfoot.com/2008/09/11/virtualbox-20/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 13:18:41 +0000</pubDate>
		<dc:creator>Wayne</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtual box]]></category>
		<guid isPermaLink="false">http://www.liquidfoot.com/?p=65</guid>
		<description><![CDATA[I saw this morning that Sun released VirtualBox 2.0 (it was released last Thursday, but had missed that). The big update (at least to me) is that it now supports 64-bit guests (on 64-bit hosts). I added the deb packages for my Ubuntu box and installed the virtualbox-2.0. The package installed properly, but the icon [...]]]></description>
			<content:encoded><![CDATA[<p>I saw this morning that Sun released VirtualBox 2.0 (it was released last Thursday, but had missed that). The big update (at least to me) is that it now supports 64-bit guests (on 64-bit hosts). I added the <a href="http://www.virtualbox.org/wiki/Linux_Downloads">deb packages for my Ubuntu</a> box and installed the virtualbox-2.0. The package installed properly, but the icon I had been using to launch the program went away and launching from the terminal also disappered.</p>
<p>The fix was pretty quick, but took a couple of minutes to locate. On top of installing the new package, you also need to run the vboxdrv setup to recompile the kernel module.</p>
<pre class="brush: php; title: ; notranslate">sudo /etc/init.d/vboxdrv setup</pre>
<p>After you run this, everything runs wonderfly again <img src='http://www.liquidfoot.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.liquidfoot.com/2008/09/11/virtualbox-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vufind and Sirsi</title>
		<link>http://www.liquidfoot.com/2008/09/05/vufind-and-sirsi/</link>
		<comments>http://www.liquidfoot.com/2008/09/05/vufind-and-sirsi/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 21:08:25 +0000</pubDate>
		<dc:creator>Wayne</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[sirsi]]></category>
		<category><![CDATA[solrmarc]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[vufind]]></category>
		<guid isPermaLink="false">http://www.liquidfoot.com/?p=58</guid>
		<description><![CDATA[I committed a bunch of small fixes into the Solrmarc and Vufind projects today to deal with the release of Solr 1.3 RC 2. We&#8217;re using the multicore functionality of Solr for Vufind and we were having some issues with the resource loaders for the different cores. The fix was pretty minor, just creating a [...]]]></description>
			<content:encoded><![CDATA[<p>I committed a bunch of small fixes into the <a href="http://code.google.com/p/solrmarc">Solrmarc</a> and <a href="http://www.vufind.org">Vufind</a> projects today to deal with the release of Solr 1.3 RC 2. We&#8217;re using the multicore functionality of Solr for Vufind and we were having some issues with the resource loaders for the different cores. The fix was pretty minor, just creating a <a href="http://lucene.apache.org/solr/api/org/apache/solr/core/CoreContainer.html">CoreContainer</a> and set the SolrCore from that:</p>
<p><code>
<pre class="brush: java; title: ; notranslate">CoreContainer cc = new CoreContainer(solrCoreDir, configFile);
solrCore = cc.getCore(solrCorename);
</pre>
<p></code></p>
<p>Ok, so that was more of an update, but it got me to reindex the our marc content. Our 001 fields don&#8217;t always have info, so our Systems Librarian told me just to use the 035a for the id field. There was only one problem&#8230;they had a &#8220;(Sirsi)&#8221; as a prefix to the actual number. This wouldn&#8217;t be that big of an issue, but it was causing the queries sent to Solr to be off, and I wasn&#8217;t getting any results for a detail view.</p>
<p>Fortunately, Solrmarc already has a facility to deal with this: PatternMaps! To pull out just the number, I changed the id definition in the vufind.properties file to</p>
<p><code>
<pre class="brush: java; title: ; notranslate">
id = 035a, (pattern_map.id), first
</pre>
<p></code></p>
<p>This basically maps the id field in the schema.xml file to the 035a, using a patternMap named pattern_map.id, and only takes the first of the 035a if there are multiples. I know, there shouldn&#8217;t be, but I&#8217;ve seen funky things <img src='http://www.liquidfoot.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, to add the PatternMap definition:</p>
<p><code>
<pre class="brush: java; title: ; notranslate">pattern_map.id.pattern_0 = \\(Sirsi\\)\\ (.*)=&gt;$1</pre>
<p></code></p>
<p>It&#8217;s just a simple regex pattern definition that takes out the &#8220;(Sirsi)&#8221; and the space between it and the actual id we&#8217;re using.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.liquidfoot.com/2008/09/05/vufind-and-sirsi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

