<?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-19163975</id><updated>2012-01-29T19:50:23.139-08:00</updated><category term='technology'/><category term='hacking'/><category term='hiking'/><category term='india'/><category term='R'/><category term='life'/><title type='text'>Vikram and Neha</title><subtitle type='html'>Articles for technology enthusiasts</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.eggwall.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default?start-index=26&amp;max-results=25'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/11194563536107656485</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/-kNtgjM1dEDU/TbRl5d_ksHI/AAAAAAAAAFU/5zjt8V3s5IY/s220/mugshot.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>217</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19163975.post-7328790962873837476</id><published>2012-01-24T19:19:00.000-08:00</published><updated>2012-01-24T19:19:11.694-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Project Euler in R: Problem 25</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Solutions in R to&amp;nbsp;&lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt;&amp;nbsp;problems are generally hard to find, so I've&amp;nbsp;recently started posting R solutions&amp;nbsp;on this site.&amp;nbsp;&amp;nbsp;Here are the previous problems: &lt;a href="http://www.eggwall.com/2012/01/project-euler-in-r-problem-22.html"&gt;problem 22&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.eggwall.com/2012/01/project-euler-in-r-problem-23.html"&gt;problem 23&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.eggwall.com/2012/01/project-euler-in-r-problem-24.html"&gt;problem 24&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now let's look at &lt;a href="http://projecteuler.net/problem=25"&gt;Problem 25&lt;/a&gt; from Project Euler. &amp;nbsp;Here is the problem statement:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;The Fibonacci sequence is defined by the recurrence relation:&amp;nbsp;Fn = Fn1 + Fn2, where F1 = 1 and F2 = 1.&lt;br /&gt;Hence the first 12 terms will be:&lt;br /&gt;F1 = 1&lt;br /&gt;F2 = 1&lt;br /&gt;...&lt;br /&gt;F11 = 89&lt;br /&gt;F12 = 144&lt;br /&gt;The 12th term, F12, is the first term to contain three digits.&amp;nbsp;What is the first term in the Fibonacci sequence to contain 1000 digits?&lt;/blockquote&gt;This is an easy problem to solve for a small number of digits. It gets interesting once we increase the required number of digits to 1000. The R &lt;i&gt;integer&lt;/i&gt;&amp;nbsp;type can hold 10 digits at most, and the type &lt;i&gt;double&lt;/i&gt; can hold 309 digits. &amp;nbsp;There is no Big Integer class in R that can hold larger numbers, so to compute the 1000 digit Fibonacci number we will have to be creative.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Computing Fibonacci numbers iteratively&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is a basic iterative Fibonacci function, that works for Fibonacci numbers with 309 or fewer digits.&lt;br /&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;fib &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/function"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;  a = &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;br /&gt;  b = &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: black; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &lt;span style="color: black; font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;:n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    tmp = b&lt;br /&gt;    b = a&lt;br /&gt;    a = a + tmp&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;a&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;The version that works with larger numbers is similar, with the following changes&lt;br /&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;ul&gt;&lt;li&gt;Integer vectors are used to store each Fibonacci number.&lt;/li&gt;&lt;li&gt;Each element of the vector is at most nine digits long. &amp;nbsp;&lt;/li&gt;&lt;li&gt;Once all the nine digits are used, a new element is added to the vector and the Fibonacci number computation is carried over to the new element.&lt;/li&gt;&lt;li&gt;The variable &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;numberDigits&lt;/span&gt; counts the number of digits in the latest Fibonacci number. &amp;nbsp;When&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;numberDigits&lt;/span&gt;&amp;nbsp;exceeds &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;999&lt;/span&gt;, the function exits, returning the Fibonacci number index.&lt;/li&gt;&lt;/ul&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;fib.bigint &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/function"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/packages/cran/LIM"&gt;lim&lt;/a&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;  a = &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  b = &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  n = &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;           &lt;span style="color: #666666; font-style: italic;"&gt;# Fibonacci number index&lt;/span&gt;&lt;br /&gt;  integerSize &amp;lt;- &lt;span style="color: #cc66cc;"&gt;1000000000&lt;/span&gt;  &lt;span style="color: #666666; font-style: italic;"&gt;## How big is each integer&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: black; font-weight: bold;"&gt;while&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    n = n + &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;     &lt;span style="color: #666666; font-style: italic;"&gt;# Compute next Fibonacci number&lt;/span&gt;&lt;br /&gt;    tmp = &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/rep"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;rep&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/length"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;length&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;a&lt;span style="color: #009900;"&gt;)&lt;/span&gt;-&lt;a href="http://inside-r.org/r-doc/base/length"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;length&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;b&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt; b&lt;span style="color: #009900;"&gt;)&lt;/span&gt;  &lt;span style="color: #666666; font-style: italic;"&gt;# Pad beginning with zero&lt;/span&gt;&lt;br /&gt;    b = a&lt;br /&gt;&amp;nbsp;&lt;br /&gt;    &lt;span style="color: #666666; font-style: italic;"&gt;# Add a and tmp&lt;/span&gt;&lt;br /&gt;    carry = &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &lt;span style="color: black; font-weight: bold;"&gt;in&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/length"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;length&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;a&lt;span style="color: #009900;"&gt;)&lt;/span&gt;:&lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;      sum.i = tmp&lt;span style="color: #009900;"&gt;[&lt;/span&gt;i&lt;span style="color: #009900;"&gt;]&lt;/span&gt; + a&lt;span style="color: #009900;"&gt;[&lt;/span&gt;i&lt;span style="color: #009900;"&gt;]&lt;/span&gt; + carry&lt;br /&gt;      a&lt;span style="color: #009900;"&gt;[&lt;/span&gt;i&lt;span style="color: #009900;"&gt;]&lt;/span&gt; = sum.i %% integerSize&lt;br /&gt;      carry = &lt;a href="http://inside-r.org/r-doc/base/floor"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;floor&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;sum.i / integerSize&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;carry &amp;gt; &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;a &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;carry&lt;span style="color: #339933;"&gt;,&lt;/span&gt; a&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;    numberDigits &amp;lt;- &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/length"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;length&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;a&lt;span style="color: #009900;"&gt;)&lt;/span&gt; - &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; * &lt;span style="color: #cc66cc;"&gt;9&lt;/span&gt; + countDigits&lt;span style="color: #009900;"&gt;(&lt;/span&gt;a&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;numberDigits &amp;gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/packages/cran/LIM"&gt;lim&lt;/a&gt; - &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;countDigits &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/function"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;  count &amp;lt;- &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: black; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &lt;span style="color: black; font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;:&lt;span style="color: #cc66cc;"&gt;9&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;n/&lt;span style="color: #cc66cc;"&gt;10&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &amp;gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;      count &amp;lt;- count + &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;br /&gt;      n = n / &lt;span style="color: #cc66cc;"&gt;10&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: black; font-weight: bold;"&gt;else&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;count&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;On my Intel Core 2 Duo 1.6Ghz laptop running Linux, this function less than 4 seconds to find the Fibonacci number with 1000 digits.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The analytical solution&lt;/span&gt;&lt;br /&gt;Fibonacci numbers have a closed form solution, which leads to a simpler &lt;a href="http://en.wikipedia.org/wiki/Fibonacci_number#Computation_by_rounding"&gt;approximation by rounding&lt;/a&gt;&amp;nbsp;(from Wikipedia), &lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;i&gt;F&lt;/i&gt;&lt;sub style="line-height: 1em;"&gt;&lt;i&gt;n&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;= the closest integer to&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(golden ratio)^n / sqrt(5)&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;We need the first Fibonacci number with 1000 digits. &amp;nbsp;This number will be greater than or equal to &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;10^999.&lt;/span&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;i&gt;F&lt;/i&gt;&lt;sub style="line-height: 1em;"&gt;&lt;i&gt;n&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;= the closest integer to&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(golden ratio)^n / sqrt(5) &amp;gt;= 10^999&lt;/span&gt;&lt;/blockquote&gt;We can drop the closest integer function because if&amp;nbsp;&lt;i&gt;F&lt;/i&gt;&lt;sub style="line-height: 1em;"&gt;&lt;i&gt;n&lt;/i&gt;&lt;/sub&gt;&amp;nbsp;rounds off to the floor of the ratio, the resulting Fibonacci number will have less than the required digits. &amp;nbsp;So we need smallest n satisfying&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(golden ratio)^n / sqrt(5) &amp;gt;= 10^999&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Or, n &amp;gt;= (999 log(10) + log(sqrt(5)))/log(golden ratio)&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Or, n &amp;gt;= 4781.86&lt;/span&gt;&lt;/blockquote&gt;So we need the 4782nd Fibonacci number to get the required 1000 digits.&lt;br /&gt;&lt;br /&gt;This problem was particularly interesting to R users because it runs into an R-specific limitation. Many other languages don't have this problem and can just use a simple Fibonacci generator to get the answer. For example, in Scheme (or other Lisp variants), a naive Fibonacci implementation produces all the digits.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Aside&lt;/u&gt;: Having started writing about R, I have found an excellent online resource,&amp;nbsp;&lt;a href="http://www.r-bloggers.com/"&gt;R-bloggers&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&amp;nbsp;an aggregator of content from various blogs about R. You can search for&amp;nbsp;&lt;a href="http://www.r-bloggers.com/?s=euler"&gt;other R Project Euler solutions&lt;/a&gt;&amp;nbsp;here. &amp;nbsp;Be sure to check out the top articles box on&amp;nbsp;&lt;a href="http://www.r-bloggers.com/"&gt;R-bloggers&lt;/a&gt;&amp;nbsp;landing page if you're looking for new and interesting applications of R.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-7328790962873837476?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/7328790962873837476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-25.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7328790962873837476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7328790962873837476'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-25.html' title='Project Euler in R: Problem 25'/><author><name>Neha</name><uri>http://www.blogger.com/profile/06155605342414360995</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-2561957859589510645</id><published>2012-01-19T19:52:00.000-08:00</published><updated>2012-01-19T20:21:32.944-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Project Euler in R: Problem 24</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I had previously posted solutions in R to&amp;nbsp;Project Euler&amp;nbsp;&lt;a href="http://www.eggwall.com/2012/01/project-euler-in-r-problem-23.html"&gt;problem 23&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.eggwall.com/2012/01/project-euler-in-r-problem-22.html"&gt;problem 22&lt;/a&gt;. &amp;nbsp;This is the next &lt;a href="http://projecteuler.net/problem=24"&gt;problem&lt;/a&gt; from&amp;nbsp;&lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt;. The statement of problem 24 is as follows.&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;blockquote class="tr_bq"&gt;A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:&amp;nbsp;012 &amp;nbsp; 021 &amp;nbsp; 102 &amp;nbsp; 120 &amp;nbsp; 201 &amp;nbsp; 210&lt;/blockquote&gt;&lt;blockquote class="tr_bq"&gt;What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?&lt;/blockquote&gt;&lt;/blockquote&gt;This is a very interesting problem and it can be solved analytically.&amp;nbsp;The key insight is that &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;n&lt;/span&gt; distinct digits can be arranged in &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;n!&lt;/span&gt; permutations.&lt;br /&gt;&lt;br /&gt;Here's the logic you could use. If the permutations of the numbers 0 through 9 are arranged in lexicographic order,&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;The first 9! permutations, #1 to #362,880 are numbers starting with 0, in order from 0123456789 to 0987654321&lt;/li&gt;&lt;li&gt;The next 9! permutations, #362,881 to #725,760, are numbers from 1023456789 to 1987654320&lt;/li&gt;&lt;li&gt;The next 9! permutations, #725,761 to #1,088,640 &amp;nbsp;are numbers from 2013456789 to 2987654310. &amp;nbsp;The millionth permutation is contained in this set. &amp;nbsp;Thus we know that the millionth number must start with a 2. &amp;nbsp;In fact, it is the&amp;nbsp;274,240th = (1000000 - 725760) number contained in this set.&lt;/li&gt;&lt;li&gt;Our problem has now reduced to finding the&amp;nbsp;274,240th&amp;nbsp;lexicographic permutation of the numbers 0, 1, 3, 4, 5, 6, 7, 8 and 9 - the nine digits excluding 2. &amp;nbsp;We can repeat the above process to get each successive digit.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Essentially we're writing one million as the following sum&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;1000000 = (a1 x 9!) + (a2 x 8!) + ... + (a10 x 1)&lt;/span&gt;&lt;/blockquote&gt;&lt;div&gt;As shown above, the index &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;a1&lt;/span&gt; is 2. &amp;nbsp;That is, only two times 9! numbers fit perfectly within 1,000,000. &amp;nbsp;So the first digit of the millionth number is the third digit in 01&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;span style="background-color: white;"&gt;2&lt;/span&gt;&lt;/span&gt;3456789. &amp;nbsp;The index &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;a2&lt;/span&gt; is 6, so the second digit of the millionth number is the seventh digit of the remaining numbers 013456&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;span style="background-color: white;"&gt;7&lt;/span&gt;&lt;/span&gt;89, which is 7. &amp;nbsp;The remaining digits can be found similarly. While finding the digits you have to be careful to ignore the digits that have been previously used. This is a permutation, so each digit appears exactly once.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The process is tedious, so here is some R code that will make it easier. &amp;nbsp;This generalizes the solution to find the nth permutation of the numbers 0 to 9.&lt;/div&gt;&lt;div&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;findperm &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/function"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;function&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #666666; font-style: italic;"&gt;# Find the indices a1 - a10&lt;/span&gt;&lt;br /&gt;  indices = &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: black; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &lt;span style="color: black; font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;9&lt;/span&gt;:&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    index = &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;while&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/factorial"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;factorial&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &amp;lt; n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;      n = n - &lt;a href="http://inside-r.org/r-doc/base/factorial"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;factorial&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;      index = index + &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;    indices = &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;indices&lt;span style="color: #339933;"&gt;,&lt;/span&gt; index&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;  &lt;span style="color: #666666; font-style: italic;"&gt;# Use the indices to find the nth permutation&lt;/span&gt;&lt;br /&gt;  input = &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;:&lt;span style="color: #cc66cc;"&gt;9&lt;/span&gt;                         &lt;span style="color: #666666; font-style: italic;"&gt;# The list of numbers to permute&lt;/span&gt;&lt;br /&gt;  output = &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: black; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;j &lt;span style="color: black; font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;:&lt;span style="color: #cc66cc;"&gt;10&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    output&lt;span style="color: #009900;"&gt;[&lt;/span&gt;j&lt;span style="color: #009900;"&gt;]&lt;/span&gt; = input&lt;span style="color: #009900;"&gt;[&lt;/span&gt;indices&lt;span style="color: #009900;"&gt;[&lt;/span&gt;j&lt;span style="color: #009900;"&gt;]&lt;/span&gt; + &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #666666; font-style: italic;"&gt;# Move digit to output&lt;/span&gt;&lt;br /&gt;    input = input&lt;span style="color: #009900;"&gt;[&lt;/span&gt;-&lt;span style="color: #009900;"&gt;(&lt;/span&gt;indices&lt;span style="color: #009900;"&gt;[&lt;/span&gt;j&lt;span style="color: #009900;"&gt;]&lt;/span&gt; + &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;  &lt;span style="color: #666666; font-style: italic;"&gt;# Remove the assigned digits from input&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;output&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;That was straight-forward and a fun illustration of R's capabilities.&lt;br /&gt;&lt;br /&gt;But you can do better. The strength of R lies in the wealth of user defined libraries and functions that can ease the implementation of tricky computation. &amp;nbsp;For a simpler solution, try the&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;lexicographicPermutation&lt;/span&gt;&amp;nbsp;function in the library &lt;a href="http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/R.basic/html/lexicographicPermutation.html"&gt;R.basic&lt;/a&gt;. Here is the entire solution.&lt;/div&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;&lt;a href="http://inside-r.org/r-doc/base/library"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;library&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;R.basic&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;lexicographicPermutation&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;3&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;4&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;5&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;6&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;7&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;8&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;9&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;999999&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;The first solution illustrates that even tricky computation can be coded easily in R and the code is pretty readable. &amp;nbsp;The second solution suggests that before writing your own code, it is a good idea to look for existing libraries that can help. Statistical computations can get complex and tricky. You can write your own k-means clustering algorithm but it is&amp;nbsp;difficult&amp;nbsp;getting all the edge cases correct. Rather than writing your own routine, look around and see if it has been written already. An expert does a better job writing such routines. And you can leverage their code and their expertise.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-2561957859589510645?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/2561957859589510645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-24.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2561957859589510645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2561957859589510645'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-24.html' title='Project Euler in R: Problem 24'/><author><name>Neha</name><uri>http://www.blogger.com/profile/06155605342414360995</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-2593045460326823804</id><published>2012-01-15T15:56:00.000-08:00</published><updated>2012-01-19T20:21:32.952-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Project Euler in R: Problem 23</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was just looking through the programming language statistics on Project Euler. It shows that only 7% of the problems have been solved in R, whereas 8% have been solved on any kind of spreadsheet. &amp;nbsp;This is outrageous!&lt;br /&gt;&lt;br /&gt;Let's look at the solution of problem 23 in R. Here is the statement of Project Euler's problem 23:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.&lt;br /&gt;A number n is called deficient if the sum of its proper divisors is less than n and it is called abundant if this sum exceeds n.&lt;br /&gt;As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers is 24. By mathematical analysis, it can be shown that all integers greater than 28123 can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit.&lt;br /&gt;Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.&lt;/blockquote&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Find proper divisors&lt;/span&gt;&lt;br /&gt;First we write a function to find the proper divisors (that is divisors less than the number itself) of a number n.&lt;/div&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;divisor &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/function"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;function&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    divs &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;    i = &lt;span style="color: #cc66cc;"&gt;2&lt;/span&gt;&lt;br /&gt;    &lt;a href="http://inside-r.org/packages/cran/LIM"&gt;lim&lt;/a&gt; = &lt;a href="http://inside-r.org/r-doc/base/floor"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;floor&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/sqrt"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;sqrt&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;while&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &amp;lt;= &lt;a href="http://inside-r.org/packages/cran/LIM"&gt;lim&lt;/a&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;n %% i == &lt;span style="color: #cc66cc;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;          divs &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;divs&lt;span style="color: #339933;"&gt;,&lt;/span&gt; i&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;n/i != i&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; divs &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;divs&lt;span style="color: #339933;"&gt;,&lt;/span&gt; n/i&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;        i = i + &lt;span style="color: #cc66cc;"&gt;1&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;    &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;divs&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Check if number is abundant&lt;/span&gt;&lt;br /&gt;Next we create a simple function which checks whether a number n is abundant.&lt;/div&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;abundant &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/function"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;function&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/sum"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;sum&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;divisor&lt;span style="color: #009900;"&gt;(&lt;/span&gt;n&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &amp;gt; n&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: black; font-weight: bold;"&gt;TRUE&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: black; font-weight: bold;"&gt;else&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/return"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;return&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: black; font-weight: bold;"&gt;FALSE&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The solution&lt;/span&gt;&lt;br /&gt;With the above two functions we have the tools we need to solve the main problem: finding the sum of all positive integers which can not be written as the sum of two abundant numbers.&lt;br /&gt;&lt;br /&gt;All the numbers greater than 28,123 can be written as sum of two abundant numbers, so we only need to check numbers smaller than 28,123 for this property. &amp;nbsp;The vector&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;abunlist&lt;/span&gt;&amp;nbsp;in the code below holds all abundant numbers starting from 12 to 28,123. &amp;nbsp;With every new abundant number than we find, we create all possible two abundant number sums and store them in the vector&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;sumno&lt;/span&gt;. &amp;nbsp;The answer we're looking for is the sum of all numbers 1 to 28,123 except the ones in the vector&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: monospace; white-space: pre;"&gt;sumno&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="overflow: auto;"&gt;&lt;div class="geshifilter"&gt;&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;abunlist &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;12&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;            &lt;span style="color: #666666; font-style: italic;"&gt;# The smallest abundant number = 12&lt;/span&gt;&lt;br /&gt;sumno &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;24&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;               &lt;span style="color: #666666; font-style: italic;"&gt;# The smallest abundant number sum = 12 + 12 = 24&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color: black; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &lt;span style="color: black; font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;13&lt;/span&gt;:&lt;span style="color: #cc66cc;"&gt;28123&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: black; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;abundant&lt;span style="color: #009900;"&gt;(&lt;/span&gt;i&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;br /&gt;    abunlist &amp;lt;- &lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;abunlist&lt;span style="color: #339933;"&gt;,&lt;/span&gt; i&lt;span style="color: #009900;"&gt;)&lt;/span&gt;                   &lt;span style="color: #666666; font-style: italic;"&gt;# Latest abundant number = i&lt;/span&gt;&lt;br /&gt;    tmp &amp;lt;- abunlist&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;abunlist + i&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &amp;lt;= &lt;span style="color: #cc66cc;"&gt;28123&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; + i   &lt;span style="color: #666666; font-style: italic;"&gt;# New abundant sums &amp;lt;= 28123 using i&lt;/span&gt;&lt;br /&gt;    sumno &amp;lt;-&lt;a href="http://inside-r.org/r-doc/base/unique"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;unique&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/c"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;sumno&lt;span style="color: #339933;"&gt;,&lt;/span&gt; tmp&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;                &lt;span style="color: #666666; font-style: italic;"&gt;# Add to existing list&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;This is certainly not the most efficient solution, but runs in approximately 25 seconds - well within the stated 1 minute goal.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: The code for this post was formatted in&amp;nbsp;&lt;a href="http://www.inside-r.org/pretty-r" title="Created by Pretty R at inside-R.org"&gt;Pretty R at inside-R.org&lt;/a&gt;.&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-2593045460326823804?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/2593045460326823804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-23.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2593045460326823804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2593045460326823804'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-23.html' title='Project Euler in R: Problem 23'/><author><name>Neha</name><uri>http://www.blogger.com/profile/06155605342414360995</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-7816178942417091163</id><published>2012-01-11T20:31:00.000-08:00</published><updated>2012-01-11T21:45:54.126-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Generate UML Diagrams From Java Source</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was navigating through a large Java project today, and I needed some source tools to help me visualize the massive class hierarchy. Looking on Google didn't produce anything obvious: people pointed to eUML2, which was difficult to install, and some tools didn't generate UML from existing code.&lt;br /&gt;&lt;br /&gt;After a while of searching, I remembered the &lt;a href="http://www.doxygen.org/"&gt;Doxygen&lt;/a&gt; utility which writes documentation from source code. It works on C,C++, and Java, among many other languages. While its diagrams might not be perfect, they were very helpful for C++ projects in the past.&lt;br /&gt;&lt;br /&gt;So I decided to give it a shot. It worked out beautifully.&lt;br /&gt;&lt;br /&gt;Here are the steps involved in generating UML diagrams.&lt;br /&gt;First, you install doxygen (to parse the files) and graphviz (to write out PNG of graphs)&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: #274e13;"&gt;sudo apt-get install doxygen graphviz&lt;/span&gt;&lt;/pre&gt;Then, run doxygen to generate a config file.&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: #274e13;"&gt;cd &amp;lt;path-to-source&amp;gt;&lt;/span&gt;&lt;br /&gt;$ &lt;span style="color: #274e13;"&gt;doxygen -g&lt;/span&gt;&lt;/pre&gt;Now you have a config file called Doxyfile. Edit this to allow recursive searching, to look for java source, to generate call graphs and to generate pictures, and to generate UML style diagrams. Here are all the changes I made to this file.&lt;br /&gt;&lt;pre&gt;&lt;span style="color: #27134e;"&gt;FILE_PATTERNS     = *.java&lt;br /&gt;RECURSIVE       = YES&lt;br /&gt;HAVE_DOT        = YES&lt;br /&gt;CALL_GRAPH       = YES&lt;br /&gt;CALLER_GRAPH      = YES&lt;br /&gt;DOT_GRAPH_MAX_NODES  = 500&lt;br /&gt;UML_LOOK            = YES&lt;/span&gt;&lt;/pre&gt;Now, generate documentation with this command:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: #274e13;"&gt;doxygen Doxyfile&lt;/span&gt;&lt;/pre&gt;To test this out for a blog post, I downloaded the source code to &lt;a href="http://azureus.sourceforge.net/"&gt;Azureus&lt;/a&gt;, a large Java-based project. Here is a graph from one of the files. The top right shows a close-up view of a tiny section of the picture. Even in this simple example, you can see how a zoomed-out view allows you to understand the complex structure.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-z_wzlWupzgs/Tw5hYmCo__I/AAAAAAAAAZw/vyAB37ASEDg/s1600/blogpost.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-z_wzlWupzgs/Tw5hYmCo__I/AAAAAAAAAZw/vyAB37ASEDg/s1600/blogpost.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Doxygen reads code written in C, C++, Java, and many other languages. So if you are in need of UML style diagrams to better understand a class hierarchy, give it a try. It is freely available, easy to install, and easy to use. In addition to class graphs, it can also make call graphs and caller graphs.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-7816178942417091163?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/7816178942417091163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/generate-uml-diagrams-from-java-source.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7816178942417091163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7816178942417091163'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/generate-uml-diagrams-from-java-source.html' title='Generate UML Diagrams From Java Source'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-z_wzlWupzgs/Tw5hYmCo__I/AAAAAAAAAZw/vyAB37ASEDg/s72-c/blogpost.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-27971455845824222</id><published>2012-01-09T00:00:00.000-08:00</published><updated>2012-01-09T00:00:10.178-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Entertainment comes from many activities</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I came across an interesting post by &lt;a href="http://rogerebert.suntimes.com/apps/pbcs.dll/article?AID=/20111228/COMMENTARY/111229973"&gt;Roger Ebert about why movie revenue is dropping&lt;/a&gt;. He raises important points about high ticket prices and the poor&amp;nbsp;theater&amp;nbsp;experience. &amp;nbsp;I agree with most of the post. Many years ago, I had written about the &lt;a href="http://www.eggwall.com/2008/07/movies-at-home-premium-experience.html"&gt;abysmal theater experience&lt;/a&gt;&amp;nbsp;and it is nice to see that my concern is shared.&lt;br /&gt;&lt;br /&gt;Movies are losing revenue because they are chasing ghosts. The days of mass theater watching is history. Even in India, people are comfortable renting or buying DVDs and watching the movie at home. The theater experience deserves much blame. Theaters function in a world of limited supply. Their glory days were when few movies were released and there was little alternate entertainment. Both assumptions are false today. Thanks to streaming video and increased access to foreign movies, I can watch Korean movies from 2011 if Hollywood produced poor movies. And I don't need to watch movies. I can play video games, watch &lt;a href="http://www.youtube.com/watch?v=Vw4KVoEVcr0"&gt;short videos online&lt;/a&gt;, or spend my evening looking at &lt;a href="http://icanhascheezburger.com/"&gt;cute kittens online&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Our definition of entertainment is changing. Movies are just a way of spending time having fun. We have many more ways of having fun. Traditional media likes their definition of "entertainment", which is "consuming content". This is a very narrow definition. It has never held true. Children's idea of enjoyment ranges from drawing to making a mess out of newspaper. Adults are similar.&lt;br /&gt;&lt;br /&gt;Computers on the Internet are the ultimate tool. I write articles (like this one) and it entertains me. Others use Facebook or Google Plus to keep in touch with their friends and family. Still others contribute to Wikipedia or online forums. Each of these activities provides enjoyment for the person. Each of these are entertainment.&lt;br /&gt;&lt;br /&gt;Some of the terminology from the movie industry indicates this bias. "&lt;a href="http://www.eonline.com/"&gt;Entertainment Online&lt;/a&gt;" and "&lt;a href="http://www.ew.com/ew/"&gt;Entertainment Weekly&lt;/a&gt;" are focused entirely on the movie and television industry. &lt;a href="http://entertainment.msn.com/"&gt;Entertainment on MSN&lt;/a&gt; is all about movie stars.&lt;br /&gt;&lt;br /&gt;Even in the absence of online streaming videos and DVDs, the number of people watching movies would drop. There is a lot more stuff you can do on a computer. And sitting in an uncomfortable chair for ninety minutes staring at a screen is not always entertainment.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-r2b4Yz4HsnA/Twjo8ki_TQI/AAAAAAAAAZo/Umo4VLvm7OA/s1600/fun.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-r2b4Yz4HsnA/Twjo8ki_TQI/AAAAAAAAAZo/Umo4VLvm7OA/s1600/fun.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-27971455845824222?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/27971455845824222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/entertainment-comes-from-many.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/27971455845824222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/27971455845824222'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/entertainment-comes-from-many.html' title='Entertainment comes from many activities'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-r2b4Yz4HsnA/Twjo8ki_TQI/AAAAAAAAAZo/Umo4VLvm7OA/s72-c/fun.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-1073001695461634400</id><published>2012-01-08T00:00:00.000-08:00</published><updated>2012-01-08T00:00:05.732-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Learning Languages as a puzzle game</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I am interested in languages. I tried learning some Japanese when I was young. I gave up rather quickly. It might have been due to the lack of good books, or the lack of teachers. It might have been the lack of native Japanese speakers with whom I could practice my skills. My experience with Japanese instilled a love for learning new languages, and understanding a culture from their perspective, through their language.&lt;br /&gt;&lt;br /&gt;A few months ago I started learning Mandarin Chinese. We found ourselves in Beijing, and we came across some great Chinese books lesson books for English speakers. These were useful in teaching characters and sentence construction in a very academic setting. Learning a language in this way is difficult. For one: your&amp;nbsp;pronunciation&amp;nbsp;is all wrong. For another, it is difficult to apply such academic learning to everyday speech.&lt;br /&gt;&lt;br /&gt;Next, I tried using audio lessons only. These were a bit more helpful. They had correct pronunciation and useful everyday phrases. I did find that the lessons were geared more towards scoring women rather than real everyday phrases. Early lessons started with, "Where do you want to go to drink?", "Would you like to come to my place?" Useful stuff I'm sure, but not for a boring family man like me. A person like me needs directions to the hospital and the rest room. Further, the audio lessons made it difficult to distinguish between close syllables like 'ga' and 'ka'. You could easily mispronounce words and not realize it. Finally, you have no idea of written Chinese. This is a real limitation. Chinese is written in a strange and confusing way. Starting out with characters is much better than trying to learn them later. Building an initial comfort level helps if you travel.&lt;br /&gt;&lt;br /&gt;Finally, we settled on Rosetta Stone (RS for short). RS teaches language in an interesting way. You don't see any of your native language written down. Concepts are introduced entirely through pictures, and you see Chinese to go along with the concepts. It is a strange feeling. You see a big ball and a small ball, and there are strange words. With time, you form the connection between the word and the concept. All without relying on the equivalent word in your native language. I was skeptical of this idea when a friend explained it to me. And RS costs an arm and a leg, which made me even more skeptical.&lt;br /&gt;&lt;br /&gt;Luckily for me, I seem to learn Chinese with RS. I use RS as a puzzle game rather than language learning. It is fun to try to understand the game and get better. Now I'm on the final unit in Level One, I am surprised at how much Chinese I can understand. We have a few Chinese friends and I can understand bits of their conversation with their children. It is a great feeling.&lt;br /&gt;&lt;br /&gt;Chinese is a devilishly hard language to learn. Right at the beginning, you start out learning&amp;nbsp;pictographs&amp;nbsp;(characters), tones in pronunciation, vocabulary, and grammar. If RS works for Chinese, I suspect it will work for Japanese too. Once I go through RS Mandarin lessons, I might just look at the RS Japanese lessons.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wWk0n9Hu-OA/TwjV1qUA5WI/AAAAAAAAAZg/CrjRpN56rz0/s1600/rosettaStone.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-wWk0n9Hu-OA/TwjV1qUA5WI/AAAAAAAAAZg/CrjRpN56rz0/s1600/rosettaStone.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Fun fact for the day: The original&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Rosetta_Stone"&gt;rosetta stone&lt;/a&gt;&amp;nbsp;was a stone which had three languages inscribed on it. The three languages had the same message. The discovery of this stone led to a breakthrough in deciphering Ancient Egyptian. It is ironic that the Rosetta Stone software teaches you a language by only showing you the language you wish to learn. Rosetta Stone never shows you a rosetta stone.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-1073001695461634400?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/1073001695461634400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/learning-languages-as-puzzle-game.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/1073001695461634400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/1073001695461634400'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/learning-languages-as-puzzle-game.html' title='Learning Languages as a puzzle game'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-wWk0n9Hu-OA/TwjV1qUA5WI/AAAAAAAAAZg/CrjRpN56rz0/s72-c/rosettaStone.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-1016391388696698160</id><published>2012-01-07T15:55:00.000-08:00</published><updated>2012-01-19T20:21:32.939-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Project Euler in R:  Problem 22</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I solve &lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt; problems for recreation. I am using the &lt;a href="http://www.r-project.org/"&gt;Statistical Language R&lt;/a&gt; to solve these. R is free for use and download, so I would recommend downloading it if you are interested in Statistical computation. &lt;br /&gt;This is &lt;a href="http://projecteuler.net/problem=22"&gt;problem 22&lt;/a&gt; from &lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt;:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;Using names.txt, a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score. &lt;br /&gt;For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 x 53 = 49714.&lt;br /&gt;What is the total of all the name scores in the file?&lt;/blockquote&gt;While this is an easy problem, its solution involves some nice R concepts. Let's go through solving this in R.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Reading free form text using scan()&lt;/span&gt;&lt;br /&gt;The first order of business is to read the text file. The file names.txt  is a single line of text, separated by commas:  &lt;br /&gt;&lt;pre&gt;"MARY","PATRICIA","LINDA","BARBARA", ...&lt;/pre&gt;The scan function reads free form text and stores each element in a vector.  We specify that the input is character data separated by commas. That should do the trick, right?&lt;br /&gt;&lt;pre&gt;&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt; &amp;lt;- &lt;span style="color: #2040a0;"&gt;scan&lt;/span&gt;(&lt;span style="color: green;"&gt;"names.txt"&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;what&lt;/span&gt;= &lt;span style="color: green;"&gt;""&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;sep&lt;/span&gt;=&lt;span style="color: green;"&gt;","&lt;/span&gt;,)&lt;br /&gt;&lt;/pre&gt;Unfortunately, this does not work. After many minutes of scratching your head you'll find that one of the names in the file is 'NA'.  This confuses the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;scan&lt;/span&gt; function since it is interpreted as the constant NA, or "Not Available" in R.  This can be fixed by setting an na.strings argument in the scan function.  &lt;br /&gt;&lt;pre&gt;&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt; &amp;lt;- &lt;span style="color: #2040a0;"&gt;scan&lt;/span&gt;(&lt;span style="color: green;"&gt;"names.txt"&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;what&lt;/span&gt;= &lt;span style="color: green;"&gt;""&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;sep&lt;/span&gt;=&lt;span style="color: green;"&gt;","&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;na&lt;/span&gt;&lt;span style="color: red;"&gt;.&lt;/span&gt;&lt;span style="color: #2040a0;"&gt;strings&lt;/span&gt;=&lt;span style="color: green;"&gt;""&lt;/span&gt;)&lt;br /&gt;  &lt;/pre&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Dictionaries / hashtables in R&lt;/span&gt;&lt;br /&gt;Getting the alphabetical value of each character is easiest if it is stored in a hashtable somewhere. In R, named vectors can be used as hashtables.  The traditional definition would go as follows:&lt;br /&gt;&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt; = &lt;span style="color: #2040a0;"&gt;c&lt;/span&gt;(&lt;span style="color: green;"&gt;"A"&lt;/span&gt; = &lt;span style="color: red;"&gt;1&lt;/span&gt;, &lt;span style="color: green;"&gt;"B"&lt;/span&gt; = &lt;span style="color: red;"&gt;2&lt;/span&gt;, &lt;span style="color: red;"&gt;...&lt;/span&gt;)  &lt;br /&gt;While you can sit and write the entire dictionary by hand, you should avoid such repeated work. Here's a niftier definition using the names() function:  &lt;br /&gt;&lt;pre&gt;&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt; = &lt;span style="color: red;"&gt;1&lt;/span&gt;:&lt;span style="color: red;"&gt;26&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #2040a0;"&gt;names&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt;) = &lt;span style="color: #2040a0;"&gt;unlist&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;strsplit&lt;/span&gt;(&lt;span style="color: green;"&gt;"ABCDEFGHIJKLMNOPQRSTUVWXYZ"&lt;/span&gt;, &lt;span style="color: green;"&gt;""&lt;/span&gt;))&lt;/pre&gt;This should be a trivial method to write in a C-style language where you can turn a character into an integer. R, however, has no internal ASCII table that I could find. If there is a simpler solution, please let me know.  &lt;br /&gt;  &lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Name scoring function&lt;/span&gt;&lt;br /&gt;The scoring function gets the name as an input, pulls the score for each letter in the name and then adds up the letter scores.&lt;br /&gt;&lt;pre&gt;&lt;span style="color: #2040a0;"&gt;score&lt;/span&gt; &amp;lt;- &lt;strong&gt;function&lt;/strong&gt; (&lt;span style="color: #2040a0;"&gt;name&lt;/span&gt;) {&lt;br /&gt;    &lt;strong&gt;return&lt;/strong&gt; (&lt;span style="color: #2040a0;"&gt;sum&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt;[&lt;span style="color: #2040a0;"&gt;unlist&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;strsplit&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;name&lt;/span&gt;, &lt;span style="color: green;"&gt;""&lt;/span&gt;))]))&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Calculating weighted scores&lt;/span&gt;&lt;br /&gt;The vector of name scores is obtained by applying the score function defined above to each name in nlist.  We use the sapply function, which gives a simplified vector output by default.  The vector of weights is a sequence of numbers from 1 to the length of nlist.  Multiply the two vectors to get the vector of weighted scores.&lt;br /&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="color: #2040a0;"&gt;weighted.score&lt;/span&gt; = (&lt;span style="color: red;"&gt;1&lt;/span&gt;:&lt;span style="color: #2040a0;"&gt;length&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt;))*(&lt;span style="color: #2040a0;"&gt;sapply&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;score&lt;/span&gt;)) &lt;br /&gt;  &lt;/pre&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The full solution&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt; &amp;lt;- &lt;span style="color: #2040a0;"&gt;scan&lt;/span&gt;(&lt;span style="color: green;"&gt;"names.txt"&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;what&lt;/span&gt;= &lt;span style="color: green;"&gt;""&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;sep&lt;/span&gt;=&lt;span style="color: green;"&gt;","&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;na&lt;/span&gt;&lt;span style="color: red;"&gt;.&lt;/span&gt;&lt;span style="color: #2040a0;"&gt;strings&lt;/span&gt;=&lt;span style="color: green;"&gt;""&lt;/span&gt;)&lt;br /&gt;&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt; = &lt;span style="color: red;"&gt;1&lt;/span&gt;:&lt;span style="color: red;"&gt;26&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #2040a0;"&gt;names&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt;) = &lt;span style="color: #2040a0;"&gt;unlist&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;strsplit&lt;/span&gt;(&lt;span style="color: green;"&gt;"ABCDEFGHIJKLMNOPQRSTUVWXYZ"&lt;/span&gt;, &lt;span style="color: green;"&gt;""&lt;/span&gt;))&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #2040a0;"&gt;score&lt;/span&gt; &amp;lt;- &lt;strong&gt;function&lt;/strong&gt; (&lt;span style="color: #2040a0;"&gt;name&lt;/span&gt;) {&lt;br /&gt;    &lt;strong&gt;return&lt;/strong&gt; (&lt;span style="color: #2040a0;"&gt;sum&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;dict&lt;/span&gt;[&lt;span style="color: #2040a0;"&gt;unlist&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;strsplit&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;name&lt;/span&gt;, &lt;span style="color: green;"&gt;""&lt;/span&gt;))]))&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt; &amp;lt;- &lt;span style="color: #2040a0;"&gt;sort&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt;)&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #2040a0;"&gt;weighted.score&lt;/span&gt; = (&lt;span style="color: red;"&gt;1&lt;/span&gt;:&lt;span style="color: #2040a0;"&gt;length&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt;))*(&lt;span style="color: #2040a0;"&gt;sapply&lt;/span&gt;(&lt;span style="color: #2040a0;"&gt;nlist&lt;/span&gt;, &lt;span style="color: #2040a0;"&gt;score&lt;/span&gt;)) &lt;br /&gt;&lt;span style="color: #2040a0;"&gt;sum&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: #2040a0;"&gt;weighted.score&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;This was an interesting problem to solve in R. It demonstrates the flexibility of R in reading and processing free form text. Trying to do a similar task in SAS would be hard.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-1016391388696698160?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/1016391388696698160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-22.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/1016391388696698160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/1016391388696698160'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/project-euler-in-r-problem-22.html' title='Project Euler in R:  Problem 22'/><author><name>Neha</name><uri>http://www.blogger.com/profile/06155605342414360995</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-9166222608566470736</id><published>2012-01-06T00:00:00.000-08:00</published><updated>2012-01-06T00:00:09.403-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: Foundation Trilogy by Asimov</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Want to start reading some good science fiction? Pick up the &lt;a href="http://en.wikipedia.org/wiki/Foundation_series"&gt;Foundation series&lt;/a&gt; by Isaac Asimov.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Isaac_Asimov"&gt;Asimov&lt;/a&gt; was a prolific writer. The foundation series comprises many books. The first three are called "Foundation", "Foundation and Empire" and "Second Foundation".&lt;br /&gt;&lt;br /&gt;The books have an interesting premise: the behavior of individual humans is unpredictable, but the behavior of a large number of people can be collectively predicted. This is similar to the behavior of molecules of a gas, or movements of electrons. It is an interesting idea, and Asimov takes this concept and writes a kind of history for the Galactic Empire. In the introduction, Asimov says that he wanted to write a science fiction book, modeled on &lt;a href="http://en.wikipedia.org/wiki/The_History_of_the_Decline_and_Fall_of_the_Roman_Empire"&gt;Gibbon's History of the Roman Empire&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The first three books are very interesting, though I did find my interest flagging in the third book. As expected, the first is the strongest. It talks of how the first Foundation was established, and how they made it through their turbulent years. The second book talks of how the Foundation faced very determined opposition, and how it escaped through it. The third talks of the second Foundation, whether it was indeed established, and what happened to it.&lt;br /&gt;&lt;br /&gt;I don't read too much science fiction, and I am impatient when reading fiction. The foundation series were a great introduction to the genre. They are old now, but they are short and punchy. After reading the first book you'll have a pretty good idea whether you like the genre.&lt;br /&gt;&lt;br /&gt;Science fiction is a popular genre among computer engineers and programmers. Imagining the future gives the author a lot of room to imagine a better future. The first Foundation books were published in 1952. Fifty years in the future, I was wondering how much of the world has changed. Looking back at old science fiction gives you an idea of what the older generations were hoping for.&lt;br /&gt;&lt;br /&gt;The first three books are a great trilogy to start reading science fiction.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-i4qSIcP5hwM/TwRzl0v1lWI/AAAAAAAAAZY/LJhTzXzpwPg/s1600/asimovfoundation.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://3.bp.blogspot.com/-i4qSIcP5hwM/TwRzl0v1lWI/AAAAAAAAAZY/LJhTzXzpwPg/s320/asimovfoundation.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-9166222608566470736?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/9166222608566470736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/book-review-foundation-trilogy-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/9166222608566470736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/9166222608566470736'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/book-review-foundation-trilogy-by.html' title='Book Review: Foundation Trilogy by Asimov'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-i4qSIcP5hwM/TwRzl0v1lWI/AAAAAAAAAZY/LJhTzXzpwPg/s72-c/asimovfoundation.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-2760193278175754217</id><published>2012-01-05T00:00:00.000-08:00</published><updated>2012-01-05T00:00:06.655-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><title type='text'>Book Review: The Elements of Computing Systems</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Want to really, truly understand how computers work? Read "&lt;a href="http://www1.idc.ac.il/tecs/"&gt;The Elements of Computing Systems&lt;/a&gt;", by Noam Nisan and Shimon Schocken.&lt;br /&gt;&lt;br /&gt;I studied Computer Science through graduate school. I love the field, and I own the texts that make this field fun. So I was surprised when this book came from nowhere. It promised to teach Computer Science completely through building an entire computer from the most basic pieces. After reading through it, and doing most of the exercises, I am convinced. This is &lt;b&gt;the&lt;/b&gt;&amp;nbsp;way to teach Computer Science. This way doesn't come easy, a high school student could go through it, but he would need a lot of exposure to Computing concepts in advance: flip-flops, how a VHDL-like language works, and programming. An undergraduate student could start on this book in this third year. It forms the textbook for a course at MIT. Lucky students.&lt;br /&gt;&lt;br /&gt;The most important concept in Computer Science is abstraction: how a layer of abstraction can hide the underlying complexity. This is a difficult concept to grasp in practice, though you see it everywhere. A CPU is an abstraction layer: you program it in Assembly, and assume that it is a magical box that "understands" assembly. The CPU itself is built using transistors and logic gates. Computer Science is built on many abstractions: a memory, a processing unit, a lower-level language, a compiler, an operating system.&lt;br /&gt;&lt;br /&gt;The Elements of Computing Systems is written in a very interesting way. It starts out with logic gates and a flip-flop as the basic unit. Using these, you create all the complexity of an adder, a register, a simple arithmetic unit. Using your creation, you create a full CPU. Using your CPU, you use an assembly language to program it. For your assembly language, you write a compiler, and then an operating system. This shows you the entire stack for a make-believe computer. The computer made is a simpler version of your laptop or desktop. Knowing one allows you to understand the more complex version.&lt;br /&gt;&lt;br /&gt;This method of learning by doing is very powerful. This is the only way this understanding sticks in the minds of students. I've seen many of these topics covered in separate Computer Science coursework. But a single book tying the topics together has more impact.&lt;br /&gt;&lt;br /&gt;This book isn't for everyone. You will need some experience with a C or Java like programming language, and perseverance. A smart high school student could tackle this with some help from his parents. I cannot think of a better way to learn computing.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-gI_qQdgTj5Q/TvkhAIomoWI/AAAAAAAAAVg/jjIa2xURDv8/s1600/cover.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-gI_qQdgTj5Q/TvkhAIomoWI/AAAAAAAAAVg/jjIa2xURDv8/s320/cover.jpg" width="284" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-2760193278175754217?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/2760193278175754217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/book-review-elements-of-computing.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2760193278175754217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2760193278175754217'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/book-review-elements-of-computing.html' title='Book Review: The Elements of Computing Systems'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-gI_qQdgTj5Q/TvkhAIomoWI/AAAAAAAAAVg/jjIa2xURDv8/s72-c/cover.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-3790127097353948639</id><published>2012-01-04T00:00:00.000-08:00</published><updated>2012-01-04T00:00:09.346-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: Three Cups of Deceit</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Want to know the true story behind &lt;a href="http://en.wikipedia.org/wiki/Greg_Mortenson"&gt;Greg Mortenson&lt;/a&gt;? Read Jon Krakauer's short book, "Three Cups of Deceit", to find how Greg was able to fool millions of people.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Greg_Mortenson"&gt;Greg Mortenson&lt;/a&gt; is a person who runs the Central Asia Institute (CAI), where they collect charity money to construct schools in Afghanistan and Pakistan. His book, "&lt;a href="http://en.wikipedia.org/wiki/Three_Cups_of_Tea"&gt;Three Cups of Tea&lt;/a&gt;", has sold many copies, and is popular in the West. Greg claims that he stumbled into the town of Korphe, and was so moved by the poverty that he made a solemn vow to return and construct a school there. In his books, he recounts this journey, and the difficulty in building a school in such a remote place. He claims to have been apprehended by Taliban, and describes how he was released on the promise of building a school. His story is a miraculous tale of transforming hotbeds of fundamentalist religion by building schools.&lt;br /&gt;&lt;br /&gt;It would be fantastic, if it were true. Jon Krakauer shows how much of Greg's story is a fabrication. Jon supports his claims with real proof. The most damning evidence is Greg's photograph alongside people whom Greg claimed were Taliban. In reality, they were his bodyguards through dangerous territory. Greg is shown holding an AK-47, and happily posing for the photograph with his tormentors. Jon also shows how other claims of success are completely hollow. Not only is the CAI building far fewer schools than it claims, but also the schools are mere buildings. There are no students because there are no teachers.&lt;br /&gt;&lt;br /&gt;Jon Krakauer writes beautifully. From his book about Everest, "&lt;a href="http://en.wikipedia.org/wiki/Into_Thin_Air"&gt;Into Thin Air&lt;/a&gt;", to the insightful account of Mormons, "&lt;a href="http://en.wikipedia.org/wiki/Under_the_Banner_of_Heaven"&gt;Under the Banner of Heaven&lt;/a&gt;". Get this book now. It is a quick and captivating read.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We're done with the review. But there is a lingering feeling in my mind that something has been left unsaid.&lt;br /&gt;&lt;br /&gt;A passage in Jon's book made me think deeply. On Page 68, Jon says how Greg was able to fool his audience.&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;It soothed the national conscience. Greg may have used smoke and mirrors to generate the hope he offered, but the illusion made people feel good about themselves, so nobody was in a hurry to look behind the curtain. Although it doesn't excuse his dishonesty, Mortenson was merely selling what the public was eager to buy.&lt;/blockquote&gt;This brilliant passage made me think of more than just Greg Morentson's fraud. People have an inherent need to believe in a feel-good story. We want to believe happy stories from hopeless areas because we are so eager for hope. This is as true in yogi-infested India as it is in the West. Many babas and yogis originate in rural India. We are eager for stories that show India in a good light. We want to believe the lies that India has a stronger spiritual connection with God than the rest of the world. We want to believe that India has all the mystic and spiritual men, the land that gave birth to five religions. In the absence of good news about the economy, or education, or political progress, we'll believe in far-fetched stories about how God favors Indians.&amp;nbsp;In our eagerness to believe such stories, we are fooled by crooks posing as saints.&lt;br /&gt;&lt;br /&gt;I am glad that Jon wrote a book exposing Greg Mortenson. But the real people I applaud are his audience. People realized that they were fooled, and they admitted this. Jon himself was a supporter of Greg's work, and had donated more than $77,000 of his own money to support the effort. It takes a lot of courage to investigate someone's fraud. But it takes a log more courage to admit that you have been fooled. I applaud the people for realizing their deceit, and having the strength to end the charade.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-48XY1zDcK7I/Tv8rj6t6g8I/AAAAAAAAAYs/xNHOvNMVp30/s1600/threecups.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-48XY1zDcK7I/Tv8rj6t6g8I/AAAAAAAAAYs/xNHOvNMVp30/s1600/threecups.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-3790127097353948639?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/3790127097353948639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/book-review-three-cups-of-deceit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/3790127097353948639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/3790127097353948639'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/book-review-three-cups-of-deceit.html' title='Book Review: Three Cups of Deceit'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-48XY1zDcK7I/Tv8rj6t6g8I/AAAAAAAAAYs/xNHOvNMVp30/s72-c/threecups.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-5690009962676709318</id><published>2012-01-03T00:00:00.001-08:00</published><updated>2012-01-03T00:00:04.572-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Indie Gaming</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was going to bemoan the loss of innovative ideas in gaming. I had seen too many first person shooters, too many car racing games, and the same old Japanese Role Playing Games.&lt;br /&gt;&lt;br /&gt;And then I met Indie Gaming, and I was blown away.&lt;br /&gt;&lt;br /&gt;If you're new to the concept, as I was, Indie Gaming are games made by independent studios. Sometimes, these are very small teams of developers producing a single game. The large game studios want to chase millions of installs and the big blockbuster game. They do not deviate much from formulaic games, massive story-lines, insanely detailed graphics and big budgets. Independent games are made by smaller teams, so they have a limited story, small budgets. This limits what they can do: they cannot put millions of dollars into graphics. And as a result, they need something to attract audience away from well established games. They need to be innovative.&lt;br /&gt;&lt;br /&gt;My introduction to Indie gaming was through the &lt;a href="http://www.humblebundle.com/"&gt;Humble Indie Bundle&lt;/a&gt;. The concept of an Indie bundle is as innovative as the games. Independent developers cannot get their games stocked in Walmart, and they don't have the traffic that can sustain Internet-only sales. As a result, they suffer from poor visibility and&amp;nbsp;lackluster&amp;nbsp;sales. So some independent game developers tried to offer a bundle of independent games at a price that the customer sets. Everyone chooses their own price. If you pay more than the mean donation amount, you also get some freebie games. The games are available for Windows, Mac, and Linux. The games have no Digital Rights Management, so you can confidently run the game on your computers in the future. They have no copy protection, so you can install the games on all your home computers. The &lt;a href="http://en.wikipedia.org/wiki/Humble_Indie_Bundle"&gt;independent games bundle&lt;/a&gt; concept has taken off. The sales are bigger and more prominent each year. The Humble Indie Bundle was the first bundle, and now there are many different types of bundles offered on the Internet.&lt;br /&gt;&lt;br /&gt;This year, I purchased the Humble Indie Bundle #4, and it included the Indie Bundle #3, since my donation amount was larger than the average. I paid $10. &amp;nbsp;I get eleven games with no DRM, and they all work on Linux: it is a bargain.&lt;br /&gt;&lt;br /&gt;The games are refreshingly innovative. &lt;a href="http://pc.ign.com/articles/114/1142949p1.html"&gt;Night Sky&lt;/a&gt; is a 2D physics platformer, where you have to roll a ball around to progress through levels. &lt;a href="http://en.wikipedia.org/wiki/Hammerfight"&gt;Hammerfight&lt;/a&gt; is a game in which you battle with a floating hammer. Hammerfight uses only a mouse, and no buttons. &lt;a href="http://en.wikipedia.org/wiki/Bit.Trip_Runner"&gt;Bit Trip Runner&lt;/a&gt; is a rhythm-based platformer, where your character has to jump and navigate through a level and your moves have to be synchronized to the background music.&lt;br /&gt;&lt;br /&gt;Independent gaming are bringing fun back into gaming with their innovative games.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-H1A38J4IC0Q/TwH4Gf4I8kI/AAAAAAAAAZE/bk4VadSlaTE/s1600/humble.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-H1A38J4IC0Q/TwH4Gf4I8kI/AAAAAAAAAZE/bk4VadSlaTE/s1600/humble.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-5690009962676709318?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/5690009962676709318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/indie-gaming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/5690009962676709318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/5690009962676709318'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/indie-gaming.html' title='Indie Gaming'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-H1A38J4IC0Q/TwH4Gf4I8kI/AAAAAAAAAZE/bk4VadSlaTE/s72-c/humble.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-7709957940400911754</id><published>2012-01-02T00:00:00.000-08:00</published><updated>2012-01-02T16:48:38.926-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: Binary, by Michael Crichton</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Want to read good fiction? Read "Binary", by Michael Crichton, one of his best works that you've never heard of. Yes, that &lt;a href="http://en.wikipedia.org/wiki/Jurassic_Park_(novel)"&gt;Michael Crichton&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The first book I read by Michael Crichton was an unknown book called "Binary" that none of my friends had heard about. I was in high school, and my father's friend had dropped this short book at our place. The author was John Lange, whom nobody had heard of. Inside, the book mentioned that the author was now revealed to be the great Michael Crichton, but I hadn't heard of Crichton either, so I wasn't expecting much.&lt;br /&gt;&lt;br /&gt;The book starts with a gripping description of a heist. It grabs you, and pulls you in. The book is a thriller, of a plot involving dangerous weapons, and one man's race to stop it all. It is a short book, written very well.&lt;br /&gt;&lt;br /&gt;I had harbored fond memories of this book. I had recommended it to many friends, knowing full well how difficult it was to obtain a copy. Recently, I received a copy of this book, and I sat down to read it. A short evening passed, and I was done. Despite having read it over a decade ago, I remembered most of the plot and many of the scenes. It was a thrilling book made punchier by the fact that I knew the story. I marveled at the plot and the excellent writing.&lt;br /&gt;&lt;br /&gt;A fantastic novel, a thrilling plot. The ending isn't blockbuster by today's standards, and that is part of the lure. No superfluous nonsense, and no extra pages.&amp;nbsp;A snappy story beautifully told.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ETzKvMsCowM/Tvqg42adP-I/AAAAAAAAAXY/OhwqIagguKY/s1600/binary.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-ETzKvMsCowM/Tvqg42adP-I/AAAAAAAAAXY/OhwqIagguKY/s320/binary.jpg" width="198" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-7709957940400911754?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/7709957940400911754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/book-review-binary-by-michael-crichton.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7709957940400911754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7709957940400911754'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/book-review-binary-by-michael-crichton.html' title='Book Review: Binary, by Michael Crichton'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-ETzKvMsCowM/Tvqg42adP-I/AAAAAAAAAXY/OhwqIagguKY/s72-c/binary.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-5601398768651772126</id><published>2012-01-01T00:00:00.000-08:00</published><updated>2012-01-01T00:00:05.099-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='india'/><title type='text'>Book Review: The Argumentative Indian</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Suffering from insomnia? Read "The Argumentative Indian", by Amartya Sen.&lt;br /&gt;&lt;br /&gt;"The Argumentative Indian" is supposed to be observations about Indian culture and society. It might be that, but the language was so convoluted that any beauty or meaning was lost in the maze of words. Here is a sample passage, after which I decided to drop the book.&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;Yet, as is discussed in Essays 7, 8 and 15, general statements about India and Indians can be found throughout history, from the ancient days of Alexander the Great, of Megasthenes (author of the Indika, in the third century BCE), and of Apollonius of Tyana (an India-expert in the first century CE) to the 'medieval' days of Arab and Iranian visitors (who, like Alberuni, wrote so much about the land and the people of India), all the way to the Enlightenment and post-Enlightenment Europe (with heroic generalizations about India presented by Herder, Schelling, Schlegel and Schopenhauer, among many others).&lt;/blockquote&gt;Say what? If you were counting, that contained &lt;b&gt;one&lt;/b&gt;&amp;nbsp;sentence.&lt;br /&gt;&lt;br /&gt;I'm sure the book contains some useful insight but the unconnected ideas and the lack of flow made the book unreadable. I would recommend V.S. Naipaul instead. Not only does he have insight into Indian culture and society, but the language is beautifully readable.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-1HK5JBz4xpo/TvkraoAtJdI/AAAAAAAAAV4/FduLt736l-Q/s1600/103008762.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-1HK5JBz4xpo/TvkraoAtJdI/AAAAAAAAAV4/FduLt736l-Q/s320/103008762.jpg" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-5601398768651772126?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/5601398768651772126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2012/01/book-review-argumentative-indian.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/5601398768651772126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/5601398768651772126'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2012/01/book-review-argumentative-indian.html' title='Book Review: The Argumentative Indian'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-1HK5JBz4xpo/TvkraoAtJdI/AAAAAAAAAV4/FduLt736l-Q/s72-c/103008762.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-8113326604303274106</id><published>2011-12-31T00:00:00.000-08:00</published><updated>2011-12-31T00:00:08.369-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: "Secrets" by Daniel Ellsberg</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Do you always do the "right" thing, or do you take the path of least resistance? "Secrets", by Daniel Ellsberg reveals the life of a person who did the right thing.&lt;br /&gt;&lt;br /&gt;Daniel Ellsberg is the person who leaked The Pentagon Papers, a secret study about the lessons learned during the Vietnam war. Leaking the study required a lot of personal courage. He was tried for acts of treason, though he was later acquitted. I find the lives of people like Daniel fascinating. They knew the path of least resistance, and yet they actively worked against it because of their conviction about the "right" thing to do. I wonder if I will have the strength that people like Daniel did.&lt;br /&gt;&lt;br /&gt;Secrets starts of with the Gulf of Tonkin incident, and Daniel talks about his observations when he was posted in Vietnam. This section of the book was very riveting: Daniel has incisive observations about the war that he saw. Later, Daniel was a scholar for the RAND corporation, studying the Vietnam war. The Pentagon Papers are the result of this study. Daniel talks about his experience with the secrecy in RAND and the Department of&amp;nbsp;Defense.&lt;br /&gt;&lt;br /&gt;I found Daniel's observation about the effect of access to secret clearance beautifully insightful. He warned Kissinger what the access to secret information will do. (Page 237 in the paperback version). I'll paraphrase Daniel's commentary:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;At first, you'll feel&amp;nbsp;exhilarated&amp;nbsp;by the volume and extent of information. Then, you'll feel like a fool for having analyzed these topics without even knowing that these secret documents existed. Then, you'll be aware of others who don't have this information, and you'll think that these people are fools. Finally, you'll become incapable of learning from people, because most people don't have access to these secret documents. No matter how great their experience compared to yours, you'll be incapable of learning from them.&amp;nbsp;&lt;/blockquote&gt;This passage should be read in the original. It is a beautifully crisp understanding of the impact of secret clearances, and power in general.&lt;br /&gt;&lt;br /&gt;Daniel talks about his thought-process, and why he decided to release the confidential study. He talks about the impact of the study, and the impact to his freedom. It makes a very interesting read.&lt;br /&gt;&lt;br /&gt;It reads like a war thriller, but it carries deep lessons about how difficult it is to do the right thing.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--VgPpNwPU1A/TvklNkxNCII/AAAAAAAAAVs/m83HppfP3co/s1600/secrets.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/--VgPpNwPU1A/TvklNkxNCII/AAAAAAAAAVs/m83HppfP3co/s320/secrets.jpg" width="219" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-8113326604303274106?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/8113326604303274106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-secrets-by-daniel-ellsberg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/8113326604303274106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/8113326604303274106'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-secrets-by-daniel-ellsberg.html' title='Book Review: &quot;Secrets&quot; by Daniel Ellsberg'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/--VgPpNwPU1A/TvklNkxNCII/AAAAAAAAAVs/m83HppfP3co/s72-c/secrets.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-8938652090317849274</id><published>2011-12-30T00:00:00.001-08:00</published><updated>2011-12-30T00:00:04.779-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='india'/><title type='text'>Book Review: Autobiography of a Yogi</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Why not read some third-grade fiction this weekend? Pick up a copy of "&lt;a href="http://en.wikipedia.org/wiki/Autobiography_of_a_Yogi"&gt;Autobiography of a Yoga&lt;/a&gt;" by&amp;nbsp;Paramhansa Yogananda.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The book is about a "yogi", a person who has attained enlightenment of some sort. However, the book reads like a supernatural fairy tale.&amp;nbsp;The very first chapter started off with this hoot of a passage.&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;The helpless humiliations of infancy are not banished from my mind. I was resentfully conscious of not being able to walk or express myself freely.... &amp;nbsp;Psychological ferment and my unresponsive body brought me to many obstinate crying-spells.&lt;/blockquote&gt;&lt;div&gt;The author claims that he was fully conscious of his infancy, and that he cried because he couldn't express himself. This is pretty damn hard to believe. Of course, the author is gone now, and no supporting evidence can be obtained. From what we know about brain development, it is difficult to believe that any child could have such capability. A few sentences before that, he claims that in his previous birth he was a Himalayan yogi. You would think such a highly perceptive creature would wait for the infancy days to get over before trying to talk.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A few pages later, &amp;nbsp;we get another passage tailor-made for the gullible audience:&lt;/div&gt;&lt;blockquote class="tr_bq"&gt;An immense flash of light at once manifested to my inward gaze. Diving shapes of saints, sitting in meditating posture in mountain caves, formed like miniature cinema pictures on the large screen of radiance within my forehead.&lt;br /&gt;"Who are you", I spoke aloud&lt;br /&gt;"We are the Himalayan yogis." The celestial response is difficult to describe; my heart was thrilled.&lt;br /&gt;"Ah, I long to go to the Himalayas and become like you!" The vision vanished, but silvery beams expanded in ever-widening circles to infinity.&lt;br /&gt;"What is this wondrous glow"&lt;br /&gt;"I am Iswara, I am Light." The voice was as murmuring clouds.&lt;br /&gt;"I want to be one with Thee!"&lt;/blockquote&gt;&lt;div&gt;It is as poorly written as it is imagined. In the first chapter, he had recognized himself as a Himalayan yogi from a previous birth, and now that he sees a few people more, he needs them to positively identify themselves.&amp;nbsp;The book is filled with&amp;nbsp;extravagant&amp;nbsp;recounting of supernatural events. Looks like the author lived in a charmed world, only dimly aware of laws of Physics. The miracles themselves are difficult to take seriously.&amp;nbsp;Extraordinary claims require extraordinary proof, none of which is provided by the book. And they aren't even written in a funny or engaging manner. They're stated with a nonchalance that suggests that this is commonplace. Even if this were a work of fiction I'd pass it by.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The lesson from the book is that you are a yogi if unnatural stuff happens to you. If it doesn't, tough luck. Maybe next birth pal.&amp;nbsp;Wait this life out.&amp;nbsp;Even as a spiritual text the book is abysmal. It has no lesson about how to live a good life, or how to achieve peace. A much more concise and beautiful lesson is the one-liner from Mae West, "You only live once, but if you do it right, once is enough."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;I am amused by "Autobiography of a Yogi". It comes highly recommended from seemingly sane people. People swear by it, and say that it changed their life. You have to be very desperate for meaning if this book gives you any. It is like finding deep meaning in "Baa Baa Black Sheep".&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Due to the poorly imagined plot, and the haphazard story-line, I didn't read too far. If someone could point out passages that they thought were spiritually enlightening, I'd be happy to revise my opinion.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kYIwk0of2HE/Tv1CyBI8QdI/AAAAAAAAAYg/mQGYXUyqwmo/s1600/Autobiography+of+a+Yogi.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-kYIwk0of2HE/Tv1CyBI8QdI/AAAAAAAAAYg/mQGYXUyqwmo/s320/Autobiography+of+a+Yogi.jpg" width="210" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(In case you are offended by this: Calm down. If this guy is half as divine as he claims, he won't mind it.)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-8938652090317849274?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/8938652090317849274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-autobiography-of-yogi.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/8938652090317849274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/8938652090317849274'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-autobiography-of-yogi.html' title='Book Review: Autobiography of a Yogi'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-kYIwk0of2HE/Tv1CyBI8QdI/AAAAAAAAAYg/mQGYXUyqwmo/s72-c/Autobiography+of+a+Yogi.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-755226056705458037</id><published>2011-12-29T00:00:00.000-08:00</published><updated>2011-12-29T00:00:08.837-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: The Golden Gate by Vikram Seth</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Want to read a moving novel in sonnets? Grab a copy of &lt;a href="http://en.wikipedia.org/wiki/The_Golden_Gate_(Vikram_Seth_novel)"&gt;"The Golden Gate", by Vikram Seth&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I am prejudiced against "popular" Indian authors. Past experiences have made me critical towards them, especially if their fiction is popular in the West. I don't know what I was thinking when I picked up "The Golden Gate" by Vikram Seth. I had heard of Vikram Seth, but I had not read anything by him.&lt;br /&gt;&lt;br /&gt;The Golden Gate is a story about a few friends, and a few years of their life. The book is written entirely in verse, which took me by surprise. It has been a few years since I read verse. I need not have worried, the Golden Gate is a great way to start reading verse again. It is easy to read, and many passages in it are moving, and thought provoking. The book starts out with a person who should be happy at his success, but he feels lonely. It follows his journey, and tells you about his friends, and their lives. Written during the turbulent period of the Vietnam era, it raises interesting questions about life, ambition, following one's dreams, and what it takes to be happy and at peace.&lt;br /&gt;&lt;br /&gt;The locations are all from the San Francisco Bay Area: San Francisco, San Jose, Marin county, and introduce the reader to the joy of living in this wonderful part of the world. It makes the reader appreciate the world we live in, and our friends.&lt;br /&gt;&lt;br /&gt;I started out skeptical, and ended up enjoying the book immensely. I was sad when it ended, Vikram had done such a fine job of introducing the characters that they felt like friends.&lt;br /&gt;&lt;br /&gt;Get the book, and enter the charming world of Vikram Seth's verse.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-whrsLFCd-J0/Tvi1aWjl3PI/AAAAAAAAAVU/eNYjESyNHyo/s1600/200px-TheGoldenGate.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-whrsLFCd-J0/Tvi1aWjl3PI/AAAAAAAAAVU/eNYjESyNHyo/s1600/200px-TheGoldenGate.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Image courtesy &lt;a href="http://en.wikipedia.org/wiki/The_Golden_Gate_(Vikram_Seth_novel)"&gt;Wikipedia&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-755226056705458037?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/755226056705458037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-golden-gate-by-vikram-seth.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/755226056705458037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/755226056705458037'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-golden-gate-by-vikram-seth.html' title='Book Review: The Golden Gate by Vikram Seth'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-whrsLFCd-J0/Tvi1aWjl3PI/AAAAAAAAAVU/eNYjESyNHyo/s72-c/200px-TheGoldenGate.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-4496313605514123689</id><published>2011-12-28T00:00:00.000-08:00</published><updated>2011-12-28T00:00:09.298-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: Spice Route</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Want to know why bay leaves were once more expensive than saffron? Read &lt;a href="http://books.google.com/books/about/The_Spice_Route.html?id=yUYdAQAAMAAJ"&gt;"The Spice Route", by John Keay&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The book is a history of the Spice Route, and the general quest of Europeans to find exotic aromas and flavors. It goes through time, showing how the trade route was a long chain of sea and overland routes through the Middle Ages. Various spices were harvested in South East Asia: India, Indonesia, and other countries. These were traded by Arabian traders, who brought them to the Middle East. Here, they were traded to others who took them to the Mediterranean.&lt;br /&gt;&lt;br /&gt;The history of this route is fascinating: spices were a big motivation for the European powers to expand East and West. Many campaigns were waged: trying all the routes, trying all ways to gain more access. The merchants from Holland successfully bypassed the Mediterranean, and the Spanish and&amp;nbsp;Portuguese&amp;nbsp;managed to go in different directions: the Spanish went towards the New World, while the Portuguese went East towards Goa and Japan. It is difficult to transport a person to that time, where travel was wretched and dangerous, but John does a fine job in giving the reader a flavor of that world.&lt;br /&gt;&lt;br /&gt;The spice route led to a colonization of the world, as the European powers carved up the commercial world among themselves. It is instructive to read this history, and learn about how a new improvement fundamentally changes the field.&lt;br /&gt;&lt;br /&gt;This book will shed a light into the colonial era, and will take the reader back through time. It made me look at my spice cabinet very differently, and treat my bay leaves with a lot more respect.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-1F_eQQuVVjQ/Tvix56i9ArI/AAAAAAAAAVI/sznnRCSmob0/s1600/spiceroute.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-1F_eQQuVVjQ/Tvix56i9ArI/AAAAAAAAAVI/sznnRCSmob0/s1600/spiceroute.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-4496313605514123689?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/4496313605514123689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-spice-route.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/4496313605514123689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/4496313605514123689'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-spice-route.html' title='Book Review: Spice Route'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-1F_eQQuVVjQ/Tvix56i9ArI/AAAAAAAAAVI/sznnRCSmob0/s72-c/spiceroute.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-7424588296058887544</id><published>2011-12-27T00:00:00.000-08:00</published><updated>2011-12-27T00:00:08.754-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: H20 A Biography</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Looking for some good science writing about a common topic? Pick up Philip Ball's, "H20, A Biography".&lt;br /&gt;&lt;br /&gt;Philip writes about water from a few different angles. It talks about how water originated in the Universe. The book talks about the origin of the Universe (Big Bang, not 6000 years), and how planets were formed. Then it goes into how Earth might have got its water. We take water for granted, but many planets have little or no water at all. If we believe that intelligent life requires water, we need to understand how water could have come around in the first place. It is a very strange set of circumstances that caused Earth to get water and retain it. Many planets might have had water, but they lost it over time. Astronomers and&amp;nbsp;Physicists&amp;nbsp;have looked at Venus and Mars and tried to reason about how Earth might have had water. The Science behind this is quite beautiful and involved, and it helps that Philip explains it so well.&lt;br /&gt;&lt;br /&gt;Next, Philip explains how humans discovered water. This is the most interesting part of the book, the history of Science. Ancients thought that water was an element, and they did not know that ice, water and steam are the same compound. This led to a long set of mistakes and it shaped the thinking of early chemists, leading them astray. I found this section remarkable. How does one realize what water contains? Philip lists all the major Physics and Chemistry milestones that allowed humans to recognize that water is a compound of hydrogen and oxygen. The book also talks of how humans realized that ice, water and steam are the same compound. The mis-steps are very instructive. They lead to a better understanding of how science proceeds and how mistakes are corrected. Early chemists thought that when something is burned, it gives up phlogiston (rather than taking up oxygen). This was an easy mistake, given the instruments of the time. Early chemistry made quick advances when people showed that burning was a process of oxidation, combining chemically with oxygen. (Similar mistakes were made in early experiments with electricity. Electricity was through to flow from the positive lead to the negative lead, when the actual flow is in the opposite direction. Thus, electrons now have a negative charge by convention.)&lt;br /&gt;&lt;br /&gt;In the third section, the book talks about the behavior of water in cells, and the anomalous behavior of water under various circumstances: low temperature, high pressure, low pressure, presence of solid bodies. I didn't know much of it, though I confess that I wasn't able to retain much of this information. It was just too dense for me in parts, and I had to skim through.&amp;nbsp;The book ends with drinking water, and explains why the lack of drinking water is one of the biggest problems facing humanity.&lt;br /&gt;&lt;br /&gt;The book is a beautiful history of early chemistry and various aspects of water. It does get technical at times explaining in quite some detail how certain things work. It is best to skim such sections and return to them later. A majority of the book is an easy and insightful read.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ExIcaG9jSrk/Tvii7UwWLZI/AAAAAAAAAU8/I1_edkczGu8/s1600/h2o.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-ExIcaG9jSrk/Tvii7UwWLZI/AAAAAAAAAU8/I1_edkczGu8/s1600/h2o.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-7424588296058887544?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/7424588296058887544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-h20-biography.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7424588296058887544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/7424588296058887544'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-h20-biography.html' title='Book Review: H20 A Biography'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-ExIcaG9jSrk/Tvii7UwWLZI/AAAAAAAAAU8/I1_edkczGu8/s72-c/h2o.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-347142469445554242</id><published>2011-12-26T08:05:00.000-08:00</published><updated>2011-12-29T21:20:58.046-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><title type='text'>Book Review: Seeing Voices</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Oliver Sacks is a neurologist of some renown. He has written some fascinating books on the working of the mind: the most famous are "The Man Who Mistook His Wife for a Hat", and "Musicophilia". "Seeing Voices" is a short book about the deaf.&lt;br /&gt;&lt;br /&gt;When I first picked up the book, I wondered if brain development for deaf people is very different from that of hearing people. Oliver's book lists the various ways in which language development suffers if a deaf person isn't allowed to sign naturally, or if he doesn't have access to other people who sign. I didn't know much about sign language before reading the book. Sign language isn't a simple translation of English or Hindi into gestures. Rather, it has its own idioms, its own grammar. So sign has a notion of poetry and of puns.&lt;br /&gt;&lt;br /&gt;Oliver lists various cases of deaf people whose parents did not sign. When these children grew up and finally encountered signing, a world of language opened up to them. This process is beautifully described, and provides valuable insights into the working of the language part of the brain. For example, without language, there was no way to describe time: today versus tomorrow blend in if there is no way to describe them.&lt;br /&gt;&lt;br /&gt;There are also examples of a few hearing individuals whose language development has been artificially suppressed. These examples showed how both hearing and non-hearing individuals pick up language in similar manner.&lt;br /&gt;&lt;br /&gt;"Seeing Voices" is a great book to read if you have a small child in the house. Children learn sign language faster than spoken language. Spoken language requires a complicated co-ordination of the vocal chords, and these develop rather late in children. Sign language requires arm motion which children acquire rather early. Based on this, many hearing parents teach their children sign language. From an early age, the child learns how to express himself: pain, hunger, boredom, and a need for mommy, daddy, or sibling. This allows for a limited communication between parent and child, removing frustrations on both ends.&lt;br /&gt;&lt;br /&gt;After reading this book, I could think of many friends who would love to read this. You don't need to be interested in neuroscience, language development, child development, or the world of the deaf to love this book. This short book makes you aware of language, and gives you much to consider about.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-kZdJ-dmMQ4g/TviTSlql_vI/AAAAAAAAAUs/61mjWXitJ4A/s1600/6_seeing_low_res.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-kZdJ-dmMQ4g/TviTSlql_vI/AAAAAAAAAUs/61mjWXitJ4A/s320/6_seeing_low_res.jpg" width="208" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-347142469445554242?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/347142469445554242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-seeing-voices.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/347142469445554242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/347142469445554242'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-seeing-voices.html' title='Book Review: Seeing Voices'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-kZdJ-dmMQ4g/TviTSlql_vI/AAAAAAAAAUs/61mjWXitJ4A/s72-c/6_seeing_low_res.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-2934401171731512871</id><published>2011-12-25T18:21:00.000-08:00</published><updated>2011-12-25T18:21:27.298-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='india'/><title type='text'>Book Review: The Man Who Knew Infinity</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="http://en.wikipedia.org/wiki/Srinivasa_Ramanujan"&gt;Srinivas Ramanujan&lt;/a&gt; was a brilliant Indian mathematician who made seminal contributions to Number Theory and the theory of continued fractions. Robert Kanigel's book, "The Man Who Knew Infinity" is a biography of Ramanujan.&lt;br /&gt;&lt;br /&gt;The book talks about Ramanujan's life in quite some detail. Robert has provided a lot of color by traveling to the places involved, and deeply researching Ramanujan's life. The book has photographs of the places and maps of areas, making it easy to identify with the story. The biography is well balanced and impartial. If this was all the book contained, it would already be a worthy read.&lt;br /&gt;&lt;br /&gt;What I found most interesting was the associated commentary on Indian society, values and the education system. Ramanujan was ignored by the Indian education system, largely because he refused to conform to its requirements. Ramanujan showed an early brilliance in Mathematics. But the system didn't care for exceptional performance in one field. Due to the inflexibility of the system, the talent of a brilliant mathematician was wasted. Having suffered through the Indian education system, I found the passages revealing. Even back in Ramanujan's day, the system was inflexible and idiotic. Many people recognized the inflexibility of the system, its arbitrary outcome, and the ill effect on genuine talent.&lt;br /&gt;&lt;br /&gt;How much part did Indian society and customs play in Ramanujan's downfall? Ramanujan refused to alter his diet in cold, cloudy England. As a result, he got very little vitamin D, and suffered poor health. This is a problem that persists to this day: Indians who firmly adhere to a restricted diet suffer from problems in countries where an Indian diet is unsuitable. Ramanujan's wife was poorly treated by his mother, and this poor treatment led to misunderstanding and stress in Ramanujan's life. Would the outcome have been different if the Indian arranged marriage was not as&amp;nbsp;stifling?&lt;br /&gt;&lt;br /&gt;Ramanujan's life is full of questions. It makes me sad at the outcome. But more importantly, it makes me wonder.&lt;br /&gt;&lt;br /&gt;Would a Ramanujan be possible today? Could a lower middle class boy with no talent for anything other than Mathematics be recognized as a genius? Could he even reach a point where he could seek collaboration or patronage from Western mathematicians?&lt;br /&gt;&lt;br /&gt;It is a very sad tale, though one I think every Indian student should know. Indian students yearn for exposure to foreign&amp;nbsp;education and worldwide recognition. This is one example of a person who got both, and yet he had a sad and lonely life. The outcome could have been so much different. Ramanujan was as good as &lt;a href="http://en.wikipedia.org/wiki/Euler"&gt;Euler&lt;/a&gt; or a &lt;a href="http://en.wikipedia.org/wiki/Gauss"&gt;Gauss&lt;/a&gt;, according to people who worked with him. And yet his talent was squandered away. An early death, a lonely life full of struggle. And Ramanujan was lucky. Today, he probably would have no hope of success.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-y1uTYoSKR2Q/TvfXoTjVoYI/AAAAAAAAANY/6g2ATEhtw8Q/s1600/200px-Ramanujan.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-y1uTYoSKR2Q/TvfXoTjVoYI/AAAAAAAAANY/6g2ATEhtw8Q/s1600/200px-Ramanujan.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Image courtesy &lt;a href="http://en.wikipedia.org/wiki/Srinivasa_Ramanujan"&gt;Wikipedia&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-2934401171731512871?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/2934401171731512871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-man-who-knew-infinity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2934401171731512871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/2934401171731512871'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-man-who-knew-infinity.html' title='Book Review: The Man Who Knew Infinity'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-y1uTYoSKR2Q/TvfXoTjVoYI/AAAAAAAAANY/6g2ATEhtw8Q/s72-c/200px-Ramanujan.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-4040947261202329612</id><published>2011-12-19T00:00:00.000-08:00</published><updated>2011-12-19T00:00:04.931-08:00</updated><title type='text'>Book Review: The Male Brain &amp; The Female Brain</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div&gt;Rather than waste your time with pop-culture books about men and women, how about read books with real science and insight this holiday season?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;This is a review of two delightful books called "The Female Brain" and "The Male Brain" written by&amp;nbsp;&lt;a href="http://drlouann.ning.com/"&gt;Louann Brizendine&lt;/a&gt;. Dr. Brizendine is a professor at UC San Francisco. Both books talk about the peculiarities of each brain from a scientific viewpoint. The books are scientifically accurate, and are accessible to a layperson with no background in neurology.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The books contain a lot of insight about the behavior of both men and women. For example, The Female Brain talks about how women's brain is highly geared towards social connections. It provides many examples to demonstrate this, and talks about the development of a female brain from a newborn to adult and to a mature brain. Along the way, you see the various changes in the brain. A lot of behavior changes accompany the development of the brain. This book made me understand the motivation behind the baffling behavior of friends and relatives.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Female Brain was the earlier book. Recently, Dr. Brizendine wrote The Male Brain. The second book is as interesting and as revealing as the first. It talks of the development of the male brain through the years. There are many ways in which the adult male brain is different from the teenage male brain. Reading about the male brain allowed me to better understand how I will change as I grow older. It also allowed me to understand male toddlers behavior.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Both books are a quick read, they make cutting-edge scientific research accessible to everyone. This is scientific writing at its best.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-0-P2qjYHVn4/Tuzh2o57XRI/AAAAAAAAABc/I3g0-8ukJpk/s1600/brains.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-0-P2qjYHVn4/Tuzh2o57XRI/AAAAAAAAABc/I3g0-8ukJpk/s1600/brains.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-4040947261202329612?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/4040947261202329612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/12/book-review-male-brain-female-brain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/4040947261202329612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/4040947261202329612'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/12/book-review-male-brain-female-brain.html' title='Book Review: The Male Brain &amp; The Female Brain'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-0-P2qjYHVn4/Tuzh2o57XRI/AAAAAAAAABc/I3g0-8ukJpk/s72-c/brains.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-6704844965943724320</id><published>2011-10-12T09:02:00.000-07:00</published><updated>2011-10-13T22:29:51.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='india'/><title type='text'>Book Review: Kashmir, The Wounded Valley</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Many years ago, Neha and I were walking around Santa Rosa in Northern California. We came across a used bookstore where the owner was listening to some good blues, and improvising with a harmonica. It was a perfect setting. We entered the store and found some very interesting books. Some of these books have been impossible to find elsewhere.&lt;br /&gt;&lt;br /&gt;Today's review is about one book from that store. The book is &lt;a href="http://openlibrary.org/books/OL1253432M/Kashmir_the_wounded_valley"&gt;"Kashmir, The Wounded Valley", by Ajit Bhattacharjea&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The book is a condensed history of the Kashmir valley. It starts around 700AD, when authoritative written record begins, and continues on till 1992. It is an insightful read. Written in an easy style, Ajit takes the reader through time in Kashmir's history. Entirely factual, and entirely gripping, the book has the pull of a crime thriller rather than the yawn of history books. It is even more chilling when you realize that all the events occurred. And when you turn to the evening news, you realize that we are still living with the repercussions.&lt;br /&gt;&lt;br /&gt;Two things struck me when reading the book.&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;The valley has had mismanagement and &lt;b&gt;cruel monarchs&lt;/b&gt;. Few rulers have cared for the well-being of their people. Dynasties follow a predictable pattern. The first monarch in a dynasty is an aggressive conqueror, or a cunning statesman. The second is a benevolent and able leader. Successive leaders are selfish, greedy, and insensitive to the needs of the people. Few monarchs have focused on improving education or living conditions. As a result, the people have suffered greatly and their lot has worsened over the years. Even before the British Raj, the condition of the people was miserable.&lt;/li&gt;&lt;li&gt;The people are surprisingly &lt;b&gt;resilient&lt;/b&gt;, and a little gullible. Kashmiris have a liberal outlook towards life. Most Kashmiris converted from Hinduism and Buddhism to Islam willingly. The benevolent influence of liberal sufis struck a chord among the liberal Kashmiris. Culture played a bigger role than religion in their life. All through the turmoil of Mughal India, Kashmir had peaceful co-existence among Hindus and Muslims. The gullibility of the people leads to their willingness to be ruled and oppressed. And it shows in the lack of popular uprising to demand better rights and better living conditions. They supported outsiders to overthrow the existing monarch, only to find the new boss was same as the old boss. Even when democracy was at hand, they did not demand their rights aggressively. As a result, leaders turned into tyrants, ignoring the needs of the people and holding Kashmir back from fully awakening.&lt;/li&gt;&lt;/ol&gt;The book also explains how Kashmir became a contentious issue between India and Pakistan, and the mistakes that led us there. The book is impartial: it points out mistakes on all sides. The ruler of Kashmir, Hari Singh, refused to make a concrete decision on joining either side. He had hopes of staying independent despite the impossibility of such an arrangement for Kashmir. Rulers of India and Pakistan refused to give the Kashmir issue the importance it deserved. And as we have seen countless times before, administrative incompetence and widespread corruption made a bad situation worse. Heavy-handed actions by the central government, corruption by well-known people, and a lack of respect for the people's needs alienated an entire state. The people started out amicable to India, eager to strengthen ties with the land of Nehru and Gandhi. Over years, all good will was squandered, culminating in the excesses of the armed forces. Warm friends turned into bitter enemies.&lt;br /&gt;&lt;br /&gt;A small bruise festered into an open sore, leading to much pain and hardship for both countries for over fifty years. Over time, that pain has spread through both countries. It has led to war and terrorism.&lt;br /&gt;&lt;br /&gt;This book should be a required reading for every Indian and Pakistani student. It has valuable lessons for future statesmen. Due to mortal follies, a place with heavenly beauty has been turned into a dark hell. Having deteriorated so far, it is debatable if the situation will ever improve. If&amp;nbsp;a workable remedy exists,&amp;nbsp;knowing how we got into this mess is the first step towards it.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-gLVJdCvSN4Y/TpW00GnF5-I/AAAAAAAAAAg/r6Z0fNDx7Q0/s1600/kashmir.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-gLVJdCvSN4Y/TpW00GnF5-I/AAAAAAAAAAg/r6Z0fNDx7Q0/s1600/kashmir.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-6704844965943724320?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/6704844965943724320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/10/book-review-kashmir-wounded-valley.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/6704844965943724320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/6704844965943724320'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/10/book-review-kashmir-wounded-valley.html' title='Book Review: Kashmir, The Wounded Valley'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-gLVJdCvSN4Y/TpW00GnF5-I/AAAAAAAAAAg/r6Z0fNDx7Q0/s72-c/kashmir.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-3978723635118917182</id><published>2011-10-10T22:37:00.000-07:00</published><updated>2011-10-11T06:13:06.810-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><title type='text'>The State of Free Software Today: What We Need to Do</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="http://stallman.org/archives/2011-jul-oct.html#06_October_2011_(Steve_Jobs)"&gt;Richard Stallman (popularly called RMS) wrote an eulogy to Steve Jobs&lt;/a&gt; recently. It was widely reported due to its angry tone. In summary, RMS was happy that Steve Jobs is dead because Jobs personifies the "walled garden" approach to computing. In the Free Software camp, nothing is more abhorrent than the walled garden approach. Free software is all about giving people a lot of freedom: including the full source code of the software, and the freedom to modify it and copy it. The walled garden approach is all about tight control: not just of the source code but also the development and the overall experience.&lt;br /&gt;&lt;br /&gt;It is easy for me to pick sides: I have been a free software enthusiast since 1995, when my friend and I chanced upon something called Linux. I spent many hours playing with Linux, and have used it as my primary system for well over a decade. In addition to Linux, I spend all my time in free application software: Firefox, Chrome, Blender, GIMP, R, Eclipse, Emacs, Arduino, ... The list goes on.&lt;br /&gt;&lt;br /&gt;I abhor the walled garden approach. It is damaging to my livelihood as a software engineer if I cannot learn from a system or modify it. I enjoy programming and have tinkered with most systems I own. My tinkering was lousy and inconsequential, but I enjoyed it. And I learned a lot by poking inside them.&lt;br /&gt;&lt;br /&gt;It is easy to identify with RMS' criticism of Steve Jobs. It is easy to rally people when you demonize someone.&amp;nbsp;But free software doesn't need this kind of rallying.&lt;br /&gt;&lt;br /&gt;I think&amp;nbsp;&lt;b&gt;RMS is&amp;nbsp;wrong&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The Lure of Free Software&lt;/span&gt;&lt;br /&gt;Free software is compelling. Many programs like Blender, Eclipse, Emacs are the best in their class. They are exceptional tools. I write better in Emacs than any other editor. Emacs is an extension of my mind: it is a supremely capable editor. My other editor, vim, is equally good. It is beautiful to watch an expert use emacs or vi: the software makes them insanely productive. Free software has done exceptionally well in technical areas like Statistics (R), 3D modelling (Blender), web serving (Apache), microcontroller hackery (Arduino), development tools (Eclipse, GCC, emacs/vi, ..) In these areas, non-free tools are at a significant disadvantage. Who would bother using some souped-up microcontroller tool when Arduino works so beautifully? Who would bother with a strange new Statistical language, now that you can download, install and use R right away? And if you have a newbie question with R, the wizard&amp;nbsp;&lt;a href="https://groups.google.com/group/r-help-archive/browse_thread/thread/fb967bc018cb0f2c/22de5b6ba2f92d0b?pli=1"&gt;Peter Dalgaard himself replies to questions&lt;/a&gt;! That is how awesome the community is. The software is great, the community is knowledgeable and helpful, and you can read the source code to learn more. It doesn't get better than that.&lt;br /&gt;&lt;br /&gt;With software like that, you don't need to yell about the virtues of free software and the evils of the walled garden. The software stands on its own merit. And it continues to attract people like me who care about the freedom.&lt;br /&gt;&lt;br /&gt;The free software world has produced some exceptional non-technical software: Firefox and Chrome as browsers, VLC as a media player. But in the non-technical area, free software has lagged behind. Ubuntu is making a gorgeous operating system that my mother can use. But companies like Canonical are the exception rather than the norm.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The Lure of the Walled Garden&lt;/span&gt;&lt;br /&gt;In recent past, Apple has gained a large following. Their products like the iPhone and the iPad are phenomenally popular. People are buying these products because of the superior user interface, and the ease of use. The &lt;a href="http://www.eggwall.com/2011/07/age-of-technology-age-of-interface.html"&gt;user interface really is the killer feature&lt;/a&gt;. Free software advocates might dislike the walled garden approach, but we cannot deny that Apple devotes extraordinary resources to getting an excellent user interface. The first bite of the Apple is bewitchingly delicious. The interface sells.&lt;br /&gt;&lt;br /&gt;For a long time, the free software world has been blind to the needs of the "common" user. We have aimed at the technical audience, and have ignored the needs of the vast majority of computer users: our parents, our grandparents, our friends. We justified this stance because there were limited developers, and we needed to get our own house in order. We needed development tools, drivers for technical products, technical software. Developers were more interested in scratching their own itches, writing programs that satisfied their needs. Nobody can be blamed for the situation we are in. Every free software developer has been working hard, quite often without pay. Asking a Statistics programmer to write a cute game would be a disaster.&lt;br /&gt;&lt;br /&gt;In the meanwhile, a walled garden has appeared with exceptional usability, even if it has a limited set of features.&lt;br /&gt;&lt;br /&gt;It is a testimony to good usability that people are willing to enter the walled garden. Many people don't care about the freedom. People who do care continue to enter the walled garden despite their loss of freedom. It is a question of convenience, and people choose their battles carefully.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The way forward&lt;/span&gt;&lt;br /&gt;We have many glimmers of hope. Look at Firefox or Chrome. Both are free software, and both wrested browser market share from Internet Explorer (IE). IE was never an explicit walled garden, but it did curtail freedoms: it ran on specific platforms, it fragmented the web with its own extensions. For a long time, the lack of a good browser was the chief hurdle for free software users. We couldn't use IE, and nothing else was good enough. Navigator was barely&amp;nbsp;usable.&lt;br /&gt;&lt;br /&gt;Then came Firefox: it was a compelling browser. Firefox was fast, it ran on every system, it was more secure. Most importantly, it was beautiful. Compared to Netscape Navigator and IE: man, was it gorgeous! Put the navigation buttons and URL bar along the menu bar, and you had one pretty interface. Chrome went one step ahead: it is an exceptional browser. It is fast, it is pretty, it is secure. Oh, and the source is available. People who don't care about freedom of software use it because it is good. And people who care about freedom can download its source code.&lt;br /&gt;&lt;br /&gt;Something similar is happening with Android now. Android's source code is available. But that's not why millions flock to buy the Nexus-S or the Droid. They want the system because it is excellent. With Gingerbread, the Android system looks beautiful. With the next release, I'm sure it will look even better. Now that it is comparable on features, it is polishing its usability.&lt;br /&gt;&lt;br /&gt;That is the way forward: to &lt;b&gt;make exceptional software&lt;/b&gt;. Make the best damn system in the world. Make it gorgeous, fast, cheap, reliable, rugged, stable. And then release the source code. Find opportunities like the Mozilla Foundation did with Firefox. Like&amp;nbsp;Canonical did with Ubuntu.&amp;nbsp;Or like Google did with Chrome, Chrome OS and Android.&lt;br /&gt;&lt;br /&gt;Users are being charmed by the the usability of the software that Steve Jobs provided. Provide the same usability with the freedom. The walled garden will disappear by itself.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-CB1bfz5A-5s/TpO_k-91BPI/AAAAAAAAAAY/MPD3BUM4bhw/s1600/Adam-and-Eve-apple.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-CB1bfz5A-5s/TpO_k-91BPI/AAAAAAAAAAY/MPD3BUM4bhw/s1600/Adam-and-Eve-apple.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-3978723635118917182?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/3978723635118917182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/10/state-of-free-software-today-what-we.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/3978723635118917182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/3978723635118917182'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/10/state-of-free-software-today-what-we.html' title='The State of Free Software Today: What We Need to Do'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-CB1bfz5A-5s/TpO_k-91BPI/AAAAAAAAAAY/MPD3BUM4bhw/s72-c/Adam-and-Eve-apple.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-4320221611329549876</id><published>2011-10-09T16:28:00.000-07:00</published><updated>2011-10-09T16:29:00.913-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='india'/><title type='text'>Indian Universities are no longer world class</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;A recent survey carried out by the &lt;a href="http://www.timeshighereducation.co.uk/world-university-rankings/2011-2012/top-400.html"&gt;Times Higher Education magazine ranked all the universities in the world&lt;/a&gt;. Sadly, Indian universities don't figure too highly. The best Indian university in that list is IIT Bombay. Its ranking is 301-350: no specific rank is given. One thing is for sure, IIT Bombay is worse than many small universities few people have heard about, like places in Turkey and Brazil.&lt;br /&gt;&lt;br /&gt;Many years ago, &lt;a href="http://www.eggwall.com/2005/11/lets-all-go-to-iit.html"&gt;I had written about how the IITs are not world class&lt;/a&gt;. When you venture out of India, you realize how bad they are. That article got a lot of pageviews, and lots of comments. Many IIT students wrote to say how deluded I was, in their own special way. Eat humble pie, my friends.&lt;br /&gt;&lt;br /&gt;The Times Higher Education survey is quite comprehensive. You can look at the &lt;a href="http://www.timeshighereducation.co.uk/world-university-rankings/2011-2012/analysis-rankings-methodology.html"&gt;methodology details here&lt;/a&gt;. In short, they asked industry and education leaders for their views of universities. Universities were graded along a variety of factors: the number of citations for their papers, the amount of research funding, the impact of its research on industry, the teaching environment. The study looks solid: all income has been adjusted for purchasing power parity, so poor countries are not penalized for their lower cost of living. Also, there is a normalization across disciplines, so sciences where overall publication frequency is lower are not penalized for having lesser research output. The weight for research output is 30%, which is perhaps too low. They have an&lt;a href="http://www.timeshighereducation.co.uk/world-university-rankings/2011-2012/iphone.html"&gt; iPhone application which allows you to change the weights&lt;/a&gt; and see the impact on the ranking.&lt;br /&gt;&lt;br /&gt;I don't have access to their raw data, but from reading about the study, their method looks sound. Ranking an institution is a difficult task, and this study is probably the most precise answer we have right now. A better study could look at the impact of graduates from the universities, or the difference between the capability of students with and without the education: thereby measuring the impact of the institution itself. Alas, such controlled studies are difficult to come by.&lt;br /&gt;&lt;br /&gt;So where does this leave us? This leaves us in the sorry state of admitting that Indian educational institutions are really not that good. The Chinese are far ahead of us. The prestigious Tsinghua University in China is at position 71, ranking near well known universities Rice and Vanderbilt, both in the US. Among Asian countries, Japan, Hong Kong, and Singapore all fare very well. In fact, the &lt;a href="http://www.timeshighereducation.co.uk/world-university-rankings/2011-2012/asia.html"&gt;top Asian universities are dominated by Japan, Hong Kong, China, Singapore, and Korea&lt;/a&gt;,&amp;nbsp;and now the reasons are somewhat clearer.&amp;nbsp;. These countries have made investments in education, and the results speak for themselves. &lt;a href="http://www.rediff.com/money/2007/feb/05edu.htm"&gt;Even between Brazil, Russia, and China, India spends the least amount of money on education, per student&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Admitting that our educational institutions have fallen behind is the first step. Only after we admit the problem can we find ways to rectify the situation.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-N_euakTOUBg/TpIdyIpvUMI/AAAAAAAAAAM/jP9a9TJDKt4/s1600/iit2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-N_euakTOUBg/TpIdyIpvUMI/AAAAAAAAAAM/jP9a9TJDKt4/s1600/iit2.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-4320221611329549876?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/4320221611329549876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/10/indian-universities-are-no-longer-world.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/4320221611329549876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/4320221611329549876'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/10/indian-universities-are-no-longer-world.html' title='Indian Universities are no longer world class'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/14128872612935211717</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-N_euakTOUBg/TpIdyIpvUMI/AAAAAAAAAAM/jP9a9TJDKt4/s72-c/iit2.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19163975.post-5756260876902997156</id><published>2011-10-08T13:00:00.000-07:00</published><updated>2011-10-08T14:28:41.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><title type='text'>Learning a new software: Blender</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Blender_(software)"&gt;Blender is a 3D design software&lt;/a&gt;. It is a complete tool, allowing you to create entire worlds in 3D, modelling, meshing, applying texture, and animating the world.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Here is an example of what Blender can do. This movie was created completely in Blender.&lt;/div&gt;&lt;iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/eRsGyueVLvQ" width="560"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Isn't that impressive? What is more impressive is that &lt;a href="http://www.blender.org/download/get-blender/"&gt;Blender is available for free, you can download it&lt;/a&gt;&amp;nbsp;and install it right now&amp;nbsp;(Windows/Mac/Linux). And if you want to make your own movie based on the characters behind Sintel, you can &lt;a href="http://www.sintel.org/download"&gt;download all the art and characters at the Sintel website&lt;/a&gt;. This level of sharing is refreshing: it allows new graphics designers to learn a complex tool, and be able to look behind the scenes of a very complex project.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Blender has a beautiful UI, though it looks very complicated initially. When you load it up the first time, the number of buttons and controls is overwhelming. This is what the default Blender 2.5 UI looks like. There is a small cube placed at the center of the viewport, and many properties and control widgets are open. Once you learn a few Blender principles, you find that the UI is clearly arranged, and every control is in the perfect place. As with any good tool, the tool itself vanishes pretty quickly. Within hours of learning Blender, you focus on the 3D modeling activity rather than the Blender tool.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-BIYflltyf8Q/TpCNlvx7ORI/AAAAAAAAATY/NzPJMtQ-rII/s1600/blender.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-BIYflltyf8Q/TpCNlvx7ORI/AAAAAAAAATY/NzPJMtQ-rII/s640/blender.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Learning Blender&lt;/span&gt;&lt;br /&gt;I tried learning how to use Blender using a book. It is hard to explain the various UI elements using written words. It is even harder to describe the 3D world you are creating using just words. The best book I have found till now is called &lt;a href="http://www.amazon.com/Blender-Dummies-Jason-van-Gumster/dp/0470584467/ref=dp_ob_title_bk/189-1885358-1820430"&gt;Blender for Dummies&lt;/a&gt;. It requires no previous knowledge, and is an excellent resource to begin modelling simple meshes in Blender. It covers Blender 2.5.&lt;br /&gt;&lt;br /&gt;In case you want to start while your book is on its way, here are a list of online resources. I list Blender 2.5 resources only. The Blender interface changed a lot between 2.4 and 2.5. If you are starting out, it is best to start with 2.5 directly.&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://cgcookie.com/blender/get-started-with-blender/"&gt;Getting Started with Blender&lt;/a&gt;: This is a set of seven video tutorials. They are short and cover the very basics of using Blender. You can watch all seven within an hour and you will have a great idea of the Blender UI and basic features.&lt;/li&gt;&lt;li&gt;&lt;a href="http://gryllus.net/Blender/3D.html"&gt;Neal Hirsig's blender learning course&lt;/a&gt;: More than a collection of isolated tutorials, Neal has created a comprehensive learning course. You can download all videos to your machine and follow along with Neal as he patiently explains every feature of Blender. Neal's explanatory style is impeccable: it is a pleasure to follow along and learn. You can &lt;a href="http://sagefans.net/"&gt;downloads all these videos from sagefans.net&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://blenderlinks.com/"&gt;A collection of tutorials at Blenderlinks&lt;/a&gt;: Finally, when you have mastered the UI, you can focus on a specific topic by looking through the links at Blenderlinks. The videos are created by many contributors, so the videos differ in sound quality and expository style. But if you want to learn a single topic, the videos at cgcookie linked from Blenderlinks often provide the perfect recipe.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Blender is a powerful software, and it compares well against software which costs thousands of dollars. With a little bit of effort, you can learn how to create an entire 3D world inside your computer. It is scriptable in Python, which allows you to use Blender 3D models from an automated system. Give Blender a try, and see what you think!&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19163975-5756260876902997156?l=www.eggwall.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.eggwall.com/feeds/5756260876902997156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.eggwall.com/2011/10/learning-new-software-blender.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/5756260876902997156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19163975/posts/default/5756260876902997156'/><link rel='alternate' type='text/html' href='http://www.eggwall.com/2011/10/learning-new-software-blender.html' title='Learning a new software: Blender'/><author><name>Vikram Aggarwal</name><uri>http://www.blogger.com/profile/11194563536107656485</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://4.bp.blogspot.com/-kNtgjM1dEDU/TbRl5d_ksHI/AAAAAAAAAFU/5zjt8V3s5IY/s220/mugshot.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/eRsGyueVLvQ/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
