<?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-612275289405565943</id><updated>2012-01-20T05:56:08.531-08:00</updated><category term='RMagick'/><category term='Atom'/><category term='AOP'/><category term='Decorator'/><category term='Prime'/><category term='Robust'/><category term='Amazon'/><category term='PAM Error'/><category term='SimpleDB'/><category term='Clojure'/><category term='Logic'/><category term='Math'/><category term='youtube'/><category term='Connection Timeout'/><category term='IDE'/><category term='WebServcie'/><category term='Google Guice'/><category term='RSS'/><category term='Release It'/><category term='Feed Aggregator'/><category term='Stability'/><category term='AXIS'/><category term='Mac'/><category term='Puzzles'/><category term='Adwords'/><category term='Terminal'/><category term='Spring'/><category term='EC2'/><category term='SQS'/><category term='Guice'/><category term='safari'/><category term='IMageMagick'/><category term='JRugged'/><category term='simple-rss'/><category term='IDEA'/><category term='Pythagorean'/><category term='Scruffy'/><category term='quicksort'/><category term='Graphs'/><category term='Euler'/><category term='Intellij'/><category term='Tech'/><category term='How to'/><category term='Google wave'/><category term='projecteuler'/><category term='robots'/><category term='dual pivot quicksort'/><category term='algorithm'/><category term='PropertyPlaceholderConfigurer'/><category term='googlewave'/><category term='Java'/><category term='XDepend'/><category term='Expose'/><category term='AWS'/><category term='DI'/><category term='SOAP'/><category term='Netbeans'/><category term='appengine'/><category term='JMX'/><category term='Code Analyzer'/><category term='Ruby'/><category term='Properties'/><category term='Typica'/><category term='Eclipse'/><category term='Jetbrains'/><category term='SimpleRSS'/><category term='Recipe'/><category term='gmail'/><category term='google'/><title type='text'>Many Moods</title><subtitle type='html'>Like everybody, I have interests in so many activities. Although like Heisenberg's uncertainty principle I can't predict, what I am going to blog about, It should be most probably related with [Business news], [Tennis], [Java], [Ruby], [Technology].</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-7313157659120767997</id><published>2010-01-03T16:38:00.000-08:00</published><updated>2010-01-03T16:50:01.627-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='projecteuler'/><category scheme='http://www.blogger.com/atom/ns#' term='Clojure'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #16 in Clojure</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement&lt;/span&gt; : &lt;br /&gt;&lt;br /&gt;2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.&lt;br /&gt;&lt;br /&gt;What is the sum of the digits of the number 2^1000?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution :&lt;/span&gt;&lt;br /&gt;The easiest way to multiply a number by 2 is to perform a left bit shift. &lt;br /&gt;Get the number, convert it to string, put the indices in a map and apply a "+" function on it. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(println (apply + (map #(Integer/parseInt (str %1)) (str (bit-shift-left 2 999)))))&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-7313157659120767997?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/7313157659120767997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=7313157659120767997' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7313157659120767997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7313157659120767997'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2010/01/solving-project-euler-problem-16-in.html' title='Solving Project Euler Problem #16 in Clojure'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-6359700015689945162</id><published>2009-11-22T19:08:00.000-08:00</published><updated>2009-11-22T19:10:18.172-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='projecteuler'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #10 in Ruby</title><content type='html'>Problem Statement :-&lt;br /&gt;&lt;br /&gt;The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.&lt;br /&gt;&lt;br /&gt;Find the sum of all the primes below two million.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt; :-&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;require "mathn"&lt;br /&gt;require "benchmark"&lt;br /&gt;module Enumerable&lt;br /&gt;  def lazy_select&lt;br /&gt;    Enumerator.new do |yielder|&lt;br /&gt;      each do |obj|&lt;br /&gt;        yielder.yield(obj) if yield(obj)&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;p 5+((5..2000000).lazy_select {|v| (v%6 == 1 || v%6 ==5) &amp;&amp; v.prime?}.take(2000000)).inject(0) {|s,v| s+=v}&lt;br /&gt;#Benchmark.bm(12) { |b| b.report('Report:') {5+((5..2000000).lazy_select {|v| (v%6 == 1 || v%6 ==5) &amp;&amp; v.prime?}.take(2000000)).inject(0) {|s,v| s+=v}}  }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-6359700015689945162?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/6359700015689945162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=6359700015689945162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6359700015689945162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6359700015689945162'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/11/solving-project-euler-problem-10-in.html' title='Solving Project Euler Problem #10 in Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-5253332918301442622</id><published>2009-11-14T13:17:00.000-08:00</published><updated>2009-11-14T16:52:06.376-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='projecteuler'/><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><category scheme='http://www.blogger.com/atom/ns#' term='Pythagorean'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #9 No code Required</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement&lt;/span&gt; :-&lt;br /&gt;&lt;br /&gt;A Pythagorean triplet is a set of three natural numbers, a  b  c, for which,&lt;br /&gt;&lt;br /&gt;a^2 + b^2 = c^2&lt;br /&gt;For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.&lt;br /&gt;&lt;br /&gt;There exists exactly one Pythagorean triplet for which a + b + c = 1000.&lt;br /&gt;Find the product abc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt; :-&lt;br /&gt;Lets have a look on the first Pythagorean triplet 3, 4 and 5.&lt;br /&gt;&lt;br /&gt;All their multiples, would also be a Pythagorean triplet (e.g. 6, 8 and 10 or 9, 12 and 15 , and so on..)&lt;br /&gt;&lt;br /&gt;Also, any odd number can be represented as x^2 - y^2&lt;br /&gt;For e.g.&lt;br /&gt;3 = 2^2 - 1^2&lt;br /&gt;5 = 3^2 - 2^2&lt;br /&gt;7 = 4^2 - 3^2&lt;br /&gt;&lt;br /&gt;Since, (x^2 - y^2)^2 + (2xy)^2 = (x^2 + y^2)^2, we can always generate a triplet for any odd number x^2 - y^2.&lt;br /&gt;&lt;br /&gt;So, using this any triplet is of the form :&lt;br /&gt;k*(x^2-y^2), k*2xy and k*(x^2+y^2), where k is any number (1, 2, ...n).&lt;br /&gt;&lt;br /&gt;Well, now let us solve the current problem.&lt;br /&gt;&lt;br /&gt;a = k*(x^2-y^2)&lt;br /&gt;b = k*2xy&lt;br /&gt;c = k*(x^2+y^2)&lt;br /&gt;Since a+b+c = 1000, and they are the sides of a triangle, &lt;br /&gt;&lt;br /&gt;a,b,c &lt; 500&lt;br /&gt;=&gt; k*(x^2+y^2) &lt; 500&lt;br /&gt;=&gt; x,y &lt; 500^(1/2) &lt; 23&lt;br /&gt;&lt;br /&gt;Now, given a+b+c = 1000&lt;br /&gt;=&gt; k(x^2-y^2+2xy+x^2+y^2) = 1000&lt;br /&gt;=&gt; 2kx(x+y) = 1000&lt;br /&gt;=&gt; k*x(x+y) = 500  (Factors of 500 is , 2,2,5,5,5)&lt;br /&gt;=&gt; k*x(x+y) = 20*(20+5)   (This is the only value, which satisfies x,y &lt; 23)&lt;br /&gt;=&gt; for k =1 , x = 20, y = 5&lt;br /&gt;&lt;br /&gt;So, a = 20^2 - 5^2 = 375&lt;br /&gt;b = 2*20*5 = 200&lt;br /&gt;c = 20^2 + 5 ^2 = 425&lt;br /&gt;&lt;br /&gt;So, the product is : 375*200*425 = 31875000&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-5253332918301442622?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/5253332918301442622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=5253332918301442622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5253332918301442622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5253332918301442622'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/11/solving-project-euler-problem-9-no-code.html' title='Solving Project Euler Problem #9 No code Required'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-7978967994515750075</id><published>2009-11-14T12:48:00.000-08:00</published><updated>2009-11-14T13:16:54.952-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Logic'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #8 No code Required</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement&lt;/span&gt; :-&lt;br /&gt;Find the greatest product of five consecutive digits in the 1000-digit number.&lt;br /&gt;73167176531330624919225119674426574742355349194934&lt;br /&gt;96983520312774506326239578318016984801869478851843&lt;br /&gt;85861560789112949495459501737958331952853208805511&lt;br /&gt;12540698747158523863050715693290963295227443043557&lt;br /&gt;66896648950445244523161731856403098711121722383113&lt;br /&gt;62229893423380308135336276614282806444486645238749&lt;br /&gt;30358907296290491560440772390713810515859307960866&lt;br /&gt;70172427121883998797908792274921901699720888093776&lt;br /&gt;65727333001053367881220235421809751254540594752243&lt;br /&gt;52584907711670556013604839586446706324415722155397&lt;br /&gt;53697817977846174064955149290862569321978468622482&lt;br /&gt;83972241375657056057490261407972968652414535100474&lt;br /&gt;82166370484403199890008895243450658541227588666881&lt;br /&gt;16427171479924442928230863465674813919123162824586&lt;br /&gt;17866458359124566529476545682848912883142607690042&lt;br /&gt;24219022671055626321111109370544217506941658960408&lt;br /&gt;07198403850962455444362981230987879927244284909188&lt;br /&gt;84580156166097919133875499200524063689912560717606&lt;br /&gt;05886116467109405077541002256983155200055935729725&lt;br /&gt;71636269561882670428252483600823257530420752963450&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt; :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;One way&lt;/span&gt; to solve is :- &lt;br /&gt;starting from the beginning 5 numbers (strating from the 1st), multiplying them, storing it in as max, continuing the process for the next 5 numbers(starting from the 2nd), replacing the max value if the current product is more than the max stored earlier and so on till we reach the last 5 elements.&lt;br /&gt;We may minimize the number of iterations based on the fact that for every zero found we don't need to calculate the product.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Lucky Solution&lt;/span&gt; :- &lt;br /&gt;I started looking for 99999 using "ctrl+F" (as I knew if I find this any where), this would be the max no matter what the other numbers are.&lt;br /&gt;Since it was not there, I started looking for the combination of for 9's and one 8 (it was also not there) and so on, and eventually found 99879. Definitely, i was lucky to get the number in a minute or so (The data set for the problem was friendly, otherwise I would have probably coded it.&lt;br /&gt;&lt;br /&gt;You may use another fact to code your logic. If you know the sum of n numbers x1+x2+..xn, the maximum value of their product is when x1=x2=..=xn.&lt;br /&gt;&lt;br /&gt;For e.g. sum of 9,9,8,8,8 and 9,9,8,7,9 is equal,  the product of 9,9,8,8,8 would be &lt;br /&gt;larger (8+7+9 = 24 = 8+8+8).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-7978967994515750075?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/7978967994515750075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=7978967994515750075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7978967994515750075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7978967994515750075'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/11/solving-project-euler-problem-8-no-code.html' title='Solving Project Euler Problem #8 No code Required'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-7545805473994036375</id><published>2009-11-01T13:31:00.000-08:00</published><updated>2009-11-01T13:50:44.911-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Clojure'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #7 in Ruby, Clojure</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement &lt;/span&gt;:&lt;br /&gt;By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.&lt;br /&gt;&lt;br /&gt;What is the 10001st prime number?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This works on Ruby 1.9+. Here we have taken advantage of the method discusses &lt;a href="http://www.michaelharrison.ws/weblog/?p=163"&gt;here&lt;/a&gt; to create Lazy enumerator in Ruby. I started looking for the ruby equivalent as the clojure code becomes so easy to deal with using the lazy sequences.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require "mathn"&lt;br /&gt;infinity = 1.0/0.0&lt;br /&gt;module Enumerable&lt;br /&gt;  def lazy_select&lt;br /&gt;    Enumerator.new do |yielder|&lt;br /&gt;      each do |obj|&lt;br /&gt;        yielder.yield(obj) if yield(obj)&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;p (1..infinity).lazy_select { |v| v.prime? }.take(10001).last&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The clojure code is as follows :&lt;br /&gt;Here we have added one optimization (&lt;span style="font-weight:bold;"&gt;Any prime number after 2 and 3, when divided by 6, leaves the remainder 5 or 1&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(defn sqrt [x]&lt;br /&gt;  (int (Math/sqrt x)))&lt;br /&gt;&lt;br /&gt;(defn get-smallest-prime-factor [n]&lt;br /&gt;  (loop [n n d 2]&lt;br /&gt;    (cond (&gt; d (sqrt n)) n&lt;br /&gt;      (= n d) n&lt;br /&gt;      (= 0 (rem n d)) d&lt;br /&gt;      true (recur n (inc d)))))&lt;br /&gt;&lt;br /&gt;(def get-nth-prime&lt;br /&gt;  (lazy-cat '(2 3)&lt;br /&gt;    (filter&lt;br /&gt;      #(= % (get-smallest-prime-factor %))&lt;br /&gt;      (filter&lt;br /&gt;        #(or (= 1 (rem % 6)) (= 5 (rem % 6)))&lt;br /&gt;        (take-nth 2 (iterate inc 3))))))&lt;br /&gt;&lt;br /&gt;(println (nth get-nth-prime 10000))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is another cheat, if you have installed the &lt;a href="http://github.com/richhickey/clojure-contrib"&gt;clojure contrib library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(use 'clojure.contrib.lazy-seqs)&lt;br /&gt;(println (nth primes 10000))&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-7545805473994036375?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/7545805473994036375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=7545805473994036375' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7545805473994036375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7545805473994036375'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/11/solving-project-euler-problem-7-in-ruby.html' title='Solving Project Euler Problem #7 in Ruby, Clojure'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-1633646446168112407</id><published>2009-11-01T13:28:00.000-08:00</published><updated>2009-11-01T13:31:00.962-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Clojure'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #6</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement&lt;/span&gt; :&lt;br /&gt;The sum of the squares of the first ten natural numbers is,&lt;br /&gt;1**2 + 2**2 + ... + 10**2 = 385&lt;br /&gt;The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)**2 = 55*2 = 3025&lt;br /&gt;Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025  385 = 2640.&lt;br /&gt;Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution&lt;/span&gt; is -&gt; (n(n+1)/2)**2 - (n*(n+1)*(2n+1))/6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(defn euler6 [n] (- (* (/ (* n (+ n 1)) 2) (/ (* n (+ n 1)) 2)) (/ (* n (+ n 1) (+ 1 (* n 2))) 6)))&lt;br /&gt;(println (euler6 100))&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-1633646446168112407?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/1633646446168112407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=1633646446168112407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1633646446168112407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1633646446168112407'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/11/solving-project-euler-problem-6.html' title='Solving Project Euler Problem #6'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-3613019133851343322</id><published>2009-10-25T06:56:00.000-07:00</published><updated>2009-10-25T07:15:58.977-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='quicksort'/><category scheme='http://www.blogger.com/atom/ns#' term='dual pivot quicksort'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>Dual Pivot Quicksort in Java</title><content type='html'>This is from the paper published by Vladimir Yaroslavskiy (Read it for more details : &lt;a href="http://iaroslavski.narod.ru/quicksort/DualPivotQuicksort.pdf"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Sorting data is one of the most fundamental problems in Computer Science, especially if the arranging objects are primitive ones, such as integers, bytes, floats, etc. Since sorting methods play an important role in the operation of computers and other data processing systems, there has been an interest in seeking new algorithms better than the existing ones. We compare sorting methods by the number of the most "expensive" operations, which influence on effectiveness of the sorting techniques, — comparisons and swaps. Quicksort algorithm is an effective and wide-spread sorting procedure with C*n *ln(n) operations, where n is the size of the arranged array. The problem is to find an algorithm with the least coefficient C. There were many attempts to improve the classical variant of the Quicksort algorithm:&lt;br /&gt;&lt;br /&gt;1. Pick an element, called a pivot, from the array.&lt;br /&gt;2. Reorder the array so that all elements, which are less than the pivot, come before the pivot and all elements greater than the pivot come after it (equal values can go&lt;br /&gt;either way). After this partitioning, the pivot element is in its final position.&lt;br /&gt;3. Recursively sort the sub-array of lesser elements and the sub-array of greater elements.&lt;br /&gt;&lt;br /&gt;We can show that using two pivot elements (or partitioning to three parts) is&lt;br /&gt;more effective, especially on large arrays. We suggest the new Dual-Pivot Quicksort&lt;br /&gt;scheme, faster than the known implementations, which improves this situation. The&lt;br /&gt;implementation of the Dual-Pivot Quicksort algorithm has been investigated on different inputs and primitive data types. Its advantages in comparison with one of the most effective known implementations of the classical Quicksort algorithm [1], [2], and implementation of Quicksort in JDK™ 6.0 platform [3] have been shown.&lt;br /&gt;&lt;br /&gt;It is proved that for the Dual-Pivot Quicksort the average number of &lt;br /&gt;comparisons is 2*n*ln(n), the average number of swaps is 0.8*n*ln(n), &lt;br /&gt;whereas classical Quicksort algorithm has 2*n*ln(n) and 1*n*ln(n) &lt;br /&gt;respectively.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the source code for the implementation : &lt;a href="http://cr.openjdk.java.net/~alanb/6880672/webrev.03/src/share/classes/java/util/DualPivotQuicksort.java.html"&gt;Code&lt;/a&gt; by Vladimir Yaroslavskiy, Jon Bentley and Josh Bloch.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Comparision between Current JDK Quicksort vs Dual Pivot Quick sort : &lt;a href="http://spreadsheets.google.com/pub?key=tZD0Uq6ox1-BHhCoXDWIyUQ&amp;output=html"&gt;comparision&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-3613019133851343322?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/3613019133851343322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=3613019133851343322' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3613019133851343322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3613019133851343322'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/dual-pivot-quicksort-in-java.html' title='Dual Pivot Quicksort in Java'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-8722932170311846356</id><published>2009-10-23T12:42:00.000-07:00</published><updated>2009-10-23T12:47:04.008-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Euler Project Problem #4 using Ruby</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement &lt;/span&gt;: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91  99.&lt;br /&gt;&lt;br /&gt;Find the largest palindrome made from the product of two 3-digit numbers&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution :&lt;/span&gt; Please check the comments before the code which explains the logic/approach to the problem. We are trying to minimize the iterations to check against the generated palindromic number. Also this divisibility by holds true only for all the even numbered palindroms.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;#A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91  99.&lt;br /&gt;#&lt;br /&gt;#Find the largest palindrome made from the product of two 3-digit numbers&lt;br /&gt;#&lt;br /&gt;# Observations :&lt;br /&gt;# Number = xyzzyx = 100001*x + 100010*y + 1100*z  (which is divisible by 11)&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def largest_palindrome_for_even_digits(n)&lt;br /&gt;  max_val = 0&lt;br /&gt;  multiplier_x = get_multiplier_x(n)&lt;br /&gt;  n.downto(100) { |y|&lt;br /&gt;    multiplier_x.each { |x|&lt;br /&gt;      product = x * y&lt;br /&gt;      if product.to_s == product.to_s.reverse&lt;br /&gt;        max_val = [max_val, product].max&lt;br /&gt;      end&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt; max_val&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def get_multiplier_x (n)&lt;br /&gt;  multipliers = []&lt;br /&gt;  current_val = n/11*11&lt;br /&gt;  while current_val &gt; 100&lt;br /&gt;    multipliers &lt;&lt; current_val&lt;br /&gt;    current_val-=11&lt;br /&gt;  end&lt;br /&gt;  multipliers&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts largest_palindrome_for_even_digits(999)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-8722932170311846356?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/8722932170311846356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=8722932170311846356' title='30 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/8722932170311846356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/8722932170311846356'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/solving-euler-project-problem-4-using.html' title='Solving Euler Project Problem #4 using Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>30</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-5142154236914076016</id><published>2009-10-23T12:36:00.000-07:00</published><updated>2009-10-23T12:42:37.727-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Prime'/><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Euler Project Problem #3 using Ruby</title><content type='html'>&lt;div&gt;&lt;b&gt;Problem Statement :&lt;/b&gt; The prime factors of 13195 are 5, 7, 13 and 29.&lt;/div&gt;&lt;div&gt;What is the largest prime factor of the number 600851475143&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Solution : &lt;/b&gt;Please check the code comments which explains the logic.&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;#The prime factors of 13195 are 5, 7, 13 and 29.&lt;br /&gt;#&lt;br /&gt;#What is the largest prime factor of the number 600851475143&lt;br /&gt;#&lt;br /&gt;#Start dividing the number by the first prime (i.e. 2). Keep dividing by the current factor&lt;br /&gt;#till the remainder is zero. So, the number left is n/(current_prime_factor)**m, where m is the no. of times&lt;br /&gt;#current factor was able to divide the number without remainder. Repeat this process with the next&lt;br /&gt;#prime factor and the number left as a result of previous division and so on, unless the result of&lt;br /&gt;#division becomes 1. As the prime factor we are using to divide keeps on increasing, and the loop ends&lt;br /&gt;#when the number is completely divided (or say n become 1), return the current prime factor. This is our&lt;br /&gt;#largest prime factor&lt;br /&gt;&lt;br /&gt;require 'mathn'&lt;br /&gt;&lt;br /&gt;def find_largest_prime(n)&lt;br /&gt; primes = Prime.new&lt;br /&gt; while n &gt; 1&lt;br /&gt;   current_prime_factor = primes.next&lt;br /&gt;   while n % current_prime_factor == 0&lt;br /&gt;     n /= current_prime_factor&lt;br /&gt;   end&lt;br /&gt; end&lt;br /&gt; current_prime_factor&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts find_largest_prime(600851475143)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-5142154236914076016?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/5142154236914076016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=5142154236914076016' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5142154236914076016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5142154236914076016'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/solving-euler-project-problem-3-using.html' title='Solving Euler Project Problem #3 using Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-5129137787299485605</id><published>2009-10-21T19:49:00.000-07:00</published><updated>2009-10-21T20:52:37.225-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Guice'/><category scheme='http://www.blogger.com/atom/ns#' term='DI'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Guice'/><title type='text'>Google Guice : Part 2 : Inject Config Value</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Was Spring 3.0 just released ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Right, Here is a link mentioning the same &lt;a href="http://www.reuters.com/article/pressRelease/idUS92638+19-Oct-2009+BW20091019"&gt;Spring3.0 release&lt;/a&gt;. I am really excited to check it out, specially the REST part of it. But yeah, let us save it for other posts.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;I directly came here, where is the part One ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you haven't gone through the &lt;a href="http://anshu-manymoods.blogspot.com/2009/10/google-guice-part-1.html"&gt;part 1&lt;/a&gt; of this article, and are totally new to Google Guice, please check it out and set up your environment as described there.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What is the goal for this article ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since in the previous article we were able to set up a working project/program. Let us extend it further. Almost all of the applications needs to have some configuration properties, today we will learn to inject the property value from a config file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Ummm.. before you dive into it, I just forgot what was the spring bean I used to configure it in a Spring App?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I guess you are probably talking about PropertyPlaceholderConfigurer.java. By the way, the other day I &lt;a href="http://anshu-manymoods.blogspot.com/2009/10/recipe-how-to-get-property-value-in.html"&gt;blogged&lt;/a&gt; about extending it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Well...Lets code it :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public interface IPrinter {&lt;br /&gt;   public void print();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyDummyPrinter implements IPrinter {&lt;br /&gt;   public void print() {&lt;br /&gt;       System.out.println("Article Printed !");&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public interface IMailSender {&lt;br /&gt;   public void sendMail();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyDummyMailSender implements IMailSender {&lt;br /&gt;   public void sendMail() {&lt;br /&gt;       System.out.println("Mail Sent !");&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public interface ArticleService {&lt;br /&gt;   public void publishArticle();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;import com.google.inject.Inject;&lt;br /&gt;import com.google.inject.name.Named;&lt;br /&gt;public class Article implements ArticleService {&lt;br /&gt;   private IMailSender mailSender;&lt;br /&gt;   private IPrinter printer;&lt;br /&gt;&lt;br /&gt;   private String advertizedAt;&lt;br /&gt;   private String articleHeading;&lt;br /&gt;&lt;br /&gt;   @Inject&lt;br /&gt;   Article(&lt;br /&gt;           @Named("advertised.at") String advertizedAt,&lt;br /&gt;           @Named("article.name") String articleHeading,&lt;br /&gt;           IMailSender mailSender, IPrinter printer) {&lt;br /&gt;       this.mailSender = mailSender;&lt;br /&gt;       this.printer = printer;&lt;br /&gt;       this.advertizedAt = advertizedAt;&lt;br /&gt;       this.articleHeading = articleHeading;&lt;br /&gt;       System.out.println("This article has been advertized at :" + advertizedAt +&lt;br /&gt;               " with the heading :" + articleHeading);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public void publishArticle() {&lt;br /&gt;       mailSender.sendMail();&lt;br /&gt;       printer.print();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Check out the Article.java code. We want to inject two properties namely "advertizedAt" and "articleHeading" throgh a config file. As you can see Guice comes with a built in annotation - &lt;span style="font-weight:bold;"&gt;named&lt;/span&gt;. So, as it appears, Guice should inject the value for these keys as defined in the config file.&lt;br /&gt;&lt;br /&gt;Well, let us define our property file :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;advertised.at=dZone&lt;br /&gt;article.name=googleGuicePartTwo&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;But How will Guice know the property value unless it loads it. Does it has something like PropertyPlaceholderConfigurer ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You are right, we are going to write some code to load the property file. As of now, I am not aware about any helper class who does it for us. If you know one please comment, or else I would update it once I know.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import com.google.inject.AbstractModule;&lt;br /&gt;import com.google.inject.name.Names;&lt;br /&gt;import java.util.Properties;&lt;br /&gt;import java.net.URL;&lt;br /&gt;&lt;br /&gt;public class MyArticleModule extends AbstractModule {&lt;br /&gt;   @Override&lt;br /&gt;   protected void configure() {&lt;br /&gt;       try {&lt;br /&gt;           Properties props = loadProperties();&lt;br /&gt;           Names.bindProperties(binder(),props);&lt;br /&gt;       } catch (Exception e) {&lt;br /&gt;           e.printStackTrace();&lt;br /&gt;       }&lt;br /&gt;       bind(IPrinter.class).to(MyDummyPrinter.class);&lt;br /&gt;       bind(IMailSender.class).to(MyDummyMailSender.class);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private static Properties loadProperties() throws Exception {&lt;br /&gt; Properties properties = new Properties();&lt;br /&gt; ClassLoader loader = MyArticleModule.class.getClassLoader();&lt;br /&gt; URL url = loader.getResource("config.properties");&lt;br /&gt; properties.load(url.openStream());&lt;br /&gt; return properties;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, before injection we are loading the config.properties. The code is straight forward. The piece important here to note is the use of &lt;span style="font-weight:bold;"&gt;com.google.inject.name.bindProperties&lt;/span&gt; which creates a constant binding to @Named(key) for each property.&lt;br /&gt;&lt;br /&gt;Well , Let us see it in action :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import com.google.inject.Injector;&lt;br /&gt;import com.google.inject.Guice;&lt;br /&gt;&lt;br /&gt;public class MyBootStrapInvoker {&lt;br /&gt;   public static void main(String[] args) {&lt;br /&gt;       Injector injector = Guice.createInjector(new MyArticleModule());&lt;br /&gt;       Article article = injector.getInstance(Article.class);&lt;br /&gt;       article.publishArticle();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sample Run :&lt;/span&gt;-&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;This article has been advertized at :dZone with the heading :googleGuicePartTwo&lt;br /&gt;Mail Sent !&lt;br /&gt;Article Printed !&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Is this the best approach to do this way &lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;I am sure there must be a better way, as Guice always discourages bindings that uses a string, because the compiler can not check the string. So that means, if there is some spelling mistakes, we would see run time error (like we see in spring, if you make spelling mistakes). Let me know, if you know a better way.&lt;br /&gt;Would appreciate your comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-5129137787299485605?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/5129137787299485605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=5129137787299485605' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5129137787299485605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5129137787299485605'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/google-guice-part-2-inject-config-value.html' title='Google Guice : Part 2 : Inject Config Value'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-2692771185361663759</id><published>2009-10-21T13:53:00.000-07:00</published><updated>2009-10-21T16:55:51.406-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Euler Project Problem #2 using Ruby</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Statement &lt;/span&gt;: Each new term in the Fibonacci sequence is generated by adding the previous two terms.&lt;br /&gt;By starting with 1 and 2, the first 10 terms will be:&lt;br /&gt;1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...&lt;br /&gt;&lt;br /&gt;Find the sum of all the even-valued terms in the sequence which do not exceed four million.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution :&lt;/span&gt; For the explanation please see the comments. Later I realized that I could have probably used &lt;a href="http://www.geocities.com/hjsmithh/Fibonacc/FibWhat.html"&gt;Binet's formula&lt;/a&gt;, however this solution also kind of looks good.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#Each new term in the Fibonacci sequence is generated by adding the previous two terms.&lt;br /&gt;#By starting with 1 and 2, the first 10 terms will be:&lt;br /&gt;#&lt;br /&gt;#1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...&lt;br /&gt;#&lt;br /&gt;#Find the sum of all the even-valued terms in the sequence which do not exceed four million.&lt;br /&gt;#&lt;br /&gt;#Obersevations : starting with 2 every 3rd number is even (it must be, as to make an even number&lt;br /&gt;#one needs to add two odds (or two even unlikely here))&lt;br /&gt;#So, lets try to decompose the fibonacci series in terms of n-3,n-6,n-9, etc...as it make us do&lt;br /&gt;#less iteration while adding&lt;br /&gt;#&lt;br /&gt;# F(n) = F(n-1)+F(n-2) = F(n-2)+F(n-3)+F(n-2) = F(n-3)+2(F(n-2)) = F(n-3) + 2(F(n-3)+ F(n-4))&lt;br /&gt;#      = 3F(n-3) + 2F(n-4)&lt;br /&gt;#      = 3F(n-3) + F(n-4)+F(n-5)+F(n-6) = 4F(n-3) + F(n-6)&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def find_sum_of_even_terms(limit)&lt;br /&gt;  if(limit&amp;lt;2)&lt;br /&gt;    return 0&lt;br /&gt;  end&lt;br /&gt;  if(limit&amp;lt;8) &lt;br /&gt;    return 2&lt;br /&gt;  end&lt;br /&gt;  second_last_even_number = 2&lt;br /&gt;  last_even_number = 8&lt;br /&gt;  current_number = 4*last_even_number+second_last_even_number&lt;br /&gt;  sum=second_last_even_number+last_even_number&lt;br /&gt;&lt;br /&gt;  while current_number&lt;=limit&lt;br /&gt;    sum+=current_number&lt;br /&gt;    second_last_even_number = last_even_number&lt;br /&gt;    last_even_number = current_number&lt;br /&gt;    current_number = 4*last_even_number+second_last_even_number&lt;br /&gt;  end&lt;br /&gt;  sum&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts find_sum_of_even_terms(4000000)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-2692771185361663759?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/2692771185361663759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=2692771185361663759' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2692771185361663759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2692771185361663759'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/solving-euler-project-problem-2-using.html' title='Solving Euler Project Problem #2 using Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-6688480037487576896</id><published>2009-10-21T13:49:00.000-07:00</published><updated>2009-10-21T13:57:50.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Euler Project Problem #1 using Ruby</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem statement&lt;/span&gt; : If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution &lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.&lt;br /&gt;#The sum of these multiples is 23.&lt;br /&gt;#&lt;br /&gt;#Find the sum of all the multiples of 3 or 5 below 1000.&lt;br /&gt;#&lt;br /&gt;#3(1+2+3+....+333)+5(1+2+3+.....+199)-15(1+2+3+...+66)&lt;br /&gt;#puts 3*333*334/2+5*199*200/2-15*66*67/2&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;def sum_of_n_consecutive_numbers (n)&lt;br /&gt;  n*(n+1)/2&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def sum_of_multiples_of_m(max,m)&lt;br /&gt;  m*sum_of_n_consecutive_numbers(max/m)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts sum_of_multiples_of_m(999,3)+sum_of_multiples_of_m(999,5)-sum_of_multiples_of_m(999,15)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-6688480037487576896?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/6688480037487576896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=6688480037487576896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6688480037487576896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6688480037487576896'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/solving-euler-project-problem-1.html' title='Solving Euler Project Problem #1 using Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-4860750321625667466</id><published>2009-10-19T21:15:00.000-07:00</published><updated>2009-10-19T21:26:53.500-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Puzzles'/><title type='text'>Solving Project Euler Problem #5 in Ruby</title><content type='html'>The problem statement :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution/s &lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;One of the solution is straight forward as Ruby exposes such a nice library (Actually it feels like a cheat :))&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; require 'rational'&lt;br /&gt; puts (1..20).inject(1) { |result, n| result.lcm n }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The other solution involves a little bit of math/algorithm. Hopefully you will enjoy it.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#&lt;br /&gt;# Directly using the ruby library&lt;br /&gt;# require 'rational'&lt;br /&gt;# puts (1..20).inject(1) { |result, n| result.lcm n }&lt;br /&gt;#&lt;br /&gt;# The other solution (Code below) Steps :&lt;br /&gt;# 1. Fetch all the primes less than "n" in an array (it would be automatically sorted, which will save our efforts later)&lt;br /&gt;# 2. For the smallest member "k" of the prime list, find the maxm power "m" such that k**m &lt;=n (For, e.g. 2**4&lt;20)&lt;br /&gt;# 3. Replace the smallest member from the array with k**m (For e.g. replace 2 with 16, because anything divisible by k**m&lt;br /&gt;#    would be itself be divisible by k**0..m-1)&lt;br /&gt;# 4. Repeat the steps 2-3, for the next member of the array (starting with the power #m-1). when the power becomes 1, no need&lt;br /&gt;#    to iterate.&lt;br /&gt;# 5. Multiply the members of the final array.&lt;br /&gt;#&lt;br /&gt;# Sample runs :&lt;br /&gt;# For n = 10&lt;br /&gt;#&lt;br /&gt;# All the primes :&lt;br /&gt;# [2, 3, 5, 7]&lt;br /&gt;# All the multipliers :&lt;br /&gt;# [8, 9, 5, 7]&lt;br /&gt;# 2520&lt;br /&gt;#&lt;br /&gt;# For n = 20&lt;br /&gt;#&lt;br /&gt;# All the primes :&lt;br /&gt;# [2, 3, 5, 7, 11, 13, 17, 19]&lt;br /&gt;# All the multipliers :&lt;br /&gt;# [16, 9, 5, 7, 11, 13, 17, 19]&lt;br /&gt;# 232792560&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;require 'mathn'&lt;br /&gt;&lt;br /&gt;def collect_primes(n)&lt;br /&gt;  primes_list = []&lt;br /&gt;  primes = Prime.new&lt;br /&gt;  primes.each { |x| break if x &amp;gt;= n; primes_list&amp;lt;&amp;lt;x;  }&lt;br /&gt;  puts "All the primes :"&lt;br /&gt;  p primes_list&lt;br /&gt;  primes_list&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def root(arg, base)&lt;br /&gt;  arg**(1/base)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def get_all_the_multipliers(n)&lt;br /&gt;  primes_list = collect_primes(n)&lt;br /&gt;  max_base = get_max_base_for_two(n)&lt;br /&gt;&lt;br /&gt;  primes_list.each_with_index do |item, index|&lt;br /&gt;    primes_list[index]=item**max_base&lt;br /&gt;    max_base = get_max_base_for_current_number(n,max_base,primes_list[index+1])&lt;br /&gt;    if max_base &amp;lt;=1 then break&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;  puts "All the multipliers :"&lt;br /&gt;  p primes_list&lt;br /&gt;  primes_list&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def get_mulitiplied_value(n)&lt;br /&gt;  list_of_multipliers = get_all_the_multipliers(n)&lt;br /&gt;  list_of_multipliers.inject(1){|total, i| total*i}&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def get_max_base_for_two(n)&lt;br /&gt;  i=2&lt;br /&gt;  while root(n,i) &amp;gt;= 2&lt;br /&gt;    i = i+1;&lt;br /&gt;  end&lt;br /&gt;  return i-1&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def get_max_base_for_current_number(n,max_base, current_number)&lt;br /&gt;  base = max_base - 1&lt;br /&gt;  while current_number**base &gt; n&lt;br /&gt;    base = base - 1&lt;br /&gt;  end&lt;br /&gt;  return base&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;puts get_mulitiplied_value(20)&lt;br /&gt;#puts get_mulitiplied_value(10)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Comments are welcome .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-4860750321625667466?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/4860750321625667466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=4860750321625667466' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/4860750321625667466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/4860750321625667466'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/solving-project-euler-problem-5-in-ruby.html' title='Solving Project Euler Problem #5 in Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-547186121291675691</id><published>2009-10-18T20:18:00.000-07:00</published><updated>2009-10-18T21:16:52.871-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adwords'/><category scheme='http://www.blogger.com/atom/ns#' term='Guice'/><category scheme='http://www.blogger.com/atom/ns#' term='DI'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Google wave'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Guice'/><category scheme='http://www.blogger.com/atom/ns#' term='youtube'/><title type='text'>Google Guice : Part 1</title><content type='html'>Over the weekend I was going through this video presented at Google IO 2009.&lt;br /&gt;Please watch it if DI (a.k.a Dependency Injection) interests you.&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/hBVJbzAagfs&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/hBVJbzAagfs&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Where is Guice being used in production&lt;/span&gt; :-&lt;br /&gt;The video mentions Google uses it for &lt;span style="font-weight:bold;"&gt;Google Wave&lt;/span&gt;, &lt;span style="font-weight:bold;"&gt;Google Adwords&lt;/span&gt;, &lt;span style="font-weight:bold;"&gt;GMail&lt;/span&gt;, &lt;span style="font-weight:bold;"&gt;Orkut&lt;/span&gt;, &lt;span style="font-weight:bold;"&gt;Google Docs&lt;/span&gt;, &lt;span style="font-weight:bold;"&gt;Youtube&lt;/span&gt;...pretty much every new project .&lt;br /&gt;&lt;br /&gt;This is how I talked with myself, in case it is gonna help you let us learn together.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Should I care to learn Guice, I already know/use Spring&lt;/span&gt; :- &lt;br /&gt;Spring framework is much more than a DI framework.It made DI popular (although there were older DI framework available before it). Spring competes with JEE stack.&lt;br /&gt;So, yeah we can say Spring is a super set of Google Guice. Guice wholly embraces annotations and generics, thereby enabling you to wire together and test objects with measurably less effort. Guice proves you can use annotations instead of error-prone, refactoring-adverse string identifiers.And of course it is much light weight.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Spring uses annotations too&lt;/span&gt; :- That is true. The newer versions (probably 2+) focuses more to use annotations. We may discuss the benefits of XML declarations vs annotations in a separate post, as it is a topic in itself . &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;There are so many annotations for different DI libraries, shouldn't it be standardized &lt;/span&gt;:- You are in luck. Check it out JSR330-  http://code.google.com/p/atinject/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Well...so show me some code &lt;/span&gt;:-&lt;br /&gt;&lt;br /&gt;I won't boar you with the definition(s) of DI, IOC (search it on google rather in case you are new to this). Goal of this post is to make you run a simple Guice Program.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://google-guice.googlecode.com/files/guice-2.0.zip"&gt;Download &lt;/a&gt;the  guice library, and add it in your classpath.&lt;br /&gt;&lt;br /&gt;The interfaces and it's implementations are self explanatory :-&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;public interface IPrinter {&lt;br /&gt;    public void print();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyDummyPrinter implements IPrinter {&lt;br /&gt;    public void print() {&lt;br /&gt;        System.out.println("Article Printed !");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public interface IMailSender {&lt;br /&gt;    public void sendMail();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyDummyMailSender implements IMailSender {&lt;br /&gt;    public void sendMail() {&lt;br /&gt;        System.out.println("Mail Sent !");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public interface ArticleService {&lt;br /&gt;    public void publishArticle();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;import com.google.inject.Inject;&lt;br /&gt;public class Article implements ArticleService{&lt;br /&gt;    private IMailSender mailSender;&lt;br /&gt;    private IPrinter printer;&lt;br /&gt;&lt;br /&gt;    @Inject&lt;br /&gt;    Article (IMailSender mailSender, IPrinter printer) {&lt;br /&gt;        this.mailSender = mailSender;&lt;br /&gt;        this.printer = printer;&lt;br /&gt;    }&lt;br /&gt;    public void publishArticle() {&lt;br /&gt;        mailSender.sendMail();&lt;br /&gt;        printer.print();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As shown in the above program, we want the mailSender and printer to be injected.&lt;br /&gt;So, note the @inject annotation over the Article Constructor.&lt;br /&gt;&lt;br /&gt;Lets inject the dependencies. Well, if you have worked with Spring's XML declarations for defining and injecting the dependencies, then think the next java code to be it's counter part in Guice.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import com.google.inject.AbstractModule;&lt;br /&gt;public class MyArticleModule extends AbstractModule {&lt;br /&gt;    protected void configure() {&lt;br /&gt;        bind(IPrinter.class).to(MyDummyPrinter.class);&lt;br /&gt;        bind(IMailSender.class).to(MyDummyMailSender.class);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;&lt;br /&gt;What I like here is the readability (It is like I am coding in Ruby :)). The code clearly shows that IPrinter.class is bound to MyDummyPrinter.class. Similarly, with the other line.&lt;br /&gt;&lt;br /&gt;Cool..Now let us launch/bootstrap the Guice. For the Spring folks, think it similar to the code you write to load spring config beans (remember : ApplicationContext ctx = new ClasspathApplicationContext("example.xml")).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import com.google.inject.Injector;&lt;br /&gt;import com.google.inject.Guice;&lt;br /&gt;&lt;br /&gt;public class MyBootStrapInvoker {&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        Injector injector = Guice.createInjector(new MyArticleModule());&lt;br /&gt;        Article article = injector.getInstance(Article.class);&lt;br /&gt;        article.publishArticle();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;&lt;br /&gt;And that's it. You are running Guice !!!&lt;br /&gt;&lt;br /&gt;Hopefully, we will dive more in depth in the second post on the same topic.&lt;br /&gt;Please let me know your comments, so the next time I could offer more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-547186121291675691?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/547186121291675691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=547186121291675691' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/547186121291675691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/547186121291675691'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/google-guice-part-1.html' title='Google Guice : Part 1'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-6110841227019140046</id><published>2009-10-18T16:20:00.000-07:00</published><updated>2009-10-18T19:59:29.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stability'/><category scheme='http://www.blogger.com/atom/ns#' term='Decorator'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Release It'/><category scheme='http://www.blogger.com/atom/ns#' term='Robust'/><category scheme='http://www.blogger.com/atom/ns#' term='JRugged'/><category scheme='http://www.blogger.com/atom/ns#' term='JMX'/><category scheme='http://www.blogger.com/atom/ns#' term='AOP'/><title type='text'>Introducing JRugged library : Make your Java Programs Rock Solid</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xeiel9jmdwI/Stujz1SCSJI/AAAAAAAAAb0/i4w8XXggnd0/s1600-h/Release+It.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 240px; height: 240px;" src="http://3.bp.blogspot.com/_xeiel9jmdwI/Stujz1SCSJI/AAAAAAAAAb0/i4w8XXggnd0/s320/Release+It.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5394085089577683090" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; This &lt;a href="http://www.amazon.com/Release-Production-Ready-Software-Pragmatic-Programmers/dp/0978739213/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1255908437&amp;sr=8-1"&gt;book&lt;/a&gt;, is definitely among one of the best books, I've read this year. It lays out some critical aspects to creating and rolling out stable software systems. Each of the case studies discussed is based on real events. &lt;br /&gt;&lt;br /&gt;While reading the book you will feel, how nice it would be if there is a library you could use to gain the advantages  discussed to make your programs/software/systems rock solid.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://code.google.com/p/jrugged"&gt;JRugged&lt;/a&gt;  is such a library written to be used in Java. To summarize, what it offers , here it is (directly from the project home page) :- &lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;The jrugged library provides straightforward add-ons to existing code to make it more robust and easier to manage.&lt;br /&gt;&lt;br /&gt;Although there are several lower-level building block classes here available for custom solutions, most clients will find they can use just the following classes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;CircuitBreaker&lt;/span&gt; provides a way to wrap a service in a way that provides a bulkhead against system failure; when a remote service fails, further calls to the service are prevented for a period of time to allow the remote service to recover.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Initializer&lt;/span&gt; provides a way to decouple service construction from initialization/startup and allows the latter to occur in the background, even retrying if initial attempts to initialize fail.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;PerformanceMonitor&lt;/span&gt; provides a way to wrap a service and collect a series of useful statistics about its latency and throughput, even calculating moving averages across different time windows.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Monitorable&lt;/span&gt;, &lt;span style="font-weight:bold;"&gt;Status&lt;/span&gt;, and &lt;span style="font-weight:bold;"&gt;RolledUpStatus&lt;/span&gt; are related classes that provide a simple RED/YELLOW/GREEN encoding for service health, possibly useful for constructing operational dashboards.&lt;br /&gt;&lt;br /&gt;Generally speaking, most of these classes implement a ServiceWrapper interface to allow them to be applied around existing services using the Decorator design pattern. Those classes providing operational information, such as PerformanceMonitor and Monitorable can be wrapped in classes that expose their data to JMX controls or on web-accessible health status pages as desired.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here I would show you, how easy it to use this in your existing code base. It  provides it  by the classic use of the Decorator Pattern.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;import org.fishwife.jrugged.CircuitBreaker;&lt;br /&gt;import org.fishwife.jrugged.PerformanceMonitor;&lt;br /&gt;import org.fishwife.jrugged.Status;&lt;br /&gt;import org.springframework.jmx.export.annotation.ManagedAttribute;&lt;br /&gt;&lt;br /&gt;public abstract class AbstractMonitor implements IMonitorable {&lt;br /&gt;&lt;br /&gt;    /** Circuit breaker to detect server oveloading */&lt;br /&gt;    protected final CircuitBreaker cBreaker = new CircuitBreaker();&lt;br /&gt;&lt;br /&gt;    /** Performance stat monitor */&lt;br /&gt;    protected final PerformanceMonitor perfMonitor = new PerformanceMonitor(5);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute(description = "My System status")&lt;br /&gt;    public String getHealthCheck() {&lt;br /&gt;        return cBreaker.getStatus().getSignal();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getAverageFailureLatencyLastDay() {&lt;br /&gt;        return perfMonitor.getAverageFailureLatencyLastDay();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getAverageFailureLatencyLastHour() {&lt;br /&gt;        return perfMonitor.getAverageFailureLatencyLastHour();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getAverageFailureLatencyLastMinute() {&lt;br /&gt;        return perfMonitor.getAverageFailureLatencyLastMinute();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getAverageSuccessLatencyLastDay() {&lt;br /&gt;        return perfMonitor.getAverageSuccessLatencyLastDay();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getAverageSuccessLatencyLastHour() {&lt;br /&gt;        return perfMonitor.getAverageSuccessLatencyLastHour();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getAverageSuccessLatencyLastMinute() {&lt;br /&gt;        return perfMonitor.getAverageSuccessLatencyLastMinute();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public long getFailureCount() {&lt;br /&gt;        return perfMonitor.getFailureCount();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getFailureRateLastDay() {&lt;br /&gt;        return perfMonitor.getFailureRateLastDay();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getFailureRateLastHour() {&lt;br /&gt;        return perfMonitor.getFailureRateLastHour();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getFailureRateLastMinute() {&lt;br /&gt;        return perfMonitor.getFailureRateLastMinute();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getFailureRateLifetime() {&lt;br /&gt;        return perfMonitor.getFailureRateLifetime();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public long getRequestCount() {&lt;br /&gt;        return perfMonitor.getRequestCount();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getRequestRateLastDay() {&lt;br /&gt;        return perfMonitor.getRequestRateLastDay();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getRequestRateLastHour() {&lt;br /&gt;        return perfMonitor.getRequestRateLastHour();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getRequestRateLastMinute() {&lt;br /&gt;        return perfMonitor.getRequestRateLastMinute();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getRequestRateLifetime() {&lt;br /&gt;        return perfMonitor.getRequestRateLifetime();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public long getSuccessCount() {&lt;br /&gt;        return perfMonitor.getSuccessCount();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getSuccessRateLastDay() {&lt;br /&gt;        return perfMonitor.getSuccessRateLastDay();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getSuccessRateLastHour() {&lt;br /&gt;        return perfMonitor.getSuccessRateLastHour();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getSuccessRateLastMinute() {&lt;br /&gt;        return perfMonitor.getSuccessRateLastMinute();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @ManagedAttribute&lt;br /&gt;    public double getSuccessRateLifetime() {&lt;br /&gt;        return perfMonitor.getSuccessRateLifetime();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public CircuitBreaker getCBreaker() {&lt;br /&gt;        return cBreaker;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public PerformanceMonitor getPerfMonitor() {&lt;br /&gt;        return perfMonitor;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Status getStatus (){&lt;br /&gt;        return cBreaker.getStatus();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, your class just needs to extend this abstract class inherits all those JMX statistics as well as the handles to the Circuitbreaker and PerformanceMonitor Object.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@ManagedResource(objectName = "com.example:type=manager,name=mysystem",&lt;br /&gt;        description = "shows the running status of mysystem")&lt;br /&gt;public class MySystem extends AbstractMonitor {&lt;br /&gt;&lt;br /&gt;.........&lt;br /&gt;.........&lt;br /&gt;       //This is the method I want to decorate&lt;br /&gt; public BackEndData processArgument(final String myArg) {&lt;br /&gt;  final BackEndService theBackend = backend;&lt;br /&gt;  try {&lt;br /&gt;   return cBreaker.invoke(new Callable&lt; BackEndData &gt;() {&lt;br /&gt;     public BackEndData call() throws Exception {&lt;br /&gt;      return perfMonitor.invoke(new Callable&lt; BackEndData &gt;() {&lt;br /&gt;        //This is the actual method which you were using earlier without decoration&lt;br /&gt;                                                                 public BackEndData call() throws Exception {&lt;br /&gt;         return theBackend.processArgument(myArg);&lt;br /&gt;        }&lt;br /&gt;       });&lt;br /&gt;     }&lt;br /&gt;    });&lt;br /&gt;  } catch (RuntimeException re) {&lt;br /&gt;   throw re;&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   throw new RuntimeException("wrapped", e);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You probably would change this code a little bit depending on the definitions of your critical components, and the health status (But you get the idea).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now just fire up the JConsole and you can see all the statistics for your classes. And it handles failures as well, showing you the status of the system as Green/Red/Yellow (depending on your definition of the critical system/components).&lt;br /&gt;&lt;br /&gt;Please check it out for details, as the &lt;a href="http://code.google.com/p/jrugged/source/browse/"&gt;code base&lt;/a&gt; is pretty terse.&lt;br /&gt;&lt;br /&gt;You may wish to extend it to be used as an Aspect (AOP), so that your classes could avail the benefits without changing your java code. The project mentions, it is looking to offer AOP wrapper to make it easier to do drop-in decoration of existing code.&lt;br /&gt;So wait if you could or if you implement it yourself, please post it so others could use it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-6110841227019140046?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/6110841227019140046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=6110841227019140046' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6110841227019140046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6110841227019140046'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/introducing-jrugged-library-make-your.html' title='Introducing JRugged library : Make your Java Programs Rock Solid'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_xeiel9jmdwI/Stujz1SCSJI/AAAAAAAAAb0/i4w8XXggnd0/s72-c/Release+It.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-3296459509772447067</id><published>2009-10-15T18:37:00.000-07:00</published><updated>2009-10-16T15:44:25.189-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Jetbrains'/><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Intellij'/><category scheme='http://www.blogger.com/atom/ns#' term='IDEA'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>Intellij Idea IDE OpenSourced - The current state of the Java IDE's</title><content type='html'>It is a great news that Jetbrains has opensourced the &lt;a href="http://www.jetbrains.com/idea/nextversion/free_java_ide.html?promo"&gt;Intellij Idea&lt;/a&gt;, a well known Java Editor. I have used it along with both Eclipse and Netbeans in the past.&lt;br /&gt;&lt;br /&gt;Last year, I decided to buy a professional license for the intellij and never looked back. So, what would I say about eclipse, Netbeans and Intellij ?&lt;br /&gt;&lt;br /&gt;Well, frankly speaking, they all have their positives. In fact, they are all competing on a very high level now.&lt;br /&gt;&lt;br /&gt;Lets compare them based on few criterias :&lt;br /&gt;&lt;br /&gt;1. &lt;span style="font-weight:bold;"&gt;User Adoption&lt;/span&gt; : Eclipse wins easily. However, I guess with today's announcement, it is going to be exciting. Don't forget Netbeans is releasing the 6.8 beta shortly, and it has significantlly improved.&lt;br /&gt;&lt;br /&gt;2. &lt;span style="font-weight:bold;"&gt;Company Backing&lt;/span&gt; : Although Eclipse was started by IBM, Jetbrains owns intellij and Netbeans is owned by Sun (ohh.. I guess it is Oracle), but now the open source has changed the game. It is all about users, developers, speed and plugins.&lt;br /&gt;&lt;br /&gt;3. &lt;span style="font-weight:bold;"&gt;Speed &lt;/span&gt; :- I don't have a benchmark, however the last time I felt, Eclipse and Intellij both were better. Netbeans still needs to work on it (I last tried the full j2ee version of it - 6.5, never tried 6.7).&lt;br /&gt;&lt;br /&gt;4. &lt;span style="font-weight:bold;"&gt;Plugins &lt;/span&gt; :- Again Eclipse wins by the numbers. As far as quality is concerned, Intellij would probably be the best. Again, used mostly the in-built plugins for the netbeans (Correct me, and add comments if you find it better). However, now I see all the three editors have got a nice plugin framework and lots of developers writing for them.&lt;br /&gt;&lt;br /&gt;5. &lt;span style="font-weight:bold;"&gt;Maven Support&lt;/span&gt; :- Hmm....Here the Netbeans is the one, closely followed by Intellij.&lt;br /&gt;&lt;br /&gt;6. &lt;span style="font-weight:bold;"&gt;Usability&lt;/span&gt; :- Power users like Intellij with the best Refactoring offering , intelligent shortcuts, the awesome customer care support.&lt;br /&gt;&lt;br /&gt;7.&lt;span style="font-weight:bold;"&gt;Dynamic Language Support (Ruby/JRuby/Groovy)&lt;/span&gt; :- NetBeans is the best IDE for Ruby/JRuby(I am not including Rubymine from Jetbrains, as it is a separate product). For Groovy, my vote goes to Intellij again. &lt;br /&gt;&lt;br /&gt;I think as now Intellij has provided the free editor (Community Edition), more people would give it a try, and hence would be in a better position to compare it (And who knows may be then buy the Professional Edition eventually).&lt;br /&gt;&lt;br /&gt;What do you think ?&lt;br /&gt;&lt;br /&gt;Update : Here is the &lt;a href="http://www.jetbrains.com/idea/nextversion/editions_comparison_matrix.html"&gt;comparison chart&lt;/a&gt; for the OpenSource version vs the Commercial One.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-3296459509772447067?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/3296459509772447067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=3296459509772447067' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3296459509772447067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3296459509772447067'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/intellij-idea-ide-opensourced-current.html' title='Intellij Idea IDE OpenSourced - The current state of the Java IDE&apos;s'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-3715106031114572559</id><published>2009-10-13T18:39:00.000-07:00</published><updated>2009-10-13T18:50:54.562-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SimpleRSS'/><category scheme='http://www.blogger.com/atom/ns#' term='simple-rss'/><category scheme='http://www.blogger.com/atom/ns#' term='Atom'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='RSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Feed Aggregator'/><title type='text'>Simple Feed Aggregator in Ruby</title><content type='html'>Ruby already has few RSS standard libraries (0.9, 1.0 , 2.0) in built, and it is good enough for simple purpose. &lt;br /&gt;&lt;br /&gt;Today, I am trying to work on a simple feed aggregator, which could take multiple feed source url's and enlists the stories published there. I was tempted to use the standard library, however since it would not support the &lt;a href="http://en.wikipedia.org/wiki/Atom_(standard)"&gt;Atom&lt;/a&gt; standard, started looking for another library which supports both.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://simple-rss.rubyforge.org/"&gt;SimpleRSS &lt;/a&gt;lib by Lucas Carlson looks great.&lt;br /&gt;&lt;br /&gt;So, here goes the code. You may extend it if you wish.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;require 'simple-rss'&lt;br /&gt;require 'open-uri'&lt;br /&gt;&lt;br /&gt;class FeedAggregator&lt;br /&gt; def initialize(urls)&lt;br /&gt;   @urls = urls&lt;br /&gt;   @feeds = []&lt;br /&gt;   read_feeds&lt;br /&gt; end&lt;br /&gt;&lt;br /&gt; def read_feeds&lt;br /&gt;   @urls.each { |url| @feeds.push(SimpleRSS.new(open(url).read)) }&lt;br /&gt; end&lt;br /&gt;&lt;br /&gt; def feed_source_counts&lt;br /&gt;   @feeds.each_with_index do |feed, index|&lt;br /&gt;     feed_source = "Feed Source [#{index}]: #{feed.channel.title}"&lt;br /&gt;     published_articles = "Published Articles: #{feed.items.size}"&lt;br /&gt;     puts feed_source + ', ' + published_articles&lt;br /&gt;   end&lt;br /&gt; end&lt;br /&gt;&lt;br /&gt; def list_articles(id)&lt;br /&gt;   puts "-----Feed Source [#{id}] : #{@feeds[id].channel.title}-----"&lt;br /&gt;   @feeds[id].items.each { |item| puts ' ' + item.title }&lt;br /&gt; end&lt;br /&gt;&lt;br /&gt; def list_all_articles&lt;br /&gt;   @feeds.each_with_index { |f, i| list_articles(i) }&lt;br /&gt; end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;MyFeedAggregator = FeedAggregator.new(ARGV)&lt;br /&gt;MyFeedAggregator.feed_source_counts&lt;br /&gt;puts "------------ Feed Details ------------------"&lt;br /&gt;MyFeedAggregator.list_all_articles&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the test run :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;C:\Ruby\bin\ruby.exe -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) C:/Users/anshu/RubymineProjects/TestRubyProjectTwo/test_two.rb http://rubyforge.org/export/rss_sfnewreleases.php http://www.dzone.com/links/feed/frontpage/rss.xml&lt;br /&gt;Feed Source [0]: RubyForge New Releases, Published Articles: 10&lt;br /&gt;Feed Source [1]: dzone.com: latest front page, Published Articles: 25&lt;br /&gt;------------ Feed Details ------------------&lt;br /&gt;-----Feed Source [0] : RubyForge New Releases-----&lt;br /&gt; Dr Nic's Utilities&lt;br /&gt; WysMacs Trainable Text and Code Editor&lt;br /&gt; Loofah&lt;br /&gt; autotest-fsevent&lt;br /&gt; state_pattern&lt;br /&gt; codeforpeople&lt;br /&gt; Seattle.rb Projects&lt;br /&gt; rjack&lt;br /&gt; snk's open source&lt;br /&gt; Spidr&lt;br /&gt;-----Feed Source [1] : dzone.com: latest front page-----&lt;br /&gt; Non-Technical Factors that Lead to Poor Architectures&lt;br /&gt; My Tools of the Trade â€“ 2009&lt;br /&gt; Week Calendar using Jquery&lt;br /&gt; Oracle Taunts IBM with $10M Challenge&lt;br /&gt; Rant about developers or how I stopped worrying and love the simplicity&lt;br /&gt; ScalaTest 1.0 Release "A Path Forward" to Scala&lt;br /&gt; Resolving a Relative URL to a Full URL in ASP.NET&lt;br /&gt; JxBrowser 2.0 Early Access Program&lt;br /&gt; PrimeFaces UI 0.9.3 Released&lt;br /&gt; Mozilla Join Microsoft in Slamming Google Chrome Frame&lt;br /&gt; TDD is not test-first. TDD is specify-first and test-last.&lt;br /&gt; Five super-secret features in Windows 7&lt;br /&gt; Git# Offers Git Access for .NET and Mono Projects&lt;br /&gt; Getting Started with Scrum&lt;br /&gt; Apparent risk and actual risk&lt;br /&gt; 8 Hand Drawn Icon Sets For Bloggers&lt;br /&gt; Optimize your Mac experience with the LaunchBar multitasker&lt;br /&gt; 18 Really Beautiful and Creative Web Designs&lt;br /&gt; Google Released Page Speed for Firefox&lt;br /&gt; Objective-C's niche: why it survives in a world of alternatives&lt;br /&gt; Mobile Ajax Push for iPhone with JSF and PrimeFaces&lt;br /&gt; Book Review - Spring in Practice&lt;br /&gt; Tips for Designing an Awesome Coming Soon Page&lt;br /&gt; Abstracting away Dependencies for Simpler code&lt;br /&gt; MacRuby 0.5 Pulls the Plug on YARV&lt;br /&gt;&lt;br /&gt;Process finished with exit code 0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-3715106031114572559?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/3715106031114572559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=3715106031114572559' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3715106031114572559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3715106031114572559'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/simple-feed-aggregator-in-ruby.html' title='Simple Feed Aggregator in Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-6602882096741121623</id><published>2009-10-13T13:03:00.000-07:00</published><updated>2011-07-15T06:56:42.727-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AXIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Recipe'/><category scheme='http://www.blogger.com/atom/ns#' term='WebServcie'/><category scheme='http://www.blogger.com/atom/ns#' term='How to'/><title type='text'>How To : A Simple Generic SOAP Test Client written in Java</title><content type='html'>There are lots of libraries which are available to consume/generate a web service, like &lt;a href="http://static.springsource.org/spring-ws/sites/1.5/"&gt;Spring Webservices&lt;/a&gt;, &lt;a href="http://xfire.codehaus.org/"&gt;XFire&lt;/a&gt;, &lt;a href="http://ws.apache.org/axis/"&gt;Apache Axis&lt;/a&gt;, to name a few.&lt;br /&gt;&lt;br /&gt;While each one has its own pro/cons (that we can leave for a separate blog entry), many a times, one needs a simple (1 or 2) methods of a webservice calls to make. She may or may not care about the response, as long as the response is not leading to error.&lt;br /&gt;&lt;br /&gt;For testing purposes, many use &lt;a href="http://www.soapui.org/"&gt;soapui&lt;/a&gt;, which is a wonderful tool. You may use it to point towards your soap end point, and it will generate request stub for you . Just fill in few params required by the method you are calling.&lt;br /&gt;&lt;br /&gt;Here, I am ind of demonstrating the same thing, using a simple java program. &lt;br /&gt;I am not using any WSDL2JAVA tool kind of stuff, to generate the stubs. [Please note, these stubs help you with the xml to java bindings, so if you are planning to use many methods, or you have sufficient time and want to do it right way, please follow that way].&lt;br /&gt;&lt;br /&gt;Here is the code, you may use to call any end point. please note, it has some security headers just to show you. You may/may not need it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package example;&lt;br /&gt;&lt;br /&gt;import org.apache.axis.client.Service;&lt;br /&gt;import org.apache.axis.client.Call;&lt;br /&gt;import org.apache.axis.message.SOAPEnvelope;&lt;br /&gt;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import java.io.ByteArrayInputStream;&lt;br /&gt;import java.net.URL;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class TestClient {&lt;br /&gt;   public static String wsURL =&lt;br /&gt;           "{YOUR_END_POINT}?WSDL";&lt;br /&gt;&lt;br /&gt;   public static String mySoapRequest =&lt;br /&gt;           new StringBuilder().&lt;br /&gt;           append("&lt;soapenv:envelope soapenv="\&amp;quot;http://schemas.xmlsoap.org/soap/envelope/\&amp;quot;" mes="\&amp;quot;http://{URL}/9.01/messages\&amp;quot;" typ="\&amp;quot;{URL}/types\&amp;quot;"&gt;\n").&lt;br /&gt;           append("      &lt;soapenv:header&gt;\n").&lt;br /&gt;           #If your soap end point doesn't need security just remove these elements, or if it implements other sceurity standards, replace here&lt;br /&gt;           append("      &lt;typ:requestheader&gt;\n").&lt;br /&gt;           append("           &lt;wsse:security mustunderstand="\&amp;quot;1\&amp;quot;" wsse="\&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\&amp;quot;"&gt;\n").&lt;br /&gt;           append("                &lt;wsse:usernametoken&gt;\n").&lt;br /&gt;           append("                    &lt;wsse:username&gt;testusername&lt;/wsse:username&gt;\n").&lt;br /&gt;           append("                    &lt;wsse:password type="\&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\&amp;quot;"&gt;testpassword&lt;/wsse:password&gt;\n").&lt;br /&gt;           append("                &lt;/wsse:usernametoken&gt;\n").&lt;br /&gt;           append("           &lt;/wsse:security&gt;\n").&lt;br /&gt;           append("      &lt;/typ:requestheader&gt;\n").&lt;br /&gt;           append("   &lt;/soapenv:header&gt;\n").&lt;br /&gt;           append("   &lt;soapenv:body&gt;\n").&lt;br /&gt;           #Here goes your request body&lt;br /&gt;           .......................&lt;br /&gt;           .......................&lt;br /&gt;           append("   &lt;/soapenv:body&gt;\n").&lt;br /&gt;           append("&lt;/soapenv:envelope&gt;").toString();&lt;br /&gt;&lt;br /&gt;  public static void test() throws Exception {&lt;br /&gt;       InputStream input = new ByteArrayInputStream(mySoapRequest.getBytes());&lt;br /&gt;       Service service = new Service();&lt;br /&gt;       Call call = (Call) service.createCall();&lt;br /&gt;       SOAPEnvelope soapEnvelope = new SOAPEnvelope(input);&lt;br /&gt;       call.setTargetEndpointAddress(new URL(wsURL));&lt;br /&gt;       call.setUseSOAPAction(true);&lt;br /&gt;       System.out.println("Request:\n"+ mySoapRequest);&lt;br /&gt;       soapEnvelope = call.invoke(soapEnvelope);&lt;br /&gt;       System.out.println("Response:\n" + soapEnvelope.toString());&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void main(String args[]) throws Exception {&lt;br /&gt;       TestClient callClient = new TestClient();&lt;br /&gt;       callClient.test();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-6602882096741121623?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/6602882096741121623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=6602882096741121623' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6602882096741121623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6602882096741121623'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/how-to-simple-generic-soap-test-client.html' title='How To : A Simple Generic SOAP Test Client written in Java'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-2981270443321573240</id><published>2009-10-12T16:40:00.000-07:00</published><updated>2009-10-12T17:32:51.308-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XDepend'/><category scheme='http://www.blogger.com/atom/ns#' term='Code Analyzer'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>XDepend : Java Code Base Analysis</title><content type='html'>Today morning, when I checked my email I was offered a Pro License for &lt;a href="http://www.xdepend.com/"&gt;XDepend&lt;/a&gt;. Thanks to them for letting me explore it. I would post my findings once my hands get a little bit dirty.&lt;br /&gt;&lt;br /&gt;The installer which I got was for a PC (I work on mac in my office), probably they have released a linux version as well. Would be nice, if they plan a release for the mac too.&lt;br /&gt;&lt;br /&gt;By now what I know about is, it is from the same people who have offered &lt;a href="http://www.ndepend.com/"&gt;NDepend&lt;/a&gt;, a well known code base analyzer in .Net environment.&lt;br /&gt;&lt;br /&gt;Here is a short and nice intro to it by &lt;span style="font-weight:bold;"&gt;Mat Huston&lt;/span&gt;  :- &lt;a href="http://www.coderanch.com/t/462565/Blatant-Advertising/New-Tool-Java-code-base#2065255"&gt;http://www.coderanch.com/t/462565/Blatant-Advertising/New-Tool-Java-code-base#2065255&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Give it a try, as the trial version is available on the XDepend.com.&lt;br /&gt;Once I get chance to explore more, I would update this thread.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-2981270443321573240?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/2981270443321573240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=2981270443321573240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2981270443321573240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2981270443321573240'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/xdepend-java-code-base-analysis.html' title='XDepend : Java Code Base Analysis'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-8353626005672806130</id><published>2009-10-11T14:34:00.000-07:00</published><updated>2009-10-11T15:42:21.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='googlewave'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Intellij'/><category scheme='http://www.blogger.com/atom/ns#' term='IDEA'/><category scheme='http://www.blogger.com/atom/ns#' term='robots'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='appengine'/><title type='text'>Writing Google Wave Robots using Java on Intellij</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xeiel9jmdwI/StJbyTS-3YI/AAAAAAAAAbs/oAAZa7rrMk4/s1600-h/google_wave_robot3.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 200px;" src="http://4.bp.blogspot.com/_xeiel9jmdwI/StJbyTS-3YI/AAAAAAAAAbs/oAAZa7rrMk4/s320/google_wave_robot3.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391472623647382914" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xeiel9jmdwI/StJYvrS2t4I/AAAAAAAAAbk/jBq14QQDYL4/s1600-h/google_wave_robot2.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://1.bp.blogspot.com/_xeiel9jmdwI/StJYvrS2t4I/AAAAAAAAAbk/jBq14QQDYL4/s320/google_wave_robot2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391469280014808962" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xeiel9jmdwI/StJX_3B9lzI/AAAAAAAAAbc/rF9jze5eiJ4/s1600-h/google_wave_robot.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://1.bp.blogspot.com/_xeiel9jmdwI/StJX_3B9lzI/AAAAAAAAAbc/rF9jze5eiJ4/s320/google_wave_robot.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5391468458531460914" /&gt;&lt;/a&gt;&lt;br /&gt;I got my &lt;a href="http://wave.google.com/"&gt;google wave&lt;/a&gt;  invite two days back (friday night, can't be a better time). And within 4 hours I was talking with my "HelloWorldish" &lt;a href="http://code.google.com/apis/wave/extensions/robots/"&gt;Robot&lt;/a&gt;, such is the power and ease to write and deploy a robot is.&lt;br /&gt;&lt;br /&gt;If you use eclipse, you already are set and this is the best place to start with : http://code.google.com/apis/wave/extensions/robots/java-tutorial.html&lt;br /&gt;&lt;br /&gt;In fact, I used the same page for the sourcecode, and the steps. Make sure, you have a  google wave id before you start looking at the next steps.&lt;br /&gt;&lt;br /&gt;Steps :-&lt;br /&gt;&lt;br /&gt;1.Make sure you are using Java 1.6.&lt;br /&gt;&lt;br /&gt;2. I am using &lt;a href="http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP"&gt;Intellij Maia (9)&lt;/a&gt;. If you are on older version install the google appengine plugin.&lt;br /&gt;&lt;br /&gt;3. Use this plugin to generate a dummy web project. In the wizard, choose google app engine. We are not going to use either GWT/ JDO or JPA for this project, so just uncheck them.&lt;br /&gt;&lt;br /&gt;4. You can see a "AppEngine Dev" settings to run. Run it ,and you should be able to browse the dummy page at localhost:8080&lt;br /&gt;&lt;br /&gt;5. To write the Robot, we need few libraries. Download it from http://code.google.com/p/wave-robot-java-client/downloads/list.&lt;br /&gt;&lt;br /&gt;6.create a lib directory inside WEB-INF and copy all these jars . Also, add servlet-api-2.4.jar or higher.&lt;br /&gt;&lt;br /&gt;7.Make a package src/parroty.server and copy paste the ParrotyServlet code described at http://code.google.com/apis/wave/extensions/robots/java-tutorial.html&lt;br /&gt;&lt;br /&gt;8.Make a web/_wave dir. Create a capabilties.xml file and copy paste the code&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;w:robot xmlns:w="http://wave.google.com/extensions/robots/1.0"&amp;gt;&lt;br /&gt;&amp;lt;w:capabilities&amp;gt;&lt;br /&gt; &amp;lt;w:capability name="WAVELET_PARTICIPANTS_CHANGED" content="true" /&amp;gt;&lt;br /&gt;&amp;lt;/w:capabilities&amp;gt;&lt;br /&gt;&amp;lt;w:version&amp;gt;1&amp;lt;/w:version&amp;gt;&lt;br /&gt;&amp;lt;/w:robot&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;9. Register your application on appengine site.&lt;br /&gt;&lt;br /&gt;In you appengine-web.xml file substitute your application id (instead of mine, "mytestwaveapp") :-&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;appengine-web-app xmlns="http://appengine.google.com/ns/1.0"&amp;gt;&lt;br /&gt;&amp;lt;application&amp;gt;mytestwaveapp&amp;lt;/application&amp;gt;&lt;br /&gt;&amp;lt;version&amp;gt;1&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/appengine-web-app&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;10. Configure your ParrotyServlet inside the web.xml :&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"&lt;br /&gt;      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee&lt;br /&gt;  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&lt;br /&gt;      version="2.5"&amp;gt;&lt;br /&gt; &amp;lt;servlet&amp;gt;&lt;br /&gt;     &amp;lt;servlet-name&amp;gt;Parroty&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;     &amp;lt;servlet-class&amp;gt;parroty.server.ParrotyServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt; &amp;lt;/servlet&amp;gt;&lt;br /&gt; &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;     &amp;lt;servlet-name&amp;gt;Parroty&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;     &amp;lt;url-pattern&amp;gt;/_wave/robot/jsonrpc&amp;lt;/url-pattern&amp;gt;&lt;br /&gt; &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Go to "Tools-&gt;Upload AppEngine Application", and you are good enough to deploy this Robot.It would ask you your appengine loginid/pwd.The console would show, that everything went fine. You can confirm by accessing the capabilties.xmlfile :- http://applicationName.appspot.com/_wave/capabilities.xml &lt;br /&gt;&lt;br /&gt;11.Well, now you are done. Use this robot as a participant for your wave and it should answer as I have shown in the picture. More Sample Robot Codes :-  http://code.google.com/p/google-wave-resources/source/browse/trunk/samples/extensions/robots/java&lt;br /&gt;&lt;br /&gt;Happy Coding ! Happy Waving !!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-8353626005672806130?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/8353626005672806130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=8353626005672806130' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/8353626005672806130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/8353626005672806130'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/writing-google-wave-robots-using.html' title='Writing Google Wave Robots using Java on Intellij'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xeiel9jmdwI/StJbyTS-3YI/AAAAAAAAAbs/oAAZa7rrMk4/s72-c/google_wave_robot3.jpg' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-810826399241110843</id><published>2009-10-11T13:43:00.000-07:00</published><updated>2009-10-11T14:15:32.428-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IMageMagick'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Graphs'/><category scheme='http://www.blogger.com/atom/ns#' term='Scruffy'/><category scheme='http://www.blogger.com/atom/ns#' term='RMagick'/><title type='text'>Easy Graph with Scruffy on Ruby</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xeiel9jmdwI/StJK0uJPzvI/AAAAAAAAAbU/nceRylFKBz4/s1600-h/split_test.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 192px;" src="http://2.bp.blogspot.com/_xeiel9jmdwI/StJK0uJPzvI/AAAAAAAAAbU/nceRylFKBz4/s320/split_test.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5391453973516373746" /&gt;&lt;/a&gt;&lt;br /&gt;This weekend, I was going through the first chapter of the book &lt;a href="http://www.manning.com/mcanally/"&gt;Ruby in Practice&lt;/a&gt;. Kind of like it as of yet , although have read only 4-5 pages. &lt;br /&gt;&lt;br /&gt;It shows an example of using the graphing library &lt;a href="http://scruffy.rubyforge.org/"&gt;Scruffy&lt;/a&gt;. Thought to give it a try on my home PC (Vitsa).&lt;br /&gt;&lt;br /&gt;This blog is to save your time, in case you want to use this nice library and run into configuration problem.&lt;br /&gt;&lt;br /&gt;1. You need to install the "Scruffy" gems&lt;br /&gt;gem install scruffy&lt;br /&gt;&lt;br /&gt;2. Then I tried the example discussed at :- http://scruffy.rubyforge.org. However, was getting error, which made it clear, you need to install another gem - RMagick. Won't bother you with my trial and errors, so to cut long story short, RMagick in turn requires other graphing lib (for e.g., I opted for IMageMagick).&lt;br /&gt;&lt;br /&gt;So, download http://rubyforge.org/frs/download.php/38052/RMagick-2.5.0-ImageMagick-6.4.1-5-Q8.zip&lt;br /&gt;&lt;br /&gt;3. Extract this to a temp directory, and run the IMageMagick installer.&lt;br /&gt;&lt;br /&gt;4. Follow the readme file, which mentions to update your gem and install the RMagick gem.&lt;br /&gt;&lt;br /&gt;5.Now, the most important part. Reboot your machine [:)]. Don't forget it.&lt;br /&gt;&lt;br /&gt;6.After this, the sample codes described here :- http://scruffy.rubyforge.org/  started to work, except the graphs being generated was exactly as it appears on this site (as of this writing, wonder why it hasn't been fixed ?), i.e. blank images.&lt;br /&gt;&lt;br /&gt;7. One blog post which helped me to fix this was :- http://www.ruby-forum.com/topic/193988&lt;br /&gt;It suggests to replace the line 35, of the base.rb (for me it is C:\Ruby\lib\ruby\gems\1.8\gems\scruffy-0.2.6\lib\scruffy\renderers\base.rb)with &lt;br /&gt;&lt;br /&gt;svg.svg(:xmlns =&gt; "http://www.w3.org/2000/svg", 'xmlns:xlink' =&gt;"http://www.w3.org/1999/xlink",:viewBox =&gt; "0 0 #{options[:size].first} #{options[:size].last}") {&lt;br /&gt;&lt;br /&gt;After it, the graphs started working like a charm. Looking forward to explore it more. Hope, it saves your time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-810826399241110843?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/810826399241110843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=810826399241110843' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/810826399241110843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/810826399241110843'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/easy-graph-with-scruffy-on-ruby.html' title='Easy Graph with Scruffy on Ruby'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xeiel9jmdwI/StJK0uJPzvI/AAAAAAAAAbU/nceRylFKBz4/s72-c/split_test.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-7235770023168197478</id><published>2009-10-05T16:47:00.000-07:00</published><updated>2009-10-14T07:51:16.300-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PropertyPlaceholderConfigurer'/><category scheme='http://www.blogger.com/atom/ns#' term='Properties'/><category scheme='http://www.blogger.com/atom/ns#' term='Expose'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='How to'/><title type='text'>Recipe : How to get property value in a Spring Application</title><content type='html'>If you work with Spring, I am sure you might have come across the scenario when you need to access the value of a property key in your application.&lt;br /&gt;&lt;br /&gt;The class "org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" is normally used  to resolve the runtime key/value pairs. However, if you need to use a property value in your bean, it doesn't expose that to be read.&lt;br /&gt;&lt;br /&gt;Here is a very simple work-around :-&lt;br /&gt;&lt;br /&gt;1. Extend the &lt;span style="font-weight:bold;"&gt;PropertyPlaceholderConfigurer&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class OpenPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer {&lt;br /&gt;&lt;br /&gt;  Properties mergedProperties;&lt;br /&gt;&lt;br /&gt;  public Properties getMergedProperties() throws IOException {&lt;br /&gt;    if (mergedProperties == null) {&lt;br /&gt;&lt;br /&gt;      mergedProperties = mergeProperties();&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    return mergedProperties;&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Configure it to be used instead of PropertyPlaceholderConfigurer &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  &lt;br /&gt;  &amp;lt;bean id="propertyConfigurer" class="com.mypackage.OpenPropertyPlaceholderConfigurer"&amp;gt;&lt;br /&gt;        &amp;lt;property name="ignoreResourceNotFound" value="false"/&amp;gt;&lt;br /&gt;        &amp;lt;property name="locations"&amp;gt;&lt;br /&gt;            &amp;lt;list&amp;gt;&lt;br /&gt;                &amp;lt;value&amp;gt;classpath:common.properties&amp;lt;/value&amp;gt;&lt;br /&gt;                &amp;lt;value&amp;gt;classpath:${YOUR_ENV}.properties&amp;lt;/value&amp;gt;&lt;br /&gt;            &amp;lt;/list&amp;gt;&lt;br /&gt;        &amp;lt;/property&amp;gt;&lt;br /&gt;    &amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3. Inject this "propertyConfigurer" in your defined bean.&lt;br /&gt;&lt;br /&gt;4. Get the key value propertyConfigurer.getMergedProperties().getProperty("your.prop.key")&lt;br /&gt;&lt;br /&gt;I am sure, there could be some better ways. Let me know, if you know one.&lt;br /&gt;&lt;br /&gt;Credit goes to &lt;a href="http://matschaffer.com/"&gt;Mat&lt;/a&gt; for this recipe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-7235770023168197478?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/7235770023168197478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=7235770023168197478' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7235770023168197478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/7235770023168197478'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/recipe-how-to-get-property-value-in.html' title='Recipe : How to get property value in a Spring Application'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-1749304704554038783</id><published>2009-10-05T08:13:00.000-07:00</published><updated>2009-10-05T08:21:00.811-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><category scheme='http://www.blogger.com/atom/ns#' term='Terminal'/><category scheme='http://www.blogger.com/atom/ns#' term='PAM Error'/><title type='text'>Mac Terminal Error : Could not determine audit condition</title><content type='html'>&lt;div&gt;When I launched my terminal today, was welcomed with this error :-&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;login: PAM Error (line 396): System error&lt;/div&gt;&lt;div&gt;login: Could not determine audit condition&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[Process completed]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is most probably because I was playing with my /usr/bin permissions the other day.&lt;/div&gt;&lt;div&gt;The fix is easy. Just delete the "/usr/bin/login" dir.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But how do I delete it, if I can't access the "Terminal" altogether ? &lt;/div&gt;&lt;div&gt;Come on - You can access any folder using the "Finder".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Open "Finder"&lt;/div&gt;&lt;div&gt;2. Open "Go To Folder"&lt;/div&gt;&lt;div&gt;3. Type "/usr/bin/login"&lt;/div&gt;&lt;div&gt;4. Delete it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You are done.&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"    style="font-family:verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;font-size:100%;color:#6C6F73;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-1749304704554038783?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/1749304704554038783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=1749304704554038783' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1749304704554038783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1749304704554038783'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/mac-terminal-error-could-not-determine.html' title='Mac Terminal Error : Could not determine audit condition'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-6220815078364673613</id><published>2009-10-04T19:54:00.000-07:00</published><updated>2009-10-04T20:06:28.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SimpleDB'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Connection Timeout'/><category scheme='http://www.blogger.com/atom/ns#' term='Typica'/><category scheme='http://www.blogger.com/atom/ns#' term='SQS'/><category scheme='http://www.blogger.com/atom/ns#' term='Amazon'/><category scheme='http://www.blogger.com/atom/ns#' term='EC2'/><category scheme='http://www.blogger.com/atom/ns#' term='AWS'/><title type='text'>Typica library - Added my patch to set connection timeout</title><content type='html'>&lt;div&gt;&lt;a href="http://code.google.com/p/typica/"&gt;Typica&lt;/a&gt; :- &lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; "&gt;is a simple API to access Amazon's SQS, EC2, SimpleDB and DevPay LS web services&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;A couple of month ago, I was using this library to interact with the Amazon's SQS queue. While testing, a bug popped up where in case of a network failure, the code was trying to make the connection endlessly.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the &lt;a href="http://code.google.com/p/typica/issues/detail?id=50"&gt;history &lt;/a&gt;of this bug. I changed the jar and suggested a patch.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The good news is that they applied my patch to the code base and from the version 1.6 onwards, this bug shouldn't appear.&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/612275289405565943-6220815078364673613?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/6220815078364673613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=6220815078364673613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6220815078364673613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/6220815078364673613'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/10/typica-library-added-my-patch-to-set.html' title='Typica library - Added my patch to set connection timeout'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-2008769965122735223</id><published>2009-09-13T08:32:00.000-07:00</published><updated>2009-09-13T08:33:12.417-07:00</updated><title type='text'>Why are we happy?</title><content type='html'>&lt;p&gt;TED.com: &lt;a href="http://www.ted.com/talks/dan_gilbert_asks_why_are_we_happy.html"&gt;Dan Gillbert asks, Why are we happy?&lt;/a&gt;: &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;...When our ambition is bounded, it leads us to work joyfully. When our ambition is unbounded, it leads us to lie, to cheat, to steal, to hurt others, to sacrifice things of real value. When our fears are bounded, we're prudent, we're cautious, we're thoughtful. When our fears are unbounded and overblown, we're reckless, and we're cowardly.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The lesson I want to leave you with from these data is that our longings and our worries are both to some degree overblown, because we have within us the capacity to manufacture the very commodity we are constantly chasing when we choose experience.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;    &lt;br /&gt;  &lt;div&gt;&lt;br /&gt;&lt;a href="http://feeds.feedburner.com/~ff/KarlMartino?a=c3Day3kZiFk:T36woxWNsN8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KarlMartino?d=yIl2AUoC8zA" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KarlMartino?a=c3Day3kZiFk:T36woxWNsN8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KarlMartino?d=7Q72WNTAKBA" border="0" /&gt;&lt;/a&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/612275289405565943-2008769965122735223?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/2008769965122735223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=2008769965122735223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2008769965122735223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2008769965122735223'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/09/why-are-we-happy.html' title='Why are we happy?'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-1987223578545840932</id><published>2009-08-29T09:55:00.000-07:00</published><updated>2009-08-29T09:55:53.320-07:00</updated><title type='text'>How spirituality awakens in a human being</title><content type='html'>&lt;a href="http://1000petals.wordpress.com/2009/07/31/how-spirituality-awakens/"&gt;How spirituality awakens in a human being&lt;/a&gt;: "&lt;div&gt;&lt;br /&gt;&lt;p&gt;&lt;img src="http://farm3.static.flickr.com/2625/3761489532_960f515664.jpg" alt="" width="451" height="500" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;Spirituality is like the water hidden in the depth of the earth: hidden in the heart of man, this water which is spirituality must be, so to speak, dug out. This digging is done when one takes pains in awakening ones sympathy towards others, in harmonizing with others and in understanding others.&lt;/em&gt;  -says my beloved Sufi saint &lt;a href="http://www.sufimessage.com/"&gt;Hazrat Inayath Khan&lt;/a&gt; &lt;a href="http://1000petals.wordpress.com/wp-admin/Hazrat%20Inayath%20Khan"&gt;(1882-1927)&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I find it a beautiful explanation of how the spirituality is generally born in a human being. The next step is when one starts seeking the Spirit everywhere – in oneself, in others, in nature. One starts seeking for the very depth, for the very essence and beauty of everything and… one day finds it!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;LOVE; axinia&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;(image by me)&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;Posted in Evolutionary Learning, how to, India, meditation, philosophy, psychology, spirituality, thoughts Tagged: beautiful, God, Hazrat Inayath Khan, heart, interesting, meditation, peace, philosophy, psychology, spirituality, Sufism, thoughts &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/1000petals.wordpress.com/2180/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/1000petals.wordpress.com/2180/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/1000petals.wordpress.com/2180/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/1000petals.wordpress.com/2180/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/1000petals.wordpress.com/2180/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/1000petals.wordpress.com/2180/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/1000petals.wordpress.com/2180/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/1000petals.wordpress.com/2180/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/1000petals.wordpress.com/2180/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/1000petals.wordpress.com/2180/" /&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=1000petals.wordpress.com&amp;amp;blog=798689&amp;amp;post=2180&amp;amp;subd=1000petals&amp;amp;ref=&amp;amp;feed=1" /&gt;&lt;/div&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-1987223578545840932?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://1000petals.wordpress.com/2009/07/31/how-spirituality-awakens/' title='How spirituality awakens in a human being'/><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/1987223578545840932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=1987223578545840932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1987223578545840932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1987223578545840932'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/08/how-spirituality-awakens-in-human-being.html' title='How spirituality awakens in a human being'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2625/3761489532_960f515664_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-2668549948824174366</id><published>2009-08-29T09:44:00.000-07:00</published><updated>2009-08-29T09:44:15.892-07:00</updated><title type='text'>Episode 173: Screen Scraping with ScrAPI</title><content type='html'>&lt;a href="http://railscasts.com/episodes/173-screen-scraping-with-scrapi"&gt;Episode 173: Screen Scraping with ScrAPI&lt;/a&gt;: "Screen scraping is not pretty, but sometimes it's your only option to extract content from an external site. In this episode I show you how to fetch product prices using ScrAPI."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-2668549948824174366?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://railscasts.com/episodes/173-screen-scraping-with-scrapi' title='Episode 173: Screen Scraping with ScrAPI'/><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/2668549948824174366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=2668549948824174366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2668549948824174366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2668549948824174366'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/08/episode-173-screen-scraping-with-scrapi.html' title='Episode 173: Screen Scraping with ScrAPI'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-5264068651707921193</id><published>2009-08-29T09:17:00.000-07:00</published><updated>2009-08-29T09:17:57.614-07:00</updated><title type='text'>Amazon, Open Your eBooks or Watch Out</title><content type='html'>&lt;a href="http://feedproxy.google.com/~r/readwriteweb/~3/GeMIHuniO_8/amazon_open_your_books_or_watch_out.php"&gt;Amazon, Open Your eBooks or Watch Out&lt;/a&gt;: "&lt;p&gt;&lt;img alt="sony_reader_wireless_logo.jpg" src="http://www.readwriteweb.com/images/sony_reader_wireless_logo.jpg" /&gt;Hardly a day went by this week without a major new announcement in the eBook and eReader arena. The &lt;a href="http://www.readwriteweb.com/archives/ebooks_sony_announces_wireless_ereader_and_partnerships.php"&gt;wireless eReaders from Sony&lt;/a&gt; and the &lt;a href="http://www.readwriteweb.com/archives/barnes_noble_partners_with_irex.php"&gt;Irex/Barnes &amp;amp; Noble&lt;/a&gt; partnership were probably some of the most interesting announcements. In addition, Google also &lt;a href="http://www.readwriteweb.com/archives/google_opens_up_its_epub_archive_download_1_million_books_for_free.php"&gt;opened up its EPUB archive&lt;/a&gt;, which will give readers easy access to over 1 million free public-domain books for their eReaders. The only company that didn't have anything to announce this week was &lt;a href="http://amazon.com/"&gt;Amazon&lt;/a&gt;, which is now in danger of losing its early lead to Sony and Barnes &amp;amp; Noble. &lt;/p&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;em&gt;Sponsor&lt;/em&gt;&lt;br /&gt;&lt;a href="http://d1.openx.org/ck.php?n=16205&amp;amp;cb=16205"&gt;&lt;img src="http://d1.openx.org/avw.php?zoneid=11205&amp;amp;cb=16205&amp;amp;n=16205" border="0" alt="" align="right" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Before this week, Amazon's Kindle still had one major advantage: wireless syncing. Now that both Sony and Barnes &amp;amp; Noble will offer the same functionality before the holiday season, the eBook market is once again completely open.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Everybody Now Offers Wireless Syncing&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;While wireless syncing and book delivery may &lt;a href="http://blogs.zdnet.com/mobile-gadgeteer/?p=1919"&gt;not be that important&lt;/a&gt; to every potential eReader user, it did give Amazon a major leg up in marketing its Kindle and Kindle DX. In a month or two, this advantage will be gone. Amazon's competitors also offer more stylish devices, and some of the upcoming new eReaders will also offer touch screens - another feature that Amazon's Kindle doesn't currently offer.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;EBook Price is Now the Same Everywhere, But Sony Supports Downloads From Local Library &lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In terms of pricing, Sony will soon offer an eReader for $199, which will put a lot of pressure on Amazon - though Sony's cheapest device will not offer wireless capabilities. As for books, prices everywhere are converging around a reasonable $9.99, the price Amazon pioneered as the default price for bestsellers in its Kindle store. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What's even more exciting is that eReader users will soon be able to &lt;a href="http://chipublib.lib.overdrive.com/747BC9A7-E94B-4D0E-985B-238BE1170FEB/10/375/en/SearchResults-ebooks.htm?SearchID=24391779&amp;amp;SortBy=rank"&gt;borrow eBooks&lt;/a&gt; from their &lt;a href="http://overdrive.com/aboutus/getArticle.aspx?newsArticleID=20090812"&gt;local libraries&lt;/a&gt;. Sony just announced a partnership with OverDrive, which supplies eBook technology to over 9,000 libraries. Amazon &lt;a href="http://blogs.zdnet.com/mobile-gadgeteer/?p=1930"&gt;doesn't&lt;/a&gt; offer a similar program (yet).&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Amazon's Problem: The Kindle is Closed&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What's giving Amazon's competitors a major advantage right now is that their devices are far more open than the Kindle. As Slate's &lt;a href="http://www.slate.com/id/2226503/pagenum/all/#p2"&gt;Farhad Manjoo&lt;/a&gt; points out, Sony and company could still be far more open and do away with all copyright restrictions. But at least you will be able to move your books to different devices,  even though Sony still uses the standard EPUB format with a &lt;a href="http://www.readwriteweb.com/archives/sony_adopts_open_but_still_drmed_format_for_ebooks.php"&gt;DRM wrapper&lt;/a&gt;, for example. Amazon's proprietary format, on the other hand, doesn't allow you to move your Kindle eBook to your new Sony Reader, for example. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For now, most publishers are still weary about releasing books without copyright. We can only assume that the book publishing industry will go through a similar cycle as the music industry, however, and that DRMed eBooks will also go the way of DRMed MP3s.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The eBook market is still young. For now, Amazon's only other advantage over its competitors is that it currently has a lot of momentum among early adopters. But, as Forrester Research's Sarah Rotman Epps &lt;a href="http://www.readwriteweb.com/as%20Forrester%20Research%E2%80%99s%20Sarah%20Rotman%20Epps%20argued%20in%20a%20recent%20report."&gt;argued&lt;/a&gt; in a recent report, as eBooks move into the mainstream, late adopters may not feel the same loyalty towards Amazon that early adopters had.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Of course, Amazon could still come out with a new eReader and a more open strategy. But for now, it doesn't look like Amazon is planning to change its strategy anytime soon, and we haven't heard any news (or even rumors) of a new Kindle for quite a while. If Amazon doesn't watch out, it could soon be left behind, because other eBook vendors and hardware manufacturers offer a more open and attractive platform for publishers and users.&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href="http://www.readwriteweb.com/archives/amazon_open_your_books_or_watch_out.php#comments-open"&gt;Discuss&lt;/a&gt;&lt;/strong&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:wyZtjr_bnvM"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?d=wyZtjr_bnvM" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:Ij26kaj3iuU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?d=Ij26kaj3iuU" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?d=yIl2AUoC8zA" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?i=GeMIHuniO_8:kQSLY9YpcVE:V_sGLiPBpWU" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?i=GeMIHuniO_8:kQSLY9YpcVE:gIN9vFwOqvQ" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?i=GeMIHuniO_8:kQSLY9YpcVE:F7zBnMyn0Lo" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?d=qj6IDK7rITs" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:OqabYuBsmOY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?d=OqabYuBsmOY" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/readwriteweb?a=GeMIHuniO_8:kQSLY9YpcVE:V0NnFgFmPVs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/readwriteweb?d=V0NnFgFmPVs" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/readwriteweb/~4/GeMIHuniO_8" height="1" width="1" /&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-5264068651707921193?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://feedproxy.google.com/~r/readwriteweb/~3/GeMIHuniO_8/amazon_open_your_books_or_watch_out.php' title='Amazon, Open Your eBooks or Watch Out'/><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/5264068651707921193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=5264068651707921193' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5264068651707921193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/5264068651707921193'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/08/amazon-open-your-ebooks-or-watch-out.html' title='Amazon, Open Your eBooks or Watch Out'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-2114178728875416157</id><published>2009-08-22T06:16:00.000-07:00</published><updated>2009-08-22T06:16:05.086-07:00</updated><title type='text'>The Truth: What’s Really Going On With Apple, Google, AT&amp;T And The FCC</title><content type='html'>&lt;a href="http://feedproxy.google.com/~r/Techcrunch/~3/e6S8JRgHDjU/"&gt;The Truth: What’s Really Going On With Apple, Google, AT&amp;amp;T And The FCC&lt;/a&gt;: "&lt;p&gt;&lt;img src="http://cache0.techcrunch.com/wp-content/uploads/2009/08/iphone3gs.jpg" alt="" /&gt;&lt;a href="http://www.techcrunch.com/2009/08/21/apples-response-to-the-fcc-we-didnt-reject-the-google-voice-app-were-still-looking-at-it/"&gt;Apple has responded&lt;/a&gt; to the FCC’s &lt;a href="http://www.techcrunch.com/2009/07/31/fcc-takes-on-apple-and-att-over-google-voice-rejection/"&gt;request&lt;/a&gt; for information around its rejection of various &lt;a href="http://www.techcrunch.com/2009/07/27/apple-is-growing-rotten-to-the-core-and-its-likely-atts-fault/"&gt;Google&lt;/a&gt; and &lt;a href="http://www.techcrunch.com/2009/07/27/apple-yanks-the-cord-on-gv-mobile-is-it-trying-to-kill-google-voice-on-the-iphone/"&gt;third party&lt;/a&gt; iPhone applications for the iPhone.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In short, Apple denies that they rejected the Google Voice application, but they go into great detail about how the Google Voice application hurts “the iPhone’s distinctive user experience.” All of those statements are either untrue, or misleading, or both.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The first part of Apple’s argument, that they never rejected the application, is “a total lie,” according to many sources with knowledge of the Google Voice application process.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The second part of Apple’s argument, that the Google Voice application hurts the iPhone’s distinctive user experience, is seriously misleading. I know this because I’ve become intimately familiar with the Google Voice service and applications over the last few months. See &lt;a href="http://www.techcrunch.com/2009/08/09/how-i-learned-to-quit-the-iphone-and-love-google-voice/"&gt;here&lt;/a&gt;, &lt;a href="http://www.techcrunch.com/2009/07/31/i-quit-the-iphone/"&gt;here&lt;/a&gt;, &lt;a href="http://www.techcrunch.com/2009/06/14/google-voices-secret-weapon-number-portability/"&gt;here&lt;/a&gt; and &lt;a href="http://www.techcrunch.com/2009/07/14/google-voice-apps-for-android-and-blackberry-are-here/"&gt;here&lt;/a&gt;, for example. I haven’t used the Google Voice app for the iPhone specifically, because it never launched. But I have been briefed by the Google team on two separate occasions on how the app would work over the last couple of months. Also, I’ve demo’d the Blackberry version of the app, and now use the Android version of the app.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here’s the key language from Apple’s letter, with my comments:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Apple:&lt;/strong&gt; &lt;em&gt;“Contrary to published reports, Apple has not rejected the Google Voice application, and continues to study it.”&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; One third party Google Voice app developer disclosed to us in July that Apple SVP &lt;a href="http://www.crunchbase.com/person/philip-schiller"&gt;Phil Schiller&lt;/a&gt; told them that Google’s own app would be or already was rejected. Google also &lt;a href="http://www.techcrunch.com/2009/07/27/apple-is-growing-rotten-to-the-core-and-its-likely-atts-fault/"&gt;confirmed&lt;/a&gt; this to us later. There is overwhelming evidence that Apple did in fact reject the application.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Apple:&lt;/strong&gt; &lt;em&gt;“The application has not been approved because, as submitted for review, it appears to alter the iPhone’s distinctive user experience by replacing the iPhone’s core mobile telephone functionality and Apple user interface with its own user interface for telephone calls, text messaging and voicemail. Apple spent a lot of time and effort developing this distinct and innovative way to seamlessly deliver core functionality of the iPhone.”&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; This strongly suggests that the Google Voice app replaces much of the core Apple iPhone OS function. This certainly isn’t accurate, and we believe the statement is misleading. More details below, but in general the iPhone app is a very light touch and doesn’t interfere with &lt;strong&gt;any&lt;/strong&gt; native iPhone apps at all.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Apple:&lt;/strong&gt; &lt;em&gt;“For example, on an iPhone, the “Phone” icon that is always shown at the bottom of the Home Screen launches Apple’s mobile telephone application, providing access to Favorites, Recents, Contacts, a Keypad, and Visual Voicemail. The Google Voice application replaces Apple’s Visual Voicemail by routing calls through a separate Google Voice telephone number that stores any voicemail, preventing voicemail from being stored on the iPhone, i.e., disabling Apple’s Visual Voicemail.”&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; Not true and misleading. The Google Voice application has its own voicemail function, which also transcribes messages. But it only works for incoming Google Voice calls, not calls to the iPhone. The Google Voice app in no way “replaces” Apple’s voicemail function.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Apple:&lt;/strong&gt; &lt;em&gt;“Similarly, SMS text messages are managed through the Google hub—replacing the iPhone’s text messaging feature.”&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; Not true and misleading. The Google Voice app doesn’t replace or in any way interfere wtih the iPhone’s text messaging feature. If someone sends a text message to your Google Voice number, the Google Voice app shows it. If it is sent directly to the iPhone phone number, nothing is different.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Apple:&lt;/strong&gt; &lt;em&gt;“In addition, the iPhone user’s entire Contacts database is transferred to Google’s servers, and we have yet to obtain any assurances from Google that this data will only be used in appropriate ways. These factors present several new issues and questions to us that we are still pondering at this time.”&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Reality:&lt;/strong&gt; Complete fabrication, way beyond misleading. The Google Voice app can access the iPhone’s contacts database, like thousands of other iPhone apps. But the Google Voice app never syncs the contacts database to their own servers. There is no option for users to do this. However, Apple offers the ability to sync iPhone contacts with Google &lt;a href="http://support.apple.com/kb/HT1245"&gt;via iTunes&lt;/a&gt;. So not only is Apple’s statement untrue, but they also provide this exact feature themselves via their own service.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So how did Google answer the same question in their own separate letter to the FCC, &lt;a href="http://www.techcrunch.com/2009/08/21/googles-response-to-the-fcc/"&gt;also made publicly available today&lt;/a&gt;? We don’t know, because Google requested that the answer be redacted. But my guess is that the answer, which the FCC has and can compare to Apple’s response, tells a significantly different (approximately the exact opposite) story:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;center&gt;&lt;img src="http://cache0.techcrunch.com/wp-content/uploads/2009/08/ga.jpg" alt="" /&gt;&lt;/center&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Our sources at Google tell us in no uncertain terms that Apple rejected the application. And we have an independent third party app developer who tells us that an Apple Exec also told them back in July that the Google Voice Application was rejected.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In other words, there is strong evidence that Apple is, well, lying.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Which also is the easiest was to explain Apple’s long rambling letter to the FCC. Why go into so much detail about the problems with the Google Voice application, and then say that it was never rejected? If the app does actually replace all of those core apple phone, contact and SMS features, why not reject it out of hand? I don’t believe anyone would say Apple made the wrong decision if that laundry list of nonsense had any truth to it (we have an answer to that, below).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Multiple sources at Google tell us that in informal discussions with Apple over the last few months Apple expressed dismay at the number of core iPhone apps that are powered by Google. Search, maps, YouTube, and other key popular apps are powered by Google. Other than the browser, Apple has little else to call its own other than the core phone, contacts and calendar features. The Google Voice App takes things one step further, by giving users an incentive to abandon their iPhone phone number and use their Google Voice phone number instead (transcription of voicemails is reason enough alone). Apple was afraid, say our sources, that Google was gaining too much power on the iPhone, and that’s why they rejected the application.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Apple seemed to be fine telling Google and others that the real reason they wouldn’t accept the Google Voice app on the iPhone was a fear of being turned into little more than a hardware manufacturer over time as users spent more and more time on Google Voice and less time on the competing native iPhone apps. Or simply letting people believe that &lt;a href="http://www.techcrunch.com/2009/07/27/apple-is-growing-rotten-to-the-core-and-its-likely-atts-fault/"&gt;AT&amp;amp;T was behind&lt;/a&gt; the rejection. Until the FCC got involved, that is. Then Apple denied the rejections and directed the FCCs attention to misleading or simply untrue factual statements about the App.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Of course, now both Google and AT&amp;amp;T are required to tell their side of the story to the FCC, too. And those stories aren’t adding up.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;big&gt;&lt;strong&gt;What Happens Next?&lt;/strong&gt;&lt;/big&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here’s what we believe Apple is preparing to do next. Their statement that they haven’t rejected the app, along with the long laundry list of complaints (none of which are true) tells us that they’re backtracking, and fast. &lt;strong&gt;Sometime soon, we guess, Apple will simply accept the Google Voice application.&lt;/strong&gt; They have to - any serious investigation into the app by the FCC will show that the complaints around the app are unfounded and that it does none of the things Apple accuses it of doing. So Apple will save face by simply asking Google to ensure that the App doesn’t take over native phone, sms and other functions, and doesn’t sync the contacts to Google’s servers.  Google will comply (they already have), and Apple will graciously accept the application.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;But we’ll all know exactly where Apple stands - jealously guarding control of their users and trying to block Google and other third party developers at every turn from getting their superior applications in front those users. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;This isn’t about protecting users, it’s about controlling them. And that’s not what Apple should be about. Put the users first, &lt;a href="http://www.crunchbase.com/person/steve-jobs"&gt;Steve&lt;/a&gt;, and don’t lie to us. We’re not that dumb.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Crunch Network&lt;/em&gt;&lt;/strong&gt;:  &lt;a href="http://www.crunchboard.com/"&gt;CrunchBoard&lt;/a&gt;&lt;em&gt; &lt;/em&gt;because it’s time for you to find a new Job2.0&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://d.techcrunch.com/ck.php?n=a8e452d3&amp;amp;cb=615"&gt;&lt;img src="http://d.techcrunch.com/avw.php?zoneid=38&amp;amp;cb=1954&amp;amp;n=a8e452d3" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://d.techcrunch.com/ck.php?n=a9e88cf5&amp;amp;cb=775"&gt;&lt;img src="http://d.techcrunch.com/avw.php?zoneid=13&amp;amp;cb=66&amp;amp;n=a9e88cf5" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://feeds.feedburner.com/~ff/Techcrunch?a=e6S8JRgHDjU:a0wyiePaouw:2mJPEYqXBVI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techcrunch?d=2mJPEYqXBVI" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techcrunch?a=e6S8JRgHDjU:a0wyiePaouw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techcrunch?d=dnMXMwOfBR0" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techcrunch?a=e6S8JRgHDjU:a0wyiePaouw:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techcrunch?i=e6S8JRgHDjU:a0wyiePaouw:D7DqB2pKExk" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techcrunch?a=e6S8JRgHDjU:a0wyiePaouw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techcrunch?d=7Q72WNTAKBA" border="0" /&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Techcrunch?a=e6S8JRgHDjU:a0wyiePaouw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Techcrunch?d=yIl2AUoC8zA" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Techcrunch/~4/e6S8JRgHDjU" height="1" width="1" /&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-2114178728875416157?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://feedproxy.google.com/~r/Techcrunch/~3/e6S8JRgHDjU/' title='The Truth: What’s Really Going On With Apple, Google, AT&amp;T And The FCC'/><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/2114178728875416157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=2114178728875416157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2114178728875416157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/2114178728875416157'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2009/08/truth-whats-really-going-on-with-apple.html' title='The Truth: What’s Really Going On With Apple, Google, AT&amp;T And The FCC'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-1460805016610453661</id><published>2008-02-09T19:03:00.000-08:00</published><updated>2008-02-09T19:51:30.925-08:00</updated><title type='text'>Rails Error : ActiveRecord::AdapterNotSpecified</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xeiel9jmdwI/R65vlpl6uEI/AAAAAAAAALg/w2a5gTEG4rs/s1600-h/RoR_error.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_xeiel9jmdwI/R65vlpl6uEI/AAAAAAAAALg/w2a5gTEG4rs/s400/RoR_error.jpg" alt="" id="BLOGGER_PHOTO_ID_5165188515251271746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I was playing a bit with Ruby on Rails (RoR). Till now the experience (I am a newbie) has been great with this framework !&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When tried generating a model (User) ,received  this error:-&lt;br /&gt;&gt;ruby script/generate model User&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_a&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;dapters/abstract/connection_specification.rb:217:in `establish_connection': deve&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;lopment database is not configured (ActiveRecord::AdapterNotSpecified)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;/connection_adapters/abstract/connection_specification.rb:208:in `establish_conn&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;ection'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:234:i&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;n `initialize_database'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:94:in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt; `process'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt; `send'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt; `run'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/Projects/Personal/Rails/rails_space/config/environment.rb:13&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;m_original_require'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;quire'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/generate.rb&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;:1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;m_original_require'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;quire'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;        from script/generate:3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;Searched a bit over the net, and was sure that there is some problem with my database.yml file.&lt;br /&gt;&lt;br /&gt;Couldn't find anything concrete, as I checked to make sure that there is no "tab" space used in the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The culprit was the indentation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the figure, can you  see the difference? In the first case, the arguments after the"development" are properly indented (one space). In the second case, since there is no such indentation, the interpreter attempts to consider "adapter" (and the rests) at the same level as the "development". Try to avoid that.&lt;br /&gt;&lt;br /&gt;Hopefully it will save other's efforts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-1460805016610453661?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/1460805016610453661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=1460805016610453661' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1460805016610453661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/1460805016610453661'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2008/02/rails-error-activerecordadapternotspeci.html' title='Rails Error : ActiveRecord::AdapterNotSpecified'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xeiel9jmdwI/R65vlpl6uEI/AAAAAAAAALg/w2a5gTEG4rs/s72-c/RoR_error.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-3840212569882757805</id><published>2007-11-03T17:57:00.000-07:00</published><updated>2007-11-03T18:10:08.827-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='safari'/><title type='text'>Strange File Upload Problem in safari</title><content type='html'>Last week one of the front end developer from my team mailed us the problem he was getting while trying to upload a file in Safari 3.0.3 on windows. He sent that, because he was getting some null pointer exception from the server (500 Error). Although, it was running perfectly on Firefox and IE.&lt;br /&gt;&lt;br /&gt;Unfortunately, I had not the access to the server side code. However, the NPE suggested that something is not being passed to the server side.&lt;br /&gt;&lt;br /&gt;After a little search got to this link http://www.webmasterworld.com/macintosh_webmaster/3300569.htm, which suggests:-&lt;br /&gt;&lt;span style="font-style: italic;font-family:verdana;font-size:85%;color:#000000;" class="mo"   &gt;This happens if you set display:none in your onsubmit function, which is often used to hide the form during the upload.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After avoiding "display:none", the problem was fixed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-3840212569882757805?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/3840212569882757805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=3840212569882757805' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3840212569882757805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/3840212569882757805'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2007/11/strange-file-upload-problem-in-safari.html' title='Strange File Upload Problem in safari'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-860338214518425382</id><published>2007-01-01T03:31:00.000-08:00</published><updated>2007-01-01T04:13:22.863-08:00</updated><title type='text'>Read books in chunks, delivered to your inbox</title><content type='html'>&lt;div style="text-align: justify;"&gt;Too busy to find time to read books daily ? How about&lt;br /&gt;reading it in chunks ? Wouldn't it be gr8, if someone&lt;br /&gt;mails you the chunk as per your wish&lt;br /&gt;(daily or on weekdays) ?&lt;br /&gt;&lt;br /&gt;I came across a site called &lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.dailylit.com/"&gt;DaliyLit&lt;/a&gt;&lt;/span&gt;, which does&lt;br /&gt;exactly this. I appreciate the idea. And yes, they have got&lt;br /&gt;a good collection of the books available to be read as&lt;br /&gt;well.&lt;br /&gt;&lt;br /&gt;Give it a try ! All the best !&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-860338214518425382?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/860338214518425382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=860338214518425382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/860338214518425382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/860338214518425382'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2007/01/read-books-in-chunks-delivered-to-your.html' title='Read books in chunks, delivered to your inbox'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-8210251293317124902</id><published>2006-12-26T22:26:00.000-08:00</published><updated>2006-12-26T22:40:31.120-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech'/><title type='text'>Custom Search for MyReader</title><content type='html'>I used the &lt;span style="font-weight:bold;"&gt;Google Reader&lt;/span&gt; to organize my feeds of the various blogs, I frequently browse through. It is really more manageable now, and I don't have to check to their sites quite often to check, if some new post exists ? It is similar to &lt;span style="font-weight:bold;"&gt;Observer Pattern&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt; ;-)&lt;br /&gt;&lt;br /&gt;Any way, although, I have just 13 feeds as of yet, but felt the need to search within these 13 feeds. &lt;br /&gt;&lt;br /&gt;Here goes my own custom search engine made using &lt;a href="http://www.google.com/coop"&gt;Google co-op&lt;/a&gt; :- &lt;a href="http://www.google.com/coop/cse?cx=012930118180063357438%3Aiezv6mzm8mc"&gt;My Reader Search Engine&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Thanks to this article :- &lt;a href="http://googlesystem.blogspot.com/2006/12/how-to-add-search-to-google-reader.html"&gt; How to Add Search to Google Reader&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Life seems a bit better now :-) !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-8210251293317124902?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/8210251293317124902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=8210251293317124902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/8210251293317124902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/8210251293317124902'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2006/12/custom-search-for-myreader.html' title='Custom Search for MyReader'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-612275289405565943.post-562301632230143674</id><published>2006-12-26T08:24:00.000-08:00</published><updated>2006-12-26T08:30:29.705-08:00</updated><title type='text'>My Album</title><content type='html'>I took sometime to organize my pics (Thanks to &lt;span style="font-weight:bold;"&gt;Gurpreet&lt;/span&gt; for sending me the pics)  using the &lt;span style="font-weight:bold;"&gt;picasa&lt;/span&gt; . Did some experimentation with the same, and found it to be quite good :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, here goes the album :-&lt;br /&gt;&lt;div style="text-align:center;width:194px;font-family:arial,sans-serif;font-size:83%"&gt;&lt;div style="height:194px;background:url(http://picasaweb.google.com/f/img/transparent_album_background.gif) no-repeat left"&gt;&lt;a href="http://picasaweb.google.com/anshu.mishra/Anshu"&gt;&lt;img src="http://lh3.google.com/image/anshu.mishra/RY_Zpx69bhE/AAAAAAAAAEE/CX-CnoZVW3c/s160-c/Anshu.jpg" width="160" height="160" style="border:none;padding:0px;margin-top:16px;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://picasaweb.google.com/anshu.mishra/Anshu"&gt;&lt;div style="color:#4D4D4D;font-weight:bold;text-decoration:none;"&gt;Anshu&lt;/div&gt;&lt;/a&gt;&lt;div style="color:#808080"&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Click the pic to see the album !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/612275289405565943-562301632230143674?l=anshu-manymoods.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://anshu-manymoods.blogspot.com/feeds/562301632230143674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=612275289405565943&amp;postID=562301632230143674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/562301632230143674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/612275289405565943/posts/default/562301632230143674'/><link rel='alternate' type='text/html' href='http://anshu-manymoods.blogspot.com/2006/12/my-album.html' title='My Album'/><author><name>Anshu</name><uri>http://www.blogger.com/profile/18379710357924026688</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://lh6.google.com/image/anshu.mishra/RY_bnR69b1I/AAAAAAAAAC4/tNs2tufqARQ/DSC00463.jpg?imgmax=144'/></author><thr:total>0</thr:total></entry></feed>
