<?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' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-25450844</id><updated>2011-04-22T05:32:53.421+02:00</updated><title type='text'>In a world gone mad..</title><subtitle type='html'>I mean.. What I'm trying to say is.. In a way I think.. You know? In a world gone mad..</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-25450844.post-114623645757983629</id><published>2006-04-28T16:58:00.000+02:00</published><updated>2006-04-28T17:06:36.030+02:00</updated><title type='text'>Blog moved to The.Berlin.Factor</title><content type='html'>Alright, with all the posted code samples in the last few days I finally had enough of non-intuitive Blogger editing. Not that WordPress solved all my editing needs right away, but I really only needed an excuse to setup my own blog.. In the end I will have to write my own blog software anyway.. :)&lt;br /&gt;&lt;br /&gt;From now on I'll post new stuff at &lt;a href="http://www.berlinfactor.com/blog/"&gt;The.Berlin.Factor&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114623645757983629?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.berlinfactor.com' title='Blog moved to The.Berlin.Factor'/><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114623645757983629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114623645757983629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114623645757983629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114623645757983629'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/blog-moved-to-theberlinfactor.html' title='Blog moved to The.Berlin.Factor'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114622201996226544</id><published>2006-04-28T11:52:00.000+02:00</published><updated>2006-04-28T14:23:38.776+02:00</updated><title type='text'>I don't like annotations</title><content type='html'>Call me crazy, but I really don't like annotations. Those weird things used in Java and .NET..&lt;br /&gt;&lt;br /&gt;Let me show you some examples why I don't like them: (And yes, there are probably some examples why they are good.. or at least why they seem to be good..)&lt;br /&gt;&lt;br /&gt;From the RhinoMocks documentation:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;br /&gt;[SetUp]&lt;br /&gt;public void Setup()&lt;br /&gt;{&lt;br /&gt;    mocks = new MockRepository();&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;What does [SetUp] tell us about "Setup"? :) And the same thing happens for the TearDown method, of course.. And really, why is this&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;br /&gt;   [Test]&lt;br /&gt;   public void CallMethodOnObject()&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;better than&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;br /&gt;   public void testCallMethodOnObject()&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Alright, there are reasons why the annotated version is better. You may not be able to 'reflect' on a class to get all the methods for which the name starts with "test", and there may be ambiguities.. But are annotations solving these problems 'better enough' to accept the penality of this added language complexity? And it is added complexity, isn't it?&lt;br /&gt;&lt;br /&gt;What is even more interesting is the fact that in the same example code from the RhinoMocks site you find lines like this:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;br /&gt;   IDemo demo = (IDemo)mocks.CreateMock(typeof(IDemo));&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Look at some recent posts like &lt;a href="http://devhawk.net/2006/04/24/Sacred+Code+Cows.aspx"&gt;Sacred Code Cows&lt;/a&gt; and &lt;a href="http://devhawk.net/2006/04/14/Talking+Dynamic+Lanugages+With+Neal+Ford.aspx"&gt;Talking Dynamic Languages&lt;/a&gt; which basically say that an I for an interface is &lt;span style="font-weight: bold;"&gt;at least&lt;/span&gt; a bit strange. Probably much worse than strange..&lt;br /&gt;&lt;br /&gt;There's more! :)&lt;br /&gt;&lt;br /&gt;So I implemented this Syntax Highlighther plugin for IDEA during the last evenings. Look at some of the signatures of methods I had to implement:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;br /&gt;   @NotNull&lt;br /&gt;   public final String getDemoText()&lt;br /&gt;&lt;br /&gt;   @Nullable&lt;br /&gt;   public final StructureViewBuilder getStructureViewBuilder( final @NotNull VirtualFile file, final @NotNull Project project )&lt;br /&gt;&lt;br /&gt;   @NotNull&lt;br /&gt;   @NonNls&lt;br /&gt;   public final String getDefaultExtension()&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;For me it just feels like the wrong approach.. It's much like being a codified part of the contract between caller and callee. That's ok. But does it look nice? Does it look 'right' in a stylish way? For me it has one of these bad smells..&lt;br /&gt;&lt;br /&gt;If you'd really like to make the code speak the truth - as much as possible - why not use something like this:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;br /&gt;   public interface Something&lt;br /&gt;   {&lt;br /&gt;       public final ExtensionString getDefaultExtension();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public final class ExtensionString&lt;br /&gt;   {&lt;br /&gt;       public static final ExtensionString newInstance( final String aExtension )&lt;br /&gt;       {&lt;br /&gt;           if ( isValidAndCorrect( aExtension ) == false )&lt;br /&gt;           {&lt;br /&gt;               throw new YouSuckException( aExtension );&lt;br /&gt;           }&lt;br /&gt;           return new ExtensionString( aExtension )&lt;br /&gt;       }&lt;br /&gt; &lt;br /&gt;       (...)&lt;br /&gt; &lt;br /&gt;       // From Object&lt;br /&gt;&lt;br /&gt;       public final String toString()&lt;br /&gt;       {&lt;br /&gt;           return myExtension;&lt;br /&gt;       }&lt;br /&gt; &lt;br /&gt;       // Implementation Details&lt;br /&gt;&lt;br /&gt;       private ExtensionString( final String aExtension )&lt;br /&gt;       {&lt;br /&gt;           myExtension = aExtension;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       private static final void isValidAndCorrect( final String aExtension )&lt;br /&gt;       {&lt;br /&gt;           (...)&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       private final String myExtension;&lt;br /&gt;   }&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Use what the language core offers you! And don't give me the performance BS.. What's your main priority? Performance or correctness? Or..? Decide that first, then be disciplined about it and follow through with it..&lt;br /&gt;&lt;br /&gt;Anyway, just a thought.. And don't ask me about C++ template (meta) programming.. In your on frikin interest.. :)&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114622201996226544?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114622201996226544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114622201996226544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114622201996226544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114622201996226544'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/i-dont-like-annotations.html' title='I don&apos;t like annotations'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114609387487794204</id><published>2006-04-27T01:14:00.000+02:00</published><updated>2006-04-27T01:24:34.896+02:00</updated><title type='text'>Update 3: Ruby Plugin for IDEA</title><content type='html'>Alright. Took me nearly three whole evenings to conquer IDEA. I've seen lots of little things I really dislike.. Globals and other BS.. Horrible..&lt;br /&gt;&lt;br /&gt;Well. I got an initial configurable version of the "SimpleSyntax" highlighter plugin done. It's available here as &lt;a href="http://www.berlinfactor.com/blogging/files/SimpleSyntax.zip"&gt;binary&lt;/a&gt; and &lt;a href="http://www.berlinfactor.com/blogging/files/SimpleSyntax-src.zip"&gt;source&lt;/a&gt;. These files will probably go away soon, after I created an official project somewhere. But some heavy cleaning up has to happen first..&lt;br /&gt;&lt;br /&gt;Anyway, some of the nice bits of this plugin. Have a look at a configuration as it is supported right now:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;[SimpleSyntax:V1.0]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Name: Ruby&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Icon: simplesyntax_ruby.png&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Description: Ruby Script File&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;ExampleCode: simplesyntax_ruby.rb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# Braces Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Braces.Pairs: (),[]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Braces.Structural: {}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# Commenter Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Comment.Line: #&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Comment.BlockPrefix:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Comment.BlockSuffix:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# FileType Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;FileType.Icon: simplesyntax_ruby.png&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;FileType.Extensions: rb, ruby&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;FileType.DefaultExtension: rb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# Syntax Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;regex BLOCK_COMMENT                 =&gt; (?m)^(?:\s*#.*$){2,}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;regex LINE_COMMENT                  =&gt; (?m)#.*$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(...)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;regex SPECIAL_QUOTED_STRING         =&gt; %[qQ](.).*\1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;regex SINGLE_QUOTED_STRING          =&gt; \'(?:[^\']|\\')*\'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;regex DOUBLE_QUOTED_STRING          =&gt; \"(?:[^\"]|\\")*\"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;(...)&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# Element Descriptions&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;descriptions[ BLOCK_COMMENT ] = Block comment&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;descriptions[ LINE_COMMENT ] = Line comment&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;descriptions[ DOC_COMMENT ] = Documentation&lt;br /&gt;(...)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# Element Default Attributes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;attributes[ BLOCK_COMMENT ] = #303030,BOLD,ITALIC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;attributes[ LINE_COMMENT ] = #305030,BOLD,ITALIC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;attributes[ DOC_COMMENT ] = #503030,BOLD,ITALIC&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;(...)&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;I removed the dirty/incomplete parts.. :) Support for easier keyword specification, etc is still missing. For now only the "regex" rules are supported. Which is pretty clumsy for specifiying keywords..&lt;br /&gt;&lt;br /&gt;Another "nice" thing I want to add are "ruby" and "groovy" rules in which some script code is executed to recognize tokens - instead of RegEx matching. We'll see..&lt;br /&gt;&lt;br /&gt;That's it for today.. BF2 is waiting.. :)&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114609387487794204?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114609387487794204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114609387487794204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114609387487794204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114609387487794204'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/update-3-ruby-plugin-for-idea.html' title='Update 3: Ruby Plugin for IDEA'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114589999077881662</id><published>2006-04-24T19:12:00.000+02:00</published><updated>2006-04-24T19:33:10.796+02:00</updated><title type='text'>Update 2: Ruby Plugin for IDEA</title><content type='html'>I've been pretty busy with work all day. Now I got back to the IDEA Ruby plugin and after only a few minutes of thinking about what I was going to do, I said to myself "Wait a minute.. that's BS..". There's a much simpler solution..&lt;br /&gt;&lt;br /&gt;Alright, here's the context: Yesterday I spent a few hours trying to use a 'search-replace' approach for turning the JavaScript IDEA example plugin into a Ruby plugin. Didn't work.. :) And after a few minutes playing around with JFlex.. well, it really was enough JFlexing for a lifetime.. I then started implementing the Lexer interface offered by IDEA again, keeping in mind that at some point I'd have JRuby doing the 'tokenizing'.&lt;br /&gt;&lt;br /&gt;But while doing that, I 'stumbled' across a simpler idea. How about a concept called 'RecognizedToken', offering a simple API like this:&lt;br /&gt;&lt;br /&gt;interface RecognizedToken&lt;br /&gt;{&lt;br /&gt;    boolean isFoundIn( CharSequence, StartOffset, EndOffset );&lt;br /&gt;    int getTokenStart();&lt;br /&gt;    int getTokenEnd();&lt;br /&gt;    IElementType getTokenType();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Then it should be possible to implement a very simple Lexer checking all registered tokens on every 'advance' call. This Lexer could read a simple config file consisting of lines such as:&lt;br /&gt;&lt;br /&gt;    LINE_COMMENT =&gt; "#.*"&lt;br /&gt;    DOUBLE_QUOTED_STRING =&gt; "\"(?:[^\"]|\\\")*\""&lt;br /&gt;    (...)&lt;br /&gt;&lt;br /&gt;Of course, the next problem is the complexity of the regular expressions. And performance could be an issue, if IDEA doesn't properly cache the Lexer output. But judging from the 'start' method signatures, my guess is they will cache everything..&lt;br /&gt;&lt;br /&gt;Anyway, the Lexer now becomes a simple "10" liner. Well, apart from the 100 LOC used to implement the generic API..&lt;br /&gt;&lt;br /&gt;    private final void updateTokenType( final int aStartOffset )&lt;br /&gt;    {&lt;br /&gt;        myTokenStart = aStartOffset;&lt;br /&gt;        myTokenEnd = myEndOffset;&lt;br /&gt;        myTokenType = null;&lt;br /&gt;&lt;br /&gt;        final RecognizedToken recognizedToken = myTokenFinder.findClosest( myCharSequence, aStartOffset, myEndOffset );&lt;br /&gt;        if ( recognizedToken == null ) return;&lt;br /&gt;&lt;br /&gt;        myTokenType = recognizedToken.getTokenType();&lt;br /&gt;        myTokenStart = recognizedToken.getTokenStart();&lt;br /&gt;        myTokenEnd = recognizedToken.getTokenEnd();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;The basic Lexer is working now. I'll add configuration file support and then try some Ruby coding in IDEA with this plugin's syntax highlighting enabled.&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114589999077881662?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114589999077881662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114589999077881662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114589999077881662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114589999077881662'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/update-2-ruby-plugin-for-idea.html' title='Update 2: Ruby Plugin for IDEA'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114573431478765342</id><published>2006-04-22T21:24:00.000+02:00</published><updated>2006-04-23T10:58:55.210+02:00</updated><title type='text'>Update: Ruby Plugin for IDEA</title><content type='html'>It's been a busy week. Not much time for my fun projects.. Only today I started looking back into the Ruby plugin for IDEA. I see two ways that I'm willing to follow:&lt;br /&gt;&lt;br /&gt;1. Embed JRuby into the Plugin and offer a Ruby-bases configuration file for the syntax definitions.&lt;br /&gt;&lt;br /&gt;2. Clone the JavaScript example plugin and do a string-replace "JavaScript" to "Ruby".&lt;br /&gt;&lt;br /&gt;I actually like the first idea a lot more. And it's much closer to my current solution, which is basically a hack using hardcoded lexer, keywords, etc.. I like the idea of having a simple config syntax to define the keywords and other parts of the languages that I want to hilight. Obviously there may be some performance issues..&lt;br /&gt;&lt;br /&gt;The second idea, cloning the JavaScript thing, well.. it's huge! And using JFelx for the lexer is nearly overkill.. imho.. :) I simply don't like these 'theoretically correct' but not too pragmatic/usable solutions..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114573431478765342?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114573431478765342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114573431478765342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114573431478765342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114573431478765342'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/update-ruby-plugin-for-idea.html' title='Update: Ruby Plugin for IDEA'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114535492252249510</id><published>2006-04-18T11:35:00.000+02:00</published><updated>2006-04-18T12:08:42.533+02:00</updated><title type='text'>TFDJ is on a rant spree</title><content type='html'>I really like simple examples.. for my IDEA Ruby plugin I just looked into JFlex.. &lt;a href="http://jflex.de/manual.html#SECTION00040000000000000000"&gt;here&lt;/a&gt;'s what they offer you as "A simple example" :)&lt;br /&gt;&lt;br /&gt;No. I don't want to be mean here. And yes, in a way it is a simple example. Compared to a full-blown language specification. But consider the whole context again. The past two days all I tried to do is add some simple Ruby syntax hilighting to IDEA. How complicated can that be? How complicated &lt;span style="font-weight: bold;"&gt;should&lt;/span&gt; that be?&lt;br /&gt;&lt;br /&gt;That's all I'm saying.. I mean.. You know?&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114535492252249510?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114535492252249510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114535492252249510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114535492252249510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114535492252249510'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/tfdj-is-on-rant-spree.html' title='TFDJ is on a rant spree'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114531108476072839</id><published>2006-04-17T23:50:00.000+02:00</published><updated>2006-04-17T23:58:04.770+02:00</updated><title type='text'>Update: IDEA Plugin Development</title><content type='html'>I've spent most part of this easter monday working on basic Ruby syntax hilighting for IDEA. (See the previous posts for some more context..) I've got a simple lexer and the "surrounding" classes finished in a "proof-of-concept" way.&lt;br /&gt;&lt;br /&gt;The funny thing, however, is,that "surrounding" means about 10 classes.. Anyway, I'll check out some more of the JavaScript example code provided by JetBrains. Quite useful to get you started in the world of "We don't need no useful APIs".. :)&lt;br /&gt;&lt;br /&gt;What becomes quite apparent quickly is that you should probably use something like "flex" to generate your lexer code. But I wonder how IDEA handles the XML filetypes stuff.. I never worked with anything remotely compiler-related (I mean yacc, etc, not the compiler itself.. :). So I have to check out flex next..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114531108476072839?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114531108476072839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114531108476072839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114531108476072839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114531108476072839'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/update-idea-plugin-development.html' title='Update: IDEA Plugin Development'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114526438331840562</id><published>2006-04-17T10:33:00.000+02:00</published><updated>2006-04-17T10:59:43.333+02:00</updated><title type='text'>IDEA (Not a) Rant Part 2</title><content type='html'>Here's a quote from &lt;a href="http://www.jetbrains.com/idea/documentation/howto_03.html#Loading%20Components"&gt;The Basics of Plugin Development for IntelliJ IDEA&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;A more complex example for getting a container inside the event handler is presented below. In this example, the &lt;a href="http://www.jetbrains.com/idea/openapi/5.0/com/intellij/openapi/actionSystem/DataContext.html" target="_blank"&gt;DataContex&lt;/a&gt;t class is used for passing context references for the considered action. This class deserves special attention, and we will consider it in detail in another article devoted to actions and passing context parameters principles.&lt;/blockquote&gt;And here's some following example code from this article:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;public class MyAction extends AnAction {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  public void actionPerformed(AnActionEvent e) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    DataContext dataContext = e.getDataContext();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    Project project = (Project)dataContext.getData(DataConstants.PROJECT);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;    Module module = (Module)dataContext.getData(DataConstants.MODULE);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;In context of my previous post, this is just another example of what I mean when I ask for more declarative APIs. Sure, I understand certain reasons for using "identifiers" to retrieve Objects from some kind of object container. And it may very well make absolute sense for the JetBrains guys to do it this way. But expose such an API? To a potential external plugin developer? Smells strange, doesn't it?&lt;br /&gt;&lt;br /&gt;And what would the problems be when offering an alternative API using a more declarative style like for example this:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;... {&lt;br /&gt;  project = dataContext.getProject();&lt;br /&gt;  module = dataContext.getModule();&lt;br /&gt;  ...&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;Of course, you can't have a million getThis, getThat, etc methods in the DataContext API. But is this a valid argument against a more declarative API? Or an argument for an ID-based "query-API"? I don't think so. All it means is, that something is not they way it should be.&lt;br /&gt;&lt;br /&gt;The question should probably be more like: How can I separate the DataContext thing into sub contexts? Or can I provide specialized contexts depending on the kind of "plugin component part" I'm currently working on.&lt;br /&gt;&lt;br /&gt;Enough of this..&lt;br /&gt;&lt;br /&gt;There's something above all that.. It has to do with arguments "Why Ruby is better?" and the like. It runs along these lines:&lt;br /&gt;&lt;br /&gt;If you're used to coding in a more dynamic language, you probably come to like how you can implement a lot of things with very little code. (Let's leave all strong-typing related matters aside for now. They don't matter here.) In this context I kind of hate Jave. Obviously.. :)&lt;br /&gt;&lt;br /&gt;BUT: I still think arguments like "Java + IDEA" vs "Ruby + ???" saying basically that with Ruby you're pretty much stuck with typing everything yourself are.. well.. valid in a way. Not so much as to &lt;a href="http://gregluck.com/blog/archives/2006/03/java_vs_ruby_th.html"&gt;count number of key strokes&lt;/a&gt; and compare them. But like.. with a nice Java API and a nice Java IDE, the IDE can actually "guide" you through what you want to acomplish.&lt;br /&gt;&lt;br /&gt;In Ruby (for example) you're pretty much stuck with reading docs (remember the days of JDK1.1 and 1.2? I do.. :) and/or trusting your guts. Of course things are not as bad for Ruby as they may sound here. Writing Ruby is a lot of fun, and you're guts are right a lot of times. And a test-driven approach helps a lot to keep a nice development speed in Ruby.&lt;br /&gt;&lt;br /&gt;But Java, with the right APIs and the right IDE, can make 90% of the coding work a real breeze. You still write a lot more code than in Ruby, no doubt about that. But you proabably have to, because of some limitation that's still present in the Ruby world, or some legacy argument forcing you to use Java. But with appropriate APIs that help the IDE to guide you, Java coding isn't that bad.&lt;br /&gt;&lt;br /&gt;This is my problem with looking at the pluging development stuff offered by IDEA.. You know what I mean?&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114526438331840562?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114526438331840562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114526438331840562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114526438331840562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114526438331840562'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/idea-not-rant-part-2.html' title='IDEA (Not a) Rant Part 2'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114519252174252984</id><published>2006-04-16T14:40:00.000+02:00</published><updated>2006-04-17T01:16:48.436+02:00</updated><title type='text'>IDEA Plugin Development</title><content type='html'>Subtitle: PicoContainers, Decoupling and other things I don't know anything about.&lt;br /&gt;&lt;br /&gt;Alright, in a really weird way this post is a perfect candidate for this 'In a world gone mad' blog. Here's why..&lt;br /&gt;&lt;br /&gt;Besides other, probably more important things, frameworks like &lt;a href="http://www.picocontainer.org/"&gt;PicoContainer&lt;/a&gt; try to make decoupling easier. Maybe a too simplistic description. But let's focus on the resulting "APIs"..&lt;br /&gt;&lt;br /&gt;You try to avoid too tight coupling. You rely on alternative mechanisms like for example singleton objects like "ApplicationManager" etc. You access the objects you need - when you need them - through the associated singleton classes.&lt;br /&gt;&lt;br /&gt;Which probably is fine under certain circumstances. But does it really make things easier? It surely makes the 'top level interfaces' easier. Have a look at for example the "ApplicationComponent" interface provided by IDEAs OpenAPI:&lt;br /&gt;&lt;br /&gt;public interface ApplicationComponent&lt;br /&gt;{&lt;br /&gt; String getComponentName();&lt;br /&gt; void initComponent();&lt;br /&gt;   void disposeComponent();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Easy enough. But what does it tell you?&lt;br /&gt;&lt;br /&gt;Here's what I mean: Why is there no "anchor" object part of method signatures? Why is it better to have to read the (quite extensive) documentation to find examples on how (and reasons why) to use for example the ApplicationManager class. Looking at a somewhat more sophisticated plugin like GroovyJ you are faced with all the beauty of this "system".&lt;br /&gt;&lt;br /&gt;Don't get me wrong.. I don't mean to sound too negative here. I think taking everything into account the JetBrains guys did a great job! And of course it's quite a hard problem itself to figure out what this before mentioned "anchor" object would look like.&lt;br /&gt;&lt;br /&gt;What I really mean to say is this: If a system gets complex (complicated?) enough to make you long for a "dependency injection thing", wouldn't it then be a good time to stop for a minute, and try to look at your problem from a different point of view? Maybe looking for alternative solutions? &lt;span style="font-weight: bold;"&gt;Shouldn't &lt;/span&gt;there be an easier solution? A more expressive, maybe more "declarative" API possible? An API that guides you through the development?&lt;br /&gt;&lt;br /&gt;OK. Sorry for this - not really! - rant. I don't know too much about component containers, dependency injection, etc. And I only looked at IDEA plugin development for a few hours. And I haven't worked on projects as big as IDEA must be.&lt;br /&gt;&lt;br /&gt;It's just that sometimes.. you know.. I feel lost.. uncomfortable.. you know.. In a world gone mad.. :)&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114519252174252984?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114519252174252984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114519252174252984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114519252174252984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114519252174252984'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/idea-plugin-development.html' title='IDEA Plugin Development'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114517982754024332</id><published>2006-04-16T11:21:00.000+02:00</published><updated>2006-04-18T00:00:25.173+02:00</updated><title type='text'>IDEA and Ruby</title><content type='html'>After reading &lt;a href="http://jayfields.blogspot.com/2006/04/hacking-intellij-for-syntax_15.html"&gt;this&lt;/a&gt; post yesterday, I started looking into 'extending' IDEA. I never had to do this before. I was quite happy with what IDEA offered me.  (And with all my Ruby coding right now, I'm pretty happy with any small text editor - as long as I can configure it to support my shortcuts.)&lt;br /&gt;&lt;br /&gt;Well.. On a recent project I implemented a J2ME slideshow framework. It used some Ruby script to define the slideshow and a simple Ruby compiler to create the J2ME code from it. I used JRuby for testing, Ruby for 'driving' the build.&lt;br /&gt;&lt;br /&gt;Anyway, it never really occurred to me that there is no good support for Ruby in IDEA. Well, it was good enough for me. (Update: What I mean is that I never had a problem with the limited support in IDEA.) I had my "Ruby Script Files.xml" which made IDEA aware of the fact that .rb files contain some kind of code. It hilights comments and strings properly, as well as some keywords. But there seem to be some weird limitations. Not all keywords work.. Funny enough this never bothered me.. :)&lt;br /&gt;&lt;br /&gt;Out of curiosity I started looking at what the Codehaus guys are doing with the GroovyJ plugin. First impressions: WTF!? I guess it's not so much the Codehaus guys.. it's more about the complexity of the IDEA API or more precise the 'possibilities' of IDEA.&lt;br /&gt;&lt;br /&gt;Now I wonder: Shouldn't it be easier to add simple support for a new filetype? Like the XML filetypes if they would work properly?&lt;br /&gt;&lt;br /&gt;I find that quite interesting. I hope I'll find some more time to look into this a bit more..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114517982754024332?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114517982754024332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114517982754024332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114517982754024332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114517982754024332'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/idea-and-ruby.html' title='IDEA and Ruby'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114514064963517922</id><published>2006-04-16T00:32:00.000+02:00</published><updated>2006-04-16T00:41:05.970+02:00</updated><title type='text'>BitStructEx</title><content type='html'>I've made available an early version of an alternative BitStruct "thing" on RubyForge:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://rubyforge.org/projects/bit-struct-ex/"&gt;http://rubyforge.org/projects/bit-struct-ex/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In contrast to the nice and more feature-complete implementation available &lt;a href="http://raa.ruby-lang.org/project/bit-struct/"&gt;here&lt;/a&gt;, I&lt;br /&gt;focused on solving my main problem: Non-byte-boundary-aligned-nested-structures :)&lt;br /&gt;&lt;br /&gt;There's really a lot to like about Ruby.. I enjoy not coding in Java.. a welcome change..&lt;br /&gt;&lt;br /&gt;However, the meta-programming parts can still be.. well.. "mind-bending".. I'll probably blog about the meta part used in BitStructEx. You basically jump between instance, class and metaclass - even though the methods are right next to each other.. feels weird sometimes.. more on this soon.. (Have a look at the struct_base.rb file if you're interested.)&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114514064963517922?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114514064963517922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114514064963517922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114514064963517922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114514064963517922'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/bitstructex.html' title='BitStructEx'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114493591190988609</id><published>2006-04-13T15:39:00.000+02:00</published><updated>2006-04-16T00:31:58.663+02:00</updated><title type='text'>Thoughts on JRuby</title><content type='html'>Just stumbled upon a - slightly weird - mentioning of JRuby on &lt;a href="http://lambda-the-ultimate.org/node/1408"&gt;Lambda&lt;/a&gt;. It's weird because JRuby has been around for a long time..&lt;br /&gt;&lt;br /&gt;Anyway, I'm just thinking, maybe this could be a nice answer to my recent 'performance' problems mentioned &lt;a href="http://tfdj.blogspot.com/2006/04/ruby-and-reality.html"&gt;here&lt;/a&gt;. Using the Java NIO memory-mapped files stuff in (J)Ruby..&lt;br /&gt;&lt;br /&gt;Overall a very cool project.. imho..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114493591190988609?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114493591190988609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114493591190988609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114493591190988609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114493591190988609'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/thoughts-on-jruby.html' title='Thoughts on JRuby'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114469198760900065</id><published>2006-04-10T19:52:00.000+02:00</published><updated>2006-04-10T19:59:47.620+02:00</updated><title type='text'>Intelli/J IDEA Light</title><content type='html'>My favourite Java IDE is JetBrain's Intelli/J IDEA. But these days I wonder about it's future. Not because of Eclipse. Eclipse - for me - is a different approach to an IDE and I simply don't like it. But that's not the point. The point is that IDEA is getting more and more bloated. Probably not only because of features, but also because of the included JDK/JRE. Not sure on this..&lt;br /&gt;&lt;br /&gt;Anyway, I simply don't need about 50% of the functionality. IDEA has become a monster like Word. And I think this sucks.&lt;br /&gt;&lt;br /&gt;I want an IDEA Light. Possibly without an embedded JDK/JRE. As a compiled executable or something like that. And less than 10 MB total size. The core editor and a Plugin API. Obviously with some serious limitations compared to the bloatware IDEA. No UI designer, no J2ME support, no J2EE support, nothing like that. Java editing with Java project-file management and the strong and beloved refactoring support. That's probably all we need in a neat package.&lt;br /&gt;&lt;br /&gt;Kind of like a tight JEdit with the known cool Intelli/J UI.&lt;br /&gt;&lt;br /&gt;Well.. Just a thought..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114469198760900065?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.intellij.com' title='Intelli/J IDEA Light'/><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114469198760900065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114469198760900065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114469198760900065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114469198760900065'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/intellij-idea-light.html' title='Intelli/J IDEA Light'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114423478569377236</id><published>2006-04-05T12:59:00.000+02:00</published><updated>2006-04-05T13:33:27.086+02:00</updated><title type='text'>Extending Ruby: GPC</title><content type='html'>For the project mentioned in my previous post, I needed a way to 'clip' polygons. Polygons had to be intersected with a 'bounding box/shape' and they had to be triangulated.&lt;br /&gt;&lt;br /&gt;I was faced with the decision to either implement one of the known algorithms, find a Ruby polygon clipper, use an external implementation, write a Ruby extension providing access to one of the available c/c++ implementations.&lt;br /&gt;&lt;br /&gt;Performance is/was an issue. Geo data polygons can contain a large number of coordinates. And many polygons have to be processed.&lt;br /&gt;&lt;br /&gt;I immediately dropped the idea of writing a pure Ruby implementation. Mainly because I'm new to Ruby and I don't dig math at all.. :/&lt;br /&gt;&lt;br /&gt;I found no Ruby implementation after a few hours of searching the web.&lt;br /&gt;&lt;br /&gt;Then I started calling external implementations of 'hgrd', 'gpc' and some other polygon clippers via a primitive 'exec' call from Ruby. Obviously the performance was lousy. But I was able to deliver some first results quickly.&lt;br /&gt;&lt;br /&gt;I also realized that there a huge differences in clipping quality. And I finally settled for the 'GPC' from Alan Murta: &lt;a href="http://www.cs.man.ac.uk/%7Etoby/alan/software/"&gt;http://www.cs.man.ac.uk/~toby/alan/software/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After a few days I had to improve performance. So I started looking a 'extending Ruby'.&lt;br /&gt;&lt;br /&gt;I needed a few hours and a look at swig to finally 'grok' the way extending Ruby works. My first approaches - before swig - failed badly. I tried to map all 'native' objects' to Ruby somehow, providing all functions somehow.. a total mess..&lt;br /&gt;&lt;br /&gt;Looking at swig I was shocked by the ugly code. But at least I was able to derive some ideas. Interestingly enough, the swig code didn't really work. It didn't 'understand' the 'pointers' as 'arrays' used by the GPC. Or to be more precise: I didn't understand how to tell swig what to do..&lt;br /&gt;&lt;br /&gt;Anyway, after playing around with this code a few hours it finally clicked. It was then a matter of a few more hours to finish the extension using very simple - imho - code.&lt;br /&gt;&lt;br /&gt;Here's the code in case you're interested:&lt;br /&gt;&lt;a href="http://www.berlinfactor.com/blogging/files/gpc_ruby.c"&gt;http://www.berlinfactor.com/blogging/files/gpc_ruby.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I should probably send this to Alan Murta. But for now it's to 'raw'. No index/error checking at all..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114423478569377236?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114423478569377236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114423478569377236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423478569377236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423478569377236'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/extending-ruby-gpc.html' title='Extending Ruby: GPC'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114423475662323441</id><published>2006-04-05T12:58:00.000+02:00</published><updated>2006-04-05T12:59:16.626+02:00</updated><title type='text'>Ruby and Reality</title><content type='html'>I was lucky enough to be able to choose Ruby for implementing a small server for 'geo data'. Basically a service not unlike Google Maps. But much more simple and with vector output. The whole thing is used for providing data that can be used on a J2ME client.&lt;br /&gt;&lt;br /&gt;Anyway, because of some weird problems inside the company, I had to read a 2 GB big file containing the geo data in a stupid textual format.&lt;br /&gt;&lt;br /&gt;I started with a trivial 'each_line' approach. A 'data entry' in the file consisted of about 10 lines. The first 9 lines contained some attributes. The last line contained the coordinates of the represented geographic feature. So within the each_line block, i collected the data and attached a resulting 'GeoObject' instance to an output array whenever a data entry has been read completely.&lt;br /&gt;&lt;br /&gt;This thing took about 4 hours to process the 2 GB.. wtf!? Alright, I didn't think much when writing the code. And I only worked with Ruby for a few days. But some things were obvious to me: For example extracting all the 'values' out of a 'line' by extracting a string and calling 'to_i' is pretty inefficient.&lt;br /&gt;&lt;br /&gt;So I started implementing a few straight forward optimizations: Instead of extracting substrings from the line I directly add the 'bytes' to determine the integer value. And instead of 'each_line' I read 16 MB chunks of data and worked with offset/index pairs on these chunks.&lt;br /&gt;&lt;br /&gt;This improved performance by more than 50%. But still close to 2 hours.&lt;br /&gt;&lt;br /&gt;Funny me, I fired up Intelli/J IDEA. This took about 2 minutes.. (I hate how bloated IDEA is by now.. I'd love to see an IDEA Light!) And I started hacking away a Java solution. Using IDEA this took me less than 30 minutes for this problem. I used the NIO features. With 'getChannel' and some 'map' call to do memory mapped IO my first version of this app took about 5 minutes to process 2 GB.&lt;br /&gt;&lt;br /&gt;How's that?&lt;br /&gt;&lt;br /&gt;I can't explain all of this huge performance difference.. A part might be the memory mapped IO. But look at this Java API. Scanning the ByteBuffer using these 'get' calls.. I assume the Java VM is a lot more powerful than what Ruby's 'foundation' offers.&lt;br /&gt;&lt;br /&gt;Anyway.. just a quick post on this topic. If I find the time I'll post the code. Unfortunately I have to change some things to protect the innocent..&lt;br /&gt;&lt;br /&gt;I'll post another note on extending Ruby soon. I needed access to a polygon clipping library.. More on that soon..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114423475662323441?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114423475662323441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114423475662323441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423475662323441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423475662323441'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/ruby-and-reality.html' title='Ruby and Reality'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114423471139540588</id><published>2006-04-05T12:57:00.000+02:00</published><updated>2006-04-05T12:58:31.396+02:00</updated><title type='text'>Directory Opus: Aliases</title><content type='html'>alright.. a little gem.. you know about bookmark keywords, right? so you got about 1 million bookmarks (why?) and 10 of them are somewhat important. with firefox (and other browsers :) you can give those important bookmarks a keyword. then you enter this keyword in the address bar of the browser and the associated bookmark is loaded. you could use 'gn' for 'news.google.com' for example.&lt;br /&gt;&lt;br /&gt;well, dopus let's you do this on your file system. there are 'favorites' (bookmarks) in dopus. and you can define aliases. then you enter '/&lt;aliasname&gt;' in the lister address bar and you navigate to '/some/really/long/path/somewhere/else'.&lt;br /&gt;&lt;br /&gt;just a little feature.. but &lt;i&gt;sooo&lt;/i&gt; good to have.. i use this for example to alias certain locations on my samba server's file system. like the main sections of my web-sites, or my cruisecontrol home, and so on..&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114423471139540588?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114423471139540588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114423471139540588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423471139540588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423471139540588'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/directory-opus-aliases.html' title='Directory Opus: Aliases'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114423458601734258</id><published>2006-04-05T12:55:00.000+02:00</published><updated>2006-04-05T12:56:26.016+02:00</updated><title type='text'>Directory Opus Rulez</title><content type='html'>if you're still using the windows explorer for file management or if you're still stuck with one of the old school file management solutions (total/speed commander and the like) you simply have to check out &lt;a href="http://www.gpsoft.com.au/"&gt;directory opus&lt;/a&gt;: bringing &lt;i&gt;the&lt;/i&gt; file management solution from the old amiga days to the pc and taking things a step further every day.&lt;br /&gt;&lt;br /&gt;dopus is not limited to a single window with two lister panes. dopus replaces the windows explorer with new improved explorer windows.&lt;br /&gt;&lt;br /&gt;i think dopus compares to all other file management solutions like intelli/j idea compares to eclipse. it's not a generic file management framework where you can plugin tools and stuff in generic ways. but it is an integrated solution that has defined ways of extending it by plugging in tools and scripts.&lt;br /&gt;&lt;br /&gt;there are pros and cons about this. above everything else i'm missing a nice lister/vfs api. one of the strengths the other file managers have: you can write a WebDAV vfs plugin if you want. but then again, i'm not missing it that much.. because dopus is just &lt;i&gt;sooo&lt;/i&gt; useful with its built in feature set.&lt;br /&gt;&lt;br /&gt;i'll blog about some of these features from time to time, to share my excitement with you.. :)&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114423458601734258?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114423458601734258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114423458601734258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423458601734258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423458601734258'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/directory-opus-rulez.html' title='Directory Opus Rulez'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-25450844.post-114423392213737489</id><published>2006-04-05T12:43:00.000+02:00</published><updated>2006-04-05T19:20:02.100+02:00</updated><title type='text'>Windows Kiosk Mode Quick Hack</title><content type='html'>Following this information&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.brembs.net/litestep/win2k.html"&gt;http://www.brembs.net/litestep/win2k.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;it is quite easy to replace the windows explorer.exe with for example a kiosk.bat from which you could start Firefox or whatever tools you want to be running in 'kiosk mode'.&lt;br /&gt;&lt;br /&gt;Some additional reg hacks make sure the taskmanager is disabled. Setting some file permissions makes sure the file system can't be tampered with.&lt;br /&gt;&lt;br /&gt;Obviously this is still a very insecure system. But it fits my needs for setting up a laptop in kiosk mode for a small espresso bar around the corner.. The bar, btw, is highly recommended: &lt;a href="http://www.trescabezas.de"&gt;www.trescabezas.de&lt;/a&gt; If you should ever be in the east part of Berlin, drop by. I'll probably be around.. :)&lt;br /&gt;&lt;br /&gt;tfdj&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/25450844-114423392213737489?l=tfdj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tfdj.blogspot.com/feeds/114423392213737489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=25450844&amp;postID=114423392213737489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423392213737489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/25450844/posts/default/114423392213737489'/><link rel='alternate' type='text/html' href='http://tfdj.blogspot.com/2006/04/windows-kiosk-mode-quick-hack.html' title='Windows Kiosk Mode Quick Hack'/><author><name>The.French.DJ</name><uri>http://www.blogger.com/profile/06270068180864502987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://www.berlinfactor.com/blogging/tfdj.jpg'/></author><thr:total>0</thr:total></entry></feed>
