<?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>tov's Blog &#187; Development</title>
	<atom:link href="http://blog.nobody-is-like.me/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nobody-is-like.me</link>
	<description>Just another (geeky) WordPress weblog</description>
	<lastBuildDate>Sat, 16 Jul 2011 14:57:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Brainfuck</title>
		<link>http://blog.nobody-is-like.me/2010/03/brainfuck/</link>
		<comments>http://blog.nobody-is-like.me/2010/03/brainfuck/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 10:31:12 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programmierung]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=57</guid>
		<description><![CDATA[Hmmm&#8230; Kleine Fingerübung in Perl (pre-alpha ) Ah ja: Brainfuck: http://lmgtfy.com/?q=Brainfuck #!/usr/bin/env perl use Term::ReadKey; ReadMode 'raw'; my $debug = 0; my $code; if ($ARGV[0]){ { local $/ = undef; local *FILE; open FILE, "+++++++++[-]+++[>++++++++++++.]]></description>
			<content:encoded><![CDATA[<p>Hmmm&#8230; Kleine Fingerübung in Perl (pre-alpha <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p>Ah ja: Brainfuck: <a href="http://lmgtfy.com/?q=Brainfuck">http://lmgtfy.com/?q=Brainfuck</a></p>
<pre>#!/usr/bin/env perl
use Term::ReadKey;
ReadMode 'raw';
my $debug = 0;

my $code;
if ($ARGV[0]){
	{ local $/ = undef; local *FILE; open FILE, "<".$ARGV[0]; $code = <FILE>; close FILE }
}

$code ||=
">+++++++++[<+++++++++++++>-]<-.-----.+++++++
.>+++[>++++++++++<-]
>++.<<----.+++.
--------- . -------.>++++[<+++++>-]<+.>++++++++++.";

$code =~ s/[^\.,+-\[\]<>]//msg;
$| = 1;
my @val;
@val[ 0 .. 29999 ] = (0) x 30000;
my $vpt = 0;
my @ls;
my @le;
my $lpt = 0;
my $cc  = 0;
my @c   = split( '', $code );
my $nc  = @c;
while ( $cc < $nc ) {
    $_ = $c[ $cc++ ];
    print "vpt:$vpt \$val[\$vpt]"
      . $val[$vpt]
      . " loop_counter:$loop_counter loop(counter)_start:"
      . $ls[$loop_counter]
      . " loop(counter)_end:"
      . $le[$loop_counter]
      . " cc:$cc command:$_\n"
      if $debug;
    /</ and do { $vpt        and $vpt--; next };
    />/ and do { $vpt < @val and $vpt++; next };
    /\+/ and do { $val[$vpt] = $val[$vpt] + 1; next; };
    /\-/ and do { $val[$vpt] = $val[$vpt] - 1; next; };
    /\./ and do { print chr( $val[$vpt] ); next; };
    /\,/ and do { $val[$vpt] = ord( ReadKey 0 ); next; };
    /\[/ and do {
        if   ( $val[$vpt] ) { $ls[ $lpt++ ] = $cc - 1 }
        else                { $cc = defined $le[$lpt] ? $le[$lpt] : (index($code,']',$cc)+1) }
        next;
    };
    /\]/ and do {
        $le[ --$lpt ] = $cc;
        $cc = $ls[$lpt];
        next;
    };
}
print "\n";
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2010/03/brainfuck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Establish a 2nd database connection in Rails</title>
		<link>http://blog.nobody-is-like.me/2009/06/establish-a-2nd-database-connection-in-rails/</link>
		<comments>http://blog.nobody-is-like.me/2009/06/establish-a-2nd-database-connection-in-rails/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 15:54:56 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[informix]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2009/06/18/establish-a-2nd-database-connection-in-rails/</guid>
		<description><![CDATA[OK, you can find some howto&#8217;s everywhere on the web but only on this site I found the complete solution: [sourcecode language='ruby'] class SecondConnection < ActiveRecord::Base SecondConnection.establish_connection( :adapter => &#8220;informix&#8221;, :host => &#8220;localhost&#8221;, :username => &#8220;hansnase&#8221;, :password => &#8220;very_secret&#8221;, :database => &#8220;ccdb@localhost&#8221; ) self.abstract_class = true end [/sourcecode] &#8220;self.abstract_class = true&#8221; makes the thing actually [...]]]></description>
			<content:encoded><![CDATA[<p>OK, you can find some howto&#8217;s everywhere on the web but only on <a href="http://blog.freerails.de/?p=347">this</a> site I found the complete solution:</p>
<p>[sourcecode language='ruby']<br />
class SecondConnection < ActiveRecord::Base</p>
<p>SecondConnection.establish_connection(<br />
:adapter  => &#8220;informix&#8221;,<br />
:host     => &#8220;localhost&#8221;,<br />
:username => &#8220;hansnase&#8221;,<br />
:password => &#8220;very_secret&#8221;,<br />
:database => &#8220;ccdb@localhost&#8221;<br />
)</p>
<p>self.abstract_class = true<br />
end<br />
[/sourcecode]</p>
<p>&#8220;self.abstract_class = true&#8221; makes the thing actually work. Otherwise Rails seems to cache the database connection and does not switch back if you access any other classes but SecondConnection.</p>
<p>Yeah!</p>
<p>Later: Not so Yeah&#8230;</p>
<p>I had to establish another call to<br />
[sourcecode language='ruby']<br />
  ActiveRecord::Base.establish_connection<br />
       logger.info { &#8220;Establishing Base Connection&#8221; }<br />
       log_connections<br />
[/sourcecode]</p>
<p>I assume it&#8217;s either an Informix problem or related to the old rails version I&#8217;m driving with.<br />
Nevertheless: It works now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/06/establish-a-2nd-database-connection-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails and incoming mails on a Mac Leopard workstation</title>
		<link>http://blog.nobody-is-like.me/2009/06/rails-and-incoming-mails-on-a-mac-leopard-workstation/</link>
		<comments>http://blog.nobody-is-like.me/2009/06/rails-and-incoming-mails-on-a-mac-leopard-workstation/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 16:27:15 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Ruby and Rails]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2009/06/17/rails-and-incoming-mails-on-a-mac-leopard-workstation/</guid>
		<description><![CDATA[Obviously I&#8217;m in a need of such an installation, otherwise I wouldn&#8217;t have googled about this (btw.: Do you know lmgtfy.com). Here are some snippets from: ChrizDee Craig Ambrose And? What did I do: I first enabled Postfix using 1). After this I have changed /etc/aliases: [sourcecode language='ruby'] echo &#8216;rails_mailer: &#8220;&#124;/usr/local/bin/mail_handler.rb&#8221;&#8216; >> /etc/aliases chmod 755 [...]]]></description>
			<content:encoded><![CDATA[<p>Obviously I&#8217;m in a need of such an installation, otherwise I wouldn&#8217;t have googled about this (btw.: Do you know <a href="http://lmgtfy.com">lmgtfy.com</a>).</p>
<p>Here are some snippets from:</p>
<ol>
<li><a href="http://www.chrizdee.de/2008/10/20/postfix-mailserver-unter-os-x-leopard-einrichten/">ChrizDee</a></li>
<li><a href="http://blog.craigambrose.com/past/2008/2/9/respond_toemail_or_how_to_handle/">Craig Ambrose</a></li>
</ol>
<p>And? What did I do:</p>
<p>I first enabled Postfix using 1). After this I have changed /etc/aliases:</p>
<p>[sourcecode language='ruby']</p>
<p>echo &#8216;rails_mailer: &#8220;|/usr/local/bin/mail_handler.rb&#8221;&#8216; >> /etc/aliases<br />
chmod 755 /usr/local/bin/mail_handler.rb&#8221;&#8216; >> /etc/aliases<br />
sudo newaliases<br />
sudo postfix reload</p>
<p>[/sourcecode]</p>
<p>[sourcecode language='ruby']<br />
#!/usr/bin/ruby<br />
require &#8216;net/http&#8217;<br />
require &#8216;uri&#8217;Net::HTTP.post_form URI.parse(&#8216;http://localhost:3000/emails&#8217;), { &#8220;email&#8221; => STDIN.read }</p>
<p>[/sourcecode]</p>
<p>The script above will be triggered by every mail that will be sent to rails_mailer@localhost (resp. your hostname). It will put a post-request to localhost:3000/email including the email in the parameter &#8220;email&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/06/rails-and-incoming-mails-on-a-mac-leopard-workstation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ein paar Ruby-Schnipsel</title>
		<link>http://blog.nobody-is-like.me/2009/06/ein-paar-ruby-schnipsel/</link>
		<comments>http://blog.nobody-is-like.me/2009/06/ein-paar-ruby-schnipsel/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 14:13:58 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Ruby and Rails]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2009/06/10/ein-paar-ruby-schnipsel/</guid>
		<description><![CDATA[Ein paar Lebensretter für mich: Installation von Postgresql unter Mac OS Wenn Rubyforge down ist:  gem install &#8211;source http://rf.gems.mocra.com NAME_OF_THE_GEM Robby on Rails (Mac/Leopard/Rails etc.)]]></description>
			<content:encoded><![CDATA[<p>Ein paar Lebensretter für mich:</p>
<ul>
<li><a href="http://www.rolleyes.de/blog/2008/07/17/ruby-rails-und-postgresql-fur-mac-os-x-105/">Installation von Postgresql unter Mac OS</a></li>
<li>Wenn Rubyforge down ist:  gem install &#8211;source http://rf.gems.mocra.com NAME_OF_THE_GEM</li>
<li>Robby on Rails <a href="http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition">(Mac/Leopard/Rails etc.)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/06/ein-paar-ruby-schnipsel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sourcecode and WordPress</title>
		<link>http://blog.nobody-is-like.me/2009/03/sourcecode-and-wordpress/</link>
		<comments>http://blog.nobody-is-like.me/2009/03/sourcecode-and-wordpress/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 18:27:50 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[being stupid]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=22</guid>
		<description><![CDATA[At last&#8230; I found the plugin SyntaxHilighter forWordPress (wasn&#8217;t that hard. It&#8217;s part of the WordPress FAQ) to solve my formatting problems&#8230;]]></description>
			<content:encoded><![CDATA[<p>At last&#8230;</p>
<p>I found the plugin <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">SyntaxHilighter</a> forWordPress (wasn&#8217;t that hard. It&#8217;s part of the WordPress FAQ) to solve my formatting problems&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/03/sourcecode-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Snippets &#8212; Arbitrary SQL</title>
		<link>http://blog.nobody-is-like.me/2009/02/rails-snippets-arbitrary-sql/</link>
		<comments>http://blog.nobody-is-like.me/2009/02/rails-snippets-arbitrary-sql/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 11:30:35 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ruby and Rails]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=20</guid>
		<description><![CDATA[Seems I&#8217;m in a Ruby/Rails mood today Sometimes you don&#8217;t need the whole Rails stuff and just want to place a query. Try the following: ActiveRecord::Base.connection.(select_all&#124;update) will do the trick. Example: list = ActiveRecord::Base.connection.select_all("select a,b from c_table") &#8211;&#62; [ {a =&#62; Value_for_a, b =&#62; Value_for_b}, {a =&#62; Value...}...] number_of_rows = ActiveRecord::Base.connection.update("update month set month_id = [...]]]></description>
			<content:encoded><![CDATA[<p>Seems I&#8217;m in a Ruby/Rails mood today</p>
<p>Sometimes you don&#8217;t need the whole Rails stuff and just want to place a query.</p>
<p>Try the following:<br />
<code><br />
ActiveRecord::Base.connection.(select_all|update)<br />
</code><br />
will do the trick.<br />
Example:</p>
<p><code><br />
list = ActiveRecord::Base.connection.select_all("select a,b from c_table")<br />
</code></p>
<p>&#8211;&gt;<br />
<code><br />
[ {a =&gt; Value_for_a, b =&gt; Value_for_b}, {a =&gt; Value...}...]<br />
</code></p>
<p><code> number_of_rows = ActiveRecord::Base.connection.update("update month set month_id = month_id +1 where month_id = 11")</code></p>
<p>If you make use of an already created Rails Model instead of the base class, you will get the benefit of accessors (instead of hash-keys) for the  selected objects.</p>
<p>Example (necessary, I know <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<ul>
<li>create the model</li>
</ul>
<p><code># script/generate model CTable</code></p>
<ul>
<li>use it in your code</li>
</ul>
<p><code> list = CTable.find_by_sql("select a,b from c_table")</code></p>
<ul>
<li>access elements</li>
</ul>
<p><code>pp list[0].a</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/02/rails-snippets-arbitrary-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Snippets</title>
		<link>http://blog.nobody-is-like.me/2009/02/rails-snippets-2/</link>
		<comments>http://blog.nobody-is-like.me/2009/02/rails-snippets-2/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 09:43:59 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=19</guid>
		<description><![CDATA[OK, this is more Ruby than Rails but nevertheless helpful&#8230; If you come from a Perl background you will be surprised that in Ruby an array is definitively not a list. So if you want to pass a list of elements to a method that you have stored in an array, you may want to [...]]]></description>
			<content:encoded><![CDATA[<p>OK, this is more Ruby than Rails but nevertheless helpful&#8230;</p>
<p>If you come from a Perl background you will be surprised that in Ruby an array is definitively not a list. So if you want to pass a list of elements to a method that you have stored in an array, you may want to use the following idiom:<br />
<code>list = []<br />
lines = File.readlines("FILENAME")<br />
lines.each do |line|<br />
list.push(Result.new(*line.split(" ")))<br />
end<br />
</code><br />
The <code>*line.split(" ")</code> creates an element list out of the array that the split command has created.</p>
<p>I fear a real Rubyist would have done it in a different way but OK.</p>
<p>P.S. Does someone know what I&#8217;m doing wrong with the code formatting in WordPress? I&#8217;m quite sure to have included whitespaces in the code above&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/02/rails-snippets-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jboss Seam</title>
		<link>http://blog.nobody-is-like.me/2009/02/jboss-seam/</link>
		<comments>http://blog.nobody-is-like.me/2009/02/jboss-seam/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 00:06:49 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=16</guid>
		<description><![CDATA[Hobbyprojekt Ich wollte mal ausprobieren, was es mit SEAM so auf sich hat. Vor dem Erfolg (Hello World) gibt&#8217;s allerdings erst &#8216;mal ne Menge Installationsarbeit zu erledigen. Da ich masochistisch veranlagt bin (?) habe ich das ganze Geraffel unter Mac OS-X Leopard installiert und mich dabei von dieser Anleitung hier inspirieren lassen. Auf geht&#8217;s: Download [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Hobbyprojekt <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </strong><img src="file:///Users/tov/Pictures/VorschauSchnappschuss001.jpg" /></p>
<p>Ich wollte mal ausprobieren, was es mit SEAM so auf sich hat.</p>
<p>Vor dem Erfolg (Hello World) gibt&#8217;s allerdings erst &#8216;mal ne Menge Installationsarbeit zu erledigen. Da ich masochistisch veranlagt bin (?) habe ich das ganze Geraffel unter Mac OS-X Leopard installiert und mich dabei von dieser Anleitung <a href="http://javathreads.de/2008/09/tutorial-mit-jboss-seam-und-jee5-unter-eclipse-starten/" title="Jboss Installation">hier</a> inspirieren lassen.</p>
<p>Auf geht&#8217;s:</p>
<ol>
<li>Download bzw. Installation von <a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR1/eclipse-jee-ganymede-SR1-macosx-carbon.tar.gz" title="Ganymede">Eclipse Ganymede</a> (ich hab&#8217; die neueste Version genommen)</li>
<li>JBoss Application Server (AS) laden: <a href="http://www.jboss.org/jbossas/downloads/">Hier</a> (auch hier die neueste&#8230; Ich erwähn&#8217;s nicht mehr <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )<br />
<strong>Achtung: Es geht nur mit Version 4.2.X für JDK 1.5<br />
</strong>Leopard ist da etwas zurück (nix mit 1.6)</li>
<li><a href="http://www.seamframework.org/Download" title="SEAM">SEAM</a></li>
<li>Mysql installieren über <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">diesen Link</a></li>
<li>Der Mysql-Connector: <a href="http://dev.mysql.com/downloads/connector/j/5.1.html" title="Mysql-Connector">Hier</a></li>
<li>Ordner anlegen z.B. unter /Users/tov/Documents/Development/Seam</li>
<li>Ganymede in diesen Ordner packen (Terminal; tar xzvf DATEINAME.tgz) &#8211;&gt; Ordner &#8220;eclipse&#8221;</li>
<li>Dann mkdir jboss</li>
<li>cd jboss</li>
<li>mv ~/Downloads/jboss* .</li>
<li>tar xzvf jboss&#8230; und tar xzvf jboss-seam&#8230; (Dateinamen bitte anpassen)</li>
<li>cd ..</li>
<li>eclipse/eclipse -data workspace -vmargs -Xmx512M -Xms254M -XX:MaxPermSize=254M</li>
<li>warten&#8230; (zumindestens auf meinem 2GHz/2GByte MacBook)</li>
<li>Eclipse Updates installierenHelp-&gt;Software Updates&#8230;-&gt;Available Software Tab-&gt;Add Sitehttp://download.jboss.org/jbosstools/updates/development eintragen</li>
</ol>
<p>Ich habe dann mal die MySQL etc. Anweisungen aus obigem Post befolgt und bin an der Stelle &#8220;Neuanlegen eines Projektes&#8221; gescheitert (classpath, error, mail.jar etc.)</p>
<p>Die (wahrscheinlich nicht korrekte) Lösung für das Problem war dann ein beherztes:<br />
<code><br />
cd /Users/tov/Documents/Development/Seam/jboss/jboss-5.0.1.GA<br />
cp -R common/lib/* server/default/lib/</code></p>
<p>Danach ließ sich das Projekt anlegen!</p>
<p><strong>Nochmal Achtung</strong> Ich glaube, dass das bei dem 4.2x er JBoss nicht nötig ist!</p>
<p><a href="http://blog.nobody-is-like.me/wp-content/uploads/2009/02/vorschauschnappschuss001.jpg" title="Projekt"><img src="http://blog.nobody-is-like.me/wp-content/uploads/2009/02/vorschauschnappschuss001.jpg" alt="Projekt" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/02/jboss-seam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Snippets</title>
		<link>http://blog.nobody-is-like.me/2009/02/rails-snippets/</link>
		<comments>http://blog.nobody-is-like.me/2009/02/rails-snippets/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 10:27:11 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programmierung]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=15</guid>
		<description><![CDATA[Some small snippets of Rails/Ruby codes that I&#8217;d like to not forget&#8230; I found an interesting site on the Web: http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/  Tweaking it a bit: require '../config/environment' require 'pp' id = ARGV[0] if id.nil? raise &#60; USAGE: $0 RESELLER_ID eof end app = ActionController::Integration::Session.new app.get "/kunden/status_mail/#{id}" This works fine from a Rails subdirectory and calls the [...]]]></description>
			<content:encoded><![CDATA[<p>Some small snippets of Rails/Ruby codes that I&#8217;d like to not forget&#8230;</p>
<p>I found an interesting site on the Web: <a href="http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/" title="How to Execute a Rails Controller Action via. Cron">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/ </a></p>
<p>Tweaking it a bit:<br />
<code>require '../config/environment'<br />
require 'pp'<br />
id = ARGV[0]<br />
if id.nil?<br />
raise &lt;<eof><br />
USAGE: $0 RESELLER_ID<br />
eof<br />
end<br />
app = ActionController::Integration::Session.new<br />
app.get "/kunden/status_mail/#{id}"</eof></code></p>
<p>This works fine from a Rails subdirectory and calls the same action like http://RAILSSITE/kunden/status_mail/ID</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/02/rails-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>_Mein_ Everyday GIT</title>
		<link>http://blog.nobody-is-like.me/2009/02/_mein_-everyday-git/</link>
		<comments>http://blog.nobody-is-like.me/2009/02/_mein_-everyday-git/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 17:08:12 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=4</guid>
		<description><![CDATA[Mal ein Versuch meinen privaten GIT-Arbeitszyklus zu dokumentieren&#8230; Dieses Post wird wohl ab und zu verändert werden &#160; &#160; Arbeitszyklus mit GIT Start Entweder neu erstellen eines Repositories oder kopieren: Erstellen mkdir Name cd Name git init Kopieren git clone username@hostname:/PFAD/Name edit/compile/fix Commit git add . (fügt alle neuen Dateien hinzu) git commit -a -m [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span>Mal ein Versuch meinen privaten GIT-Arbeitszyklus zu dokumentieren&#8230;</p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px">Dieses Post wird wohl ab und zu verändert werden <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px">&nbsp;</p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px">&nbsp;</p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 18px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px"><strong>Arbeitszyklus mit GIT</strong></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px"><strong>Start</strong></span></p>
<ol style="list-style-type: decimal">
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Entweder neu erstellen eines Repositories oder kopieren:</span>
<ol style="list-style-type: decimal">
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Erstellen</span>
<ol style="list-style-type: decimal">
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">mkdir Name</span></li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">cd Name</span></li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">git init</span></li>
</ol>
</li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Kopieren</span>
<ol style="list-style-type: decimal">
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">git clone username@hostname:/PFAD/Name</span></li>
</ol>
</li>
</ol>
</li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">edit/compile/fix</span></li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Commit</span>
<ol style="list-style-type: decimal">
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">git add . (fügt alle neuen Dateien hinzu)</span></li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">git commit -a -m „KOMMENTAR“ </span></li>
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">git push (zurück ins Repository)</span></li>
</ol>
</li>
</ol>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Wenn das Repository ein sogenanntes „non-bare“ Repository ist (also mit Working-Tree), werden die Änderungen dort _nicht_ ins Working Directory eingetragen. Wenn dort nichts verändert wurde (also kein Merge notwendig ist), kann mittels</span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #000099"><span>git reset &#8211;hard (<a href="http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73"><span style="text-decoration: underline; letter-spacing: 0px">http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73</span></a>)</span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">der neue Sourcecode aktiviert werden. </span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px"><strong>Alternative: Benutzen eines „post-update-hooks“</strong></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #000099"><span style="text-decoration: underline; letter-spacing: 0px"><a href="http://utsl.gen.nz/git/post-update">http://utsl.gen.nz/git/post-update</a></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Eintragen in .git/hooks/post-update (auf dem Ziel-Repository)</span></p>
<ol style="list-style-type: lower-alpha">
<li style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #000099"><span>auch: <a href="http://www.mail-archive.com/git@vger.kernel.org/msg03458.html"><span style="text-decoration: underline; letter-spacing: 0px">http://www.mail-archive.com/git@vger.kernel.org/msg03458.html</span></a></span></li>
</ol>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Damit reicht dann das „push“ von der Remote-Maschine, um ein Merge des Repositories zu erreichen!</span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Wenn im Master Repository (also dem, in das gerade gepushed wurde) vorher kein Commit durchgeführt wurde, werden die lokalen Änderungen gestashed</span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #000099"><span style="text-decoration: underline; letter-spacing: 0px"><a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html">http://www.kernel.org/pub/software/scm/git/docs/git-stash.html</a></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">Mittels </span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">git stash apply</span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px">können die ebenfalls reingemerged werden</span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal">&nbsp;</p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal">&nbsp;</p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px"><span style="letter-spacing: 0px"></span></p>
<p style="margin: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal"><span style="letter-spacing: 0px"></span></p>
<h3>Rollback nach einem fehlgeschlagenen Merge</h3>
<p><code>git pull blafasel</code><br />
hat mal wieder (OK&#8230; Das kommt nicht so häufig vor; Es ist ja schließlich nicht Subversion <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) diverse Konflikte gemeldet und nur weil vorher lokal irgendetwas vergessen wurde.<br />
Ausweg:</p>
<p><code>git reset --hard</code><br />
Alles ist wieder gut (wie vorher).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/02/_mein_-everyday-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

