<?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>Passion is like genius; a miracle.</title>
	<atom:link href="http://mkseo.pe.kr/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://mkseo.pe.kr/blog</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 15:33:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Fork Join Framework in Java7</title>
		<link>http://mkseo.pe.kr/blog/?p=2465</link>
		<comments>http://mkseo.pe.kr/blog/?p=2465#comments</comments>
		<pubDate>Fri, 11 May 2012 17:26:24 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2465</guid>
		<description><![CDATA[Java7 introduced interesting framework called fork join. It&#8217;s a mapreduce like lightweight parallel programming library. The basic idea is to split the work into multiple small parts. Process them, and merge the results into final return value. I&#8217;ve written a sample code that computes sum of integers in ArrayList: Fork-Join framework is interesting in some [...]]]></description>
			<content:encoded><![CDATA[<p>Java7 introduced interesting framework called fork join. It&#8217;s a mapreduce like lightweight parallel programming library.</p>
<p>The basic idea is to split the work into multiple small parts. Process them, and merge the results into final return value.</p>
<p>I&#8217;ve written a sample code that computes sum of integers in ArrayList:</p>
<pre class="brush: java; title: ; notranslate">
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.RecursiveTask;

// Use RecursiveTask for task that returns value. Use RecursiveAction, otherwise.
public class SumTask extends RecursiveTask&lt;BigDecimal&gt;{

  private static final long serialVersionUID = -5398793510775248257L;
  private ArrayList&lt;Integer&gt; data;
  private int start;
  private int end;

  public SumTask(ArrayList&lt;Integer&gt; data, int start, int end) {
    super();
    this.data = data;
    this.start = start;
    this.end = end;
  }

  private static boolean isCheapComputation(int start, int end) {
    return (end - start) &lt; 10000;
  }

  @Override
  protected BigDecimal compute() {
    // If the task is small, do it in a single thread.
    if (isCheapComputation(start, end)) {
      BigDecimal result = BigDecimal.ZERO;
      for (int i = start; i &lt; end; ++i) {
        result = result.add(BigDecimal.valueOf(data.get(i)));
      }
      return result;
    }
    // If the task is big, split it into multiple subtasks. They can be subdivided recursively.
    final int mid = start + (end - start) / 2;
    ForkJoinTask&lt;BigDecimal&gt; t1 = new SumTask(data, start, mid);
    ForkJoinTask&lt;BigDecimal&gt; t2 = new SumTask(data, mid + 1, end);
    invokeAll(t1, t2);  // Fork t1 and t2, then wait until both of them finish.
    return t1.join().add(t2.join());
  }

  public static void main(String[] args) {
    Random r = new Random();
    ArrayList&lt;Integer&gt; data = new ArrayList&lt;&gt;();
    for (int i = 0; i &lt; 10000000; i++) {
      data.add(r.nextInt());
    }
    ForkJoinPool pool = new ForkJoinPool();
    SumTask sumTask = new SumTask(data, 0, data.size());
    // Call pool.compute() and wait until completion.
    pool.invoke(sumTask);
    System.out.println(sumTask.join());
  }
}
</pre>
<p>Fork-Join framework is interesting in some ways:<br />
1) It removed tedious (or sometimes error prone) boilerplate that was necessary for thread join and condition variable. Now, I can just fork and join.<br />
2) Work stealing. As described by <a href="http://gee.cs.oswego.edu/dl/papers/fj.pdf">A Java Fork/Join Framework, Doug Lea</a>, a thread can steal other thread&#8217;s task as a way of smart workload balancing.</p>
<p>Another interesting tutorial is <a href="http://www.oracle.com/technetwork/articles/java/fork-join-422606.html">Fork and Join: Java Can Excel at Painless Parallel Programming Too!</a> though it lacks in-depth discussion/comparisons between Java 5/6&#8242;s executor service based approach VS Fork/Join framework.</p>
<p>And here&#8217;s critiques on F/J framework: <a href="http://coopsoft.com/ar/CalamityArticle.html">A Java™ Fork-Join Calamity</a>. I myself found the library is pretty much limited, say, for IO. (Read API doc carefully before you start using the library. It noted some limitations in the comments.)</p>
<p>Sadly, ParallelArray was not included in Java7. If it had, we could have written like the below for multiprocessor parallel programming:</p>
<pre class="brush: java; title: ; notranslate">
// Taken from http://www.ibm.com/developerworks/java/library/j-jtp03048/index.html
ParallelArray&lt;Student&gt; students = new ParallelArray&lt;Student&gt;(fjPool, data);
double bestGpa = students.withFilter(isSenior)
                         .withMapping(selectGpa)
                         .max();
</pre>
<p>Anyway, I think F/J is a good move (as long as it won&#8217;t get too complex in the next version of Java). And F/J framework is good enough for no-so-serious parallel tasks. </p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2465</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrypt &#8211; follow up on moderan password hashing algorithm</title>
		<link>http://mkseo.pe.kr/blog/?p=2453</link>
		<comments>http://mkseo.pe.kr/blog/?p=2453#comments</comments>
		<pubDate>Sat, 07 Apr 2012 07:02:16 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2453</guid>
		<description><![CDATA[This is the follow up on the previous article: modern password hashing. In case you didn&#8217;t read it, bcrypt is slow hashing algorithm which is not vulnerable to rainbow table as it has built-in salt. Also, as it can be slowed down as much as you want, it can&#8217;t be broken even if computers get [...]]]></description>
			<content:encoded><![CDATA[<p>This is the follow up on the previous article: <a href="http://mkseo.pe.kr/blog/?p=2394">modern password hashing</a>. In case you didn&#8217;t read it, bcrypt is slow hashing algorithm which is not vulnerable to <a href="http://en.wikipedia.org/wiki/Rainbow_table">rainbow table</a> as it has <a href="http://stackoverflow.com/questions/6832445/how-can-bcrypt-have-built-in-salts">built-in salt</a>. Also, as it can be slowed down as much as you want, it can&#8217;t be broken even if computers get faster.</p>
<p>Recently, I realized that <a href="http://security.stackexchange.com/questions/4781/do-any-security-experts-recommend-bcrypt-for-password-storage">bcrypt is designed so that it&#8217;s difficult to attack it even with GPU</a>. Also, there&#8217;s <a href="http://code.google.com/p/scrypt/">scrypt</a> which has more ram requirement than bcrypt, effectively making it much more difficult to attack with hardware(say, gpu). Scrypt is used by chromium according to the <a href="http://www.chromium.org/chromium-os/chromiumos-design-docs/protecting-cached-user-data">design doc</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2453</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Information Retrieval 무료 ebook</title>
		<link>http://mkseo.pe.kr/blog/?p=2450</link>
		<comments>http://mkseo.pe.kr/blog/?p=2450#comments</comments>
		<pubDate>Sat, 17 Mar 2012 13:58:08 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2450</guid>
		<description><![CDATA[http://nlp.stanford.edu/IR-book/ 정말 좋은 무료 ir book. 예를들어 &#8216;stopword는 색인안할것이다&#8217;같은 저의 오해를 깔끔히 깨주었습니다.]]></description>
			<content:encoded><![CDATA[<p><a href="http://nlp.stanford.edu/IR-book/">http://nlp.stanford.edu/IR-book/</a></p>
<p>정말 좋은 무료 ir book. 예를들어 &#8216;stopword는 색인안할것이다&#8217;같은 저의 오해를 깔끔히 깨주었습니다.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2450</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWIRL 2012 &#8211; Future of IR</title>
		<link>http://mkseo.pe.kr/blog/?p=2447</link>
		<comments>http://mkseo.pe.kr/blog/?p=2447#comments</comments>
		<pubDate>Tue, 13 Mar 2012 17:31:46 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2447</guid>
		<description><![CDATA[http://www.cs.rmit.edu.au/swirl12/discussion.php IR 관련 방향을 제시하는 중요논문들을 모아놓은 페이지입니다. 참가자들에게 숙제로 3개씩 추천을 받았나보네요. 다른데 볼거없이 이것만 읽어봐도 좋을듯.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cs.rmit.edu.au/swirl12/discussion.php">http://www.cs.rmit.edu.au/swirl12/discussion.php</a></p>
<p>IR 관련 방향을 제시하는 중요논문들을 모아놓은 페이지입니다. 참가자들에게 숙제로 3개씩 추천을 받았나보네요. 다른데 볼거없이 이것만 읽어봐도 좋을듯.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2447</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online regular expression testing</title>
		<link>http://mkseo.pe.kr/blog/?p=2445</link>
		<comments>http://mkseo.pe.kr/blog/?p=2445#comments</comments>
		<pubDate>Sat, 10 Mar 2012 12:53:47 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2445</guid>
		<description><![CDATA[http://regexpal.com/ Nice online tool for testing regexp. Still, I wish it had the ability to print captured groups.]]></description>
			<content:encoded><![CDATA[<p><a href="http://regexpal.com/">http://regexpal.com/</a></p>
<p>Nice online tool for testing regexp. Still, I wish it had the ability to print captured groups.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2445</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RoR zeroday</title>
		<link>http://mkseo.pe.kr/blog/?p=2442</link>
		<comments>http://mkseo.pe.kr/blog/?p=2442#comments</comments>
		<pubDate>Mon, 05 Mar 2012 15:36:09 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2442</guid>
		<description><![CDATA[https://gist.github.com/1978249 Github를 덮친 ror zeroday attack입니다.RoR쓰시면 체크해보셔야 할듯.]]></description>
			<content:encoded><![CDATA[<p><a href="https://gist.github.com/1978249">https://gist.github.com/1978249</a></p>
<p>Github를 덮친 ror zeroday attack입니다.RoR쓰시면 체크해보셔야 할듯.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2442</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NoSQL Data Modeling</title>
		<link>http://mkseo.pe.kr/blog/?p=2440</link>
		<comments>http://mkseo.pe.kr/blog/?p=2440#comments</comments>
		<pubDate>Fri, 02 Mar 2012 01:28:41 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2440</guid>
		<description><![CDATA[http://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/ Nosql 데이터 모델링 기법들. 같은 사이트에 mapreduce패턴정리도 올려져 있습니다. 이런쪽 기술 정리하는데 타고나신듯.]]></description>
			<content:encoded><![CDATA[<p><a href="http://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/">http://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/</a></p>
<p>Nosql 데이터 모델링 기법들. 같은 사이트에 mapreduce패턴정리도 올려져 있습니다. 이런쪽 기술 정리하는데 타고나신듯.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2440</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pulse architecture</title>
		<link>http://mkseo.pe.kr/blog/?p=2437</link>
		<comments>http://mkseo.pe.kr/blog/?p=2437#comments</comments>
		<pubDate>Wed, 22 Feb 2012 12:32:14 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2437</guid>
		<description><![CDATA[http://eng.pulse.me/scaling-to-10m-on-aws/ Pulse (well known RSS reader) system architecture.]]></description>
			<content:encoded><![CDATA[<p><a href="http://eng.pulse.me/scaling-to-10m-on-aws/">http://eng.pulse.me/scaling-to-10m-on-aws/</a></p>
<p>Pulse (well known RSS reader) system architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2437</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookie syncing</title>
		<link>http://mkseo.pe.kr/blog/?p=2434</link>
		<comments>http://mkseo.pe.kr/blog/?p=2434#comments</comments>
		<pubDate>Sat, 18 Feb 2012 03:23:25 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2434</guid>
		<description><![CDATA[http://www.adopsinsider.com/ad-exchanges/ssp-to-dsp-cookie-synching-explained/ A way to share cookies between two sites. Simply pass my cookie as a parameter of request to another site. Then the callee can pair that passed cookie with its own cookie.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.adopsinsider.com/ad-exchanges/ssp-to-dsp-cookie-synching-explained/">http://www.adopsinsider.com/ad-exchanges/ssp-to-dsp-cookie-synching-explained/</a></p>
<p>A way to share cookies between two sites. Simply pass my cookie as a parameter of request to another site. Then the callee can pair that passed cookie with its own cookie.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2434</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>STL for extra large datasets</title>
		<link>http://mkseo.pe.kr/blog/?p=2432</link>
		<comments>http://mkseo.pe.kr/blog/?p=2432#comments</comments>
		<pubDate>Sun, 12 Feb 2012 12:47:38 +0000</pubDate>
		<dc:creator>Minkoo Seo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mkseo.pe.kr/blog/?p=2432</guid>
		<description><![CDATA[http://stxxl.sourceforge.net/ 요즘은 이런 툴도 나오네요. 결국은 기존 프로그램이 프로그래머의 노력없이 자동으로 병렬화되는 것이 최종 목표겠죠.]]></description>
			<content:encoded><![CDATA[<p><a href="http://stxxl.sourceforge.net/">http://stxxl.sourceforge.net/</a></p>
<p>요즘은 이런 툴도 나오네요. 결국은 기존 프로그램이 프로그래머의 노력없이 자동으로 병렬화되는 것이 최종 목표겠죠.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkseo.pe.kr/blog/?feed=rss2&#038;p=2432</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

