<?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>Meeho!™ &#187; Blog &#187; Tech stuff</title>
	<atom:link href="http://www.meeho.net/blog/category/techstuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.meeho.net/blog</link>
	<description>This is the official blog about Meeho!™, the platform for getting your business organized.</description>
	<lastBuildDate>Sat, 04 Jun 2011 23:06:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Soon to come: IMAP integration</title>
		<link>http://www.meeho.net/blog/2011/02/soon-to-come-imap-integration/</link>
		<comments>http://www.meeho.net/blog/2011/02/soon-to-come-imap-integration/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 00:02:13 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/2011/02/soon-to-come-imap-integration/</guid>
		<description><![CDATA[We&#8217;re doing the final testing of our brand new IMAP module for Meeho!&#8482;. In short, it&#8217;ll give you complete integration of your e-mail inbox, sent mails etc. with contacts, clients, and projects in Meeho!&#8482;. We honestly can&#8217;t wait to release version 2.2 on the new server platform, packed with new features &#8212; it&#8217;s gonna be [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re doing the final testing of our brand new IMAP module for Meeho!&#8482;. In short, it&#8217;ll give you complete integration of your e-mail inbox, sent mails etc. with contacts, clients, and projects in Meeho!&#8482;. We honestly can&#8217;t wait to release version 2.2 on the new server platform, packed with new features &mdash; it&#8217;s gonna be sweet.</p>
<div class="shr-publisher-1485"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2011/02/soon-to-come-imap-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do a RubyGems selfupdate</title>
		<link>http://www.meeho.net/blog/2010/11/how-to-do-a-rubygems-selfupdate/</link>
		<comments>http://www.meeho.net/blog/2010/11/how-to-do-a-rubygems-selfupdate/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 19:00:04 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=1312</guid>
		<description><![CDATA[I was just looking for this, because I forgot the command and issuing gem help doesn&#8217;t say a word about it &#8212; at least I couldn&#8217;t find it. To do a so-called selfupdate of your gem (RubyGems) installation, run the following command: sudo gem update &#8211;system (Those are two dashes and not just one, in [...]]]></description>
			<content:encoded><![CDATA[<p>I was just looking for this, because I forgot the command and issuing <em>gem help</em> doesn&#8217;t say a word about it &mdash; at least I couldn&#8217;t find it. To do a so-called selfupdate of your gem (RubyGems) installation, run the following command:</p>
<blockquote><p>sudo gem update &#8211;system</p></blockquote>
<p><span style="font-size: 12px;">(Those are two dashes and not just one, in cause your browser displays them as one.)</span></p>
<p>There you go.</p>
<div class="shr-publisher-1312"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/11/how-to-do-a-rubygems-selfupdate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>This is how you format your own XML in Ruby on Rails</title>
		<link>http://www.meeho.net/blog/2010/10/this-is-how-you-format-your-own-xml-in-ruby-on-rails/</link>
		<comments>http://www.meeho.net/blog/2010/10/this-is-how-you-format-your-own-xml-in-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 21:25:19 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=999</guid>
		<description><![CDATA[Here is the situation: you&#8217;ve got your own Ruby on Rails application, and you need to create an API that spits out XML for use somewhere. This is what you could be doing: respond_to do &#124;format&#124; &#160;&#160;format.xml { render :xml =&#62; @users.to_xml end The above will create and return fully functional XML which is all [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the situation: you&#8217;ve got your own Ruby on Rails application, and you need to create an API that spits out XML for use somewhere. This is what you could be doing:</p>
<blockquote><p>
respond_to do |format|<br />
&nbsp;&nbsp;format.xml { render :xml =&gt; @users.to_xml<br />
end
</p></blockquote>
<p>The above will create and return fully functional XML which is all good and dandy.</p>
<p>Well, it&#8217;s not. The above will mirror each and every detail about your <em>users</em> table in your database. But what if you don&#8217;t want to include the user passwords in the XML? What if you want to rename one of the fields to something else in your XML?</p>
<p>You use the <a href="http://builder.rubyforge.org/">Builder</a>. With the help of the Builder, you can modify the XML to look like anything you want and not just mirror your table structure completely. Here is how you use the Builder:</p>
<blockquote><p>
xml = Builder::XmlMarkup.new<br />
xml.instruct!<br />
xml.users do<br />
&nbsp;&nbsp;@users.each { |user|<br />
&nbsp;&nbsp;&nbsp;&nbsp;xml.username user.username<br />
&nbsp;&nbsp;&nbsp;&nbsp;xml.email user.email_address<br />
&nbsp;&nbsp;&nbsp;&nbsp;xml.<strong>write-whatever-you-want-here</strong> user.<strong>whichever-field-you-need</strong><br />
&nbsp;&nbsp;}<br />
end</p>
<p>respond_to do |format|<br />
&nbsp;&nbsp;format.xml { render :xml => xml.target! }<br />
end
</p></blockquote>
<p>The above code creates a new Builder object, then defines for a set of <em>users</em> to be shown in the XML. Then, the <em>@users</em> array is processed, and inside each <em>user</em> node in the XML you&#8217;re pretty much able to do whatever you want &#8211; including calling other methods you might need on-the-fly.</p>
<p>So whenever you need just a tad bit more freedom when working with XML, discard the <em>.to_xml</em> approach and create your own Builder object. That works like a charm!</p>
<div class="shr-publisher-999"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/10/this-is-how-you-format-your-own-xml-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby &#8211; how to detect the encoding of a string</title>
		<link>http://www.meeho.net/blog/2010/03/ruby-how-to-detect-the-encoding-of-a-string/</link>
		<comments>http://www.meeho.net/blog/2010/03/ruby-how-to-detect-the-encoding-of-a-string/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 20:51:59 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=853</guid>
		<description><![CDATA[With file uploads in Ruby on Rails, e.g. an upload of a 2 KB CSV file, you&#8217;ll often run into trouble trying to decipher the encoding of the Tempfile string data stored in params[:my_upload_form][:uploaded_file] or whatever you&#8217;ve named your input field. If you want to keep everything to one encoding, you could make use of [...]]]></description>
			<content:encoded><![CDATA[<p>With file uploads in Ruby on Rails, e.g. an upload of a 2 KB CSV file, you&#8217;ll often run into trouble trying to decipher the encoding of the Tempfile string data stored in <em>params[:my_upload_form][:uploaded_file]</em> or whatever you&#8217;ve named your input field.</p>
<p>If you want to keep everything to one encoding, you could make use of <em>Iconv.conv(&#8216;UTF-8&#8242;, </em>&lt;whatever encoding&gt;<em>, string)</em> to convert the data from the input field to UTF-8. But to make the iconv() wrapper work properly, it needs to know what to convert from&#8230; So how do you acquire this knowledge?</p>
<p>Try to use the Ruby gem <a title="rchardet" href="http://github.com/jmhodges/rchardet">rchardet</a> by Jeff Hodges. Here is an example of how to use it:</p>
<blockquote><p>require &#8216;rchardet&#8217;</p>
<p>[...]</p>
<p>cd = CharDet.detect(params[:my_upload_form][:uploaded_file])<br />
encoding = cd['encoding']</p>
<p>converted_string = Iconv.conv(&#8216;UTF-8&#8242;, encoding, params[:my_upload_form][:uploaded_file])</p></blockquote>
<p>The above is not bullet proof, but it&#8217;ll get you going. If you have alternative ideas in this regard, please comment to let us all know.</p>
<div class="shr-publisher-853"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/03/ruby-how-to-detect-the-encoding-of-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL &#8211; ERROR: cannot drop the currently open database</title>
		<link>http://www.meeho.net/blog/2010/03/postgresql-error-cannot-drop-the-currently-open-database/</link>
		<comments>http://www.meeho.net/blog/2010/03/postgresql-error-cannot-drop-the-currently-open-database/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 20:35:06 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=850</guid>
		<description><![CDATA[You might come across the following error when trying to drop a database in your PostgreSQL: ERROR: cannot drop the currently open database This is because you are trying to delete the database that you are currently connected to (or in MySQL jargon: the database you are current USEing). To fix the problem, try to [...]]]></description>
			<content:encoded><![CDATA[<p>You might come across the following error when trying to drop a database in your PostgreSQL:</p>
<blockquote><p>ERROR: cannot drop the currently open database</p></blockquote>
<p>This is because you are trying to delete the database that you are currently connected to (or in MySQL jargon: the database you are current USEing). To fix the problem, try to issue the following command:</p>
<blockquote><p>\connect postgres</p></blockquote>
<p>This will connect you to the postgres database in PostgreSQL, sometimes referred to as the maintenance database. From here, try to issue your drop command again &#8211; it will now work out for you as expected.</p>
<div class="shr-publisher-850"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/03/postgresql-error-cannot-drop-the-currently-open-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scp &#8211; copy a file via SSH from a remote server to your computer</title>
		<link>http://www.meeho.net/blog/2010/03/scp-copy-file-from-remote-ssh-to-your-computer/</link>
		<comments>http://www.meeho.net/blog/2010/03/scp-copy-file-from-remote-ssh-to-your-computer/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 07:13:50 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=840</guid>
		<description><![CDATA[If you have SSH access to a UNIX/Linux based system somewhere and want to copy a file located on the server to your computer via SSH, you can use the scp command found in most UNIX/Linux systems, including Mac OS X. Say you want to copy a file from the remote server to your own [...]]]></description>
			<content:encoded><![CDATA[<p>If you have SSH access to a UNIX/Linux based system somewhere and want to copy a file located on the server to your computer via SSH, you can use the <em>scp</em> command found in most UNIX/Linux systems, including Mac OS X.</p>
<p>Say you want to copy a file from the remote server to your own computer, a file called <em>my_file.txt</em>. In this case, you would issue the following command in your terminal:</p>
<blockquote><p>scp your_login@addres.of.remote.server:my_file.txt .</p></blockquote>
<p>This makes your computer connect to the server with the login you provide, and copy the <em>my_file.txt</em> file to the directory you are currently working (using the exact same file name locally on your computer, that&#8217;s why there is a dot in the end of the command).</p>
<div class="shr-publisher-840"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/03/scp-copy-file-from-remote-ssh-to-your-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyGems: uninitialized constant Gem::GemRunner (NameError)</title>
		<link>http://www.meeho.net/blog/2010/03/rubygems-uninitialized-constant-gemgemrunner-nameerror/</link>
		<comments>http://www.meeho.net/blog/2010/03/rubygems-uninitialized-constant-gemgemrunner-nameerror/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 20:59:44 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=805</guid>
		<description><![CDATA[After having finished an update of your RubyGems installation, you might receive the following error: uninitialized constant Gem::GemRunner (NameError) If you get the above when trying to use gem, first of all, you need to find out which gem you&#8217;re using. Open up your shell and type in the following: which gem This will print [...]]]></description>
			<content:encoded><![CDATA[<p>After having finished an update of your RubyGems installation, you might receive the following error:</p>
<blockquote><p>uninitialized constant Gem::GemRunner (NameError)</p></blockquote>
<p>If you get the above when trying to use gem, first of all, you need to find out which gem you&#8217;re using. Open up your shell and type in the following:</p>
<blockquote><p>which gem</p></blockquote>
<p>This will print out which gem you&#8217;re using and the location of it, typically being <em>/usr/bin/gem</em> or <em>/usr/local/bin/gem</em>.</p>
<p>Next, open up the actual gem file in your favourite text editor. If you&#8217;re using TextMate for Mac OS X, this can be accomplished directly from your shell by issuing the <em>mate /usr/bin/gem</em> command (you might need to change the path to gem to reflect your system setup).</p>
<p>Here, you&#8217;ll see a line reading <em>require &#8216;rubygems&#8217;</em>. Just below this line, add require <em>&#8216;rubygems/gem_runner&#8217;</em>, save the file and try to use gem again. It should work fine now. The change you need to do is shown below:</p>
<div id="attachment_806" class="wp-caption aligncenter" style="width: 351px"><img class="size-full wp-image-806" title="This showns the gem file brought up in TextMate. Line 10 is the fix." src="http://www.meeho.net/blog/wp-content/uploads/RubyGemsGemRunnerFix.png" alt="This showns the gem file brought up in TextMate. Line 10 is the fix." width="341" height="128" /><p class="wp-caption-text">This showns the gem file brought up in TextMate. Line 10 is the fix.</p></div>
<div class="shr-publisher-805"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/03/rubygems-uninitialized-constant-gemgemrunner-nameerror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem with importing vCards containing foreign characters in Address Book for Mac OS X</title>
		<link>http://www.meeho.net/blog/2010/02/problem-with-import-vcards-containing-foreign-characters-in-address-book-for-mac-os-x/</link>
		<comments>http://www.meeho.net/blog/2010/02/problem-with-import-vcards-containing-foreign-characters-in-address-book-for-mac-os-x/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:17:46 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=779</guid>
		<description><![CDATA[If you ever experience a problem with importing vCards (.vcf files) that contain foreign characters in Address Book for Mac OS X, you might be in complete dark as to how to solve the problem with the foreign characters not being displayed properly. You might have tried to save the vCard as ISO-8859-1, UTF-8 or [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever experience a problem with importing vCards (.vcf files) that contain foreign characters in Address Book for Mac OS X, you might be in complete dark as to how to solve the problem with the foreign characters not being displayed properly.</p>
<p>You might have tried to save the vCard as ISO-8859-1, UTF-8 or the likes, and it still doesn&#8217;t work in Address Book. You might even have tried to add charset info in the MIME type of the vCard, having it display something like <em>text/vcard; charset=iso-8859-1</em> all the while it still doesn&#8217;t work. Bugger.</p>
<p>The only solution is to make Address Book use a different character encoding for the vCards. If you access <em>Address Book -&gt; Settings&#8230; -&gt; vCard</em>, you&#8217;ll see the ability to change the character encoding. However, Address Book might have chosen vCard version 3.0 for you per default. Change this to 2.1, then change the character set to e.g. Windows Latin 1, and then change the version back to version 3.0.</p>
<p>Having done the above, the import of vCards containing foreign characters will work as expected. <span style="text-decoration: underline; color: #000000;">This includes vCards exported from Meeho!™.</span></p>
<div id="attachment_789" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-789" title="A screenshot of the settings regarding vCards in Address Book." src="http://www.meeho.net/blog/wp-content/uploads/AddressBookvCard-2.jpg" alt="A screenshot of the settings regarding vCards in Address Book." width="300" height="164" /><p class="wp-caption-text">A screenshot of the settings regarding vCards in Address Book.</p></div>
<p><em>(One last note: Having to choose vCard version 2.1 to change the character encoding, then changing the version back to 3.0 AND having Address Book preserve the encoding settings might be a bug&#8230; Seems odd that it preserves the encoding settings while jumping from version 2.1 to version 3.0, when the dropdown menu is dimmed when set to vCard version 3.0, indicating that a change is not possible in that case&#8230;)</em></p>
<div class="shr-publisher-779"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/02/problem-with-import-vcards-containing-foreign-characters-in-address-book-for-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyGems: how to find out where the gems are installed</title>
		<link>http://www.meeho.net/blog/2010/02/rubygems-how-to-find-out-where-the-gems-are-installed/</link>
		<comments>http://www.meeho.net/blog/2010/02/rubygems-how-to-find-out-where-the-gems-are-installed/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:08:46 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=775</guid>
		<description><![CDATA[Should you ever be in the need of finding out where RubyGems installs all of your precious gems, just run the following command: sudo gem environment This will give you an overview of the environment settings for RubyGems. Find the &#8220;GEM PATHS&#8221; settings and there you go:]]></description>
			<content:encoded><![CDATA[<p>Should you ever be in the need of finding out where RubyGems installs all of your precious gems, just run the following command:</p>
<blockquote><p>sudo gem environment</p></blockquote>
<p>This will give you an overview of the environment settings for RubyGems. Find the &#8220;GEM PATHS&#8221; settings and there you go:</p>
<div id="attachment_776" class="wp-caption aligncenter" style="width: 430px"><img class="size-full wp-image-776" title="A screenshot of my l33t Terminal.app." src="http://www.meeho.net/blog/wp-content/uploads/RubyGemsPaths.jpg" alt="A screenshot of my l33t Terminal.app." width="420" height="138" /><p class="wp-caption-text">A screenshot of my l33t Terminal.app.</p></div>
<div class="shr-publisher-775"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/02/rubygems-how-to-find-out-where-the-gems-are-installed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails: how to render a custom layout in a controller method</title>
		<link>http://www.meeho.net/blog/2010/02/ruby-on-rails-how-to-render-custom-layout-in-a-controller-method/</link>
		<comments>http://www.meeho.net/blog/2010/02/ruby-on-rails-how-to-render-custom-layout-in-a-controller-method/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 23:31:59 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=768</guid>
		<description><![CDATA[If you have a controller that uses a general layout, but you want to use a custom layout for one of your controller methods and the corresponding view, what you do is simply to add a render :layout =&#62; &#8216;my_layout&#8217; to the method. Have a look at the below example: class MyController &#60; ApplicationController layout [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a controller that uses a general layout, but you want to use a custom layout for one of your controller methods and the corresponding view, what you do is simply to add a <em>render :layout =&gt; &#8216;my_layout&#8217;</em> to the method. Have a look at the below example:</p>
<blockquote><p>class MyController &lt; ApplicationController<br />
layout &#8216;main&#8217;</p>
<p>&nbsp;def my_method</p>
<p>&nbsp;&nbsp;&nbsp;# Do stuff here&#8230;<br />
&nbsp;&nbsp;&nbsp;render :layout =&gt; &#8216;my_layout&#8217;</p>
<p>&nbsp;end</p>
<p>end</p></blockquote>
<div class="shr-publisher-768"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/02/ruby-on-rails-how-to-render-custom-layout-in-a-controller-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

