<?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>gauda.de &#187; tip</title>
	<atom:link href="http://www.gauda.de/tag/tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gauda.de</link>
	<description>The work of Johannes Leers - a webworker from Siegen, Germany</description>
	<lastBuildDate>Tue, 15 Sep 2009 23:04:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use rails-footnotes to open files in NetBeans from Firefox</title>
		<link>http://www.gauda.de/ruby-on-rails/use-rails-footnotes-to-open-files-in-netbeans-from-firefox/</link>
		<comments>http://www.gauda.de/ruby-on-rails/use-rails-footnotes-to-open-files-in-netbeans-from-firefox/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 11:16:58 +0000</pubDate>
		<dc:creator>Johannes Leers</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.gauda.de/?p=53</guid>
		<description><![CDATA[Here is how to use rails-footnotes with NetBeans on linux!
Thanks to José Valim we have a nice new plugin for better debugging of Rails applications! In his blog post he describes how to open links to files on your hard disk with notepad++ on windows. I adapted this idea for opening files with netbeans on [...]]]></description>
			<content:encoded><![CDATA[<p>Here is how to use <a href="http://github.com/josevalim/rails-footnotes/tree/master">rails-footnotes</a> with <a href="http://www.netbeans.org/">NetBeans</a> on linux!</p>

<a href='http://www.gauda.de/ruby-on-rails/use-rails-footnotes-to-open-files-in-netbeans-from-firefox/attachment/rails-footnote/' title='Clicking on the link ...'><img width="150" height="75" src="http://www.gauda.de/wordpress/wp-content/uploads/rails-footnote-150x75.png" class="attachment-thumbnail" alt="Clicking on the link ..." title="Clicking on the link ..." /></a>
<a href='http://www.gauda.de/ruby-on-rails/use-rails-footnotes-to-open-files-in-netbeans-from-firefox/attachment/netbeans/' title='... opens the file in Netbeans'><img width="150" height="150" src="http://www.gauda.de/wordpress/wp-content/uploads/netbeans-150x150.png" class="attachment-thumbnail" alt="... opens the file in Netbeans" title="... opens the file in Netbeans" /></a>

<p>Thanks to José Valim we have a nice new plugin for better debugging of Rails applications! In his <a href="http://josevalim.blogspot.com/2008/06/textmate-protocol-behavior-on-any.html">blog post</a> he describes how to open links to files on your hard disk with notepad++ on windows. I adapted this idea for opening files with netbeans on linux, and here is your way to go:</p>
<p>open <code>about:config</code> in firefox and add:</p>
<ul>
<li>string <code>network.protocol-handler.app.editor</code> with content <code>~/.editor.rb</code></li>
<li>bool <code>network.protocol-handler.external.editor</code> and set it to <code>true</code></li>
</ul>
<p>create the file ~/.editor.rb and make it executable: </p>
<pre>touch ~/.editor.rb &#038;&#038; chmod +x  ~/.editor.rb</pre>
<p>And here is the content:</p>
<pre class="prettyprint">#!/usr/bin/ruby
file = ARGV.first.split('file://').last.split('&#038;').first
line = /\&#038;line\=(\d+)/.match(ARGV.first)[1] rescue 0
`"/path/to/your/netbeans-dir/bin/netbeans" "#{file}:#{line}"`
`wmctrl -a "NetBeans IDE"`</pre>
<p>install <a href="http://sweb.cz/tripie/utils/wmctrl/">wmctrl</a></p>
<pre>sudo aptitude install wmctrl</pre>
<p>We&#8217;ll need this to give focus to the NetBeans window.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gauda.de/ruby-on-rails/use-rails-footnotes-to-open-files-in-netbeans-from-firefox/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Use to_money to convert a string to an integer</title>
		<link>http://www.gauda.de/ruby-on-rails/use-to_money-to-convert-a-string-to-an-integer/</link>
		<comments>http://www.gauda.de/ruby-on-rails/use-to_money-to-convert-a-string-to-an-integer/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 00:35:34 +0000</pubDate>
		<dc:creator>Johannes Leers</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.gauda.de/?p=43</guid>
		<description><![CDATA[Just a quick note: You can use the following code in your helpers/application_helper.rb to convert a string to an integer in your Rails application:
class String
  def to_money
    fee = self.match(/(\d+)(,&#124;.?)(\d{0,2})/)
    if %w(, .).include?(fee[2]) # 56,99 1.00 5,-
      return "#{fee[1]}#{fee[3].to_i.to_s.ljust(2, '0')}"
    [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note: You can use the following code in your <code>helpers/application_helper.rb</code> to convert a string to an integer in your Rails application:</p>
<pre class="prettyprint">class String
  def to_money
    fee = self.match(/(\d+)(,|.?)(\d{0,2})/)
    if %w(, .).include?(fee[2]) # 56,99 1.00 5,-
      return "#{fee[1]}#{fee[3].to_i.to_s.ljust(2, '0')}"
    elsif fee[1] &#038;&#038; fee[2].blank? # 5
      return "#{fee[1]}00"
    end
  end

  def to_money!
    self.replace to_money
  end
end</pre>
<p>Now you can do some fancy stuff like the following:</p>
<pre class="prettyprint">"12 Euro".to_money => 1200
"12 Dollar".to_money => 1200
"12.00 Dollar".to_money => 1200
"12,00 Euro".to_money => 1200
"12,- Euro".to_money => 1200
"1200 Euro".to_money => 120000
money = "12,8 Euro"
money.to_money!
puts money # => 1280</pre>
<p>You can read about the motivation why to use integer in favor of decimals in the database here: <a href="http://www.setfiremedia.com/blog/7-top-tips-for-coding-with-currency">7 Top Tips for Coding With Currency</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gauda.de/ruby-on-rails/use-to_money-to-convert-a-string-to-an-integer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Please select an appropriate title when you write emails!</title>
		<link>http://www.gauda.de/random/please-select-an-appropriate-title-when-you-write-emails/</link>
		<comments>http://www.gauda.de/random/please-select-an-appropriate-title-when-you-write-emails/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 19:07:54 +0000</pubDate>
		<dc:creator>Johannes Leers</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[grumping]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.gauda.de/?p=42</guid>
		<description><![CDATA[More and more often I get emails from customers which just hit reply in their email-account to write me something. So far, so good. The problem is, that the contents don&#8217;t belong to all prior emails. That sucks and I will explain you why:
I am using Google Mail a.k.a. Gmail (not in Germany btw) which [...]]]></description>
			<content:encoded><![CDATA[<p>More and more often I get emails from customers which just hit reply in their email-account to write me something. So far, so good. The problem is, that the contents don&#8217;t belong to all prior emails. That sucks and I will explain you why:<br />
I am using Google Mail a.k.a. Gmail (<a href="http://en.wikipedia.org/wiki/Gmail#Germany">not in Germany btw</a>) which has the nice feature of threaded conversations. <a href="http://xkahn.zoned.net/software/evolution/threads/">You&#8217;ll find a nice explanation about this killer-feature here</a>, and shortening this: All emails of one subject, whether I send it or receive it, are one thread. There are no folders <code>received emails</code> and <code>sent emails</code>. So when somebody sends me an email by hitting reply I get this email in the appropriate thread because it has the same subject.<br />
Please differ the subject of your emails, when you are writing something that belongs to a completely different subject!</p>
<p>Other subjects that give me headaches are something like this: &#8220;I thought&#8230;&#8221;, &#8220;Can you&#8221;, &#8220;Problem&#8221; or &#8220;Help!&#8221;. This isn&#8217;t new to anyone visiting internet-forums from time to time knowing what a <a href="http://en.wikipedia.org/wiki/Netiquette">netiquette</a> is. It says, e.g. to select a good subject for your posts! This is the same for emailing! Write good subjects like this: &#8220;Problem with module x&#8221;, &#8220;Module y is to slow&#8221; or &#8220;Question regarding project z&#8221;</p>
<p>Please think about this the next time you email, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gauda.de/random/please-select-an-appropriate-title-when-you-write-emails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast scrolling in Linux</title>
		<link>http://www.gauda.de/ubuntu/fast-scrolling-in-linux/</link>
		<comments>http://www.gauda.de/ubuntu/fast-scrolling-in-linux/#comments</comments>
		<pubDate>Wed, 21 May 2008 11:16:15 +0000</pubDate>
		<dc:creator>Johannes Leers</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.gauda.de/?p=36</guid>
		<description><![CDATA[ Well, this is for sure not new to anybody but for anyone else it could be of interest and so it&#8217;s worth a post 
Just wanted to let you know that you can scroll to a specific point in any window using the middle-click of your mouse. So hover the scrollbar of any window [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.gauda.de/wordpress/wp-content/uploads/scroll-to.png" alt="Fast scrolling in Linux" title="scroll-to" width="110" height="131" class="alignleft size-full wp-image-37" /> Well, this is for sure not new to anybody but for anyone else it could be of interest and so it&#8217;s worth a post <img src='http://www.gauda.de/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Just wanted to let you know that you can scroll to a specific point in any window using the middle-click of your mouse. So hover the scrollbar of any window and click the wheel of your mouse and the window jumps to the position clicked.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gauda.de/ubuntu/fast-scrolling-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
