<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>BeefyApps Blog</title>
	
	<link>http://blog.beefyapps.com</link>
	<description>iPhone and iPod touch App Development News</description>
	<lastBuildDate>Thu, 09 Feb 2012 22:20:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BeefyappsBlog" /><feedburner:info uri="beefyappsblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Ruby ODBC and MSSQL delivering \x96 Character</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/MRfnCnVRIOU/</link>
		<comments>http://blog.beefyapps.com/2012/02/ruby-odbc-and-mssql-delivering-x96-character/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 22:20:19 +0000</pubDate>
		<dc:creator>wdevauld</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=385</guid>
		<description><![CDATA[We recently overcame a problem where we were trying to pull data from Microsoft&#8217;s SQL Server into Ruby for some processing. First, the SQL Server we were connecting to was configured to use a case insensitive form of latin1. You can find your encoding by executing: ?View Code SQLSELECT DATABASEPROPERTYEX&#40;'DBName', 'Collation'&#41; SQLCollation; In our case [...]]]></description>
			<content:encoded><![CDATA[<p>We recently overcame a problem where we were trying to pull data from Microsoft&#8217;s SQL Server into Ruby for some processing.  First, the SQL Server we were connecting to was configured to use a case insensitive form of latin1.  You can find your encoding by executing:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code4'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3854"><td class="code" id="p385code4"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> DATABASEPROPERTYEX<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'DBName'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Collation'</span><span style="color: #66cc66;">&#41;</span> SQLCollation;</pre></td></tr></table></div>

<p>In our case we were getting a: <code>SQL_Latin1_General_CP1_CI_AS</code>.  Now, we were making use of the fine <a href="http://www.ch-werner.de/rubyodbc/">Ruby ODBC library</a>, and we tried to have the library do a conversion to UTF-8 for us, by setting the ODBC::UTF8 constant to true before proceeding.  Although, we didn&#8217;t get what we&#8217;d expect.  Our algorithm ran fine until we tried to convert one of the VarChar columns to UTF-8, and we ran into the following error:<br />
<code><br />
Encoding::UndefinedConversionError: "\x96" from ASCII-8BIT to UTF-8<br />
</code><br />
Now looking at the string, we could see a single character &#8220;\x96&#8243; in the string returned from the ODBC library.  Querying the database through the Management Studio we found that the offending character was a hyphen.  Now looking at 0&#215;96 (150 in decimal) in the <a href="http://www.ascii-code.com/">extended ASCII table</a> we find a dash.  The problem is that our keyboards have a hyphen, or a 0x2d (45 in decimal).  This can be verified in the interactive ruby interpreter:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code5'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3855"><td class="code" id="p385code5"><pre class="ruby" style="font-family:monospace;">ruby<span style="color:#006600; font-weight:bold;">-</span>1.9.2<span style="color:#006600; font-weight:bold;">-</span>p290 :001 <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#996600;">&quot;-&quot;</span>.<span style="color:#9900CC;">ord</span>
 <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">45</span>
ruby<span style="color:#006600; font-weight:bold;">-</span>1.9.2<span style="color:#006600; font-weight:bold;">-</span>p290 :002 <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\x</span>96&quot;</span>.<span style="color:#9900CC;">ord</span>
 <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">150</span>
ruby<span style="color:#006600; font-weight:bold;">-</span>1.9.2<span style="color:#006600; font-weight:bold;">-</span>p290 :003 <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">45</span>.<span style="color:#9900CC;">chr</span>
 <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;-&quot;</span>
ruby<span style="color:#006600; font-weight:bold;">-</span>1.9.2<span style="color:#006600; font-weight:bold;">-</span>p290 :004 <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">150</span>.<span style="color:#9900CC;">chr</span>
 <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\x</span>96&quot;</span>
ruby<span style="color:#006600; font-weight:bold;">-</span>1.9.2<span style="color:#006600; font-weight:bold;">-</span>p290 :005 <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\x</span>96&quot;</span>.<span style="color:#9900CC;">encode</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'UTF-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#6666ff; font-weight:bold;">Encoding::UndefinedConversionError</span>: <span style="color:#996600;">&quot;<span style="color:#000099;">\x</span>96&quot;</span> from ASCII<span style="color:#006600; font-weight:bold;">-</span>8BIT to UTF<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">8</span></pre></td></tr></table></div>

<p>No dash for you!<br />
The easiest way to get rid of this problem was to just substitute the dash for a legit hyphen</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code6'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3856"><td class="code" id="p385code6"><pre class="ruby" style="font-family:monospace;">bad_string.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">150</span>.<span style="color:#9900CC;">chr</span>,<span style="color:#996600;">'-'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/MRfnCnVRIOU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2012/02/ruby-odbc-and-mssql-delivering-x96-character/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2012/02/ruby-odbc-and-mssql-delivering-x96-character/</feedburner:origLink></item>
		<item>
		<title>PostgreSQL &gt; MySQL (Facebook MySQL Article Response)</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/df-yY-hC5Lc/</link>
		<comments>http://blog.beefyapps.com/2011/07/postgresql-mysql-facebook-mysql-article-response/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 18:46:04 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Application Infrastructure]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=375</guid>
		<description><![CDATA[I saw this original article via LinkedIn and a conversation ensued on Google+ and I thought some of the comments were worth posting here. The original article: http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/ The question was raised, that because PostgreSQL was an old SQL model, wont it have the same problems as MySQL and Wes Devauld (of BeefyApps fame) commented [...]]]></description>
			<content:encoded><![CDATA[<p>I saw this original article via <a href="http://linkedin.com">LinkedIn</a> and a conversation ensued on <a href="http://plus.google.com">Google+</a> and I thought some of the comments were worth posting here.</p>
<p>The original article: <a href="http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/">http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/</a></p>
<p>The question was raised, that because PostgreSQL was an old SQL model, wont it have the same problems as MySQL and Wes Devauld (of BeefyApps fame) commented stating:</p>
<blockquote><p>Wes Devauld: Postgres was built from the ground up using MVCC, which has a much smaller overhead in update transactions. MySQL InnoDB 5.1 added MVCC, but I&#8217;ve read that the implementation is half assed and they are still hamstrung on how they handle the transaction logs. </p></blockquote>
<p>I thought it was a comment worth preserving, for posterity.</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/df-yY-hC5Lc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2011/07/postgresql-mysql-facebook-mysql-article-response/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2011/07/postgresql-mysql-facebook-mysql-article-response/</feedburner:origLink></item>
		<item>
		<title>Xen Cloud Platform; Mount Disk in different Virtual Host</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/GjUYHvyhja8/</link>
		<comments>http://blog.beefyapps.com/2011/06/xen-cloud-platform-mount-disk-in-different-virtual-host/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 19:36:27 +0000</pubDate>
		<dc:creator>wdevauld</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Read Only]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[Virtual Disk Mounting]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[Xen Cloud Platform]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=362</guid>
		<description><![CDATA[Here at BeefyApps we run our infrastructure atop the Xen Cloud Platform to maximize the utility of physical hardware. Working in a virtual environment has some excellent advantages for when things do not go quite as planned. Say for instance while messing with a boot loader, or kernel you ended up with a machine that [...]]]></description>
			<content:encoded><![CDATA[<p>Here at BeefyApps we run our infrastructure atop the <a href="http://www.xen.org/products/cloudxen.html">Xen Cloud Platform</a> to maximize the utility of physical hardware.  Working in a virtual environment has some excellent advantages for when things do not go quite as planned.  Say for instance while messing with a boot loader, or kernel you ended up with a machine that was not in a bootable state.  Because all the disks are on the hypervisor, we can just take the device and mount it on another virtual machine without needing a screwdriver.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p362code9'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3629"><td class="code" id="p362code9"><pre class="bash" style="font-family:monospace;">xe vm-list
xe vm-disk-list <span style="color: #007800;">vm</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>dead-vm<span style="color: #000000; font-weight: bold;">&gt;</span>
xe vdb-create vm-uuid=<span style="color: #000000; font-weight: bold;">&lt;</span>good-vm<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">device</span>=<span style="color: #000000;">1</span> vdi-uuid=<span style="color: #000000; font-weight: bold;">&lt;</span>disk-vdi-from-dead-vm<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">mode</span>=RW <span style="color: #007800;">type</span>=Disk
<span style="color: #666666; font-style: italic;"># returned newly-minted-uuid</span>
xe vbd-plug <span style="color: #007800;">uuid</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>newly-minted-uuid<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>First we find our <code>&lt;dead-vm&gt;</code> and <code>&lt;good-vm&gt;</code> UUIDs and keep them handy.  Look up the VDI (not the VDB) from the dead host; depending on your setup, you may have a lot of disks listed for the machine, in our case we only had the system default <code>Local storage</code>.  </p>
<p>With the virtual device interface we create a new block device on a good host, and plug it in.  Our example uses device 1, which will create and install <code>/dev/xvdb</code> in the virtual machine.  Using device 0 gives you <code>/dev/xvda</code> which is probably already in use.  Inside the good host we simply mapped the partitions and mounted them</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p362code10'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p36210"><td class="code" id="p362code10"><pre class="bash" style="font-family:monospace;">kpartx <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvdb
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>xvdb3 <span style="color: #000000; font-weight: bold;">/</span>mnt</pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/GjUYHvyhja8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2011/06/xen-cloud-platform-mount-disk-in-different-virtual-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2011/06/xen-cloud-platform-mount-disk-in-different-virtual-host/</feedburner:origLink></item>
		<item>
		<title>Export iCal to Excel or CSV</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/MFm1jzy38dk/</link>
		<comments>http://blog.beefyapps.com/2011/01/export-ical-to-excel-or-csv/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 05:01:55 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iCal]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=346</guid>
		<description><![CDATA[I had what I thought was a simple task. I wanted to get a group calendar that I was putting together in Google out into a list that I could print out to pass around to the *ahem* more tactilely oriented among us. Google Calendar does print and agenda format which is okay except for [...]]]></description>
			<content:encoded><![CDATA[<p>I had what I thought was a simple task. I wanted to get a group calendar that I was putting together in Google out into a list that I could print out to pass around to the *ahem* more tactilely oriented among us.</p>
<p>Google Calendar does print and agenda format which is okay except for the fact that it adds in the person who created the event and the calendar that the event came from.  This is great if you want to know all the information, but if you are just trying to print off a quick list for people to read, they often don&#8217;t want to look through multiple pages of repetitive text.  Also, think of the tree-folk.</p>
<p>So I thought, I have desktop programs that can read a calendar, surely they will have a view that corresponds to my needs.  I looked at iCalendar for OSX and I happened to have a copy of Entourage (first time using it, I guess it is like Outlook light?), but neither of these applications met my needs.  Entourage teased me on to the point of getting me to a list that I thought looked good, but then would not let me print it.</p>
<p>So then I thought to myself, &#8220;self&#8221;, I said, because I always refer to myself in the third person, the second person sounds so accusatory, &#8220;you&#8217;re a programmer, how hard could this problem be?&#8221;</p>
<p>So I took a look at the Ruby libraries and I immediately found <a href="http://icalendar.rubyforge.org/">http://icalendar.rubyforge.org/</a>.  So I installed it</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p346code13'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p34613"><td class="code" id="p346code13"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> icalendar</pre></td></tr></table></div>

<p>and created this little ruby program to export a CSV for my easy printing needs.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p346code14'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p34614"><td class="code" id="p346code14"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'icalendar'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'date'</span>
&nbsp;
ARGV.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>filename<span style="color:#006600; font-weight:bold;">|</span>
  file = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
  cals = Icalendar.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span>file<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  cals.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>calendar<span style="color:#006600; font-weight:bold;">|</span>
    calendar.<span style="color:#9900CC;">events</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>event<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\&quot;</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> event.<span style="color:#9900CC;">dtstart</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%Y-%m-%d %H:%M&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\&quot;</span>,<span style="color:#000099;">\&quot;</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> event.<span style="color:#9900CC;">dtend</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%Y-%m-%d %H:%M&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\&quot;</span>,<span style="color:#000099;">\&quot;</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> event.<span style="color:#9900CC;">summary</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\&quot;</span>,<span style="color:#000099;">\&quot;</span>&quot;</span> <span style="color:#006600; font-weight:bold;">+</span> event.<span style="color:#9900CC;">location</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\&quot;</span>&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>I hope this helps someone out there.  I was surprised how quickly I managed to get that up and running, it took me longer to write the blog post than it did to write the code.</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/MFm1jzy38dk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2011/01/export-ical-to-excel-or-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2011/01/export-ical-to-excel-or-csv/</feedburner:origLink></item>
		<item>
		<title>WordPress PostgreSQL Trouble – PHP Fatal error:  Cannot redeclare class wpdb</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/C1I9qXy4rTo/</link>
		<comments>http://blog.beefyapps.com/2010/12/wordpress-postgresql-trouble-php-fatal-error-cannot-redeclare-class-wpdb/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 19:11:06 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Application Infrastructure]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=342</guid>
		<description><![CDATA[So over here at BeefyApps are using PostgreSQL instead of MySQL for our WordPress backend. There is this discussion in the WordPress codex which talks about why they do not natively support PostgreSQL out of the box. However, we have decided that PostgreSQL is the way forward for us so we needed to find a [...]]]></description>
			<content:encoded><![CDATA[<p>So over here at <a href="http://beefyapps.com">BeefyApps</a> are using <a href="http://www.postgresql.org">PostgreSQL</a> instead of <a href="http://mysql.org">MySQL</a> for our <a href="http://wordpress.org">WordPress</a> backend.  There is <a href="http://codex.wordpress.org/Using_Alternative_Databases">this</a> discussion in the WordPress codex which talks about why they do not natively support PostgreSQL out of the box.  </p>
<p>However, we have decided that PostgreSQL is the way forward for us so we needed to find a work around.  Luckily for us there is a plugin, <a href="http://wordpress.org/extend/plugins/postgresql-for-wordpress/">PostgreSQL for WordPress</a>, which will allow us to do this.</p>
<p>So I followed the steps that were laid out in the Readme.txt that is bundled with the package and I eventually came to run the installation (after the configuration) and I was presented with a blank white screen.  Not so lucky after all&#8230;</p>
<p>I went through the logs and found:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p342code16'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p34216"><td class="code" id="p342code16"><pre class="text" style="font-family:monospace;">PHP Fatal error:  Cannot redeclare class wpdb</pre></td></tr></table></div>

<p>Which was originating in the class wp-db.php in the wp-includes directory.  This was being invoked from the wp-admin/setup-config.php file.</p>
<p>After some searching on the internet I came across some other posts talking about modifying the wp-functions.php file and some others which didn&#8217;t really seem appropriate because they would be overwritten with an upgrade.  I did find that in the wp-admin/install.php file, there was a reference to wp-db.php as part of the installer.  I commented this section out and the installer ran successfully.</p>
<p>I think this problem occurs because before the db.php file can run and eval the class definition inside the wp-db.php file, after it makes it&#8217;s replacements for the file, the install.php file has already loaded and processed that class into memory.  When we try to redefine the class it throws an error.  Anyway it seems to work now.</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/C1I9qXy4rTo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2010/12/wordpress-postgresql-trouble-php-fatal-error-cannot-redeclare-class-wpdb/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2010/12/wordpress-postgresql-trouble-php-fatal-error-cannot-redeclare-class-wpdb/</feedburner:origLink></item>
		<item>
		<title>Connecting to a Xen Console</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/_yyvKdHQeTY/</link>
		<comments>http://blog.beefyapps.com/2010/09/connecting-to-a-xen-console/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 04:41:22 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Application Infrastructure]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[XCP]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=338</guid>
		<description><![CDATA[So earlier I had one solution for connecting to a Xen domU instance that you had created, but I just came across another, more native way and I thought I should include it up here. Once you have created your domU guest you can find it&#8217;s domain id by entering: ?View Code BASHxe vm-list params=dom-id [...]]]></description>
			<content:encoded><![CDATA[<p>So earlier I had one solution for connecting to a Xen domU instance that you had created, but I just came across another, more native way and I thought I should include it up here.</p>
<p>Once you have created your domU guest you can find it&#8217;s domain id by entering:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p338code19'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33819"><td class="code" id="p338code19"><pre class="bash" style="font-family:monospace;">xe vm-list <span style="color: #007800;">params</span>=dom-id <span style="color: #007800;">uuid</span>=<span style="color: #000000; font-weight: bold;">&lt;</span>uuid-of-vm<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #660033;">--minimal</span></pre></td></tr></table></div>

<p>That will give you the domain id and then you just plug that into:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p338code20'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33820"><td class="code" id="p338code20"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>xenconsole <span style="color: #000000; font-weight: bold;">&lt;</span>dom-id<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>and you are off to the races.</p>
<p>I would like to credit the XVP installation guide for pointing that out to me:<br />
<a href="http://www.xvpsource.org/?topic=build&#038;page=appliancevm">http://www.xvpsource.org/?topic=build&#038;page=appliancevm</a></p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/_yyvKdHQeTY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2010/09/connecting-to-a-xen-console/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2010/09/connecting-to-a-xen-console/</feedburner:origLink></item>
		<item>
		<title>UITextView Scrolling Doesn’t Work</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/hRSYzeV9ndY/</link>
		<comments>http://blog.beefyapps.com/2010/07/uitextview-scrolling-doesnt-work/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 04:03:15 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[UIImageView]]></category>
		<category><![CDATA[UITextView]]></category>
		<category><![CDATA[userInteractionEnabled]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=321</guid>
		<description><![CDATA[I had an issue where I was unable to get scrolling on a UITextView to work when editing was turned off. I searched and searched through the vast sea of information that is the internet and came up empty. Basically the problem was that I had nested my UITextView inside of a UIImageView. This seems [...]]]></description>
			<content:encoded><![CDATA[<p>I had an issue where I was unable to get scrolling on a UITextView to work when editing was turned off.  I searched and searched through the vast sea of information that is the internet and came up empty.</p>
<p>Basically the problem was that I had nested my UITextView inside of a UIImageView.  This seems innocuous enough but UIImageView does not have the userInteractionEnabled flag set to YES by default.  Therefore the event was dispatched up to that view from the main thread and was blocked because the view would not handle and propagate the event.</p>
<p>So the solution was to set the UIImageView&#8217;s userInteractionEnabled flag to YES.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p321code22'); return false;">View Code</a> OBJ-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32122"><td class="code" id="p321code22"><pre class="obj-c" style="font-family:monospace;">    self.userInteractionEnabled = YES;</pre></td></tr></table></div>

<p>I think there could be other views that are set up like this as well, although I am not sure which ones they would be.  So watch out for this, especially if you are defining your views in code.</p>
<p>I hope that this shows up in someone&#8217;s Google search and helps them out.</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/hRSYzeV9ndY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2010/07/uitextview-scrolling-doesnt-work/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2010/07/uitextview-scrolling-doesnt-work/</feedburner:origLink></item>
		<item>
		<title>Custom Fonts in iOS 4</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/mbgiSCJ1rxs/</link>
		<comments>http://blog.beefyapps.com/2010/06/custom-fonts-in-ios-4/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 01:21:50 +0000</pubDate>
		<dc:creator>Sanjeev</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[Custom Fonts]]></category>
		<category><![CDATA[iOS 4]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[UITextView]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=316</guid>
		<description><![CDATA[Up till now there hasn&#8217;t been an easy way to add custom fonts to your iPhone applications.  As of iOS 4 it has become very easy to do.  Here is what you need to do in order to add custom fonts: Add your custom font files into your project using XCode as a resource Add [...]]]></description>
			<content:encoded><![CDATA[<p>Up till now there hasn&#8217;t been an easy way to add custom fonts to your iPhone applications.  As of iOS 4 it has become very easy to do.  Here is what you need to do in order to add custom fonts:</p>
<ol>
<li>Add your custom font files into your project using XCode as a resource</li>
<li>Add a key to your info.plist file called UIAppFonts.</li>
<li>Make this key an array</li>
<li>For each font you have, enter the full name of your font file (including the extension) as items to the UIAppFonts array</li>
<li>Save info.plist</li>
<li>Now in your application you can simply call [UIFont fontWithName:@"CustomFontName" size:12] to get the custom font to use with your UILabels and UITextViews, etc&#8230;</li>
</ol>
<p>It&#8217;s that simple!</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/mbgiSCJ1rxs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2010/06/custom-fonts-in-ios-4/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2010/06/custom-fonts-in-ios-4/</feedburner:origLink></item>
		<item>
		<title>CoreData SQLite3 Database Constraint Failed Error</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/jgqpiFaRW7I/</link>
		<comments>http://blog.beefyapps.com/2010/03/coredata-sqlite3-database-constraint-failed-error/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 16:45:09 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[CoreData]]></category>
		<category><![CDATA[Error 256]]></category>
		<category><![CDATA[NSPersistenceStore]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=307</guid>
		<description><![CDATA[Have you ever seen the following error message: Error Domain=NSCocoaErrorDomain Code=256 UserInfo=0x3baae90 "Operation could not be completed. (Cocoa error 256.) Talk about not Helpful. Inside this there was a userInfo dictionary with the following message: error during SQL execution : constraint failed Slightly more helpful, but not by very much. We came across this error [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever seen the following error message:</p>
<p><code>Error Domain=NSCocoaErrorDomain Code=256 UserInfo=0x3baae90 "Operation could not be completed. (Cocoa error 256.)</code></p>
<p>Talk about not Helpful.</p>
<p>Inside this there was a userInfo dictionary with the following message: </p>
<p><code>error during SQL execution : constraint failed</code></p>
<p>Slightly more helpful, but not by very much.</p>
<p>We came across this error message while we were developing our <a href="http://www.beefyapps.com/electrophobe/info">Electrophobe</a> game.  We started the debugging process by inserting logging code and pinpointing where the code was failing out.  After about 6 hours of work combing through both code and rebuilt databases we finally found the solution.</p>
<p>The trick was that the primary key store for the SQLite3 database that was backing our CoreData NSPersistenceStore had an incorrect value for the Z_MAX column.  This column is used, we believe, to house the maximum primary key in order to quickly retrieve it for additional inserts.</p>
<p>As is evident from our escapade however, it is clearly a little vulnerable to tampering when loading the data directly into the SQLite database.  To fix the issue, simply update the table with the max(Z_ID) from the referenced table and it should all hook up again.</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/jgqpiFaRW7I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2010/03/coredata-sqlite3-database-constraint-failed-error/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2010/03/coredata-sqlite3-database-constraint-failed-error/</feedburner:origLink></item>
		<item>
		<title>Posting Multiple Files With ASI</title>
		<link>http://feedproxy.google.com/~r/BeefyappsBlog/~3/_xHwB6QFg9Y/</link>
		<comments>http://blog.beefyapps.com/2010/02/posting-multiple-files-with-asi/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 03:00:08 +0000</pubDate>
		<dc:creator>jrickard</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[ASI]]></category>
		<category><![CDATA[ASIFormDataRequest]]></category>
		<category><![CDATA[Binary Data]]></category>
		<category><![CDATA[Post Request]]></category>
		<category><![CDATA[Sending Files]]></category>
		<category><![CDATA[Web Integration]]></category>

		<guid isPermaLink="false">http://blog.beefyapps.com/?p=297</guid>
		<description><![CDATA[How to modify ASI to support the post of multiple data objects]]></description>
			<content:encoded><![CDATA[<p>ASI (from <a href="http://allseeing-i.com/">All-Seeing Interactive</a>)  is a great product.  Apple has made strides to incorporate some of the advanced procedures that this allows for, but ASI gives you some great features to easily handle some more complicated operations.  It will allow you to easily download multiple files at once and aggregate the progress monitoring of these; It allowed for upload progress monitoring, before apple wired up its NSConnection objects for this purpose and many other features.  Having said that I have run across a couple of scenarios and extensions to the basic code that I have found useful.</p>
<p>First I had the need to post multiple files in the same post request up to a web server.  The ASI stack has a basic method for attaching an NSData object to your request data.  This method simply takes in the data and assigns it &#8220;filename&#8221; as the default filename for the data that is passed in.  Realistically there is no way for ASIFormDataRequest to infer the filename from the binary data.  However, this can be quite useful when you are posting binary file data to a web service as the web service is often looking for unique filename identification of each binary part of the posted multipart-form request.</p>
<p>In order to enhance the ASIFormDataRequest to handle this scenario we simply modified the setData: forKey: method to have an override that sets the filename property.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p297code23'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p29723"><td class="code" id="p297code23"><pre class="objective-c" style="font-family:monospace;">- (void)setData:(NSData *)data forKey:(NSString *)key
{
	[self setData:data forKey:key withFilename:@&quot;file&quot;];
}
&nbsp;
- (void)setData:(NSData *)data forKey:(NSString *)key withFilename:(NSString *)filename
{
	if (!fileData) {
		fileData = [[NSMutableDictionary alloc] init];
	}
	NSMutableDictionary *file = [[[NSMutableDictionary alloc] init] autorelease];
	[file setObject:data forKey:@&quot;data&quot;];
	[file setObject:filename forKey:@&quot;filename&quot;];
	[fileData setValue:file forKey:key];
	[self setRequestMethod:@&quot;POST&quot;];
}</pre></td></tr></table></div>

<p>By adding the override on the method we have maintained the core functionality and extended it to allow for multiple files with multiple file names.</p>
<img src="http://feeds.feedburner.com/~r/BeefyappsBlog/~4/_xHwB6QFg9Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.beefyapps.com/2010/02/posting-multiple-files-with-asi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.beefyapps.com/2010/02/posting-multiple-files-with-asi/</feedburner:origLink></item>
	</channel>
</rss>

