<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-25217618</id><updated>2009-12-07T10:35:35.777+01:00</updated><title type='text'>blog://gestalt.monoid.net</title><subtitle type='html'>Michael Nischt's Personal Weblog</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gestalt.monoid.net/blog/atom.xml'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-25217618.post-4424413406104764748</id><published>2009-11-27T17:56:00.001+01:00</published><updated>2009-11-27T17:56:00.251+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='Documents'/><title type='text'>MS Fonts in Google Documents on Ubuntu</title><content type='html'>A major reason why I love &lt;a href="http://docs.google.com" target="docs"&gt;google documents&lt;/a&gt; is that I can access all the files from any computer regardless of the operating system. In principle this works great for me but unfortunately changing the text font (e.g. to Courier New) doesn't work on &lt;a href="http://ubuntu.com"&gt;ubuntu&lt;/a&gt;. Although I still hope there is something goggle can do, the intermediate solution is using the 'Installer for Microsoft TrueType core fonts':&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo apt-get install ttf-mscorefonts-installer&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;P.S. Don't forget to restart you browser afterwards.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-4424413406104764748?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/4424413406104764748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=4424413406104764748' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4424413406104764748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4424413406104764748'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2009/11/ms-fonts-in-google-documents-on-ubuntu.html' title='MS Fonts in Google Documents on Ubuntu'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-314088885965081994</id><published>2009-09-18T18:12:00.001+01:00</published><updated>2009-09-18T18:13:29.141+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MATLAB'/><category scheme='http://www.blogger.com/atom/ns#' term='Octave'/><title type='text'>MATLAB/Octave Utils: submat, grouped</title><content type='html'>Totally forgot to share these two MATLAB/Octave functions I wrote some time ago: &lt;br /&gt;  &lt;b&gt;submat:&lt;/b&gt; accessing a sub-matrix of an &lt;i&gt;unknown&lt;/i&gt; multi-dimensional matrix&lt;br /&gt;  &lt;b&gt;grouped:&lt;/b&gt; creating record like data structures from arrays &lt;i&gt;grouped&lt;/i&gt; by an index cell&lt;br /&gt;&lt;br /&gt;Actually, I still wonder if or why this functionality is not part of the core library or even the 'language syntax '? Anyhow, I couldn't find it so I wrote the two functions myself. (please tell me if you know about a predefined equivalent or a better solution)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. submat&lt;/span&gt; ( &lt;a href="http://gestalt.monoid.net/blog/code/matlab/submat.m"&gt;submat.m&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;In Matlab everything is a (potential) N-dimensional matrix of elements such as doubles, cells or structs. Sub-indexing is easy, unless you try to program in a generic way, e.g. with high-order functions. The problem is that traditional &lt;b&gt;sub-indexing requires you to know the element type (cell or not) and dimensions of the matrix&lt;/b&gt;. So I came up with a function &lt;i&gt;submat&lt;/i&gt;, which basically does sub-indexing in the highest dimension of an unknown type:&lt;br /&gt;&lt;code&gt;&lt;font face="Courier New"&gt;&lt;br /&gt;A = [ 1, 2, 3; 4, 5, 6 ];&lt;br /&gt;&lt;b&gt;submat&lt;/b&gt;(A,2:3)   % same as A(:,2:3)&lt;br /&gt;-&gt; [ 2, 3; 5, 6 ]&lt;br /&gt;&lt;br /&gt;B = { 'Hello', 'submat'; 'Goodbye', '(:)' };&lt;br /&gt;&lt;b&gt;submat&lt;/b&gt;(B',1)  % same as B'{:,1}&lt;br /&gt;-&gt; { 'Hello', 'submat' }&lt;br /&gt;&lt;/font&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. grouped&lt;/span&gt; ( &lt;a href="http://gestalt.monoid.net/blog/code/matlab/grouped.m"&gt;grouped.m&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;The other thing I missed was a simple way to group data arrays to structs. Of course this can easily be done within a for loop, but using the &lt;i&gt;group&lt;/i&gt; function eliminates the code repetition. Also, it can be be used in two ways:&lt;br /&gt;&lt;br /&gt;First, it allows to simply group equal indices together.&lt;br /&gt;&lt;code&gt;&lt;font face="Courier New"&gt;&lt;br /&gt;&lt;b&gt;grouped&lt;/b&gt;( [ 1, 2, 1, 3, 1, 2, 3] )&lt;br /&gt;-&gt; { [ 1, 3, 5 ], [ 2, 6 ], [ 4, 7 ] }&lt;br /&gt;&lt;/font&gt;&lt;/code&gt;&lt;br /&gt;So far nothing special, but its main purpose is to create a custom struct array.&lt;br /&gt;&lt;code&gt; &lt;font face="Courier New"&gt;&lt;br /&gt;&lt;font color="green"&gt;%artists  =  { 'Beatles', 'Bob Dylan' };&lt;br /&gt;%records&lt;/font&gt;&lt;br /&gt;record_artist_ids = [1, 1, 2, 2, 1];&lt;br /&gt;&lt;font color="green"&gt;% or the result of group(record_artist_ids)&lt;/font&gt;&lt;br /&gt;record_artist_ids = { [1, 2, 5], [3, 4] };&lt;br /&gt;title = { 'White Album', 'Rubber Soul', 'Blood on the Tracks', 'Blonde on Blonde', 'Revolver' };&lt;br /&gt;year = [ 1968, 1965, 1975, 1966, 1966 ];&lt;br /&gt;&lt;br /&gt;artist_records = &lt;b&gt;grouped&lt;/b&gt; ( record_artist_ids, 'title', title, 'year', year)&lt;br /&gt;&lt;br /&gt;-&gt; artist_records(1).title = { 'White Album', 'Rubber Soul', 'Revolver' }&lt;br /&gt;   artist_records(1).year = [ 1968, 1965, 1966 ]&lt;br /&gt;   artist_records(2).title = { 'White Album', 'Rubber Soul', 'Revolver' }&lt;br /&gt;   artist_records(2).year = [ 1975, 1966 ]&lt;br /&gt;&lt;/font&gt; &lt;/code&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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-314088885965081994?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/314088885965081994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=314088885965081994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/314088885965081994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/314088885965081994'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2009/09/matlaboctave-utils-submat-grouped.html' title='MATLAB/Octave Utils: submat, grouped'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-7393586507258306730</id><published>2009-09-17T02:31:00.005+01:00</published><updated>2009-09-17T18:59:30.641+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team-Tactics'/><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><category scheme='http://www.blogger.com/atom/ns#' term='GameDev'/><category scheme='http://www.blogger.com/atom/ns#' term='Research'/><title type='text'>New Project: Team-Tactics</title><content type='html'>So what is it about? Well, it's meant to be a playground for exploring intuitive and efficient ways to control/direct virtual entities - or simply a turn based football (soccer) game.&lt;br /&gt;&lt;br /&gt;As some might know, my current research is about interaction metaphors for 3D scenes using novel input modalities (multi-touch, motion-sensors, video, ...). Thereby, a special focus lies on concurrent user interaction with both shared and networked devices. Although I might not be able to share much information about this before scientifically published, I believe the evaluation platform should be open right from the beginning. And why shouldn't it be something fun. A tactical football game will fit:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;the rules are not too complicated to understand and implement&lt;/li&gt;&lt;br /&gt;&lt;li&gt;the big team size and typical player proximities are ideal for cooperative/competitive interaction&lt;/li&gt;&lt;br /&gt;&lt;li&gt;easy to realize in both 2D/3D as well as in various levels of abstraction&lt;/li&gt;&lt;br /&gt;&lt;li&gt;my Ph.D. supervisor is crazy about that football (!FC Barcelona!)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;The gameplay will most likely consist of two repeating phases: First, the tactics are defined/adjusted by altering the players' next actions. Afterwards, all the movements are simulated concurrently. Hopefully, this 'genre' (half real-time tactics?) facilitates the strategic/tactical emphasis. &lt;br /&gt;&lt;br /&gt;Except for this choice, everything else is still open. The idea is to prototype a lot and to find the most fun and intuitive concepts. (Clearly, the target audience includes casual gamers.)&lt;br /&gt;I guess this is also the place to mention that help is always welcome: if you want to contribute design/interaction ideas, code, graphics, music/sounds or anything else - please let me know.&lt;br /&gt;&lt;br /&gt;OK, that's it for now. If you're interested, please follow the dedicated blog at &lt;a href="http://teamtacticsproject.blogspot.com"&gt;teamtacticsproject.blogspot.com&lt;/a&gt; - I intend to write a regular development diary and promise to write at least one post tomorrow.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/8bvrunxpkm" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-7393586507258306730?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/7393586507258306730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=7393586507258306730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7393586507258306730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7393586507258306730'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2009/09/new-project-team-tactics.html' title='New Project: Team-Tactics'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-7178683222564070138</id><published>2008-04-12T10:51:00.003+01:00</published><updated>2008-04-12T11:29:00.415+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scala'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Nonsense'/><title type='text'>Shell History Meme</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-7178683222564070138?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/7178683222564070138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=7178683222564070138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7178683222564070138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7178683222564070138'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2008/04/shell-history-meme.html' title='Shell History Meme'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-7007195163226519827</id><published>2008-02-02T03:37:00.002+01:00</published><updated>2008-08-24T07:13:21.160+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scala'/><category scheme='http://www.blogger.com/atom/ns#' term='Textmate'/><title type='text'>A *new* Scala Bundle for Textmate</title><content type='html'>&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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-7007195163226519827?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/7007195163226519827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=7007195163226519827' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7007195163226519827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7007195163226519827'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2008/02/new-scala-bundle-for-textmate.html' title='A *new* Scala Bundle for Textmate'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-4129008281664689571</id><published>2007-10-18T16:15:00.001+01:00</published><updated>2008-08-24T07:13:42.514+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scala'/><title type='text'>Streams for Incremental and Tail-Recoursive Computing</title><content type='html'>&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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-4129008281664689571?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/4129008281664689571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=4129008281664689571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4129008281664689571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4129008281664689571'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/10/streams-for-incremental-and-tail.html' title='Streams for Incremental and Tail-Recoursive Computing'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-4157301081570196750</id><published>2007-10-17T14:11:00.001+01:00</published><updated>2008-08-24T07:14:00.972+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scala'/><title type='text'>Building Scala from the Sources</title><content type='html'>&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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-4157301081570196750?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/4157301081570196750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=4157301081570196750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4157301081570196750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4157301081570196750'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/10/building-scala-from-sources.html' title='Building Scala from the Sources'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-7328056923477125859</id><published>2007-10-06T09:20:00.000+01:00</published><updated>2007-10-06T10:32:43.720+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><category scheme='http://www.blogger.com/atom/ns#' term='Random'/><title type='text'>11 Amazingly Simple Tricks To Turn Your Brain Into A Powerful Thinking Machine</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-7328056923477125859?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/7328056923477125859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=7328056923477125859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7328056923477125859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/7328056923477125859'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/10/11-amazingly-simple-tricks-to-turn-your.html' title='11 Amazingly Simple Tricks To Turn Your Brain Into A Powerful Thinking Machine'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-4139827508792507327</id><published>2007-08-15T18:23:00.000+01:00</published><updated>2007-08-15T20:10:58.181+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='RFE'/><title type='text'>Named Arguments - Pure Danger (Tech) for Java 7?</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-4139827508792507327?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/4139827508792507327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=4139827508792507327' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4139827508792507327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/4139827508792507327'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/08/named-arguments-pure-danger-tech-for.html' title='Named Arguments - Pure Danger (Tech) for Java 7?'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-1380101687284716176</id><published>2007-07-17T21:39:00.000+01:00</published><updated>2007-07-29T17:54:19.015+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Re: How to write Iterators really REALLY fast (in Java)</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-1380101687284716176?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/1380101687284716176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=1380101687284716176' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/1380101687284716176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/1380101687284716176'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/07/re-how-to-write-iterators-really-really.html' title='Re: How to write Iterators really REALLY fast (in Java)'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-5839672528589334599</id><published>2007-07-07T01:26:00.000+01:00</published><updated>2007-07-07T16:01:42.481+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='RFE'/><title type='text'>Inline-Methods and Closure-Blocks</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-5839672528589334599?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/5839672528589334599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=5839672528589334599' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/5839672528589334599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/5839672528589334599'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/07/inline-methods-and-closure-blocks.html' title='Inline-Methods and Closure-Blocks'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-6559617583220695607</id><published>2007-04-21T13:04:00.000+01:00</published><updated>2007-04-21T13:24:20.156+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Concurrency'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>The Java Memory Model &amp; Concurrency</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-6559617583220695607?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/6559617583220695607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=6559617583220695607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/6559617583220695607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/6559617583220695607'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/04/java-memory-model-concurrency.html' title='The Java Memory Model &amp; Concurrency'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-6008571471255985563</id><published>2007-04-02T16:39:00.003+01:00</published><updated>2007-04-21T13:41:01.189+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='RFE'/><title type='text'>Extended Type-Cast vs. Closures vs. Current Java</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-6008571471255985563?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/6008571471255985563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=6008571471255985563' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/6008571471255985563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/6008571471255985563'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/04/extended-type-cast-vs-closures-vs_9303.html' title='Extended Type-Cast vs. Closures vs. Current Java'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-2549663826612838032</id><published>2007-03-31T16:13:00.000+01:00</published><updated>2007-04-01T09:55:45.383+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='RFE'/><title type='text'>A new usage of this() !</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-2549663826612838032?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/2549663826612838032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=2549663826612838032' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/2549663826612838032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/2549663826612838032'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/04/new-usage-of-this.html' title='A new usage of &lt;i&gt;this()&lt;/i&gt; !'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-3702201579243061125</id><published>2007-02-23T22:00:00.000+01:00</published><updated>2007-02-23T22:26:03.582+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nonsense'/><category scheme='http://www.blogger.com/atom/ns#' term='Skateboarding'/><category scheme='http://www.blogger.com/atom/ns#' term='Advertisement'/><title type='text'>Car Surfing Advertisement</title><content type='html'>&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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-3702201579243061125?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/3702201579243061125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=3702201579243061125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/3702201579243061125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/3702201579243061125'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/02/car-surfing-advertisement.html' title='Car Surfing Advertisement'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-2175338603131757089</id><published>2007-02-23T13:26:00.000+01:00</published><updated>2007-02-23T15:00:09.758+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Nonsense'/><category scheme='http://www.blogger.com/atom/ns#' term='Portfolio'/><category scheme='http://www.blogger.com/atom/ns#' term='Art'/><title type='text'>Obvious Facts and the 3 Types of Virgins</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-2175338603131757089?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/2175338603131757089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=2175338603131757089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/2175338603131757089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/2175338603131757089'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/02/obvious-facts-and-3-types-of-virgins.html' title='Obvious Facts and the 3 Types of Virgins'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25217618.post-8456677358147763654</id><published>2007-02-04T17:40:00.000+01:00</published><updated>2007-03-31T18:25:53.993+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reactable'/><category scheme='http://www.blogger.com/atom/ns#' term='transmediale.07'/><title type='text'>Transmediale.07 and Reactable</title><content type='html'>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;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25217618-8456677358147763654?l=gestalt.monoid.net%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/8456677358147763654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=25217618&amp;postID=8456677358147763654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/8456677358147763654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25217618/posts/default/8456677358147763654'/><link rel='alternate' type='text/html' href='http://gestalt.monoid.net/blog/2007/02/freak-out.html' title='Transmediale.07 and Reactable'/><author><name>Michael Nischt</name><uri>http://www.blogger.com/profile/07488126278314276322</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14838018316747067054'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>