<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts By Year on winfonet.eu</title><link>https://winfonet.eu/en/posts/index.html</link><description>Recent content in Posts By Year on winfonet.eu</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 17 Oct 2023 21:09:00 +0200</lastBuildDate><atom:link href="https://winfonet.eu/en/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>How A Girl Spoiled The Marshmallow Experiment</title><link>https://winfonet.eu/en/posts/marshmallow-experiment.html</link><pubDate>Tue, 17 Oct 2023 21:09:00 +0200</pubDate><guid>https://winfonet.eu/en/posts/marshmallow-experiment.html</guid><description>&lt;figure&gt;
&lt;img src="https://winfonet.eu/posts/marshmallow-experiment/hero.webp" alt="Marshmallows"/&gt;&lt;figcaption&gt;
Marshmallows |&amp;nbsp;&lt;a href="https://commons.wikimedia.org/wiki/File:Marshmallows.JPG" target="_blank" title="Proceed to original picture at wikimedia.org"&gt;&amp;copy; Wikimedia Commons&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en" target="_blank" hreflang="en" title="Proceed to CC BY-SA 4.0 Deed at creativecommons.org"&gt;CC BY-SA 4.0&lt;/a&gt;
&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I have recently watched a video of a lecture &lt;em&gt;The mystery of the human being, from the ancient times until today&lt;/em&gt;. At &lt;a href="https://www.youtube.com/watch?v=toSN5XU6ht0&amp;t=3985s" target="_blank" hreflang="de" title="Proceed to video at youtube.com"&gt;minute 56 of the video (in German)&lt;/a&gt; Prof. Dr. Daum talks about an incident during a marshmallow experiment.&lt;/p&gt;
&lt;h2 id="detailed-procedure"&gt;Detailed procedure&lt;/h2&gt;
&lt;p&gt;During the marshmallow experiment the experimenter presents a marshmallow to a child. The experimenter tells the child that he/she&amp;rsquo;ll get a second one, if he/she manages not to eat the first one immediately, but is able to wait for a certain amount of time (usually around 15 minutes). The experiment is about the abillity to wait in expectation of a greater reward and to stand the feeling delayed of gratification.&lt;/p&gt;</description></item><item><title>Java: Checked Exceptions Without Throws-clause</title><link>https://winfonet.eu/en/posts/java-checked-exceptions-without-throws.html</link><pubDate>Thu, 19 Jan 2017 00:00:00 +0200</pubDate><guid>https://winfonet.eu/en/posts/java-checked-exceptions-without-throws.html</guid><description>&lt;figure&gt;
&lt;img src="https://winfonet.eu/posts/java-checked-exceptions-ohne-throws/hero.webp" alt="Footballplayers throw/catch ball"/&gt;&lt;figcaption&gt;
Footballplayers throw/catch ball | trimmed |&amp;nbsp;&lt;a href="https://commons.wikimedia.org/wiki/File:Alex_Smith_throw_(50611113126).jpg" target="_blank" title="Procced to original picture at wikimedia.org"&gt;&amp;copy; Wikimedia Commons&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a href="https://creativecommons.org/licenses/by-sa/2.0/deed.en" hreflang="en" target="_blank" title="Proceed to CC BY-SA 2.0 Deed ad creativecommons.org"&gt;CC BY-SA 2.0 Deed&lt;/a&gt;
&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Code that potentially throws checked exceptions, is often processed within a &lt;em&gt;try-catch&lt;/em&gt; block. Two posibilities exist to forward caught exception to the caller:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Wrap checked exception into an instance of &lt;code&gt;RuntimeException&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Declare a &lt;code&gt;throws&lt;/code&gt;-clause&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Both may be undesired. This article describes a technice to throw checked exceptions without the need of either. The technique is called &lt;em&gt;throw sneaky&lt;/em&gt;. It is implemented as a static method:&lt;/p&gt;</description></item><item><title>Eclipse: Flip arguments using regular expressions</title><link>https://winfonet.eu/en/posts/eclipse-flip-method-args.html</link><pubDate>Fri, 09 Sep 2011 00:00:00 +0200</pubDate><guid>https://winfonet.eu/en/posts/eclipse-flip-method-args.html</guid><description>&lt;figure&gt;
&lt;img src="https://winfonet.eu/posts/eclipse-methodenargumente-vertauschen/hero.webp" alt="Symbolic picture of a flip-action A,T tp T,A"/&gt;&lt;figcaption&gt;
Symbolic picture of a flip-action |&amp;nbsp;&lt;a href="https://commons.wikimedia.org/wiki/File:Zweitore_vertauschen.svg" target="_blank" title="Procced to original picture at wikimedia.org"&gt;&amp;copy; Wikimedia Commons&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a href="https://creativecommons.org/publicdomain/zero/1.0/deed.en" hreflang="en" target="_blank" title="Proceed to CC0 1.0 Deed at creativecommons.org"&gt;CC0 1.0 Deed&lt;/a&gt;
&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Lately I have migrated a project from &lt;em&gt;JUnit&lt;/em&gt; to &lt;em&gt;TestNG&lt;/em&gt;. With the help of an Ecplipse plugin this is a one-click task. Every assert-method is replaced by its counterpart in class &lt;code&gt;org.testng.AssertJUnit&lt;/code&gt;. This is only an intermediate solution. The final goal is to use &lt;code&gt;org.testng.Assert&lt;/code&gt;. This will present a small challenge. JUnit&amp;rsquo;s two arg assert-methods, e.g. &lt;code&gt;assertEquals&lt;/code&gt; or &lt;code&gt;assertSame&lt;/code&gt; define order &lt;em&gt;expected, actual&lt;/em&gt;. TestNG defines the opposite. Therefore argument order needs to be flipped.&lt;/p&gt;</description></item></channel></rss>