<?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/" version="2.0">

<channel>
	<title>Johannes Thönes</title>
	
	<link>http://jthoenes.bergischweb.de</link>
	<description>Gedanken, Anmerkungen und Anleitungen aus meinem Leben und meiner Welt.</description>
	<lastBuildDate>Sat, 06 Mar 2010 12:05:07 +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/jthoenes" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jthoenes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Get All SVN Commiters from a Repository or Working Copy</title>
		<link>http://jthoenes.bergischweb.de/2010/01/30/get-all-svn-commiters-from-a-repository-or-working-copy/</link>
		<comments>http://jthoenes.bergischweb.de/2010/01/30/get-all-svn-commiters-from-a-repository-or-working-copy/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:38:32 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[No Category]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=99</guid>
		<description><![CDATA[Short &#8211; but unfortunatly to long for Twitter. With this little snippet you can get all commits from an svn working copy, repository or from a pure log: svn log &#124; ruby -e &#34;puts STDIN.read.split(/\n/).select{&#124;l&#124; l =~ /^r\d+/}.map{&#124;l&#124; l.split('&#124;')[1].strip}.uniq.sort&#34; Who has any guess why I did need this?]]></description>
			<content:encoded><![CDATA[<p>Short &#8211; but unfortunatly to long for Twitter. With this little <a href="http://gist.github.com/290641">snippet</a> you can get all commits from an svn working copy, repository or from a pure log:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> log <span style="color: #000000; font-weight: bold;">|</span> ruby <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;puts STDIN.read.split(/<span style="color: #000099; font-weight: bold;">\n</span>/).select{|l| l =~ /^r\d+/}.map{|l| l.split('|')[1].strip}.uniq.sort&quot;</span></pre></div></div>

<p>Who has any guess why I did need this? </p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/UEbJG3ldW04" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2010/01/30/get-all-svn-commiters-from-a-repository-or-working-copy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Ruby Script for Upgrading Multiple DokuWiki Installations</title>
		<link>http://jthoenes.bergischweb.de/2010/01/24/a-ruby-script-for-upgrading-multiple-dokuwiki-installations/</link>
		<comments>http://jthoenes.bergischweb.de/2010/01/24/a-ruby-script-for-upgrading-multiple-dokuwiki-installations/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 14:59:36 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[DokuWiki]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=85</guid>
		<description><![CDATA[After DokuWiki has been released multiple times in the last few days because of security problems, I though it was a good time, to write a little script for automatically updating multiple instances. You can find the ruby script at http://gist.github.com/285219. The ruby script basically automates the upgrade instructions from the DokuWiki main page. So the [...]]]></description>
			<content:encoded><![CDATA[<p>After <a title="DokuWiki" href="http://www.splitbrain.org/projects/dokuwiki">DokuWiki</a> has been released multiple times in the last few days because of security problems, I though it was a good time, to write a little script for automatically updating multiple instances. You can find the ruby script at <a href="http://gist.github.com/285219">http://gist.github.com/285219</a>.</p>
<p>The ruby script basically automates the <a href="http://www.dokuwiki.org/install:upgrade">upgrade instructions</a> from the DokuWiki main page. So the following actions are performed when executing the script:</p>
<ol>
<li>Making a backup into /tmp/dokuwiki_backup_#{timestamp} of every installation.</li>
<li>Downloading the dokuwiki release (passed in as a parameter).</li>
<li>Extracting the files and copying everything to the installations (execept for the content of the /data directory).</li>
<li>Creating missing folders in the /data directory, making the owner www-data:www-data and chmodding them to 664.</li>
<li>Deleting files from a list of file from older revisions.</li>
</ol>
<p>Within the script you need to specifiy this snipped for setting your DokuWiki installations:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Definition of existing installation</span>
INSTALLATIONS = <span style="color:#006600; font-weight:bold;">&#91;</span>
  <span style="color:#996600;">'/path/to/docu/wiki/installation1'</span>,
  <span style="color:#996600;">'/path/to/docu/wiki/installation2'</span>
<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">freeze</span></pre></div></div>

<p>Then you can call for a new release as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>script<span style="color: #000000; font-weight: bold;">/</span>upgrade_dokuwiki.rb http:<span style="color: #000000; font-weight: bold;">//</span>www.splitbrain.org<span style="color: #000000; font-weight: bold;">/</span>_media<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>dokuwiki<span style="color: #000000; font-weight: bold;">/</span>dokuwiki-<span style="color: #000000;">2009</span>-<span style="color: #000000;">12</span>-25c.tgz</pre></div></div>

<p>If you want to improve the script, feel free to fork me on <a href="http://gist.github.com/285219">Gist</a>.</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/pjHuu0shCLU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2010/01/24/a-ruby-script-for-upgrading-multiple-dokuwiki-installations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speeding up iterative calculation in Ruby</title>
		<link>http://jthoenes.bergischweb.de/2009/02/27/speeding-up-iterative-calculation-in-ruby/</link>
		<comments>http://jthoenes.bergischweb.de/2009/02/27/speeding-up-iterative-calculation-in-ruby/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 17:45:18 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Thesis]]></category>
		<category><![CDATA[Klinische Studien]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=64</guid>
		<description><![CDATA[The domain background of my diploma thesis is sample size calculation for clinical trials &#8211; in fact simulation of those. This means I need to calculate how many probands or trial subjects are needed, to get the result with a certain error propability (I don&#8217;t mind going into detail right here). The procedures for sample [...]]]></description>
			<content:encoded><![CDATA[<p>The domain background of my diploma thesis is sample size calculation for clinical trials &#8211; in fact simulation of those. This means I need to calculate how many probands or trial subjects are needed, to get the result with a certain error propability (I don&#8217;t mind going into detail right here).</p>
<p>The procedures for sample size calculation are well published, but some of those work in a manner like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> calculate_sample_size
  n = <span style="color:#006666;">4</span> <span style="color:#008000; font-style:italic;"># 4 is a good starting point</span>
          <span style="color:#008000; font-style:italic;"># a we have 2 arms minimum and a trial with propability involved need 2 probands at least</span>
  <span style="color:#CC0066; font-weight:bold;">loop</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> n <span style="color:#9966CC; font-weight:bold;">if</span> fullfills_a_some_mathematical_condition<span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span>
    n <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>So we need to return the smallest integer fulfilling a certain condition and we need to iterate up to this one, testing against a condition each time.</p>
<p>The above works, but has a big problem: I&#8217;m doing it for at least 10 million times, usually around 100 million times. Caching is not an option here, as we are dealing with stocastic we don&#8217;t have deterministic parameters (those parameters are hidden in the code above). </p>
<p>But, going back to my computer science books, I found &#8216;binary search&#8217; which I applied for this &#8211; of course with a Ruby closure:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> IterationHelper
  <span style="color:#008000; font-style:italic;"># This is the entry point for the iteration</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> iterate_up start = <span style="color:#006666;">0</span>, step = <span style="color:#006666;">1000</span>, <span style="color:#006600; font-weight:bold;">&amp;</span>block
    max = start
    <span style="color:#008000; font-style:italic;"># First we need to find the a maximum, because in theory we have infinite integers</span>
    <span style="color:#008000; font-style:italic;"># I define the step parameters, as for some sample size calculation, there is a way to guess those to</span>
    <span style="color:#008000; font-style:italic;">#   some extend.</span>
    <span style="color:#008000; font-style:italic;"># I could of course start with Fixnum::MAX but I in my case this is faster</span>
    <span style="color:#9966CC; font-weight:bold;">until</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>max<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      max <span style="color:#006600; font-weight:bold;">+</span>= step
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Now that we know the range where to look for the smallest match</span>
    find_smallest_satisfier<span style="color:#006600; font-weight:bold;">&#40;</span>max <span style="color:#006600; font-weight:bold;">-</span> step, max, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
  private
  <span style="color:#008000; font-style:italic;"># This works nearly exactly as textbooks binary sort</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> find_smallest_satisfier min, max, <span style="color:#006600; font-weight:bold;">&amp;</span>block
&nbsp;
    <span style="color:#008000; font-style:italic;"># If min and max differ less than 2, we have found the smallest n</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> max <span style="color:#006600; font-weight:bold;">-</span> min <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006666;">2</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> min <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>min<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> max
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Get the value in the middle</span>
    n = min <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006600; font-weight:bold;">&#40;</span>max<span style="color:#006600; font-weight:bold;">-</span>min<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006666;">2</span>
    <span style="color:#008000; font-style:italic;"># If yield(n) ==&gt; value might be smaller</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> find_smallest_satisfier<span style="color:#006600; font-weight:bold;">&#40;</span>min, n, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#008000; font-style:italic;"># Unless yield(n) ==&gt; value might be bigger</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> find_smallest_satisfier<span style="color:#006600; font-weight:bold;">&#40;</span>n, max, <span style="color:#006600; font-weight:bold;">&amp;</span>block<span style="color:#006600; font-weight:bold;">&#41;</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></div></div>

<p>This leeds to a much cleaner call like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">include</span> IterationHelper
<span style="color:#9966CC; font-weight:bold;">def</span> sample_size
  iterate_up <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>n<span style="color:#006600; font-weight:bold;">|</span> fullfills_a_some_mathematical_condition<span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
 <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>But &#8211; i did say &#8211; I didn&#8217;t do this for cleaner calls. So I did a litte benchmark:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'lib/helpers/iteration_helper'</span>
<span style="color:#9966CC; font-weight:bold;">include</span> IterationHelper
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'benchmark'</span>
<span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#CC00FF; font-weight:bold;">Benchmark</span>
&nbsp;
N = <span style="color:#006666;">10</span><span style="color:#006600; font-weight:bold;">**</span><span style="color:#006666;">3</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> complex_calculation n
  <span style="color:#008000; font-style:italic;"># some dummy calculations</span>
  10.<span style="color:#9900CC;">times</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#CC00FF; font-weight:bold;">Math</span>.<span style="color:#9900CC;">sqrt</span> <span style="color:#CC00FF; font-weight:bold;">Kernel</span>.<span style="color:#CC0066; font-weight:bold;">rand</span><span style="color:#006600; font-weight:bold;">&#125;</span>
  n <span style="color:#006600; font-weight:bold;">&gt;</span>= <span style="color:#0066ff; font-weight:bold;">@n_0</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#0066ff; font-weight:bold;">@targets</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">25</span>, <span style="color:#006666;">105</span>, <span style="color:#006666;">234</span>, <span style="color:#006666;">500</span>, <span style="color:#006666;">765</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
&nbsp;
bm<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">7</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;normal&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#0066ff; font-weight:bold;">@targets</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>t<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#0066ff; font-weight:bold;">@n_0</span> = t
      N.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        m = <span style="color:#006666;">4</span>
        <span style="color:#CC0066; font-weight:bold;">loop</span> <span style="color:#9966CC; font-weight:bold;">do</span>
           <span style="color:#9966CC; font-weight:bold;">break</span> <span style="color:#9966CC; font-weight:bold;">if</span> complex_calculation<span style="color:#006600; font-weight:bold;">&#40;</span>m<span style="color:#006600; font-weight:bold;">&#41;</span>
           m <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</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>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;binary&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#0066ff; font-weight:bold;">@targets</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>t<span style="color:#006600; font-weight:bold;">|</span>
        <span style="color:#0066ff; font-weight:bold;">@n_0</span> = t
        N.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        iterate_up<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">4</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>n<span style="color:#006600; font-weight:bold;">|</span> complex_calculation<span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</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>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The result was very impressing:</p>
<p><code>             user     system      total        real<br />
normal  12.210000   0.030000  12.240000 ( 15.631090)<br />
binary   0.520000   0.010000   0.530000 (  0.778788)</code></p>
<p>You should &#8211; of course &#8211; expect the iteration do do better, when the actual satisfaction test needs less mathematics, but perform worse if the mathematics are more time consuming (which mine are).</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/c5acrzQaxPA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2009/02/27/speeding-up-iterative-calculation-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Argument Fun with Ruby</title>
		<link>http://jthoenes.bergischweb.de/2009/02/03/argument-fun-with-ruby/</link>
		<comments>http://jthoenes.bergischweb.de/2009/02/03/argument-fun-with-ruby/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 18:02:32 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Thesis]]></category>
		<category><![CDATA[Klinische Studien]]></category>
		<category><![CDATA[Meta-Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=38</guid>
		<description><![CDATA[As some of you might know, my diploma thesis is on simulation with the help of an internal ruby DSL. This DSL will be &#8211; at least I hope so &#8211; full of small little interesting things, making the life of those who use the DSL (i.e. biometricians) easier. This requires some interesting stuff on [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you might know, my diploma thesis is on simulation with the help of an internal ruby DSL. This DSL will be &#8211; at least I hope so &#8211; full of small little interesting things, making the life of those who use the DSL (i.e. <span>biometricians) easier. This requires some interesting stuff on ruby meta programming, that will be posted &#8211; as done -  in this blog. One of them is a thing I call &#8220;multiple parameters&#8221;. So what is it all about?</span></p>
<p><span>First of all we have a method in the DSL:<br />
</span></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">simulate <span style="color:#9966CC; font-weight:bold;">do</span>
<span style="color:#008000; font-style:italic;"># Some other definition ...</span>
arms <span style="color:#9966CC; font-weight:bold;">do</span>
treatment N<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>, <span style="color:#006666;">0.1</span>, <span style="color:#006666;">0.3</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>
placebo N<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span>,<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#008000; font-style:italic;"># Some more definitions ...</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The intersting thing happens when you call the N function. If you just call it with simple numeric arguments, you get back a normal distributed sampler. If you call it with an array as one or more arguments, you get back the multiple normal distributed samples &#8211; constructed from the cartesian product of all params. This means, the treatment will get the Array as if you called:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&#91;</span>N<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span>,<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>, N<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0.1</span>,<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>, N<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0.3</span>,<span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span></pre></div></div>

<p>The idea behind this is, that if you specify those multiple parameters for the simulation, the simulation is run multiple times &#8211; each time with a sligly different set of definitions.</p>
<p>A direct implementation wouldn&#8217;t be to hard &#8211; at least we are doing ruby. But as this is not only related to the N method, but to a lot of other things as well, I wanted to extract this rather into a model so I could write the N method something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> DistributionHelper
  extend MultipleParameters
  <span style="color:#9966CC; font-weight:bold;">def</span> N mean, variance
    <span style="color:#6666ff; font-weight:bold;">Distribution::Gauss</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>mean,variance<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  mutate_params <span style="color:#ff3333; font-weight:bold;">:N</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The MultipleParameters module is implemented following the path, Dave Thomas led in his 5th Episode of &#8220;The Ruby Object Model and Metaprogramming&#8221; for memorization. I&#8217;ll try to explain the module but first have the implementation:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> MultipleParameters
  <span style="color:#9966CC; font-weight:bold;">def</span> mutate_params<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
    original_method = instance_method<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    define_method<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|*</span>args<span style="color:#006600; font-weight:bold;">|</span>
      mutated_arguments = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      args.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>arg<span style="color:#006600; font-weight:bold;">|</span>
        <span style="color:#9966CC; font-weight:bold;">if</span> arg.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">Array</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          new_results = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
          mutated_arguments.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>r<span style="color:#006600; font-weight:bold;">|</span>
            arg.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>a<span style="color:#006600; font-weight:bold;">|</span>
              rm = r.<span style="color:#9900CC;">clone</span>
              rm <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&lt;</span> a
              new_results <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> rm
            <span style="color:#9966CC; font-weight:bold;">end</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
          mutated_arguments = new_results
        <span style="color:#9966CC; font-weight:bold;">else</span>
          mutated_arguments.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>r<span style="color:#006600; font-weight:bold;">|</span> r <span style="color:#006600; font-weight:bold;">&amp;</span>lt;<span style="color:#006600; font-weight:bold;">&amp;</span>lt; arg  <span style="color:#006600; font-weight:bold;">&#125;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      bound_method = original_method.<span style="color:#9900CC;">bind</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      ret = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      mutated_arguments.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>mutated_args<span style="color:#006600; font-weight:bold;">|</span>
        ret <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> bound_method.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">*</span>mutated_args<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#006600; font-weight:bold;">&#40;</span>ret.<span style="color:#9900CC;">size</span> == <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? ret.<span style="color:#9900CC;">first</span> : ret
    <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></div></div>

<p>So this is a class-level module (i.e. you need to get access to class methods rather than object methods) so you extend your class/module with it rather than including it. After having done this, you can call the mutate_params method for any previously defined method. When called, your originally defined method will get boxed into an object (line 3) and it will be redefinded. The redefined method will create the cartesian product of the argumenes (i.e. ([0,1], [1,2]) yields to (0,1), (0,2), (1,1) and (1,2)) and than create an array of all the results from the calls. Before beeing able to call the originally defined method you have to bind the method to the current self (line 24), because the method will be called as an object method, and than passing all different parameter sets to it.</p>
<p>Finally you have an array of all return values which is returned. The last line is somewhat of convinience as it returns the object directly if you did not specify any multiple parameters.</p>
<p>Note: This approach does not work, if you original method needs an array to be passed. I will probably extends the approach in the future to work with ranges as well.</pre>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/24BM4dkmojY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2009/02/03/argument-fun-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RANDI2 Day of Code</title>
		<link>http://jthoenes.bergischweb.de/2008/11/12/randi2-day-of-code/</link>
		<comments>http://jthoenes.bergischweb.de/2008/11/12/randi2-day-of-code/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 13:36:49 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Studium MI]]></category>
		<category><![CDATA[Code Event]]></category>
		<category><![CDATA[Randi2]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=31</guid>
		<description><![CDATA[ich möchte euch an dieser Stelle kurz auf den RANDI2 Day of Code am 28.11 in der Hochschule Heilbronn hinweisen. Details dazu im Projektblog: http://randi2.hs-heilbronn.de/blog/index.php/2008/11/12/randi2-day-of-code]]></description>
			<content:encoded><![CDATA[<p>ich möchte euch an dieser Stelle kurz auf den RANDI2 Day of Code am 28.11 in der Hochschule Heilbronn hinweisen. Details dazu im Projektblog: <a href="http://randi2.hs-heilbronn.de/blog/index.php/2008/11/12/randi2-day-of-code">http://randi2.hs-heilbronn.de/blog/index.php/2008/11/12/randi2-day-of-code</a></p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/P03ZMIdBXjA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2008/11/12/randi2-day-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print-Version anzeigen mit Greasemonkey und JQuery</title>
		<link>http://jthoenes.bergischweb.de/2008/08/14/print-version-anzeigen-mit-greasemonkey-und-jquery/</link>
		<comments>http://jthoenes.bergischweb.de/2008/08/14/print-version-anzeigen-mit-greasemonkey-und-jquery/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 09:29:11 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Grease Monkey]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=20</guid>
		<description><![CDATA[Ich habe in letzter Zeit viel mit JQuery gearbeitet und als erste Javascript-Bibliothek habe ich bei JQuery das Gefühl, dass man richtig schönen Code schreiben kann. Nun trug es sich aber zu (;-)), dass heise.de sein Design geändert hat. Mich hat deren Design schon vorhher immer genervt, wenn ich aus meinem RSS-Reader auf die einzelnen [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe in letzter Zeit viel mit <a href="http://jquery.com" target="_blank">JQuery</a> gearbeitet und als erste Javascript-Bibliothek habe ich bei JQuery das Gefühl, dass man richtig schönen Code schreiben kann.</p>
<p>Nun trug es sich aber zu (;-)), dass heise.de sein Design geändert hat. Mich hat deren Design schon vorhher immer genervt, wenn ich aus meinem RSS-Reader auf die einzelnen Artikel bin. Aber jetzt war definitiv die Schmerzensgrenze überschritten. Um nicht alle Elemente nachstylen zu müssen (was ja auch sehr fragil ist, da die ids und classes ja jederzeit geändert werden können), habe ich mir überlegt, das ich erstmal die Styles der Printversion nehme. Das ging erstaunlich einfach:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Erstmal JQuery ins Dokument einführen</span>
<span style="color: #006600; font-style: italic;">// Der Code zum einbinden von JQuer ist ist von:</span>
<span style="color: #006600; font-style: italic;">// http://www.joanpiedra.com/jquery/greasemonkey/ und ist unter MIT-Lizenz gestellt</span>
<span style="color: #006600; font-style: italic;">// Kommentare sind angepasst.</span>
<span style="color: #003366; font-weight: bold;">var</span> GM_JQ <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
GM_JQ.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://jquery.com/src/jquery-latest.js'</span><span style="color: #339933;">;</span>
GM_JQ.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'head'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>GM_JQ<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Warten bis JQuery nachgeladen ist</span>
<span style="color: #003366; font-weight: bold;">function</span> GM_wait<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> unsafeWindow.<span style="color: #660066;">jQuery</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>GM_wait<span style="color: #339933;">,</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> $ <span style="color: #339933;">=</span> unsafeWindow.<span style="color: #660066;">jQuery</span><span style="color: #339933;">;</span> letsJQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
GM_wait<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Das normale Greasemonkey Skript, nur jetzt mit JQuery</span>
<span style="color: #003366; font-weight: bold;">function</span> letsJQuery<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Lösche alle Stylesheets die nicht media=print sind</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'link[rel=stylesheet]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">not</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[media=print]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Ändere das media von print auf screen</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'link[rel=stylesheet]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[media=print]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'media'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'screen'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Ich habe das Skript speziell für heise.de noch etwas erweitert &#8230; wen das interessiert, der möge mich ansprechen.</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/GUlxNVwyOrs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2008/08/14/print-version-anzeigen-mit-greasemonkey-und-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wahl zum Senat und Fakultätsrat 2008</title>
		<link>http://jthoenes.bergischweb.de/2008/06/10/wahl-zum-senat-und-fakultatsrat-2008/</link>
		<comments>http://jthoenes.bergischweb.de/2008/06/10/wahl-zum-senat-und-fakultatsrat-2008/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 08:21:30 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Studium MI]]></category>
		<category><![CDATA[Hochschule]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=12</guid>
		<description><![CDATA[Ich habe soeben meine Briefwahl zum Senat der Hochschule Heilbronn und zum Fakultätsrat Fakultät IT an der Hochschule Heilbronn getätigt. Wer nicht per Brief wählt, sollte nicht vergessen, am 12. Juni in der Hochschule vorbeizukommen und sein Stimmrecht auszuüben &#8211; es geht um einiges. Ich möchte an dieser Stelle &#8211; zumindest partiell &#8211; das Wahlgeheimnis [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe soeben meine Briefwahl zum Senat der Hochschule Heilbronn und zum Fakultätsrat Fakultät IT an der Hochschule Heilbronn getätigt. Wer nicht per Brief wählt, sollte nicht vergessen, am 12. Juni in der Hochschule vorbeizukommen und sein Stimmrecht auszuüben &#8211; es geht um einiges.</p>
<p>Ich möchte an dieser Stelle &#8211; zumindest partiell &#8211; das Wahlgeheimnis aussetzen: Ich habe eine Stimme für den Senat Sandra Scheel gegeben. Und alle anderen empfehle ich, dass selbe zu tun (und ggf. auch darüber zu bloggen &#8230;).</p>
<p>Ich kenne Sandra vor allem von Theater &#8211; sie hat sich damals extrem schnell in die Gruppe eingefunden und auch Verantwortung übernommen. Sie war immer zuverlässig (was man beim besten Willen nicht von allen bei uns behaupten kann!) und hat das, was sie uns zugesagt hat, stets auch getan. Ich glaube, das sie die richtige ist, uns Studenten im Senat zu vertreten und bin mir sicher, dass sie für Anliegen ein offenes Ohr hat.</p>
<p>Insofern: VOTE FOR SANDRA!</p>
<p>P.S.: Bevor es jemand anmerkt. Sandra tritt in einem Team von vier Studenten auf &#8211; kann aber einzeln gewählt werden.</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/YSHY73q26II" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2008/06/10/wahl-zum-senat-und-fakultatsrat-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Der MIdizini Podcast geht online …</title>
		<link>http://jthoenes.bergischweb.de/2008/04/28/der-midizini-podcast-geht-online/</link>
		<comments>http://jthoenes.bergischweb.de/2008/04/28/der-midizini-podcast-geht-online/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 21:52:15 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Studium MI]]></category>
		<category><![CDATA[Medizinische Informatik]]></category>
		<category><![CDATA[Meine Projekte]]></category>
		<category><![CDATA[Podcast]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=11</guid>
		<description><![CDATA[Liebe Blogleser, der eine oder andere von euch hat in den letzten Tagen vielleicht schon das eine oder andere meinem neusten Projekt gehört. Ab jetzt geht es also los: Der MIdizini Podcast In diesem Podcast möchte ich &#8211; zusammen mit Hauke Hund &#8211; ca. alle 4 Wochen Projekte innerhalb des MI Studiums beleuchten. Dazu werden [...]]]></description>
			<content:encoded><![CDATA[<p>Liebe Blogleser,</p>
<p>der eine oder andere von euch hat in den letzten Tagen vielleicht schon das eine oder andere meinem neusten Projekt gehört. Ab jetzt geht es also los:</p>
<p><a class="aligncenter" title="Der MIdizini Podcast" href="http://midizini.bergischweb.de" target="_self"><strong>Der MIdizini Podcast</strong></a></p>
<p>In diesem Podcast möchte ich &#8211; zusammen mit Hauke Hund &#8211; ca. alle 4 Wochen Projekte innerhalb des MI Studiums beleuchten. Dazu werden wir mit Teilnehmern der verschiedenen Projekte Interviews führen. Den Anfang hat Herr Haag gemacht &#8211; natürlich mit dem CAMPUS Projekt. Ich hoffe das diese Angebot viele Studenten interessiert. Hauke und ich sind schon gespannt auf eure Rückmeldungen &#8230; also lasst und wissen, was euch gefällt und was nicht.</p>
<p>Wer mehr über die Idde und Hintergründe zum Podcast erfahren will, kann dies erfahren unter: <a href="http://midizini.bergischweb.de/blog/derpodcast/">http://midizini.bergischweb.de/blog/derpodcast/</a></p>
<p>Die Länge des Podcasts ist übrigens genau auf eine Zugfahrt zwischen HD und HN bzw. zurück zugeschnitten. Vorbild für den Podcast war &#8211; zumindest für mich &#8211; der exzellente Podcast SE-Radio (<a href="http://www.se-radio.net">http://www.se-radio.net</a>) den ich übrigens auch jedem nur empfehlen kann &#8230;</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/whkyHn3qQZI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2008/04/28/der-midizini-podcast-geht-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lesenswerte Artikel von mir und anderen</title>
		<link>http://jthoenes.bergischweb.de/2008/04/25/lesenswerte-artikel-von-mir-und-anderen/</link>
		<comments>http://jthoenes.bergischweb.de/2008/04/25/lesenswerte-artikel-von-mir-und-anderen/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 19:04:21 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Various]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=10</guid>
		<description><![CDATA[Ich persönlich bin ja der Meinung, dass das Web 2.0 hauptsächlich Content Produziert &#8230; aber keine Inhalte. Oder um es mit den Worten von Frau Knaup zu sagen: Daten und keine Informationen &#8211; wobei die Frage, ob sinnlose Informationen wirklich Daten sind möglichweise längere Diskussionen nach sich ziehen könnte &#8230; Aber, ich habe jetzt was [...]]]></description>
			<content:encoded><![CDATA[<p>Ich persönlich bin ja der Meinung, dass das Web 2.0 hauptsächlich Content Produziert &#8230; aber keine Inhalte. Oder um es mit den Worten von Frau Knaup zu sagen: Daten und keine Informationen &#8211; wobei die Frage, ob sinnlose Informationen wirklich Daten sind möglichweise längere Diskussionen nach sich ziehen könnte &#8230;</p>
<p>Aber, ich habe jetzt was gefunden was ich echt hilfreich finde: Empfohle Blogpost im Google Reader. Hier kann ich meine Empfehlungen zu Posts &#8211; die ich persönlich gut gefunden habe &#8211; als RSS-Feed weitergeben. Natürlich funktioniert das nur, wenn euch auch die Dinge gefallen die mir gefallen. Ist das der Fall, so könnt ihr den Feed (ab jetzt Rechts in meinem Blog zu finden) abonnieren. Wenn nicht &#8230; naja, gut stört mich auch nicht.</p>
<p>Was ich habe gerne hätte wären andere Menschen, die dieses  Feature (oder ähnliche Features, denn ich glaube nicht dass es das nur bei Google Reader gibt) nutzen und mir die Feedadresse mitteilen. Man kann ja nicht alle Feeds lesen und möchte nichts verpassen. Also: Her mit euren Empfehlungen.</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/mBYQZcJH-bU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2008/04/25/lesenswerte-artikel-von-mir-und-anderen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>EURUKO 2008</title>
		<link>http://jthoenes.bergischweb.de/2008/03/31/euruko-2008/</link>
		<comments>http://jthoenes.bergischweb.de/2008/03/31/euruko-2008/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 14:27:01 +0000</pubDate>
		<dc:creator>Johannes Thönes</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jthoenes.bergischweb.de/?p=8</guid>
		<description><![CDATA[Wie der eine oder andere von euch mitbekommen hat, bin ich dieses Wochenende auf der European Ruby Conference in Prag gewesen. Damit die Banausen, die zu Hause geblieben sind auch ungefähr mitbekommen, was sich dort so abgespielt hat, hier eine kurze Zusammenfassung von mir: Ruby 1.9 Matz und Koichi Sasada haben das neue Ruby 1.9 [...]]]></description>
			<content:encoded><![CDATA[<p>Wie der eine oder andere von euch mitbekommen hat, bin ich dieses Wochenende auf der European Ruby Conference in Prag gewesen. Damit die Banausen, die zu Hause geblieben sind auch ungefähr mitbekommen, was sich dort so abgespielt hat, hier eine kurze Zusammenfassung von mir:</p>
<p><strong>Ruby 1.9</strong></p>
<p>Matz und Koichi Sasada haben das neue Ruby 1.9 vorgestellt. Und einen Überblick darüber gegeben, was war, was ist und was noch  kommen wird. Neben den technischen Details (die man übrigens sehr gut auch aus dem Google TechTalk Vortrag von Matz entnehmen kann) hat Matz vorallem herausgehoben, dass für ihn die Innovation der Sprache Ruby sehr wichtig ist. Er möchte nicht mit dem zufrieden sein was ist, sondern möchte weiter gehen und Ruby weiter entwickeln.<br />
Weiterhin ist natürlich zu erwähnen: Ruby programming is fun &#8230;</p>
<p><strong>JRuby</strong></p>
<p>Für mich war JRuby die absolute Überraschung. Bisher hat man sich immer gefragt, was eigentlich JRuby soll &#8211; nun im Prinzip ist JRuby dazu da, Ruby Code zu schreiben und gleichzeitig Java-Klassen zu verwenden. Whant so see some?<br />
<em>(Nach Installation via apt-get install jruby1.0 und interaktiv, also jirb1.0)</em></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'java'</span>
include_class <span style="color:#996600;">'javax.swing.JFrame'</span>
include_class <span style="color:#996600;">'javax.swing.JLabel'</span>
include_class <span style="color:#996600;">'java.awt.event.ActionListener'</span>
include_class <span style="color:#996600;">'javax.swing.JOptionPane'</span>
&nbsp;
frame = JFrame.<span style="color:#9900CC;">new</span> <span style="color:#996600;">&quot;Das JRuby Fenster&quot;</span>
frame.<span style="color:#9900CC;">setSize</span> <span style="color:#006666;">400</span>,<span style="color:#006666;">200</span>
<span style="color:#008000; font-style:italic;"># Überlagerter Setter von</span>
<span style="color:#008000; font-style:italic;"># frame.set_default_close_operation(JFrame::EXIT_ON_CLOSE)</span>
frame.<span style="color:#9900CC;">default_close_operation</span>=<span style="color:#6666ff; font-weight:bold;">JFrame::EXIT_ON_CLOSE</span>
label = JLabel.<span style="color:#9900CC;">new</span> <span style="color:#996600;">&quot;Hello World&quot;</span>
frame.<span style="color:#9900CC;">add</span> label
&nbsp;
frame.<span style="color:#9900CC;">visible</span>= <span style="color:#0000FF; font-weight:bold;">true</span></pre></div></div>

<p>Dinge wie obejct.method etc gehen natürlich auch, sodass man super neuer Java-Bibliotheken über jruby ausprobieren kann, selbst wenn man sie &#8216;nur&#8217; für Java selbst verwenden will.<br />
Übrigens wurde die 1.1 Release während der Konferenz bekannt gegeben.</p>
<p><strong>Weitere Vorträge</strong></p>
<p>Wurden auch gehalten. Alle waren sehr interessant und haben vorallem eines gezeigt: Mit Ruby kann man verdammt viel mehr machen, als bloß Rails. Und dass heißt ja nun wirklich etwas &#8230; Ich fands jedenfalls sehr cool (schon alleine wegen der T-Shirts <img src='http://jthoenes.bergischweb.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> )</p>
<p>Die Folien sollten in Kürze http://www.euruko2008.org zu finden sein.</p>
<img src="http://feeds.feedburner.com/~r/jthoenes/~4/Y38DLiLwVDY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jthoenes.bergischweb.de/2008/03/31/euruko-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
