<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Otaku, Cedric&#039;s blog</title>
	<atom:link href="http://beust.com/weblog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://beust.com/weblog</link>
	<description>Thoughts about software development</description>
	<lastBuildDate>Thu, 10 May 2012 16:08:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on My Rubik&#8217;s cube solution by Karin</title>
		<link>http://beust.com/weblog/2004/04/13/my-rubiks-cube-solution/comment-page-1/#comment-14073</link>
		<dc:creator>Karin</dc:creator>
		<pubDate>Thu, 10 May 2012 16:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1245#comment-14073</guid>
		<description>Thanks for posting this. I too memorized the solutions when I was young, and then was able to straighten up almost the whole cube recently, just letting my fingers do what they remembered. But I could NOT remember how to place and orient the last corners. Once I saw your solution for how to place them, my fingers &quot;remembered&quot; those same steps. The way you orient the corners is different from what I learned, but so easy! So hopefully i&#039;ll be able to remember these now!</description>
		<content:encoded><![CDATA[<p>Thanks for posting this. I too memorized the solutions when I was young, and then was able to straighten up almost the whole cube recently, just letting my fingers do what they remembered. But I could NOT remember how to place and orient the last corners. Once I saw your solution for how to place them, my fingers &#8220;remembered&#8221; those same steps. The way you orient the corners is different from what I learned, but so easy! So hopefully i&#8217;ll be able to remember these now!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why Scala&#8217;s &#8220;Option&#8221; and Haskell&#8217;s &#8220;Maybe&#8221; types won&#8217;t save you from null by Greg</title>
		<link>http://beust.com/weblog/2010/07/28/why-scalas-option-and-haskells-maybe-types-wont-save-you-from-null/comment-page-2/#comment-14023</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Sat, 05 May 2012 12:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=795#comment-14023</guid>
		<description>I guess others have pointed this out, but the beauty of Option[T] is that the return type of a function tells you whether the return value might be &quot;Oops.&quot;

That way, you don&#039;t have to guess, and your understanding of the return type is even checked by the compiler.

You still use exceptions to signal major errors. But, e.g., asking a map for a key it doesn&#039;t have shouldn&#039;t throw an exception, it returns None.</description>
		<content:encoded><![CDATA[<p>I guess others have pointed this out, but the beauty of Option[T] is that the return type of a function tells you whether the return value might be &#8220;Oops.&#8221;</p>
<p>That way, you don&#8217;t have to guess, and your understanding of the return type is even checked by the compiler.</p>
<p>You still use exceptions to signal major errors. But, e.g., asking a map for a key it doesn&#8217;t have shouldn&#8217;t throw an exception, it returns None.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Scala&#8217;s parallel collections by Ben Wing</title>
		<link>http://beust.com/weblog/2011/08/15/scalas-parallel-collections/comment-page-1/#comment-13983</link>
		<dc:creator>Ben Wing</dc:creator>
		<pubDate>Sat, 28 Apr 2012 04:55:58 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1421#comment-13983</guid>
		<description>Another data point here.  I&#039;m working on a computational linguistics package called TextGrounder, whose purpose is to automatically geolocate documents based on their text, given a set of geolocated documents (e.g. a large collection of tweets annotated with latitude/longitude coordinates).  It was originally written in Python; when I converted it to Scala it got an order of magnitude faster -- but unfortunately took up about 3x the memory, which for me is a big issue since the processes are sometimes 40GB or more due to having to divide the earth up into hundreds of thousands or millions of grid cells and create hash tables of word counts for each cell.

Even so, testing on large enough corpora of documents sometimes takes several hours or even several days.  I added Hadoop support but it was PAINFUL to write and it&#039;s incredibly temperamental trying to get it working.  In addition, it&#039;s a heavy-weight solution since each separate node has to create the entire cell grid and eat up all sorts of memory, meaning I can only have one or two worker tasks per 48GB, 8-core machine.  

I tried switching the inner loop to the .par() version.  Things immediately broke because of some non-thread-safe code that was using and reusing a static array to avoid lots of unnecessary garbage collection; but with this issue fixed, I get about a 6x speedup (average CPU usage about 600% according to &#039;top&#039;) on the 8-core machines.  This is a big win and uses up no additional memory because the cell grid is shared.

I&#039;m not sure why I&#039;m not getting completely efficient CPU usage, and it definitely would be nice to have some way of tuning the innards, but even so, it&#039;s a lot of gain for not very much work (and would have been no work at all if my code were thread-safe from the beginning).

BTW Cedric: See my comment above about &#039;top&#039; -- that&#039;s how you figure out whether multiple threads are being used.</description>
		<content:encoded><![CDATA[<p>Another data point here.  I&#8217;m working on a computational linguistics package called TextGrounder, whose purpose is to automatically geolocate documents based on their text, given a set of geolocated documents (e.g. a large collection of tweets annotated with latitude/longitude coordinates).  It was originally written in Python; when I converted it to Scala it got an order of magnitude faster &#8212; but unfortunately took up about 3x the memory, which for me is a big issue since the processes are sometimes 40GB or more due to having to divide the earth up into hundreds of thousands or millions of grid cells and create hash tables of word counts for each cell.</p>
<p>Even so, testing on large enough corpora of documents sometimes takes several hours or even several days.  I added Hadoop support but it was PAINFUL to write and it&#8217;s incredibly temperamental trying to get it working.  In addition, it&#8217;s a heavy-weight solution since each separate node has to create the entire cell grid and eat up all sorts of memory, meaning I can only have one or two worker tasks per 48GB, 8-core machine.  </p>
<p>I tried switching the inner loop to the .par() version.  Things immediately broke because of some non-thread-safe code that was using and reusing a static array to avoid lots of unnecessary garbage collection; but with this issue fixed, I get about a 6x speedup (average CPU usage about 600% according to &#8216;top&#8217;) on the 8-core machines.  This is a big win and uses up no additional memory because the cell grid is shared.</p>
<p>I&#8217;m not sure why I&#8217;m not getting completely efficient CPU usage, and it definitely would be nice to have some way of tuning the innards, but even so, it&#8217;s a lot of gain for not very much work (and would have been no work at all if my code were thread-safe from the beginning).</p>
<p>BTW Cedric: See my comment above about &#8216;top&#8217; &#8212; that&#8217;s how you figure out whether multiple threads are being used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Erasure vs reification by Andrew Lee Rubinger</title>
		<link>http://beust.com/weblog/2011/07/29/erasure-vs-reification/comment-page-1/#comment-13982</link>
		<dc:creator>Andrew Lee Rubinger</dc:creator>
		<pubDate>Sat, 28 Apr 2012 02:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1384#comment-13982</guid>
		<description>Alternate workaround to the &quot;Overloading&quot; example: Change the return type.</description>
		<content:encoded><![CDATA[<p>Alternate workaround to the &#8220;Overloading&#8221; example: Change the return type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Dark Souls by R Caloca</title>
		<link>http://beust.com/weblog/2012/04/26/dark-souls/comment-page-1/#comment-13980</link>
		<dc:creator>R Caloca</dc:creator>
		<pubDate>Thu, 26 Apr 2012 20:53:18 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1774#comment-13980</guid>
		<description>Also try the &#039;original&#039; Demon&#039;s Souls after beating it, you&#039;ll like it!</description>
		<content:encoded><![CDATA[<p>Also try the &#8216;original&#8217; Demon&#8217;s Souls after beating it, you&#8217;ll like it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Solution to the quiz by Gon</title>
		<link>http://beust.com/weblog/2011/10/29/solution-to-the-quiz/comment-page-1/#comment-13937</link>
		<dc:creator>Gon</dc:creator>
		<pubDate>Fri, 20 Apr 2012 05:10:29 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1620#comment-13937</guid>
		<description>I assume that a, b, c, and d are possible answers to the given question. The universe here is constituted by the following parallel universes:
1) One of the answers is correct
2) Two answers are correct
3) The correct answer is not among the given possibilities
(there cannot be 3 or more answers correct, since the probability is only one, and the only repeated answer is 25%, being repeated twice)

Now, I consider the aforementioned scenarios:
CASE 1: One of the answers given (either a, b, c, or d) is correct.
In this case, without looking the actual answers, it&#039;s easy to understand that the chance to be correct is 25%.
Looking at the four possibilities, we see that both a and d indicate 25%: there are two correct answers, which is INCOMPATIBLE WITH THE SCENARIO.

CASE 2: Two of the answers given are correct at the same time.
The only way for this to be possible is that both a and d would be correct, and then the actual answer for the question would be 50%. NICE. Now when we want to map the 50% to its corresponding letter, we discover that only one option shows that number, which is INCOMPATIBLE WITH THE SCENARIO.

We are left with scenario 3: The correct answer is NOT LISTED, hence the answer to the question is 0%.

In this &quot;answer&quot; post, you are actually CHANGING THE QUESTION. However, I guess that is what some teachers would do, but does not justify B being correct whatsoever!!</description>
		<content:encoded><![CDATA[<p>I assume that a, b, c, and d are possible answers to the given question. The universe here is constituted by the following parallel universes:<br />
1) One of the answers is correct<br />
2) Two answers are correct<br />
3) The correct answer is not among the given possibilities<br />
(there cannot be 3 or more answers correct, since the probability is only one, and the only repeated answer is 25%, being repeated twice)</p>
<p>Now, I consider the aforementioned scenarios:<br />
CASE 1: One of the answers given (either a, b, c, or d) is correct.<br />
In this case, without looking the actual answers, it&#8217;s easy to understand that the chance to be correct is 25%.<br />
Looking at the four possibilities, we see that both a and d indicate 25%: there are two correct answers, which is INCOMPATIBLE WITH THE SCENARIO.</p>
<p>CASE 2: Two of the answers given are correct at the same time.<br />
The only way for this to be possible is that both a and d would be correct, and then the actual answer for the question would be 50%. NICE. Now when we want to map the 50% to its corresponding letter, we discover that only one option shows that number, which is INCOMPATIBLE WITH THE SCENARIO.</p>
<p>We are left with scenario 3: The correct answer is NOT LISTED, hence the answer to the question is 0%.</p>
<p>In this &#8220;answer&#8221; post, you are actually CHANGING THE QUESTION. However, I guess that is what some teachers would do, but does not justify B being correct whatsoever!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sublime Lion King by Antony</title>
		<link>http://beust.com/weblog/2004/02/03/sublime-lion-king/comment-page-1/#comment-13936</link>
		<dc:creator>Antony</dc:creator>
		<pubDate>Thu, 19 Apr 2012 23:28:30 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=96#comment-13936</guid>
		<description>This show was absolutely awesome! I had seen it 7 or 8 years ago and I&#039;ve been wanting to see it again for a while. I finally went and it was well worth it. All the costumes and sets were out of this world!</description>
		<content:encoded><![CDATA[<p>This show was absolutely awesome! I had seen it 7 or 8 years ago and I&#8217;ve been wanting to see it again for a while. I finally went and it was well worth it. All the costumes and sets were out of this world!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Five reasons why you should rejoice about Kotlin by Nicholas Sterling</title>
		<link>http://beust.com/weblog/2011/07/20/five-reasons-why-should-rejoice-about-kotlin/comment-page-1/#comment-13912</link>
		<dc:creator>Nicholas Sterling</dc:creator>
		<pubDate>Mon, 16 Apr 2012 20:56:53 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1358#comment-13912</guid>
		<description>Thanks for the interesting article; I hope Kotlin is successful.

The amount of JVM code (94%?) written in Java doesn&#039;t seem particularly interesting to me.  What seems *far* more relevant is the proportion of new functionality being implemented in Java, and that number is certainly far lower.  Our shop, for example, still has lots of Java code, but a significant portion of new code is being written in Scala, and it&#039;s only going to increase for the foreseeable future.  To take this example to its logical conclusion, let&#039;s say that at some point we are writing 100% of new code in Scala but Java still accounts for 90% of the code we have accumulated over the years.  Would you still say that Java dominates in our world?  That characterization would seem very misleading to me.

Also, a given number of tokens of Scala seems to get at least three times as much done (and more maintainably) as the same number of tokens of Java.  So if I write 3000 tokens of Java and 1000 tokens of Scala, I&#039;m really doing half of my work in Scala.

Don&#039;t get me wrong; I hope Kotlin brings something great to the party, and I&#039;m always on the lookout for a better language that looks viable.  But I am always wary of opinions that there is no significant competition to Java on the JVM.  People point to jobs openings and to StackOverflow questions and the like, but such metrics are deeply flawed, as discussed here: http://www.scala-lang.org/node/10923

Also, while I&#039;m happy for the enhancements in Java 7 and those planned for Java 8, bear in mind that during the time it took to produce the language and API enhancements in Java 7 the Scala folks made *far* more substantial enhancements.  There really is no comparison.  The JVM enhancements of course accrue to *all* JVM languages (although to some more than others -- dynamic languages in particular benefited greatly from Java 7&#039;s invokedynamic).

Personally, at this point I would be unlikely to work for any shop that still sees the Java *language* as the future.  I would be concerned about them not being able to keep pace with their competition, for one thing, and I would just feel more comfortable working with what I consider more powerful tools and folks who know how to use them.  From what I have seen recently, many companies are actually quite willing to have engineers program in Scala, if they have staff who know the language.

There will be lots of Java code around for a long time, but I don&#039;t think it&#039;s anywhere close to true that migration to other tools has yet to start.  Those who really believe this may find themselves behind the curve at some point.</description>
		<content:encoded><![CDATA[<p>Thanks for the interesting article; I hope Kotlin is successful.</p>
<p>The amount of JVM code (94%?) written in Java doesn&#8217;t seem particularly interesting to me.  What seems *far* more relevant is the proportion of new functionality being implemented in Java, and that number is certainly far lower.  Our shop, for example, still has lots of Java code, but a significant portion of new code is being written in Scala, and it&#8217;s only going to increase for the foreseeable future.  To take this example to its logical conclusion, let&#8217;s say that at some point we are writing 100% of new code in Scala but Java still accounts for 90% of the code we have accumulated over the years.  Would you still say that Java dominates in our world?  That characterization would seem very misleading to me.</p>
<p>Also, a given number of tokens of Scala seems to get at least three times as much done (and more maintainably) as the same number of tokens of Java.  So if I write 3000 tokens of Java and 1000 tokens of Scala, I&#8217;m really doing half of my work in Scala.</p>
<p>Don&#8217;t get me wrong; I hope Kotlin brings something great to the party, and I&#8217;m always on the lookout for a better language that looks viable.  But I am always wary of opinions that there is no significant competition to Java on the JVM.  People point to jobs openings and to StackOverflow questions and the like, but such metrics are deeply flawed, as discussed here: <a href="http://www.scala-lang.org/node/10923" rel="nofollow">http://www.scala-lang.org/node/10923</a></p>
<p>Also, while I&#8217;m happy for the enhancements in Java 7 and those planned for Java 8, bear in mind that during the time it took to produce the language and API enhancements in Java 7 the Scala folks made *far* more substantial enhancements.  There really is no comparison.  The JVM enhancements of course accrue to *all* JVM languages (although to some more than others &#8212; dynamic languages in particular benefited greatly from Java 7&#8242;s invokedynamic).</p>
<p>Personally, at this point I would be unlikely to work for any shop that still sees the Java *language* as the future.  I would be concerned about them not being able to keep pace with their competition, for one thing, and I would just feel more comfortable working with what I consider more powerful tools and folks who know how to use them.  From what I have seen recently, many companies are actually quite willing to have engineers program in Scala, if they have staff who know the language.</p>
<p>There will be lots of Java code around for a long time, but I don&#8217;t think it&#8217;s anywhere close to true that migration to other tools has yet to start.  Those who really believe this may find themselves behind the curve at some point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Structural typing vs. Duck typing by Tashia M. Burton</title>
		<link>http://beust.com/weblog/2008/02/11/structural-typing-vs-duck-typing/comment-page-1/#comment-13785</link>
		<dc:creator>Tashia M. Burton</dc:creator>
		<pubDate>Mon, 02 Apr 2012 01:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=484#comment-13785</guid>
		<description>Structural typing is more effective than duck typing even though they are similar, I prefer structural typing.</description>
		<content:encoded><![CDATA[<p>Structural typing is more effective than duck typing even though they are similar, I prefer structural typing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on You&#8217;ve been implementing main() wrong all this time by Moandji Ezana</title>
		<link>http://beust.com/weblog/2012/03/25/dependency-injection/comment-page-1/#comment-13747</link>
		<dc:creator>Moandji Ezana</dc:creator>
		<pubDate>Thu, 29 Mar 2012 11:52:29 +0000</pubDate>
		<guid isPermaLink="false">http://beust.com/weblog/?p=1643#comment-13747</guid>
		<description>@Colm
&quot;inject per request state, is there an idiom for doing that?&quot;

Yes, you can do that quite easily in Guice, even if Deep is a singleton. If Deep is itself created for every request, then you can inject normally. If Deep has a longer lifecycle than what&#039;s being injected, you&#039;d use a Provider.</description>
		<content:encoded><![CDATA[<p>@Colm<br />
&#8220;inject per request state, is there an idiom for doing that?&#8221;</p>
<p>Yes, you can do that quite easily in Guice, even if Deep is a singleton. If Deep is itself created for every request, then you can inject normally. If Deep has a longer lifecycle than what&#8217;s being injected, you&#8217;d use a Provider.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

