<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-25217618</atom:id><lastBuildDate>Sun, 24 Aug 2008 06:14:00 +0000</lastBuildDate><title>blog://gestalt.monoid.net</title><description/><link>http://gestalt.monoid.net/blog/</link><managingEditor>noreply@blogger.com (Michael Nischt)</managingEditor><generator>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-7178683222564070138</guid><pubDate>Sat, 12 Apr 2008 09:51:00 +0000</pubDate><atom:updated>2008-04-12T11:29:00.415+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Scala</category><category domain='http://www.blogger.com/atom/ns#'>Java</category><category domain='http://www.blogger.com/atom/ns#'>Nonsense</category><title>Shell History Meme</title><description>Reading &lt;a href="http://yclian.blogspot.com/2008/04/im-java-guy.html" target="meme"&gt;YC's post&lt;/a&gt; about the meme happening at the &lt;a href="http://planet.fedoraproject.org/" target="meme"&gt;Fedora Planet&lt;/a&gt;, I also gave it a try:&lt;br /&gt;&lt;br /&gt;history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head&lt;br /&gt;&lt;br /&gt;113 cd&lt;br /&gt;88 ls&lt;br /&gt;53 hg&lt;br /&gt;38 ant&lt;br /&gt;28 fsc&lt;br /&gt;23 ln&lt;br /&gt;17 ssh&lt;br /&gt;13 java&lt;br /&gt;10 ../../../bin/java&lt;br /&gt;9 scala&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;In words:&lt;br /&gt;&lt;/span&gt;I am guy who likes to be at many places [cd] and to know the surroundings [ls] - I try to keep record of everything [hg]. Further, I don't want to bother with annoying repetitive tasks: things should be done automatically [ant] and fast [fsc]. Mental links [ln] help me not to get lost while my mind is far away [ssh]. Finally, you know I used to program in Java [java,../../../bin/java] but nothing can stop the rise of Scala [scala]. ;-)&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2008/04/shell-history-meme.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-7007195163226519827</guid><pubDate>Sat, 02 Feb 2008 02:37:00 +0000</pubDate><atom:updated>2008-08-24T07:13:21.160+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Scala</category><category domain='http://www.blogger.com/atom/ns#'>Textmate</category><title>A *new* Scala Bundle for Textmate</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.scala-lang.org" target="scala"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 80px;" src="http://gestalt.monoid.net/blog/images/scala.jpg" border="0" alt=""/&gt;&lt;/a&gt; No doubt, the upcoming &lt;a href="http://blogtrader.net/page/dcaoyuan/entry/scala_on_netbeans_modules_on" target="dcaoyuan"&gt;Scala Module&lt;/a&gt; will make &lt;a href="http://www.netbeans.org/" target="netbeans"&gt;Netbeans&lt;/a&gt; the No.1 Scala IDE. I use the current pre-release version on my linux box at work without any difficulties. Unfortunately, I have encountered problems running the recommended daily development builds of Netbeans on my private macbook pro. I hoped that I could at least use my favorite editor for MacOS X, &lt;a href="http://macromates.com/"&gt;Textmate&lt;/a&gt;, but the bundle shipped with Scala 2.6.1 still seems to be a dummy/placeholder. Well, instead of falling into a deep depression, I invested half a day to create a new bundle myself.&lt;br /&gt;&lt;br /&gt;For those interested, please find the download below:&lt;br /&gt;&lt;br /&gt;- The &lt;a href="http://gestalt.monoid.net/blog/code/textmate/ScalaBundle.zip"&gt;Scala Bundle&lt;/a&gt;&lt;br /&gt;- An &lt;a href="http://gestalt.monoid.net/blog/code/textmate/ScalaExamples.project.zip"&gt;Example Project&lt;/a&gt; (with some sources ripped from scala-lang.org)&lt;br /&gt;&lt;br /&gt;The main goal was to have simple syntax highlighting, which actually looks quite good using the 'Cobalt Theme'. (I'm not 100% sure that &lt;code&gt;value:&lt;span style="font-weight:bold;"&gt;Type&lt;/span&gt;&lt;/code&gt; is always displayed correctly, but it seemed to work with the samples.)&lt;br /&gt;&lt;br /&gt;Further, there is a template for an &lt;a href="http://ant.apache.org/" target="apache"&gt;Ant&lt;/a&gt;-Script which includes a compile, run &amp; deploy task. These can be executed as bundle commands (menu or shortcuts), if the file is called 'build.xml'. Customization should be easy with a few properties at the top of the file.&lt;br /&gt;&lt;br /&gt;Finally, there are a few snippets to write new code quickly. E.g. typing&lt;br /&gt;&lt;br /&gt;&lt;code&gt;trait -&gt;| Adder -&gt;| def -&gt;| add -&gt;| Int -&gt;| 2 -&gt;| left -&gt;| Int -&gt;| right -&gt;| Int&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;results in&lt;br /&gt;&lt;pre&gt;&lt;code&gt;/**&lt;br /&gt; * Adder&lt;br /&gt; */&lt;br /&gt;trait Adder&lt;br /&gt;{&lt;br /&gt;    def add ( left : Int, right : Int )  : Int&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;without pressing two keys at the same time (no SHIFT)!&lt;br /&gt;&lt;br /&gt;But of course you can sketch your own (and share them with me =) ) !&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2008/02/new-scala-bundle-for-textmate.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-4129008281664689571</guid><pubDate>Thu, 18 Oct 2007 15:15:00 +0000</pubDate><atom:updated>2008-08-24T07:13:42.514+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Scala</category><title>Streams for Incremental and Tail-Recoursive Computing</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.scala-lang.org" target="scala"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 80px;" src="http://gestalt.monoid.net/blog/images/scala.jpg" border="0" alt=""/&gt;&lt;/a&gt; Programming in &lt;a href="http://www.scala-lang.org" target="scala"&gt;Scala&lt;/a&gt; is a lot of fun for me, but I really love &lt;code&gt;Stream&lt;/code&gt;s. Their laziness allows really nice  implementations of incremental algorithms and tail-recursive functions. the best thing is they can be used efficiently under different requirements: no matter if you are interested in each &lt;span style="font-style:italic;"&gt;intermediate&lt;/span&gt; result or only the final one, you'll only need one implementations. =)&lt;br /&gt;&lt;br /&gt;I hope the following example computing the &lt;a href="http://gestalt.monoid.net/blog/code/streams/Streams.scala" target="source"&gt;factorial(s) using Streams&lt;/a&gt; explains it well:&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/streams/Streams.html" width="100%" height="970"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/10/streams-for-incremental-and-tail.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-4157301081570196750</guid><pubDate>Wed, 17 Oct 2007 13:11:00 +0000</pubDate><atom:updated>2008-08-24T07:14:00.972+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Scala</category><title>Building Scala from the Sources</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.scala-lang.org" target="scala"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 80px;" src="http://gestalt.monoid.net/blog/images/scala.jpg" border="0" alt=""/&gt;&lt;/a&gt; As I noticed that the actual &lt;a href="http://www.scala-lang.org" target="scala"&gt;Scala&lt;/a&gt; sources include a great enhancement for all &lt;span style="font-style:italic;"&gt;RandomAccessSeq.Mutable&lt;/span&gt;s, such as &lt;span style="font-style:italic;"&gt;Array&lt;/span&gt; or &lt;span style="font-style:italic;"&gt;ArrayBuffer&lt;/span&gt;: Now, the methods &lt;span style="font-style:italic;"&gt;drop&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;take&lt;/span&gt;, &lt;span style="font-style:italic;"&gt;slice&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;reverse&lt;/span&gt; return a &lt;span style="font-style:italic;"&gt;RandomAccessSeq.MutableProjection&lt;/span&gt;, which allows cool things to be done in O(1), e.g. &lt;code&gt;Array(1,2,3) reverse(0) = 10&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Unable to hold mysself back waiting, I decided try the latest version. All I had to do was to follow these instruction: &lt;a href="http://www.scala-lang.org/downloads/svn.htm" target="scala"&gt;Building Scala 2 from the sources&lt;/a&gt;. Et viola, one can already taste some of the features/fixes scheduled for Scala 2.6.1. =)&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/10/building-scala-from-sources.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-7328056923477125859</guid><pubDate>Sat, 06 Oct 2007 08:20:00 +0000</pubDate><atom:updated>2007-10-06T10:32:43.720+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Life</category><category domain='http://www.blogger.com/atom/ns#'>Random</category><title>11 Amazingly Simple Tricks To Turn Your Brain Into A Powerful Thinking Machine</title><description>Today, I enjoyed reading the article &lt;a href="http://www.bspcn.com/2007/10/05/10-amazingly-simple-tricks-to-turn-your-brain-into-a-powerful-thinking-machine/trackback/" target="_brain_1-10"&gt;10 Amazingly Simple Tricks To Turn Your Brain Into A Powerful Thinking Machine&lt;/a&gt;. Actually, my life includes most of the them since quite a time, except for points 4 and 9. Ok and the first "trick" I only do partly, because I don't focus that much on varying the the subjects - but who's perfect. ;-)&lt;br /&gt;&lt;br /&gt;However one important thing is left on the list, maybe because it is not so simple as the others:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;0. Exercise every 1 or 2 days&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It has been shown recently, that for adults the only way to create new brain cells is &lt;span style="font-style:italic;"&gt;exercise&lt;/span&gt;. Especially these greatly improve learning and memory, if combined with the daily brain training like described in 1-10. The reason is that the new cells get instantly inserted into the neural network where needed, which is a faster process than  optimizing by transforming/rebuilding it.&lt;br /&gt;So this is really step zero, since without challenging the mind (brain training, learning), the new cells will not be linked strong enough and therefore will die within a few weeks.&lt;br /&gt;&lt;br /&gt;Regularly sport and fitness exercises are great, but I believe not using the elevator for changing only 1-3 floors and going small distances by foot or bike are nice additions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1] &lt;a href="http://seniorjournal.com/NEWS/Fitness/2007/7-03-19-FirstProof.htm"&gt;First Proof that Exercise Creates New Cells in Brain Area Affecting Age-Related Memory Loss &lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.spiegel.de/wissenschaft/mensch/0,1518,507829,00.html"&gt;Das Wundermittel namens Bewegung - Hirnforscher revidieren alte Lehrmeinungen&lt;/a&gt; (german)&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/10/11-amazingly-simple-tricks-to-turn-your.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-4139827508792507327</guid><pubDate>Wed, 15 Aug 2007 17:23:00 +0000</pubDate><atom:updated>2007-08-15T20:10:58.181+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Java</category><category domain='http://www.blogger.com/atom/ns#'>RFE</category><title>Named Arguments - Pure Danger (Tech) for Java 7?</title><description>On his blog, Alex Miller is has put up &lt;a href="http://tech.puredanger.com/2007/08/15/dr-java7/"&gt;Some comments on D&amp;R’s Java 7 wishlist&lt;/a&gt;. One is about &lt;span style="font-weight:bold;"&gt;Named Arguments&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;I have seen no one propose this, but I’ve been thinking for a while that it would be really helpful in situations where you have lots of optional parameters. It would be great for constructor injection, argument passing on a program interface, embedded DSLs/fluent interfaces, etc.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I really like the idea of &lt;span style="font-style:italic;"&gt;named arguments&lt;/span&gt;, although I'm not sure if they are the best solution for all the things mentioned above: DSLs in Java? Without operator overloading?.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Anyway, it believe they would make Java Code (even more) readable and the usage could prevent mistakes:&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/namedargs/Compare.html" width="100%" height="190"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Documentation and parameter re-ordering are nice, but it would be really cool to have &lt;span style="font-style:italic;"&gt;default&lt;/span&gt; values along with them:&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/namedargs/Vector3.html" width="100%" height="190"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;However, when does it end? Imagine &lt;span style="font-style:italic;"&gt;indexed varargs&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/namedargs/Matrix3x3.html" width="100%" height="200"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;And did I hear critics say "But named methods can simulated with a dedicated bean (having a corresponding property for each method parameter)!"&lt;br /&gt;Well, that would leads to lots of &lt;span style="font-style:italic;"&gt;grabage&lt;/span&gt; of code (and objects inside the jvm):&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/namedargs/Greetings.html" width="100%" height="285"&gt;&lt;/iframe&gt;&lt;br /&gt;Summing up, I think this would be a minor but not less worth language change to consider for Java 7 (or 8). Especially since everything above should be 100% backward compatible and YOU DON'T HAVE TO USE EM!&lt;br /&gt;&lt;br /&gt;What do you think: Take it or leave it?&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/08/named-arguments-pure-danger-tech-for.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-1380101687284716176</guid><pubDate>Tue, 17 Jul 2007 20:39:00 +0000</pubDate><atom:updated>2007-07-29T17:54:19.015+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Java</category><title>Re: How to write Iterators really REALLY fast (in Java)</title><description>Browsing through the last week entries of my subscriptions, I stumbled across an interesting post entitled &lt;a href="http://chaoticjava.com/posts/how-to-write-iterators-really-really-fast/" target="_chaotic"&gt;"How to write Iterators really REALLY fast"&lt;/a&gt;. It is about simulating the &lt;code&gt;yield&lt;/code&gt; functionality available in C# iterator blocks as of .NET 2.0 - as you might have guessed: it allows to write iterators really fast. =)&lt;br /&gt;&lt;br /&gt;The author presents an example featuring a utility class &lt;code&gt;Yielder&lt;/code&gt;, which provides the same ease-of-use completely without pre-compilers and keyword overrides/additions. However, the implementation details were not published with it - but promised for next week (as of now 'this' week). Feeling eager how this can be done, I tried implementing the interface based on the descriptions in the text and the mentioned examples (one repeated here for convenience):&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;br /&gt;public Iterator iterator() {&lt;br /&gt;  &lt;b&gt;return new Yielder() {&lt;br /&gt;    public void yieldNextCore()&lt;/b&gt; {&lt;br /&gt;      for (Object nextItem : coll) {&lt;br /&gt;        if (pred.evaluate(nextItem)) {&lt;br /&gt;          &lt;b&gt;yieldReturn(nextItem);&lt;/b&gt;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  };&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;However, it turned out that the task was not as easy as I thought. Actually, it took me over one hour to write one and I didn't succeed in making it as efficient as a true "yield".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Probably, the author will soon present a smart solution to the two challenges I encountered:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. How to create more than one &lt;code&gt;Iterator&lt;/code&gt; from a &lt;span style="font-style:italic;"&gt;single&lt;/span&gt; &lt;code&gt;Yielder&lt;/code&gt; instance?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Obviously, &lt;code&gt;yieldReturn&lt;/code&gt; is a method of the &lt;code&gt;Yielder&lt;/code&gt; class, so  it is not (automatically) aware of the a specific &lt;code&gt;Iterator&lt;/code&gt; instance. Therefore, I moved the method (along with a &lt;code&gt;yieldBreak&lt;/code&gt; equivalent) to an interface which will be passed to the iterator-block (&lt;code&gt;yieldNextCore&lt;/code&gt;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. How to avoid multiple iterations without an additional collection as storage?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Maybe my intuition is wrong, but the &lt;span style="font-style:italic;"&gt;Next&lt;/span&gt; in &lt;code&gt;yieldNextCore&lt;/code&gt; implies to me that the method will be called repeatedly. Probably until it exits after a &lt;code&gt;yieldBreak&lt;/code&gt; call or without one to &lt;code&gt;yieldReturn&lt;/code&gt;. Hence, in the example above it would be the number of elements the predicate &lt;code&gt;pred&lt;/code&gt; evaluates to &lt;code&gt;true&lt;/code&gt;. Taking the worst case: One call for each of the &lt;code&gt;n&lt;/code&gt; elements in the collection &lt;code&gt;coll&lt;/code&gt;. Ergo the time scale rises from O(n) to O(n^2)!&lt;br /&gt;&lt;br /&gt;Anyway, I might be wrong and it is only called once. Thus however, an element passed to &lt;code&gt;yieldReturn&lt;/code&gt; has be stored until the corresponding &lt;code&gt;Iterator.next&lt;/code&gt; call releases it. In a single threaded environment, the means &lt;span style="font-style:italic;"&gt;all&lt;/span&gt; of the (predicated) elements since there is no way to suspend the for-loop. This may be practicable for iterations over a few elements. But again, the worst cast the complexity rises from O(n) to O(n^2) - this time in memory consumption!&lt;br /&gt;&lt;br /&gt;As a result, the only possible implementation idea I got was utilizing a dedicated thread to execute the iterator-block (&lt;code&gt;yieldNextCore&lt;/code&gt;). This can block the iteration while the iterators' method can return. However, it turned out one thread is not enough, since it could "wait forever", if the iteration is not completed. Another had to monitor a weak reference to it. But again, the the problem is that the loop will always be executed, which leads to O(n) even if the iteration is not continued after retrieving the first element.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/07/re-how-to-write-iterators-really-really.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-5839672528589334599</guid><pubDate>Sat, 07 Jul 2007 00:26:00 +0000</pubDate><atom:updated>2007-07-07T16:01:42.481+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Java</category><category domain='http://www.blogger.com/atom/ns#'>RFE</category><title>Inline-Methods and Closure-Blocks</title><description>Yesterday, I browsed once again through &lt;a href="http://gafter.blogspot.com/2006/08/whats-point-of-closures.html"&gt;Neal Gafter's Blog&lt;/a&gt;... It turned out to be a great mistake, as I got an idea which kept floating in my mind almost the whole night and day: A way to abstract loops or other code blocks without closures, but by inlining special methods around them (seems like the inverse of a closure to me). &lt;br /&gt;Still not being 100% convinced by function types, especially their syntax, I tried to write myself: &lt;span style="font-style:italic;"&gt;A proposal for extending the Java Language Specification&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Actually, I think the idea behind it is great, although the proposal itself might not - I didn't sleep much last night and have/had plenty other things to work, so please forgive the small mistakes in the pseudo code and text. However, if there is interest, I'll try to find the time to revise it. So please let me know what you think about it!&lt;br /&gt;[ Collaborators are welcome - its on Google Docs you know ;-) ]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Abstract:&lt;/span&gt;&lt;br /&gt;This proposal shows that it is not necessary to add full blown closures or function types to the Java programming language in order to allow control abstraction.&lt;br /&gt;The main motivation behind it is the agreement, that control abstraction cannot be implement with the current language constructs, such as anonymous classes - only syntactic improvements won't help. On the other side however, there is the fear that the introduction of nameless functions will remove one of the languages strongest points: its readability - raw type sequences everywhere. The proposed solution is to reuse existing syntax and add a single new semantic, which is simple-to-use, (relatively-)simple-to-implement, but yet very powerful. In short, the main idea is to inline special methods surrounding a (closure-)block, which remains in the lexical scope where is called.&lt;br /&gt;&lt;br /&gt;Please have a look at the &lt;a href="http://docs.google.com/Doc?id=dc6rvxth_30fkwgg6"&gt;full document&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Usage-Example: &lt;a href="http://gestalt.monoid.net/blog/code/inline/forEachMap.html"&gt;Map enhanced for-loop&lt;/a&gt;.&lt;br /&gt;&lt;font size="small"&gt;(see document for the declaration of 'forEach')&lt;/font&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/inline/forEachMap.html" width="100%" height="120"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Usage-Example: &lt;a href="http://gestalt.monoid.net/blog/code/inline/transfer.html"&gt;with a.k.a. closeAfter&lt;/a&gt;.&lt;br /&gt;&lt;font size="small"&gt;(see document for the declaration of 'with')&lt;/font&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/inline/transfer.html" width="100%" height="250"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Usage-Example: &lt;a href="http://gestalt.monoid.net/blog/code/inline/readFastOrFail.html"&gt;blocked asynchronous reading&lt;/a&gt;.&lt;br /&gt;&lt;font size="small"&gt;(see document for the declaration of 'readFully')&lt;/font&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/inline/readFastOrFail.html" width="100%" height="380"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/07/inline-methods-and-closure-blocks.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-6559617583220695607</guid><pubDate>Sat, 21 Apr 2007 12:04:00 +0000</pubDate><atom:updated>2007-04-21T13:24:20.156+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Concurrency</category><category domain='http://www.blogger.com/atom/ns#'>Java</category><category domain='http://www.blogger.com/atom/ns#'>Google</category><title>The Java Memory Model &amp; Concurrency</title><description>I just watched the presentation &lt;i&gt;Advanced Topics in Programming Languages: The Java Memory Model&lt;/i&gt; given by &lt;a href="http://www.cs.umd.edu/~jmanson/" target="manosn"&gt;Jeremy Manson&lt;/a&gt; (Google Tech Talks March 21, 2007). Although I was familiar with most, I really enjoyed watching the complete video (I rarely do this for those longer than 15min). If didn't see it already:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=8394326369005388010&amp;hl=en" flashvars=""&gt; &lt;/embed&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/04/java-memory-model-concurrency.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-6008571471255985563</guid><pubDate>Mon, 02 Apr 2007 15:39:00 +0000</pubDate><atom:updated>2007-04-21T13:41:01.189+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Java</category><category domain='http://www.blogger.com/atom/ns#'>RFE</category><title>Extended Type-Cast vs. Closures vs. Current Java</title><description>Although I'm not a fan of messing up the Java language, I had another idea, I'd like to share:&lt;br /&gt;&lt;br /&gt;An &lt;i&gt;extended type-cast for single-method interfaces&lt;/i&gt;, which succeeds if the signatures are compitable. More precise, the target's method could be overridden by the one of the source interface, the syntax could be: &lt;code&gt;(A &lt;b&gt;as&lt;/b&gt; B)&lt;/code&gt;&lt;br /&gt;(Note: contravariant arguments would be also possible) &lt;br /&gt;&lt;br /&gt;I guess it's is highly related to the ongoing debate if and how to integrate closures (&lt;a href="http://docs.google.com/Doc.aspx?id=k73_1ggr36h" target="syntax"&gt;CICE&lt;/a&gt;, &lt;a href="http://docs.google.com/Doc?id=ddhp95vd_0f7mcns" target="fcm"&gt;FCM&lt;/a&gt; and &lt;a href="http://javac.info/" target="closures"&gt;BGGA&lt;/a&gt;). Although, I think the last one has its pros and I really like the idea of first-class methods (place my vote here), the remaining one really has a mighty ally: &lt;b&gt;simplicity&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;However, the absense of method/functions type, which can be assigned only depending on their signature types, makes it look a bit clumsy. With the proposed extended type-cast, things would be more balanced as this &lt;a href="http://gestalt.monoid.net/blog/code/extcast/ExtendedTypeCast.java"&gt;example&lt;/a&gt; shows.&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/extcast/ExtendedTypeCast.html" width="100%" height="750"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Just, for those who didn't have noticed yet, the main thing is &lt;code&gt;(Bar &lt;b&gt;as&lt;/b&gt; Foo)&lt;/code&gt;, but it looks nicer within the other syntax sugar as well:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;calling the single method of an interface, its name can be omitted&lt;/li&gt;&lt;li&gt;simplifyedcreation of anonymous classes, which implement single-method interfaces&lt;/li&gt;&lt;li&gt;usage of &lt;code&gt;var/final&lt;/code&gt; instead of specifying the reference type&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;EDIT:&lt;/b&gt; Modified the source to match the &lt;a href="http://javac.info/" target="closures"&gt;BGGA&lt;/a&gt; proposal accoringly to Neal Gafter's comment.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/04/extended-type-cast-vs-closures-vs_9303.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-2549663826612838032</guid><pubDate>Sat, 31 Mar 2007 15:13:00 +0000</pubDate><atom:updated>2007-04-01T09:55:45.383+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Java</category><category domain='http://www.blogger.com/atom/ns#'>RFE</category><title>A new usage of this() !</title><description>All Java developers know the &lt;i&gt;this()&lt;/i&gt;-method, which is used to call a constructor of a class within another one. It is the only Java-method with a return value constrained to the actual class (a.k.a. self-type).&lt;br /&gt;&lt;br /&gt;Imagine if we could use the parameterless version (even if there is no such constructor) within a method. As &lt;i&gt;this&lt;/i&gt;, it would return a reference of the class, but virtually typed.&lt;br /&gt;&lt;br /&gt;What about the benefits?&lt;br /&gt;This simple, but powerful language extension would allow &lt;b&gt;virtual calls to static methods!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let's take a look at this &lt;a href="http://gestalt.monoid.net/blog/code/this/this.java"&gt;example&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;iframe style="border: 0px solid;" src ="http://gestalt.monoid.net/blog/code/this/this.html" width="100%" height="500"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Without the new &lt;i&gt;this()&lt;/i&gt;-method, one would have to override every method calling the static method, which we want to be virtual. Here, one would have to remove all comment to maintain the output:&lt;br /&gt;&lt;br /&gt;One: static(0) - virtual(1)&lt;br /&gt;Two: static(0) - virtual(2)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What do you think, is it worth to submit a RFE?&lt;br /&gt;At least no new keyword or anything else have to introduced and the meaning is widely consistent with the constructor.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/04/new-usage-of-this.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-3702201579243061125</guid><pubDate>Fri, 23 Feb 2007 21:00:00 +0000</pubDate><atom:updated>2007-02-23T22:26:03.582+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Nonsense</category><category domain='http://www.blogger.com/atom/ns#'>Skateboarding</category><category domain='http://www.blogger.com/atom/ns#'>Advertisement</category><title>Car Surfing Advertisement</title><description>&lt;a href="http://www.nissan-qashqai.com" target="_blank"&gt;Nissan Qashqai&lt;/a&gt; looks like a great car, but the advertisement is really awesome:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center"&gt;&lt;object width="400" height="330"&gt;&lt;param name="movie" value="http://www.youtube.com/v/El6OVFhipwM"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/El6OVFhipwM" type="application/x-shockwave-flash" wmode="transparent" width="400" height="330"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I guess this kind of recreational sport can get very expensive without a sponsor, remembering my wastage of skateboards in the good old days. :-)&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/02/car-surfing-advertisement.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-2175338603131757089</guid><pubDate>Fri, 23 Feb 2007 12:26:00 +0000</pubDate><atom:updated>2007-02-23T15:00:09.758+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Nonsense</category><category domain='http://www.blogger.com/atom/ns#'>Portfolio</category><category domain='http://www.blogger.com/atom/ns#'>Art</category><title>Obvious Facts and the 3 Types of Virgins</title><description>A recent &lt;a href="http://weblogs.java.net/blog/davidvc/archive/2007/02/now_thats_a_pow.html" target="_blank"&gt;blog entry&lt;/a&gt; about a video called &lt;a href="http://www.clemenskogler.net/grandcontent" target="_clemenskogler"&gt;Le Grand Content&lt;/a&gt;, which examines the omnipresent Powerpoint-culture in search for its philosophical potential, brought me to the &lt;a href="http://www.clemenskogler.net" target="_clemenskogler"&gt;website of the creator&lt;/a&gt;. Beside that these pages are a great online portfolio IMO, the whole videos there are so f%#$%ing incredibly entertaining - in short: watch'em, now!&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;img style="border: 1px solid #232323;" src="http://gestalt.monoid.net/blog/clemenskogler/facts.jpg"/&gt;&lt;br /&gt;obvious facts &lt;font size="small"&gt;(&lt;a href="http://www.clemenskogler.net/grandcontent" target="_clemenskogler"&gt;Le Grand Content&lt;/a&gt; by &lt;a href="http://www.clemenskogler.net" target="_clemenskogler"&gt;Clemens Kogler&lt;/a&gt;)&lt;/font&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;img style="border: 1px solid #232323;" src="http://gestalt.monoid.net/blog/clemenskogler/virgins.jpg"/&gt;&lt;br /&gt;the 3 types of virgins &lt;font size="small"&gt;(&lt;a href="http://www.clemenskogler.net/grandcontent" target="_clemenskogler"&gt;Le Grand Content&lt;/a&gt; by &lt;a href="http://www.clemenskogler.net" target="_clemenskogler"&gt;Clemens Kogler&lt;/a&gt;)&lt;/font&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/02/obvious-facts-and-3-types-of-virgins.html</link><author>noreply@blogger.com (Michael Nischt)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-25217618.post-8456677358147763654</guid><pubDate>Sun, 04 Feb 2007 16:40:00 +0000</pubDate><atom:updated>2007-03-31T18:25:53.993+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>reactable</category><category domain='http://www.blogger.com/atom/ns#'>transmediale.07</category><title>Transmediale.07 and Reactable</title><description>Finally, I made myself attending to the &lt;a href="http://transmediale.de" target="_blank"&gt;transmediale.07&lt;/a&gt; exhibition at the very last day..&lt;br /&gt;&lt;br /&gt;It began great, because two french girls gave me 2 tickets for free :-)&lt;br /&gt;(o.k. I only needed one and that would have cost me 2 bucks, but very nice anyway!)&lt;br /&gt;&lt;br /&gt;Afterwards, I found myself waiting in row for almost 25 minutes to see not more than 10 installations. Although I must confess, that I was a bit disappointed in the beginning because of the quantity, but it turned out, I liked more than half. This is is a very good rate IMO, though none was really super spectacular,&lt;br /&gt;&lt;br /&gt;The best thing however was later on and beneath: a live demo of another multi-touch and marker sensing table called &lt;a href="http://mtg.upf.edu/reactable/" target="_blank"&gt;reactable&lt;/a&gt;. Sure not only a great interface for DJing, but the performance was very nice to watch and use (at least the 45 sec I tried)..&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;br /&gt;&lt;div style="text-align:center;width:194px;font-family:arial,sans-serif;font-size:83%"&gt;&lt;div style="height:194px;background:url(http://picasaweb.google.com/f/img/transparent_album_background.gif) no-repeat left"&gt;&lt;a href="http://picasaweb.google.com/Michael.Nischt/Transmediale07Reactable" target="picasa"&gt;&lt;img src="http://lh6.google.com/image/Michael.Nischt/RcZ5dLTc7zE/AAAAAAAAAJo/Zb7Sqy-OqaQ/s160-c/Transmediale07Reactable.jpg" width="160" height="160" style="border:none;padding:0px;margin-top:16px;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://picasaweb.google.com/Michael.Nischt/Transmediale07Reactable"&gt;&lt;div style="color:#4D4D4D;font-weight:bold;text-decoration:none;"&gt;Transmedia&lt;wbr&gt;&lt;/wbr&gt;le.07 + Reactable&lt;/div&gt;&lt;/a&gt;&lt;div style="color:#808080"&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;/div&gt;</description><link>http://gestalt.monoid.net/blog/2007/02/freak-out.html</link><author>noreply@blogger.com (Michael Nischt)</author></item></channel></rss>