Sandeep Soni's Blog
https://blogs.oracle.com/insidemyhead/
Blog for insidemyheaden-usCopyright 2011Thu, 20 Oct 2011 05:02:17 +0000Apache Roller BLOGS401ORA6 (20130904125427)https://blogs.oracle.com/insidemyhead/entry/the_men_who_killed_gandhiThe Men Who Killed Gandhiinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/the_men_who_killed_gandhi
Mon, 21 Dec 2009 08:47:22 +0000Personal
<p><p> <img src="/insidemyhead/resource/mwkg.jpg" style="padding: 5px; width: 216px; height: 288px; float: left;" /><br /></p> <br/>
<p> </p> <br/>
<p> </p> <br/>
<div align="justify"> <br/>
<p>Just finished reading the book "The Men Who killed Gandhi" by Manohar Malgonkar and I was totally delighted to read this brilliant book. Basically if you are interested in Indian history and want to feel the real feeling or the general mood of the country during the 1947-1948 period ( which incidentally was one of the major influential periods of Indian history ), this is one of the best books to take you through that crucial period. The book takes a deep dive into the lives of the people involved in the murder of Mahatma Gandi. These people being Nathuram Vinayak Godse, Narayan Apte, Vishnu Karkare, Madanlal Pahwa, Badge and Shankar Kishtayyia. It goes deep into the personal lives of these folks, how they lived, and their personalities, what went on in their heads during the 1948 times, the effect of partition, release of the 55 crores to Pakistan, how they planned the murder of Mahatma Gandhi. It goes deep into the initial plan to kill Mahatma Gandhi on 20 Jan 1948 and how that failed. And even though sufficient clues were there for the police to pickup and their awareness of a plan to kill Gandhiji by the 24th of Jan 1948 and even then the folks succeeded in killing Gandhiji.<br/>
</p> <br/>
</div><br/>
<p><br/>
The book is extremely honest, unbiased and feels like a thriller novel. The best thing i found about the book is that it gives the facts and tries to present a true picture of pulse of the country at that time, and it does so without taking sides.<br/>
</p> <br/>
<p> <br/>
This is a MUST read for all who are interested to know the facts behind why Gandhiji got murdered. And even today, why the close relatives and friends of Nathuram Godse and the others involved in this gruesome act, still regard the murderers as 'martyrs' who gave away their lives for a 'noble' cause.<br/>
</p> <br/>
<p> The book contains some very exclusive unpublished photographs. Going to buy this book as I feel it is a treasure.</p></p>
https://blogs.oracle.com/insidemyhead/entry/charting_portlet_using_jsr_286Charting Portlet using JSR-286insidemyhead
https://blogs.oracle.com/insidemyhead/entry/charting_portlet_using_jsr_286
Wed, 2 Jan 2008 06:58:33 +0000Personaljsr-286portalportletprogrammingresourceserve
<p><p>A while ago I had written an <a href="http://developers.sun.com/portalserver/reference/techart/jfreechart.html">SDN article</a> on how to generate charts dynamically in portlets. Following up on that, I have created a portlet that uses the JSR-286 feature of serve resources, to dynamically generate charts by reading its data from a JDBC compliant database. The essential feature of this portlet is that the image is generated dynamically and served via a serve resource call and isn't stored in any temporary location. The portlet can be run under any portlet container that supports JSR-286 specification. It has been tested on <a href="http://portlet-container.dev.java.net">OpenPortal Portlet Container</a> which supports the draft 19 of the JSR_286 specification. You can download the portlet war file from <a href="http://bevy.googlecode.com/files/Jsr286ChartPortlet.war">here</a>.<br /></p><p><img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/images/jsr286-chart-portlet.PNG" /><br /><br /><br /> </p></p>
https://blogs.oracle.com/insidemyhead/entry/flex_or_ajax_well_bothFlex or Ajax .. well both!insidemyhead
https://blogs.oracle.com/insidemyhead/entry/flex_or_ajax_well_both
Mon, 6 Aug 2007 20:27:17 +0000Personalajaxflexria
<p><p><br/>
The release of Flash Player 9 included a new External API using a class file called the ExternalInterface that allows for the communication between JavaScript and Flash applications. To create the communication link and pass data between JavaScript and Flex, the developer had to create custom code to handle each call. <br /><br />The newly introduced Flex-Ajax Bridge has simplified the usage of this API. By simply including the necessary classes, the bridge exposes all of the classes within the Flex application to JavaScript. You can almost create anything in your Flex application using JavaScript instead of ActionScript.</p><p>So if you are a JavaScript pro and want to try out Flex this is a good time to do so!<br /><br /></p></p>
https://blogs.oracle.com/insidemyhead/entry/update_flex_up_your_portletsUpdate: Flex up your portletsinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/update_flex_up_your_portlets
Thu, 2 Aug 2007 23:57:27 +0000Personalflexportletria
<p><p>A while ago I had talked about Rich Internet Applications on my blog and talked in detail about Flex. You can read that entry <a href="http://blogs.sun.com/insidemyhead/entry/flex_up_your_portlets">here</a>. I had promised to put a tutorial/entry on how to create a portlet out of your Flex application, but <font color="#ff0000"><font color="#000000">I<br/>
didn't get time to post the entry. </font></font></p><p><font color="#ff0000"><font color="#000000">Recently, I helped my colleague Murali on getting his Flex app converted to a portlet and he has been prompt enough to post the instructions on his blog <a href="../../PortalMusings/entry/flexify_your_portlets">here</a>. Thanks Murali.</font></font><br/>
</p></p>
https://blogs.oracle.com/insidemyhead/entry/a_solution_maths_fun_againA Solution: Maths Fun Again.. Againinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/a_solution_maths_fun_again
Wed, 1 Aug 2007 08:52:33 +0000Personalfunmaths
<p><p>So the solution to my <a href="http://blogs.sun.com/insidemyhead/entry/maths_fun_again_again">previous </a>entry and the one <a href="http://blogs.sun.com/insidemyhead/entry/maths_fun_again">prior</a> to that was provided by a few folks as (root 2), which is actually quite trivial in my opinion. The actual question that has been bothering me was what i posted in the comments to whatever few replies i got: </p><p>That is , what actually is <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2.gif" />. If the answer to both questions (blog entries) is <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/root2.gif" />, then how come <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2.gif" />is 2 as per my <a href="http://blogs.sun.com/insidemyhead/entry/maths_fun_again">first</a> blog entry and equal to 4 as per the <a href="http://blogs.sun.com/insidemyhead/entry/maths_fun_again_again">second</a> entry. This is the one I was actually looking for an answer to. I have kind of an idea what it could be, I will put my explanation here, and hopefully it makes some sense.</p><p><img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2.gif" />is actually limit of the sequence <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/root2.gif" />,<img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2-once.gif" />,<img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2-twice.gif" /> ... </p><p>It is trivial to prove that the above sequence is increasing and is upper bounded by 2.</p><p>Coming back to the original question (the previous two blog entries marked above) which can be rewritten as <img vspace="0" hspace="0" border="0" align="bottom" src="../../insidemyhead/resource/maths/x-equals-yth-root-of-y.png" />.</p><p> I tried to plot the graph of this function and it comes out as follows:</p><p><img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/x-raised-to-itself-infintely.png" /><br /> </p><p>This proves that given a value of x, there are two values for y. And for x = <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/root2.gif" />, we know these values are 2 and 4. But we just indicated above that the sequence <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2.gif" />is upper bounded by 2. So the value 4 can't be possible for <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/maths/root-raised-to-root2.gif" />.</p><p> </p><p>Hope it makes some sense.</p><p><br /></p></p>
https://blogs.oracle.com/insidemyhead/entry/maths_fun_again_againMaths Fun Again .. Againinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/maths_fun_again_again
Fri, 27 Jul 2007 08:47:52 +0000Personalfunmaths
<p><p>Some of the folks answered this in the comments to my <a href="http://blogs.sun.com/insidemyhead/entry/maths_fun_again">previous</a> entry as the answer to x being equal to <img vspace="0" hspace="0" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/root2.gif" />. However if that is true then what is the value of x in the following equation? <br /></p><p><img width="94" vspace="0" hspace="0" height="58" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/equation-2.png" /> </p><p>Getting interesting now I guess :-)<br /><br/>
</p></p>
https://blogs.oracle.com/insidemyhead/entry/maths_fun_againMaths Fun Againinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/maths_fun_again
Fri, 20 Jul 2007 07:47:43 +0000Personalfunmath
<p><p>Given that : </p><p><img width="87" vspace="0" hspace="0" height="54" border="0" align="bottom" src="http://blogs.sun.com/insidemyhead/resource/equation.png" /></p><p>What is the value of x?<br/>
</p></p>
https://blogs.oracle.com/insidemyhead/entry/locker_mania_answerLocker Mania - Answerinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/locker_mania_answer
Fri, 20 Jul 2007 00:20:07 +0000Personalmath
<p><p>Although there were solutions to this provided by Murali and Eric in the comments section and they are correct. Just posting it here for more general viewing. BTW, I went through the C program written by Eric, it was really nicely written program with neat output as well. Really nice!</p><p> Anyway back to the answer.</p><p>The state of any locker N will remain unchanged from the beginining as long as N = P \* Q, and P and Q happen to be distinct (There can be multiple combinations of P and Q). That means, given the 10th locker, its state will be toggled by the 1st and the 10th member. Its state will again be toggled by the 2nd member and then again by the 5th member, thus its state remaining unchanged. This is since the factors of 10 are (1,10) and (2,5)<br /></p><p> For locker number N where N =P\*Q, and P and Q are same, i.e locker numbers which are perfect squares, there will only be one state change and hence are the ones which will remain open in the end.</p><p>Example, locker number 9. Its state will be changed by (1,9) member and again by the (3,3). But since the 3rd member can only toggle once, we can see that the state if the 9th locker will be open ultimately. Same for all perfect squared numbered locker till 100.<br /><br /> </p></p>
https://blogs.oracle.com/insidemyhead/entry/locker_maniaLocker Maniainsidemyhead
https://blogs.oracle.com/insidemyhead/entry/locker_mania
Tue, 17 Jul 2007 07:10:01 +0000Personalfunmathspuzzle
<p>There is a locker room in the club and they are numbered from 1 to 100. There are 100 members of the club who will enter the locker room in the following sequence. When the first member enters, he opens all the lockers. When the second member enters the locker room, he closes all even numbered lockers. When the next member enters the room, he toggles the state of every locker which is a multiple of 3.<br /><br /> This process continues till all the 100 members have been through the locker room. At the end of this process, which are the lockers that are open?<br /> </p>
https://blogs.oracle.com/insidemyhead/entry/secure_remote_access_sra_inSecure Remote Access (SRA) in 7.1insidemyhead
https://blogs.oracle.com/insidemyhead/entry/secure_remote_access_sra_in
Wed, 11 Jul 2007 10:29:19 +0000Personalaccesscacaofirewallremotesecuresra
<p><p>Sun Java Systems Enterprise Secure Remote Access version 7.x</p><br/>
<p>The 7.0 release of Portal Server saw the introduction of the JMX Administration. All administrative interfaces in portal now used mbeans to manage the various servers and configuration. A single command line interface was provided for all the administrative activities ( viz. psadmin). The Portal Admin Server (PAS) is the admin server that holds all the configuration of the various mbeans known to the JMX Server. The PAS held its configuration/bootstrap information in LDAP. </p><br/>
<p>Gateway, the main workhorse of Secure Remote Access (SRA) component of Sun's JES stack, resides in the DMZ ( De Militrized Zone) and hence doesnt or rather shouldn't have direct access to LDAP which is inside the corporate firewall. So as a workaround in 7.0 there was a requirement of installation of a local directory server on the Gateway host. This directory server was not required by the Gateway process per se, but was required to bootstrap the administrative interface of Portal Server (PAS). This local directory server contained only the bootstrap information to startup PAS and nothing else. Once the GW is started up using psadmin, this local directory server on the gateway node could very well be shut off and that wouldn't affect the gateway at all. This (installation of a local directory) however was a major restriction and was a big no no.</p><br/>
<p>So in 7.1, release this restriction was done away with. The PAS module on the local gateway box uses a file based JNDI mechanism to load its configuration information and hence no need for a local LDAP on the gateway box. So far so good.</p><p>However it recently came to my attention that there was a bug in which it was reported that the LDAP port between GW and the Portal Server was required to be opened. I have traced the issue down and have done the fix for that. It should be checked in by EOD tomorrow. Once this fix is done in the code<br/>
base and the product patched with the fix, the flow of traffic from an administrative perspective should follow exactly the diagram below.<br /></p><br/>
<p>So in 7.1 the scenario, as far as the GW, Portal nodes and the firewall is concerned looks pretty much like this. Note this figure is only for as far as the administration of GW is concerned. What I mean by that is, executing of any SRA related psadmin commands on the gateway node. Once the step 8 is completed in the figure below, the gateway starts up and starts serving pages from the portal ( ofcourse the HTTP/HTTPS port for the portal server needs to be opened in the firewall as well, but like I mentioned the figure essentially talks about the admin interface only.)</p></p>
<p><p><img vspace="0" hspace="0" border="0" src="http://blogs.sun.com/insidemyhead/resource/sra-cacao-firewall-config.png" /></p><br /></p>
https://blogs.oracle.com/insidemyhead/entry/possible_answer_to_the_123Possible answer to the 123 black holeinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/possible_answer_to_the_123
Tue, 3 Jul 2007 02:09:27 +0000Personal
<p><p>Here is a explanation of the mathemagical black hole (123) in my opinion. If we consider the transformation on x as a function f(x), such that f(x) = E(x) O(x) T(x)</p><p>where E(x) = Number of even digits in x, O(x) = Number of odd digits in x and T(x) = Number of digits in x</p><p>Then for all x, </p><p>f(x) < x</p><p>So eventually as we recurse this process, at some point f(x) will fall below 1000. In that case the only possibilities for E(x) O(x) and T(x) are</p><p>1 2 3</p><p>2 1 3</p><p>3 0 3 </p><p>Each of the above in the next iteration will give 123. Hence the proof. </p><p><br /><br /> </p></p>
https://blogs.oracle.com/insidemyhead/entry/another_mathemagical_black_holeAnother Mathemagical Black Holeinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/another_mathemagical_black_hole
Mon, 2 Jul 2007 07:19:44 +0000Personalblackholemathematics
<p><p>Read about another mathemagical black hole.. Really interesting one. </p><p>Take any natural number, treat it as a string. For example: 24,89,62,698.</p><ol><li>Count the number of even digits. In this case 7 even digits.</li><li>Count the number of odd digits. In this case 2</li><li>Count the total number of digits. In this case 9</li></ol><p>So the new number now is 729. Repeat the above process. Even digits (1), odd digits (2), total digits (3). So the new number is 123. And now any more iterations will return 123 only. So in this case 123 is the mathemagical black hole.</p><p> All numbers in this universe are drawn to the number 123 by this process. Never to escape. Try it out. <br /></p><p><br /></p></p>
https://blogs.oracle.com/insidemyhead/entry/answerA Solution: Playing with numbersinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/answer
Sun, 24 Jun 2007 23:10:20 +0000Personal
<p><p>Consider the original binary bits, keep the bits in pairs of 2 for beginning. </p></p>
<p><p>First set each 2-bit field equal to the sum of the two single bits that were originally in the field. Then sum adjacent 2-bit fields, putting the results in each 4-bit field, and so on. The original problem (summing 16 bits) is divided into two problems (summing 8 bits), which are solved separately, and the results are added. The strategy is applied recursively, breaking the 8-bit fields into 4-bit fields, and so on.</p></p>
<p><p>So solving the above problem, the original number is 0xCF39. Write it down as binary keeping adjacent bit together as below.</p></p>
<p><pre>11 00 11 11 00 11 10 01<br /></pre></p>
<p><p><br/>
As indicated earlier, sum up the pairs above (binary) and put the results back in the individual two bit fields as follows.</p></p>
<p><pre>10 00 10 10 00 10 01 01<br /></pre><br/>
<p><br/>
Now combine these numbers in blocks of 4 as follows and repeate the process of summing the two two bit numbers and putting the result back in the 4 bit fields as below.</p></p>
<p><pre>1000 1010 0010 0101<br />0010 0100 0010 0010<br /><br /></pre></p>
<p><p><br/>
Next, repeat the process by pairing the numbers in blocks of 8 and adding the two 4 bit numbers and placing the result back in the 8 bit block as below.</p></p>
<p><pre>00100100 00100010<br />00000110 00000100<br /></pre></p>
<p><p><br/>
And lastly repeat the process by adding the two 8 bit numbers above and placing the result in the 16 bits as below and that is the sum of all the <br /><br/>
1's in your original number i.e 0xCF39</p><br/>
<pre>0000000000001010 ----> Decimal 10.</pre><br/>
<p><br/>
The above strategy makes the original problem of summing 1's in a 16 digit number complete in 4 discrete steps. Point to note is that each of these steps of determining adjacent bits and summing them at each step can be done in parallel. Hence making the operation an order 4 operation ( i.e Log <sub>2 </sub>(16) = 4 steps ).</p><p> It should be easy to write this recursive loop in any decent high level language... give it a shot!<br /> </p></p>
https://blogs.oracle.com/insidemyhead/entry/playing_with_numbersPlaying with numbers.insidemyhead
https://blogs.oracle.com/insidemyhead/entry/playing_with_numbers
Wed, 20 Jun 2007 21:36:41 +0000Personalbinarycoutingmaths
<p>Consider that you have a 32 bit machine and you have a number such as say Hex CF39. How would you go about counting the number of 1's in the binary representation of this number? In other words, the binary representation of CF39 is 1100111100111001. What is needed is a way to count the number of 1's in this number i.e the answer should be 10.[ Your 32 bit machine doesn't have an instruction that can do this :-) ]</p>
https://blogs.oracle.com/insidemyhead/entry/mathematical_black_holeMathematical Black Holeinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/mathematical_black_hole
Mon, 26 Mar 2007 23:16:44 +0000Personalblackfunholemathematics
<p>A mathematical black hole is, defined non mathematically, any number to which other elements (usually numbers) are drawn by some stated process. Though the number itself is the star of the show, the real trick is in finding interesting processes which make this "star".<br /><br />Following is one example of the Mathemagical Black Hole by Martin Gardner. Take any whole number and write out its numeral in English, such as FIVE for the usual 5. Count the number of characters in the spelling. In this case, it is 4 — or FOUR. Number of characters in the spelling is 4. Repeat with 4 to get 4 again. So here the number 4 is the mathemagical black hole.<br /><br />Just to prove it is not a lie, Another example lets take the number 155. <br />ONE HUNDRED FIFTY FIVE : Number of characters = 19<br />NINETEEN : Number of characters = 8<br />EIGHT : Number of characters = 5<br />FIVE : Number of characters = 4<br /><br />And we repeat from here. Interesting!<br /><br /></p>
https://blogs.oracle.com/insidemyhead/entry/personal_blog_sitePersonal Blog Siteinsidemyhead
https://blogs.oracle.com/insidemyhead/entry/personal_blog_site
Wed, 21 Mar 2007 03:14:45 +0000Personal
<p>I added a bookmark for my personal blog at the right of the page. Visit it <a href="http://sonisandeep.blogspot.com/">here</a><br /></p>
https://blogs.oracle.com/insidemyhead/entry/percentages_applied_successivelyPercentages Applied Successively ...insidemyhead
https://blogs.oracle.com/insidemyhead/entry/percentages_applied_successively
Sun, 18 Mar 2007 06:12:18 +0000Personalmath
<p><p>Came across a nice simple problem but an alternative insightful solution to it as well. I quite liked it. So posting it here.</p><p>Wanting to buy a coat, Lisa is faced with a dilemma. Two competing stores next to each other carry the same brand coat with the same list price, but with two different discount offers. Store A offers a 10% discount year round on all its goods, but on this particular day offers an additional 20% on topof its already discounted price. Store B simply offers a discount of 30% on that day in order to stay competitive. How many percentage points difference is there between the two options open to Lisa? Which one should she go for?</p><p> <br /></p><h3>Discussion</h3><p>Assume the cost of the coat to be 100,calculate the 10% discount,yielding 90 as the price,and an additional 20% on 90 (or 18) will bring the price down to 72. In store B, the 30% discount on 100 would bring the price down to 70,giving a discount difference of 2,which will be 2%.</p><p>Correct procedure. But came across another insightful way :</p><p>Here is a mechanical method for obtaining a single percentage discount equivalent to two (or more) successive discounts.</p><p>1. Change each of the percentages involved into decimal form: .20 and .10.<br />2. Subtract each of these decimals from 1.00: .80 and .90<br />3. Multiply these differences: .8 \* .9 = .72</p><p>4. Subtract back from 1.00: 1.00-.72 = .28</p><p>5. Convert it back to percentage i.e 28%</p><p>So the store A's successive discounts of 20% and 10% is actually a cumulative discount of 28%. The store B's discount is 30%. The difference again as proven earlier is 2%.</p><p>This procedure not only streamlines a typically cumbersome situation, but also provides some insight into the overall picture. For example,the question "Is it advantageous to the buyer in the above problem to receive a 20% discount and then a 10% discount,or the reverse,a 10% discount and then a 20% discount?". Since the procedure shown above clearly indicates that the calculation is merely multiplication, a commutative operation, we can immediately tell that there is no difference between the two. </p></p>