<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ary Boretc.</title>
	<atom:link href="http://weblogs.manas.com.ar/ary/feed/" rel="self" type="application/rss+xml" />
	<link>http://weblogs.manas.com.ar/ary</link>
	<description>Programando una manzana</description>
	<lastBuildDate>Thu, 17 Jun 2010 16:12:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Building an application to track expenses in one hour using GeoChat</title>
		<link>http://weblogs.manas.com.ar/ary/2010/06/17/154/</link>
		<comments>http://weblogs.manas.com.ar/ary/2010/06/17/154/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 03:33:30 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[GeoChat]]></category>
		<category><![CDATA[Nuntium]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=154</guid>
		<description><![CDATA[Whenever one of our team member travels to another country we tell her to track expenses like food, transportation and accomodation so that later that money can be refunded. Each of us does it in a different way: we write it in a notes application in a cellphone, or in a text file in our [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever one of our team member travels to another country we tell her to track expenses like food, transportation and accomodation so that later that money can be refunded. Each of us does it in a different way: we write it in a notes application in a cellphone, or in a text file in our computer, or maybe in a web application. The problem with the two first approaches is that the information might be lost: the machine might crash or be lost. The last approach is ok, but then you need to remember to connect to the internet to track the expense, and that can happen several hours after having paid, and our memory is not very good.</p>
<p>So I wanted to simply send an sms message to some number to track my expenses. I carry my cellphone all the time so I can send an sms immediately after paying something. Such an application seems very hard to do at first, specially because of the messaging component: receiving sms, configuring a number, etc. Doesn&#8217;t it?</p>
<p>Well, we have <a href="http://geochat.instedd.org">GeoChat</a>! GeoChat is an application that lets you  create groups of people to stay in touch with them. When a message is sent to a group it will be broadcasted to every member. And not necessarily to their mobile phone: each user can decide to receive emails, twitter updates, an instant message to their jabber client, etc. The original use case is for people in the field to report emergency and disaster situations to recover from them as quickly as possible. But that doesn&#8217;t mean we can use it for other purposes.</p>
<p>For example, one thing that you can do is configure a group in GeoChat to forward some or all of the messages to an <a href="http://geochathelp.com/doku.php?id=advanced:datasetservices&amp;s[]=dataset">external service</a>. You can also configure GeoChat not to broadcast its messages.</p>
<p>So here&#8217;s the idea: we&#8217;ll create a group and we&#8217;ll configure it to send every message to an external service. This service will receive messages like &#8220;shopping $20&#8243; or &#8220;accomodation $300&#8243;.</p>
<p>So I started coding it and in one hour I got it working! This new tool is called <a href="http://xpenz.heroku.com/">Xpenz</a>.</p>
<p>That shows us how easy is to build some applications on top of GeoChat. In fact, here we are not using much of GeoChat&#8217;s power, mainly the messaging component. For this you could instead use <a href="http://nuntium.googlecode.com/">Nuntium</a>, but I decided to use GeoChat since a lot of messaging is already configured for me and I also had the authentication problem solved.</p>
<p>The code is in <a href="http://code.google.com/p/xpenz/">Google Code</a>, so it&#8217;s open source. Let&#8217;s review the main logic:</p>
<pre>
class TrackController &lt; ApplicationController
  def expense
    name = params[:sender]
    if name.blank?
      head 'bad_request'
    else
      User.track :user =&gt; name, :message =&gt; request.raw_post
      head 'ok'
    end
  end
end
</pre>
<p>So basically we are getting the sender query parameter, which is the GeoChat login name, and if it is present we track the expense by using the request raw post body. And here&#8217;s User#track:</p>
<pre>
def self.track(options)
    user = User.find_or_create_by_name options[:user]
    pieces = options[:message].split(' ')
    pieces.map!{|x| x.start_with?('$') ? x[1 .. -1] : x}

    numbers = pieces.select{|x| x.float?}
    texts = pieces.select{|x| !x.float?}
    text = texts.join(' ')

    if numbers.length == 0
      user.currency = text
      user.save!
    else
      if numbers.length == 1
        amount = numbers[0].to_f
      else
        amount = numbers.last
        numbers[0 .. -2].reverse.each{|n| text = "#{n} #{text}"}
      end
      Expense.create! :user =&gt; user, :amount =&gt; amount, :reason =&gt; text, :currency =&gt; user.currency
    end
  end
</pre>
<p>So the first line finds or create the user in xpenz for the GeoChat user. Then we split the message in spaces and do some logic do termine whether it&#8217;s a currency change or an expense track.</p>
<p>The main point here is that I just had to write about 20 lines of code to make it work. Well, maybe 50 because <a href="http://code.google.com/p/xpenz/source/browse/test/functional/track_controller_test.rb">I tested it</a>. <img src='http://weblogs.manas.com.ar/ary/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2010/06/17/154/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick way to test many values in ruby</title>
		<link>http://weblogs.manas.com.ar/ary/2010/04/15/quick-way-to-test-many-values-in-ruby/</link>
		<comments>http://weblogs.manas.com.ar/ary/2010/04/15/quick-way-to-test-many-values-in-ruby/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 15:36:13 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=139</guid>
		<description><![CDATA[Many times we end up having similar tests: same logic but different inputs and expected outputs. For example, suppose we need to test our brand new sqrt function: test "sqrt 1" do assert_equals 1, sqrt(1) end test "sqrt 4" do assert_equals 2, sqrt(4) end test "sqrt 9" do assert_equals 3, sqrt(9) end Here we are [...]]]></description>
			<content:encoded><![CDATA[<p>Many times we end up having similar tests: same logic but different inputs and expected outputs. For example, suppose we need to test our brand new sqrt function:</p>
<pre>
test "sqrt 1" do
  assert_equals 1, sqrt(1)
end

test "sqrt 4" do
  assert_equals 2, sqrt(4)
end

test "sqrt 9" do
  assert_equals 3, sqrt(9)
end
</pre>
<p>Here we are dupplicating code, since &#8220;assert_equals X, sqrt(Y)&#8221; is written all over the place. The naive way to refactor this is:</p>
<pre>
def assert_sqrt(input, output)
  assert_equals output, sqrt(input)
end

test "sqrt 1" do
  assert_sqrt 1, 1
end

test "sqrt 4" do
  assert_sqrt 4, 2
end

test "sqrt 9" do
  assert_sqrt 9, 3
end
</pre>
<p>Much better.</p>
<p>Some languages provide tools to deal with this problem in a nicer way. In C# you can do this:</p>
<pre>
[Test]
public void TestSqrt(
  Values(
    new int[] { 1, 1 },
    new int[] { 4, 2 },
    new int[] { 9, 3 }
    ) int[] values) {
  Assert.Equals(values[1], Sqrt(values[0]));
}
</pre>
<p>So here we are supplying a set of values for our test. (maybe not much nicer, but the code duplication is gone)</p>
<p>The thing I like most about ruby is that the language gives you the tools to get the most out of your code so you don&#8217;t end up inventing classes, attributes or whatever just to make something as simple as supplying many values to a test.</p>
<p>Here&#8217;s a better way to do it in ruby:</p>
<pre>
[[1, 1], [4, 2], [9, 3]].each do |values|
  test "sqrt #{values[0]}"
    assert_equal values[1], sqrt(values[0])
  end
end
</pre>
<p>Very good!</p>
<p>What makes this possible?</p>
<ol>
<li>Ruby lets you define code that will be executed at the class definition level</li>
<li>Ruby lets you define methods dynamically (here the test function defines a &#8220;test_&#8230;&#8221; method)</li>
</ol>
<p>Those two particularities makes the language really nice to work with.</p>
<p>Oh, but wait, there&#8217;s one more thing. I just found out I can do |input, output| in that last piece of code. It seems that if you iterate an array of arrays, you can specify many arguments to the given block and the i-th argument will match the i-th element of the array, so you don&#8217;t end up doing values[0] and values[1], which obfuscates the meaning of our code. Thanks again, ruby!</p>
<p>So, here&#8217;s the final code:</p>
<pre>
[[1, 1], [4, 2], [9, 3]].each do |input, output|
  test "sqrt #{input}"
    assert_equal output, sqrt(input)
  end
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2010/04/15/quick-way-to-test-many-values-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>String concatenation in ruby</title>
		<link>http://weblogs.manas.com.ar/ary/2010/02/22/string-concatenation-in-ruby/</link>
		<comments>http://weblogs.manas.com.ar/ary/2010/02/22/string-concatenation-in-ruby/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 14:16:01 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=133</guid>
		<description><![CDATA[I just found out the difference between += and &#60;&#60; when used for a string. irb(main):001:0&#62; str = 'chan' =&#62; "chan" irb(main):002:0&#62; str.object_id =&#62; 69952758899780 irb(main):003:0&#62; str += 'ged' =&#62; "changed" irb(main):004:0&#62; str.object_id =&#62; 69952758848800 irb(main):005:0&#62; str &#60;&#60; ', now not' =&#62; "changed, now not" irb(main):006:0&#62; str.object_id =&#62; 69952758848800 So I think that basically you [...]]]></description>
			<content:encoded><![CDATA[<p>I just found out the difference between += and &lt;&lt; when used for a string.</p>
<pre>irb(main):001:0&gt; str = 'chan'
=&gt; "chan"
irb(main):002:0&gt; str.object_id
=&gt; 69952758899780
irb(main):003:0&gt; str += 'ged'
=&gt; "changed"
irb(main):004:0&gt; str.object_id
=&gt; 69952758848800
irb(main):005:0&gt; str &lt;&lt; ', now not'
=&gt; "changed, now not"
irb(main):006:0&gt; str.object_id
=&gt; 69952758848800</pre>
<p>So I think that basically you should never use += for strings, unless you really want to hurt the garbage collector.</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2010/02/22/string-concatenation-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby-Jump plugin for gedit</title>
		<link>http://weblogs.manas.com.ar/ary/2010/02/10/ruby-jump-plugin-for-gedit/</link>
		<comments>http://weblogs.manas.com.ar/ary/2010/02/10/ruby-jump-plugin-for-gedit/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:11:01 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=125</guid>
		<description><![CDATA[I searched the internet for a gedit plugin that would allow me to press a key and jump (navigate) to the file where a ruby class is defined. I couldn&#8217;t find one so I wrote one (I know about Geany but I couldn&#8217;t find that functionality there either). Usage If the file you are editing [...]]]></description>
			<content:encoded><![CDATA[<p>I searched the internet for a gedit plugin that would allow me to press a key and jump (navigate) to the file where a ruby class is defined. I couldn&#8217;t find one so I wrote one (I know about Geany but I couldn&#8217;t find that functionality there either).</p>
<p><strong>Usage</strong></p>
<p>If the file you are editing is located in a ruby on rails projects, this will work automatically. If not, you will need to have the FileBrowser plugin installed and activated. The file browser should be pointing to your project&#8217;s root path.</p>
<p>Pressing F3 will jump to the file of the name under the cursor. This uses ruby convention so if your cursor is over the word SomeClass the file some_class.rb will be opened. It also works for some plural forms, so pressing F3 over :my_messages will try to open my_message.rb.</p>
<p>Pressing F4 goes to the test file of the name under the cursor, or to the test file of the current document if no match was found for the previous search. So pressing F4 over SomeClass will open some_class_test.rb.</p>
<p><strong>Download</strong></p>
<p><a href="http://dl.dropbox.com/u/579084/ruby-jump_0.2.tar.gz">ruby-jump_0.2.tar.gz</a> &#8211; Extract the contents of the file in /home/<em>youruser</em>/.gnome2/gedit/plugins</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2010/02/10/ruby-jump-plugin-for-gedit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Keep an eye open on what LINQ does</title>
		<link>http://weblogs.manas.com.ar/ary/2009/08/11/keep-an-eye-open-on-what-linq-does/</link>
		<comments>http://weblogs.manas.com.ar/ary/2009/08/11/keep-an-eye-open-on-what-linq-does/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 15:16:44 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=121</guid>
		<description><![CDATA[Today I was profiling an application. The timings pointed to a piece of code that executed a query using LINQ. I opened an SQL profiler and saw what queries were performed. Here they are: SELECT [t3].[value] AS [Key] FROM ( SELECT ( SELECT [t2].[Role] FROM ( SELECT TOP (1) [t1].[Role] FROM [dbo].[Membership] AS [t1] WHERE [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was profiling an application. The timings pointed to a piece of code that executed a query using LINQ. I opened an SQL profiler and saw what queries were performed. Here they are:</p>
<pre style="overflow: auto;height: 100px">SELECT [t3].[value] AS [Key]
FROM (
SELECT (
SELECT [t2].[Role]
FROM (
SELECT TOP (1) [t1].[Role]
FROM [dbo].[Membership] AS [t1]
WHERE ([t1].[UserID] = @p0) AND ([t1].[SocialID] = [t0].[Id])
) AS [t2]
) AS [value], [t0].[Id], [t0].[IsPrivate]
FROM [dbo].[Social] AS [t0]
) AS [t3]
WHERE (EXISTS(
SELECT NULL AS [EMPTY]
FROM [dbo].[Membership] AS [t4]
WHERE ([t4].[UserID] = @p1) AND ([t4].[SocialID] = [t3].[Id])
)) AND ((NOT ([t3].[IsPrivate] = 1)) OR (EXISTS(
SELECT NULL AS [EMPTY]
FROM [dbo].[Membership] AS [t5]
WHERE ([t5].[UserID] = @p2) AND ([t5].[SocialID] = [t3].[Id])
)))
GROUP BY [t3].[value]</pre>
<pre style="overflow: auto;height: 100px">SELECT [t0].[Id], [t0].[SocialName], [t0].[Title], [t0].[Description], [t0].[IsPrivate], [t0].[CreationDate], [t0].[LastModified], [t0].[Logo], [t0].[LogoUrl], [t0].[CustomSidebar], [t0].[AuthenticatedUserRole], [t0].[Activity]
FROM [dbo].[Social] AS [t0]
WHERE (((@x1 IS NULL) AND (((
SELECT [t2].[Role]
FROM (
SELECT TOP (1) [t1].[Role]
FROM [dbo].[Membership] AS [t1]
WHERE ([t1].[UserID] = @p0) AND ([t1].[SocialID] = [t0].[Id])
) AS [t2]
)) IS NULL)) OR ((@x1 IS NOT NULL) AND (((
SELECT [t4].[Role]
FROM (
SELECT TOP (1) [t3].[Role]
FROM [dbo].[Membership] AS [t3]
WHERE ([t3].[UserID] = @p0) AND ([t3].[SocialID] = [t0].[Id])
) AS [t4]
)) IS NOT NULL) AND (@x1 = ((
SELECT [t6].[Role]
FROM (
SELECT TOP (1) [t5].[Role]
FROM [dbo].[Membership] AS [t5]
WHERE ([t5].[UserID] = @p0) AND ([t5].[SocialID] = [t0].[Id])
) AS [t6]
))))) AND (EXISTS(
SELECT NULL AS [EMPTY]
FROM [dbo].[Membership] AS [t7]
WHERE ([t7].[UserID] = @p1) AND ([t7].[SocialID] = [t0].[Id])
)) AND ((NOT ([t0].[IsPrivate] = 1)) OR (EXISTS(
SELECT NULL AS [EMPTY]
FROM [dbo].[Membership] AS [t8]
WHERE ([t8].[UserID] = @p2) AND ([t8].[SocialID] = [t0].[Id])
)))
ORDER BY [t0].[Title]</pre>
<p>It doesn&#8217;t matter what the LINQ code that generated that query was. It looked &#8220;nice&#8221;. What matters is that I was able to change that LINQ code to do the same thing but using a different expression (instead of using EntitySets in the query, I used context.GetTable&lt;&#8230;&gt; and made the joins myself). Here&#8217;s the resulting query:</p>
<pre style="overflow: auto;height: 100px">SELECT [t0].[Id], [t0].[SocialName], [t0].[Title], [t0].[Description], [t0].[IsPrivate], [t0].[CreationDate], [t0].[LastModified], [t0].[Logo], [t0].[LogoUrl], [t0].[CustomSidebar], [t0].[AuthenticatedUserRole], [t0].[Activity], [t1].[Role]
FROM [dbo].[Social] AS [t0], [dbo].[Membership] AS [t1]
WHERE ([t0].[Id] = [t1].[SocialID]) AND ([t1].[UserID] = @p0)</pre>
<p>The timings were lower than with the previous queries.</p>
<p>So my recomendation is that you keep an eye open (preferably an SQL profiler open) to see how LINQ translates are queries.</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2009/08/11/keep-an-eye-open-on-what-linq-does/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse plugin to exclude svn and cvs folders in text search</title>
		<link>http://weblogs.manas.com.ar/ary/2009/06/19/eclipse-plugin-to-exclude-svn-and-cvs-folders-in-text-search/</link>
		<comments>http://weblogs.manas.com.ar/ary/2009/06/19/eclipse-plugin-to-exclude-svn-and-cvs-folders-in-text-search/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 18:15:46 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=111</guid>
		<description><![CDATA[Once again, Sergio was complaining because matches inside svn folders were showing up in search results. Since I like challenges, I wrote this small Eclipse plugin that excludes .svn and CVS folders from searches. Here&#8217;s the relevant file (contains also the source code). To activate it, first copy it to your plugins folder, restart Eclipse, [...]]]></description>
			<content:encoded><![CDATA[<p>Once again, Sergio was complaining because matches inside svn folders were showing up in search results. Since I like challenges, I wrote this small Eclipse plugin that excludes .svn and CVS folders from searches.</p>
<p>Here&#8217;s the <a href='http://weblogs.manas.com.ar/ary/wp-content/uploads/2009/06/comasteritebettersearchengine_100.jar'>relevant file</a> (contains also the source code).</p>
<p>To activate it, first copy it to your plugins folder, restart Eclipse, go to Windows -> Preferences -> General -> Search and select &#8220;Better Search Engine&#8221; in &#8220;Text Search Engine to be used&#8221;.</p>
<p><b>Update</b>: <a href="http://weblogs.manas.com.ar/ary/wp-content/uploads/2009/06/comasteritebettersearchengine_for35_100.jar">Here</a>&#8216;s the same plugin for Eclipse 3.5 (the other won&#8217;t work).</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2009/06/19/eclipse-plugin-to-exclude-svn-and-cvs-folders-in-text-search/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Eclipse Plugin to sort proposals by hierarchy</title>
		<link>http://weblogs.manas.com.ar/ary/2009/03/16/eclipse-plugin-to-sort-proposals-by-hierarchy/</link>
		<comments>http://weblogs.manas.com.ar/ary/2009/03/16/eclipse-plugin-to-sort-proposals-by-hierarchy/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 13:32:59 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=94</guid>
		<description><![CDATA[Again, Sergio, a friend of mine, came up with a need: to sort Eclipse Java proposals by hierarchy. What that means is that if you have a type C < B < A (where Preferences -> Java -> Editor -> Content Assist and select &#8220;by hierarchy&#8221; in the combo &#8220;Sort proposals&#8221;. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>Again, <a href="http://weblogs.manas.com.ar/smedina/" target="_blank">Sergio</a>, a friend of mine, came up with a need: to sort Eclipse Java proposals by hierarchy. What that means is that if you have a type <span style="font-family:monospace">C < B < A</span> (where <strong style="font-family:monospace"><</strong> means <strong>subclass of</strong>), first <span style="font-family:monospace">C</span>&#8216;s methods will be shown, then <span style="font-family:monospace">B</span>&#8216;s methods and finally <span style="font-family:monospace">A</span>&#8216;s methods.</p>
<p>This is specially useful when writing GUI code with libraries like <a href="http://en.wikipedia.org/wiki/Swing_(Java)"target="_blank">Swing</a> or <a href="http://www.eclipse.org/swt/"target="_blank">SWT</a>, because when you request a <span style="font-family:monospace">ComboBox</span>&#8216;s members you&#8217;d <em>normally</em> want to set or change the items to show, what to do when you select an item, maybe less often what&#8217;s the size of the component, etc. You&#8217;d almost never use methods in bottom-level classes like <span style="font-family:monospace">Object</span>.</p>
<p>So I made a plugin that does exactly that. And better: the proposals are first sort by hierarchy and then by relevance (<a href="http://www.eclipse.org/jdt/"target="_blank">JDT</a>&#8216;s default order which takes into account, for example, the type of the expected expression).</p>
<p>You can <a href='http://weblogs.manas.com.ar/ary/wp-content/uploads/2009/03/asteriteserchproposals_102.jar'>download</a> a copy for free that comes with the source code. To active it first copy the JAR into your plugins directory. Then open Eclipse and go to Windows -> Preferences -> Java -> Editor -> Content Assist and select &#8220;by hierarchy&#8221; in the combo &#8220;Sort proposals&#8221;.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2009/03/16/eclipse-plugin-to-sort-proposals-by-hierarchy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Black theme for Eclipse</title>
		<link>http://weblogs.manas.com.ar/ary/2009/03/13/black-theme-for-eclipse/</link>
		<comments>http://weblogs.manas.com.ar/ary/2009/03/13/black-theme-for-eclipse/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 18:24:49 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=62</guid>
		<description><![CDATA[A friend of mine just asked me if I had a black theme for Eclipse similar to this one. I didn&#8217;t, so I made one. Here&#8217;s the result (click to enlarge): You can download a copy of it. To start using it you must extract the zip file in $workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings where $workspace is your workspace [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://weblogs.manas.com.ar/smedina/" target="_blank">friend </a>of mine just asked me if I had a black theme for Eclipse similar to <a href="http://blog.wekeroad.com/2007/10/17/textmate-theme-for-visual-studio-take-2/" target="_blank">this one</a>. I didn&#8217;t, so I made one. Here&#8217;s the result (click to enlarge):</p>
<p><a href="http://weblogs.manas.com.ar/ary/wp-content/uploads/2009/03/blacklipse.jpg" target="_blank"><img src="http://weblogs.manas.com.ar/ary/wp-content/uploads/2009/03/blacklipse_small.jpg" alt="A screenshot of the Black Theme for Eclipse" title="blacklipse_small" /></a></p>
<p>You can <a href='http://weblogs.manas.com.ar/ary/wp-content/uploads/2009/03/blacklipse.zip'>download</a> a copy of it. To start using it you must <strong>extract the zip file in</strong></p>
<p><span style="font-family:monospace">$workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings</span></p>
<p>where <span style="font-family:monospace">$workspace</span> is your workspace location.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2009/03/13/black-theme-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Neyun: an awesome way to visualize your content</title>
		<link>http://weblogs.manas.com.ar/ary/2009/03/12/neyun-an-awesome-way-to-visualize-your-content/</link>
		<comments>http://weblogs.manas.com.ar/ary/2009/03/12/neyun-an-awesome-way-to-visualize-your-content/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 12:30:55 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Neyun]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=47</guid>
		<description><![CDATA[As you might already read here and here, the beta release of Neyun is finally with us! In a nutshell: it&#8217;s a web application that allows you to extract your emails, contacts, photos, videos and more from services like Gmail, Facebook, YouTube and Twitter and see them all at once. So&#8230; why use Neyun when [...]]]></description>
			<content:encoded><![CDATA[<p>As you might already read <a href="http://weblogs.manas.com.ar/mverzilli/?p=12">here </a>and <a href="http://weblogs.manas.com.ar/spalladino/?p=40">here</a>, the beta release of <a href="http://www.neyun.com/">Neyun </a> is finally with us!</p>
<p>In a nutshell: it&#8217;s a web application that allows you to extract your emails, contacts, photos, videos and more from services like Gmail, Facebook, YouTube and Twitter and see them all at once.</p>
<p>So&#8230; why use Neyun when you already have access to all these services in their websites? Well, Neyun allows you do do some things you can&#8217;t do otherwise, for example:</p>
<ul>
<li>Since all your information is accessible in a single place you can search over all your content at once and find results in your emails, photos, videos, etc.</li>
<li>Even wanted to search photos in Facebook? Just connect your Facebook account to Neyun and search!</li>
<li>Want to see your friends&#8217; birthdays in a nice way? Turn on the timeline and drag the &#8220;Contact&#8221; icon to the left.</li>
<li>Want to see some photos in a cool way? First search or filter your content as you wish and then turn on <a href="http://www.cooliris.com/">Cool Iris</a>. For me, that&#8217;s one of the coolest features in Neyun.</li>
<li>See a <a href="http://en.wikipedia.org/wiki/Tag_cloud">tag cloud</a> of all your content.</li>
<li>Explore all your stuff in a timeline so you can quickly see, for example, which mails and twitters your receieved, and which photos you uploaded when you graduated.</li>
</ul>
<p>I must say I&#8217;m pretty excited about this new application. I think you&#8217;ll love it, specially if you are into all this cool applications.</p>
<p>There are sure a lot of other nice things you can do with Neyun. If you find something cool you can do with it please send me a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2009/03/12/neyun-an-awesome-way-to-visualize-your-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indentation also means something else&#8230;</title>
		<link>http://weblogs.manas.com.ar/ary/2009/03/04/indentation-means-also-something-else/</link>
		<comments>http://weblogs.manas.com.ar/ary/2009/03/04/indentation-means-also-something-else/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 04:04:36 +0000</pubDate>
		<dc:creator>ary</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://weblogs.manas.com.ar/ary/?p=34</guid>
		<description><![CDATA[Some days ago I read this in the Digital Mars D programming language newsgroup. bearophile says: From: http://jeremymanson.blogspot.com/2009/02/small-language-changes-for-jdk7.html Automated Resource Blocks, to be able to say things like: try (BufferedReader br = new BufferedReader(new FileReader(path)) { return br.readLine(); } instead of: BufferedReader br = new BufferedReader(new FileReader(path)); try { return br.readLine(); } finally { br.close(); [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I read this in the Digital Mars <a href="http://digitalmars.com/d">D programming language</a> <a href="http://www.digitalmars.com/webnews/newsgroups.php?search_txt=&amp;group=digitalmars.D">newsgroup</a>.</p>
<p>bearophile says:</p>
<div style="margin-left:10px; padding: 4px; background: #EFEFEF; border:1px solid #BCBCBC">From:<br />
<a href="http://jeremymanson.blogspot.com/2009/02/small-language-changes-for-jdk7.html" target="_blank">http://jeremymanson.blogspot.com/2009/02/small-language-changes-for-jdk7.html</a></p>
<p>Automated Resource Blocks, to be able to say things like:</p>
<pre>
try (BufferedReader br = new BufferedReader(new FileReader(path)) {
    return br.readLine();
}
</pre>
<p>instead of:</p>
<pre>
BufferedReader br = new BufferedReader(new FileReader(path));
try {
    return br.readLine();
} finally {
    br.close();
}
</pre>
</div>
<p>and Andrei Alexandrescu (one of the designers behind the language) replies:</p>
<div style="margin-left:10px; padding: 4px; background: #EFEFEF; border:1px solid #BCBCBC">
They keep on missing the point that the blessed code on the normal path <strong>must not take the hit of an extra indentation level</strong>.
</div>
<p>And he&#8217;s so right!</p>
<p>In D you&#8217;d write it like this:</p>
<div style="margin-left:10px; padding: 4px; background: #EFEFEF; border:1px solid #BCBCBC">
<pre>
Disposable disp = new Disposable();
scope(exit) disp.dispose(); // you can use braces too: scope(exit) { }

disp.doSomething();
disp.doSomethingElse();
</pre>
</div>
<p>I think this concept is really important. You want the important logic of your method to be always at the same indentation level. The things that, well, you need to do to cleanup things, catch errors, etc., should be on a separate indentation level so that the reader of the code (and that can be you, later!) understands it better.</p>
<p>That&#8217;s why I prefer this:</p>
<div style="margin-left:10px; padding: 4px; background: #EFEFEF; border:1px solid #BCBCBC">
<pre>
void process(Foo someObject) {
  if (isNotValidForThisFunctionBecauseOfBar(someObject))
    return;

  if (isNotValidForThisFunctionBecauseOfBaz(someObject))
    return;

  // do something else with someObject
}
</pre>
</div>
<p>instead of this:</p>
<div style="margin-left:10px; padding: 4px; background: #EFEFEF; border:1px solid #BCBCBC">
<pre>
void process(Foo someObject) {
  if (isValidForThisFunctionBecauseOfBar(someObject)) {
    if (isValidForThisFunctionBecauseOfBaz(someObject)) {
      // do something with someObject
    }
  }
}
</pre>
</div>
<p>Those last indentation levels are distracting. They are forcing you to read on cascade. The first example clearly marks which are the invalid values for the function, or the exceptional values to be handled, while the second one mixes those conditions with the main logic.</p>
]]></content:encoded>
			<wfw:commentRss>http://weblogs.manas.com.ar/ary/2009/03/04/indentation-means-also-something-else/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
