<?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-6078706</id><updated>2012-02-05T18:43:17.626Z</updated><category term='moody'/><title type='text'>codeWord - Thoughts on Software</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default?start-index=101&amp;max-results=100'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>575</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6078706.post-3096195163346664211</id><published>2012-01-19T21:40:00.000Z</published><updated>2012-01-19T21:40:18.434Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='moody'/><title type='text'>Simplicity</title><content type='html'>&lt;blockquote&gt;Simplicity is the ultimate sophistication - Leonardo da Vinci&lt;/blockquote&gt;Rich Hickey presented a fantastic talk, &lt;a href="http://www.infoq.com/presentations/Simple-Made-Easy"&gt;Simple made easy&lt;/a&gt; - "Rich Hickey emphasizes simplicity’s virtues over easiness', showing that while many choose easiness they may end up with complexity, and the better way is to choose easiness along the simplicity path."&lt;br /&gt;&lt;br /&gt;Anders Hejlsberg mentioned &lt;a href="http://www.artima.com/intv/simplexity.html"&gt;simplexity&lt;/a&gt; in an interview a while back as well where he says "Let me first talk a little bit about how I view simplicity in general. No one ever argues that simplicity isn't good, but people define simplicity in a variety of ways. There's one kind of simplicity that I like to call &lt;i&gt;simplexity&lt;/i&gt;. When you take something incredibly complex and try to wrap it in something simpler, you often just shroud the complexity. You don't actually design a truly simple system. And in some ways you make it even more complex, because now the user has to understand what was omitted that they might sometimes need. That's simplexity. So to me, simplicity has to be true, in the sense that the further down you go the simpler it gets. It shouldn't get more complicated as you delve down."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Over time I have seen quite a few systems with too much complexity. And mostly it was not needed. Just a lot of code added without too much thought to design. More thought should be put into design and refractoring and testing.&lt;br /&gt;&lt;br /&gt;It is also funny how this parallels to a sense of &lt;a href="http://en.wikipedia.org/wiki/Minimalism"&gt;minimalistic design&lt;/a&gt; for design and architecture.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-3096195163346664211?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/3096195163346664211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=3096195163346664211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/3096195163346664211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/3096195163346664211'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2012/01/simplicity.html' title='Simplicity'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-4982678012569343685</id><published>2011-11-23T03:37:00.001Z</published><updated>2011-11-23T03:47:16.671Z</updated><title type='text'>Installing mercurial on CentOS or RHEL 4</title><content type='html'>For mercurial/hg you need a relatively new version of python installed. Since that is not available as an rpm let's compile the source.&lt;br /&gt;&lt;br /&gt; From http://python.org/download/ download a python source version like http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz&lt;br /&gt;&lt;br /&gt;From http://mercurial.selenic.com/release/ download a mercurial source drop like http://mercurial.selenic.com/release/mercurial-1.7.5.tar.gz&lt;br /&gt;&lt;br /&gt;Run the following commands as root:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#Install some dependencies&lt;br /&gt;yum install zlib-devel.i386 ncurses-devel.i386 openssl-devel.i386 readline-devel.i386 bzip2-devel.i386&lt;br /&gt;&lt;br /&gt;#Extract the python code&lt;br /&gt;tar xvzf Python-2.7.2.tgz&lt;br /&gt;cd Python-2.7.2&lt;br /&gt;&lt;br /&gt;# Python will be installed in /opt/python27&lt;br /&gt;make clean; ./configure --prefix=/opt/python27; make; make install&lt;br /&gt;cd ..&lt;br /&gt;&lt;br /&gt;# Extract the mercurial code&lt;br /&gt;tar xvzf mercurial-1.7.5.tar.gz&lt;br /&gt;cd mercurial-1.7.5&lt;br /&gt;&lt;br /&gt;#Python will be installed in /opt/hg17&lt;br /&gt;make install PYTHON=/opt/python27/bin/python PREFIX=/opt/hg17&lt;br /&gt;&lt;br /&gt;#Add new python and mercurial to PATH&lt;br /&gt;export PATH=/opt/python27/bin:/opt/hg17/bin:$PATH&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/6078706-4982678012569343685?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/4982678012569343685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=4982678012569343685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/4982678012569343685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/4982678012569343685'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2011/11/installing-mercurial-on-centos-or-rhel.html' title='Installing mercurial on CentOS or RHEL 4'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-1846576686828564230</id><published>2011-06-14T21:26:00.000Z</published><updated>2011-06-14T21:26:41.729Z</updated><title type='text'>Java7 Automatic resource management</title><content type='html'>&lt;b&gt;ARM:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One of the useful features in Java7 is the Automatic resource management via the try-with-resources statement.&lt;br /&gt;&lt;br /&gt;In the olden days thou would (or atleast were supposed to) code like:&lt;br /&gt;&lt;pre class="brush: java"&gt;void doSomething() throws IOException {&lt;br /&gt;  OutputStream out = null;&lt;br /&gt;  try {&lt;br /&gt;    out = new FileOutputStream("");&lt;br /&gt;    out.write(data);&lt;br /&gt;  } finally {&lt;br /&gt;    if (out != null) {&lt;br /&gt;      out.close();&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which is error prone if you do forget to close the resources.&lt;br /&gt;&lt;br /&gt;The new way is:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;void doSomethingNew() throws IOException {&lt;br /&gt;  try (OutputStream out = new FileOutputStream("")) {&lt;br /&gt;    out.write(data);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is syntactically much more pleasing and does the right thing internally.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Going deep&lt;/b&gt;:&lt;br /&gt;The try-with syntax works with any &lt;a href="http://download.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html"&gt;AutoCloseable&lt;/a&gt; implementation and you can have multiple resources as well.&lt;br /&gt;&lt;br /&gt;The compiler will transform the above code into something like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;void doSomethingNew() throws IOException {&lt;br /&gt;  OutputStream out = null;&lt;br /&gt;  Throwable localThrowable1 = null;&lt;br /&gt;  try {&lt;br /&gt;    out = new FileOutputStream("");&lt;br /&gt;    out.write(blah);&lt;br /&gt;  } catch (Throwable localThrowable2) {&lt;br /&gt;    // We keep a reference to which can add a suppressed exception&lt;br /&gt;    localThrowable1 = localThrowable2;&lt;br /&gt;    throw localThrowable2;&lt;br /&gt;  } finally {&lt;br /&gt;    if (out != null) {&lt;br /&gt;      if (localThrowable1 != null) {&lt;br /&gt;        // Already have an exception thrown&lt;br /&gt;        try {&lt;br /&gt;          out.close();&lt;br /&gt;        } catch (Throwable localThrowable3) {&lt;br /&gt;          // Add the suppressed exception during close&lt;br /&gt;          localThrowable1.addSuppressed(localThrowable3);&lt;br /&gt;        }&lt;br /&gt;      } else {&lt;br /&gt;        // Potentially throw an IOException due to failure when close'ing&lt;br /&gt;        out.close();&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The pattern is:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If there are no exception - close() in the finally block OR&lt;/li&gt;&lt;li&gt;If there are no exception during operation but there is an exception during close() then throw it OR&lt;/li&gt;&lt;li&gt;If there is an exception thrown then throw it after closing the resource OR&lt;/li&gt;&lt;li&gt;If there is an exception1 thrown then throw it .. and if there is an exception2 closing the resource.. then exception1.addSuppressed(exception2). This is new in the&lt;a href="http://download.oracle.com/javase/7/docs/api/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)"&gt;Throwable&lt;/a&gt; class&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Sidenote&lt;/b&gt;:&lt;br /&gt;There was a huge effort to get closures into Java7 but none of the solutions was light on syntax/complexity. After the backlash over Generics a smaller but better step has been taken.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sidenote++&lt;/b&gt;:&lt;br /&gt;For scala see &lt;a href="http://stackoverflow.com/questions/2207425/what-automatic-resource-management-alternatives-exists-for-scala/2219494#2219494"&gt;using&lt;/a&gt;. You do not need to wait for language changes to make syntactically pleasing APIs because of curry-ing and other fancy stuff.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;More References&lt;/b&gt;:&lt;br /&gt;&lt;a href="http://blogs.oracle.com/darcy/entry/project_coin_updated_arm_spec"&gt;ARM spec&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html"&gt;Article on ARM&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-1846576686828564230?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/1846576686828564230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=1846576686828564230' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/1846576686828564230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/1846576686828564230'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2011/06/java7-automatic-resource-management.html' title='Java7 Automatic resource management'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-541765024877364509</id><published>2011-02-23T19:51:00.000Z</published><updated>2011-02-23T19:51:03.457Z</updated><title type='text'>Beautiful software</title><content type='html'>&amp;lt;moody&amp;gt;&lt;br /&gt;I feel a deep sense of happiness when I use Google products like gmail and chrome. Every now and then they update the applications and things just work. They make things look so simple but they must be super complex in the back. That's great software. &lt;br /&gt;&lt;br /&gt;Great software can only be built by great teams. That means everyone from engineers to managers. Give enough freedom to the team to execute. Treat them like people. Understand software.&lt;br /&gt;&lt;br /&gt;No software methodology can save you. Let the team define its processes. Let common sense prevail. And then greatness will follow.&lt;br /&gt;&amp;lt;/moody&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-541765024877364509?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/541765024877364509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=541765024877364509' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/541765024877364509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/541765024877364509'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2011/02/beautiful-software.html' title='Beautiful software'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-8406890557860346891</id><published>2011-01-04T18:54:00.009Z</published><updated>2011-01-04T19:14:02.395Z</updated><title type='text'>Where did the class get loaded from?</title><content type='html'>&lt;div&gt;As with most enterprise apps gone crazy you have a bunch of duplicate jars or some jars at places you don't even know were in the classpath. And once a while you need to know from which jar a particular class file was loaded. To find this out run java with the -verbose:class flag. For each class loaded, the VM will print out the folder or jar where the class was found.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;~ $ java -verbose:class HelloWorld&lt;br /&gt;...&lt;br /&gt;[Loaded HelloWorld from file:/C:/work/cygwin/home/rrevo/]&lt;br /&gt;Hello World&lt;br /&gt;[Loaded java.lang.Shutdown from shared objects file]&lt;br /&gt;[Loaded java.lang.Shutdown$Lock from shared objects file]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Read &lt;a href="http://download.oracle.com/javase/6/docs/technotes/tools/windows/java.html"&gt;java options&lt;/a&gt; for more info.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;PS: It's time to start blogging again.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-8406890557860346891?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/8406890557860346891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=8406890557860346891' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/8406890557860346891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/8406890557860346891'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2011/01/where-did-class-get-loaded-from.html' title='Where did the class get loaded from?'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-2212626819846403334</id><published>2009-11-04T19:40:00.002Z</published><updated>2009-11-04T19:51:24.262Z</updated><title type='text'>Linux on the desktop</title><content type='html'>&lt;p&gt;Recently I performed some upgrades on my laptop and the sound broke once again. Sound has been flaky for a while now and I've had to use windows to use skype. This was a pretty useful tutorial which helped me sort out the issues - &lt;a href="http://ubuntuforums.org/showthread.php?t=789578"&gt;http://ubuntuforums.org/showthread.php?t=789578&lt;/a&gt;&lt;/p&gt;&lt;p&gt;But it got me thinking more about experience on Linux once again. Applications like OpenOffice, Gimp are inferior in usability to MS Office and Photoshop. Its painful when I need a newer version of software but the distro is older and so only an older version is available in the repo. Maybe its time to move back to Windows...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-2212626819846403334?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/2212626819846403334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=2212626819846403334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/2212626819846403334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/2212626819846403334'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/11/linux-on-desktop.html' title='Linux on the desktop'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-6353077073394971314</id><published>2009-10-01T18:48:00.005Z</published><updated>2009-10-01T19:02:04.170Z</updated><title type='text'>An Overview of Spring</title><content type='html'>Spring is a very popular framework in the Java space and quickly becoming an alternative to JEE. Spring started of as an implementation of the ideas in the book "Expert One-on-One J2EE Design and Development" in 2002 by Rob Johnson. Today the project has grown into to a large framework with multiple modules to assist with different areas of serverside programming. Spring provides a lightweight container and uses POJOs. This makes code much simpler to reason about and also test. No starting a mega EJB container anymore with remoting when you don't really need it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Inversion Of Control (IoC)&lt;/b&gt;&lt;br /&gt;At its core, Spring is an IoC container. Generally at some point in code you use 'new' instances. If you are coding against an interface you end up with code like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Bar {&lt;br /&gt; Foo foo;&lt;br /&gt; void Bar() {&lt;br /&gt;   foo = new FooImpl();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now the class Bar has a dependency on Foo and its implementation FooImpl. Now you could remove this dependency by using the ServiceLocator pattern but then you end up with a dependency to the ServiceLocator class and your code is not that testable anymore.&lt;br /&gt;In Spring you instead inject the actual implementations at runtime and rules about which instances are to be returned are written in an XML configuration file (or via Annotations). So code becomes like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Bar {&lt;br /&gt; Foo foo;&lt;br /&gt; void Bar(Foo foo) {&lt;br /&gt;   this.foo = foo;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;with an instance of FooImpl being returned where Foo is expected. Now Bar depends only on the interface Foo but not the implementation of Foo which is simply passed to it. Hence the name Inversion of Control as Bar does not depend on FooImpl but gets it.&lt;br /&gt;&lt;br /&gt;More importantly the code can be tested very easily. If I wanted to test the Bar class I can very easily provide a mock implementation of the Foo instance. Writing testable code is difficult and a major part of the problem is breaking dependencies. You should probably never need to new objects again but just get them injected.&lt;br /&gt;&lt;br /&gt;In the above example Foo is set in the constructor. This is an example of a Constructor based injection. Another way to inject dependencies is via setter methods. However I prefer Constructor based injection as it allows for final fields which should be the default to help with immutability.&lt;br /&gt;&lt;br /&gt;Another important idea is how instances are created. This is known as scopes. By default instances are created only once and that reference will be passed everywhere similar to a Singleton. So one FooImpl instance is created and passed wherever a Foo is needed. A lot of code can be written in a style where there is no local state allowing for Singletons. Again since the Singleton pattern is not explicitly needed, code remains testable. Another scope is prototype in which a new instance of FooImpl will be created whenever a Foo needs to be injected. For web programming other scopes like Request, Session and Application also exist.&lt;br /&gt;&lt;br /&gt;The complete lifetime of instances can be managed and there are many other features but thats another post. If you just need an IoC container then there are alternatives like Google Guice.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Aspect Oriented Programming&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;AOP allows for crosscutting code to be written external to the main business logic. This allows cleaner code in areas like logging. The implementation of AOP in Spring is based on Proxy based interceptors which happen at runtime. AspectJ integration is also provided in some form.&lt;br /&gt;One of the major uses of AOP is defining transactions which will be covered soon.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Data Access and Transaction management&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Most serverside code needs to talk to a database. Spring provides neat abstractions over JDBC and other frameworks to simplify code to a great extent.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;A DataSource is usually configured and injected.&lt;br /&gt;JDBC code is wrapped with classes like the SimpleJdbcTemplate. Queries become like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;String daString = getSimpleJdbcTemplate().queryForObject(&lt;br /&gt;    "SELECT daString FROM DaStringTable WHERE daStringId = ?",&lt;br /&gt;    String.class, daStringId);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Thats one line of code for what would have been multiple lines of JDBC like getting a connection, then statement, then query and result parsing. And there are no SQLExceptions. All of those are wrapped into a DataAccessException instance which is a RuntimeException. Create a generic handler in your code for exceptions because thats what you'll mostly be interested in. You can easily provide mapper classes to map from db values to object instances for custom types. Also variations exist for returning mutiple rows and other SQL CRUD operations.&lt;br /&gt;And I almost forgot to mention that there are also named parameters for queries.&lt;br /&gt;&lt;br /&gt;Using Hibernate is even easier. Use HibernateTemplate instead and get access to a hibernate API. Or JPATemplate if you want to use JPA. All of this code is obviously going to be tucked under a DAO tier!&lt;br /&gt;&lt;br /&gt;Transaction management is also dead simple with usage of Java annotations. You declare the Transaction rules for a method invocation like Isolation level (Read uncommitted, Read committed, Repeatable Read, Serializable), Propagation (Required, New), timeout and exceptions for rollback. An AOP proxy is created over the method which enforces the Transaction rules over the underlying datastore.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Web MVC&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Built on the core IoC functionality Spring has a Web MVC framework as well. Like Struts it is a request or action based framework. The DispatcherServlet class is a FrontController and acts as the entry point to the MVC framework. Typically request URIs are mapped to Controller classes. Controllers compute the Model and then render a View based on the Model for the request. A general multi tier architecture for applications is another topic.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Even more&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There are quite a few other projects under the Spring banner. WebFlow extends Web MVC for richer work flows in webapps. Spring WebServices for WebService (duh). Spring IDE is a bunch of Eclipse plugins to help with Spring development.&lt;br /&gt;&lt;br /&gt;Spring Framework 3 is going to be released. It adds better Java 5 support across various APIs. There is also a lot of annotation usage.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The company and future&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Spring started off as a simple open source project and has now morphed into a complete stack framework backed by a company.&lt;br /&gt;The core framework helps building applications. Further they added Groovy language and Grails. Mostly spring apps need a web container like Tomcat or Jetty to run. SpringSource also provides a custom Tomcat build known as tcServer with additional capabilities. Another environment is the dmServer which adds OSGi capabilities. For management and diagnostics they have additional tools. All of these play together to provide a really strong stack against the usual JEE standard running in an application container.&lt;br /&gt;&lt;br /&gt;VMWare bought SpringSource which means that soon Cloud-deployed apps based on Spring are going to be dead simple to make. This means that VMWare will now compete with the likes of Google App Engine and Microsoft Azure as well by providing virtualized application frameworks.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Links&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.infoq.com/presentations/Spring-Framework-3.0-Juergen-Hoeller"&gt;Spring 3 presentation&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.springsource.org/"&gt;Spring Community project&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.springsource.com/"&gt;SpringSource&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-6353077073394971314?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/6353077073394971314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=6353077073394971314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6353077073394971314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6353077073394971314'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/10/overview-of-spring.html' title='An Overview of Spring'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-7952566159712231352</id><published>2009-08-19T05:01:00.003Z</published><updated>2009-08-19T05:09:11.310Z</updated><title type='text'>List of countries and timezones</title><content type='html'>I'm pasting a csv file containing a list of timezone data of some of the cities from &lt;a href="http://www.timeanddate.com/worldclock/custom.html?sort=1"&gt;timeanddate.com&lt;/a&gt;. I was unable to find such a list and eventually had to do a lot of manual work. Do comment if there are any errors.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Afghanistan - Kabul,Asia/Kabul,Afghanistan Time,UTC/GMT +4:30&lt;br /&gt;Algeria - Algiers,Africa/Algiers,Central European Time,UTC/GMT +1:00&lt;br /&gt;Argentina - Buenos Aires,America/Argentina/Buenos_Aires,Argentine Time,UTC/GMT -3:00&lt;br /&gt;Australia - Australian Capital Territory - Canberra,Australia/Canberra,Eastern Standard Time (New South Wales),UTC/GMT +10:00&lt;br /&gt;Australia - New South Wales - Sydney,Australia/Sydney,Eastern Standard Time (New South Wales),UTC/GMT +10:00&lt;br /&gt;Australia - Northern Territory - Darwin,Australia/Darwin,Central Standard Time (Northern Territory),UTC/GMT +9:30&lt;br /&gt;Australia - Queensland - Brisbane,Australia/Brisbane,Eastern Standard Time (Queensland),UTC/GMT +10:00&lt;br /&gt;Australia - South Australia - Adelaide,Australia/Adelaide,Central Standard Time (South Australia),UTC/GMT +9:30&lt;br /&gt;Australia - Victoria - Melbourne,Australia/Melbourne,Eastern Standard Time (Victoria),UTC/GMT +10:00&lt;br /&gt;Australia - Western Australia - Perth,Australia/Perth,Western Standard Time (Australia),UTC/GMT +8:00&lt;br /&gt;Austria - Vienna,Europe/Vienna,Central European Time,UTC/GMT +1:00&lt;br /&gt;Bahamas - Nassau,America/Nassau,Eastern Standard Time,UTC/GMT -5:00&lt;br /&gt;Bangladesh - Dhaka,Asia/Dhaka,Bangladesh Time,UTC/GMT +6:00&lt;br /&gt;Belarus - Minsk,Europe/Minsk,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Belgium - Brussels,Europe/Brussels,Central European Time,UTC/GMT +1:00&lt;br /&gt;Bolivia - La Paz,America/La_Paz,Bolivia Time,UTC/GMT -4:00&lt;br /&gt;Brazil - São Paulo - Sao Paulo,America/Sao_Paulo,Brasilia Time,UTC/GMT -3:00&lt;br /&gt;Bulgaria - Sofia,Europe/Sofia,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Canada - Alberta - Edmonton,America/Edmonton,Mountain Standard Time,UTC/GMT -7:00&lt;br /&gt;Canada - British Columbia - Vancouver,America/Vancouver,Pacific Standard Time,UTC/GMT -8:00&lt;br /&gt;Canada - Manitoba - Winnipeg,America/Winnipeg,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;Canada - Newfoundland and Labrador - St. John's,America/St_Johns,Newfoundland Standard Time,UTC/GMT -3:30&lt;br /&gt;Canada - Nova Scotia - Halifax,America/Halifax,Atlantic Standard Time,UTC/GMT -4:00&lt;br /&gt;Canada - Ontario - Toronto,America/Toronto,Eastern Standard Time,UTC/GMT -5:00&lt;br /&gt;Canada - Quebec - Montreal,America/Montreal,Eastern Standard Time,UTC/GMT -5:00&lt;br /&gt;Chile - Santiago,America/Santiago,Chile Time,UTC/GMT -4:00&lt;br /&gt;China - Shanghai,Asia/Shanghai,China Standard Time,UTC/GMT +8:00&lt;br /&gt;Colombia - Bogota,America/Bogota,Colombia Time,UTC/GMT -5:00&lt;br /&gt;Croatia - Zagreb,Europe/Zagreb,Central European Time,UTC/GMT +1:00&lt;br /&gt;Cuba - Havana,America/Havana,Cuba Standard Time,UTC/GMT -5:00&lt;br /&gt;Czech Republic - Prague,Europe/Prague,Central European Time,UTC/GMT +1:00&lt;br /&gt;Denmark - Copenhagen,Europe/Copenhagen,Central European Time,UTC/GMT +1:00&lt;br /&gt;Dominican Republic - Santo Domingo,America/Santo_Domingo,Atlantic Standard Time,UTC/GMT -4:00&lt;br /&gt;Egypt - Cairo,Africa/Cairo,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;El Salvador - San Salvador,America/El_Salvador,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;Estonia - Tallinn,Europe/Tallinn,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Ethiopia - Addis Ababa,Africa/Addis_Ababa,Eastern African Time,UTC/GMT +3:00&lt;br /&gt;Fiji - Suva,Pacific/Fiji,Fiji Time,UTC/GMT +12:00&lt;br /&gt;Finland - Helsinki,Europe/Helsinki,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;France - Paris,Europe/Paris,Central European Time,UTC/GMT +1:00&lt;br /&gt;Germany - Berlin - Berlin,Europe/Berlin,Central European Time,UTC/GMT +1:00&lt;br /&gt;Greece - Athens,Europe/Athens,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Guatemala - Guatemala,America/Guatemala,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;Honduras - Tegucigalpa,America/Tegucigalpa,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;Hong Kong - Hong Kong,Asia/Hong_Kong,Hong Kong Time,UTC/GMT +8:00&lt;br /&gt;Hungary - Budapest,Europe/Budapest,Central European Time,UTC/GMT +1:00&lt;br /&gt;Iceland - Reykjavik,Atlantic/Reykjavik,Greenwich Mean Time,UTC/GMT +0:00&lt;br /&gt;India - Delhi - New Delhi,Asia/Kolkata,India Standard Time,UTC/GMT +5:30&lt;br /&gt;India - Maharashtra - Mumbai,Asia/Kolkata,India Standard Time,UTC/GMT +5:30&lt;br /&gt;India - West Bengal - Kolkata,Asia/Kolkata,India Standard Time,UTC/GMT +5:30&lt;br /&gt;Indonesia - Java - Jakarta,Asia/Jakarta,West Indonesia Time,UTC/GMT +7:00&lt;br /&gt;Iran - Tehran,Asia/Tehran,Iran Standard Time,UTC/GMT +3:30&lt;br /&gt;Iraq - Baghdad,Asia/Baghdad,Arabia Standard Time,UTC/GMT +3:00&lt;br /&gt;Ireland - Dublin,Europe/Dublin,Greenwich Mean Time,UTC/GMT +0:00&lt;br /&gt;Israel - Jerusalem,Asia/Jerusalem,Israel Standard Time,UTC/GMT +2:00&lt;br /&gt;Italy - Rome,Europe/Rome,Central European Time,UTC/GMT +1:00&lt;br /&gt;Jamaica - Kingston,America/Jamaica,Eastern Standard Time,UTC/GMT -5:00&lt;br /&gt;Japan - Tokyo,Asia/Tokyo,Japan Standard Time,UTC/GMT +9:00&lt;br /&gt;Jordan - Amman,Asia/Amman,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Kazakstan - Almaty,Asia/Almaty,Alma-Ata Time,UTC/GMT +6:00&lt;br /&gt;Kenya - Nairobi,Africa/Nairobi,Eastern African Time,UTC/GMT +3:00&lt;br /&gt;Kiribati - Christmas Island - Kiritimati,Pacific/Kiritimati,Line Is. Time,UTC/GMT +14:00&lt;br /&gt;Kuwait - Kuwait City,Asia/Kuwait,Arabia Standard Time,UTC/GMT +3:00&lt;br /&gt;Lebanon - Beirut,Asia/Beirut,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Madagascar - Antananarivo,Indian/Antananarivo,Eastern African Time,UTC/GMT +3:00&lt;br /&gt;Malaysia - Kuala Lumpur,Asia/Kuala_Lumpur,Malaysia Time,UTC/GMT +8:00&lt;br /&gt;Mexico - Federal District - Mexico City,America/Mexico_City,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;Morocco - Casablanca,Africa/Casablanca,Western European Time,UTC/GMT +0:00&lt;br /&gt;Myanmar - Yangon,Asia/Rangoon,Myanmar Time,UTC/GMT +6:30&lt;br /&gt;Nepal - Kathmandu,Asia/Kathmandu,GMT+05:45,UTC/GMT +5:45&lt;br /&gt;Netherlands - Amsterdam,Europe/Amsterdam,Central European Time,UTC/GMT +1:00&lt;br /&gt;New Zealand - Auckland,Pacific/Auckland,New Zealand Standard Time,UTC/GMT +12:00&lt;br /&gt;New Zealand - Chatham Islands,Pacific/Chatham,Chatham Standard Time,UTC/GMT +12:45&lt;br /&gt;Nicaragua - Managua,America/Managua,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;Nigeria - Lagos,Africa/Lagos,Western African Time,UTC/GMT +1:00&lt;br /&gt;Norway - Oslo,Europe/Oslo,Central European Time,UTC/GMT +1:00&lt;br /&gt;Pakistan - Karachi,Asia/Karachi,Pakistan Time,UTC/GMT +5:00&lt;br /&gt;Paraguay - Asuncion,America/Asuncion,Paraguay Time,UTC/GMT -4:00&lt;br /&gt;Peru - Lima - Lima,America/Lima,Peru Time,UTC/GMT -5:00&lt;br /&gt;Philippines - Manila,Asia/Manila,Philippines Time,UTC/GMT +8:00&lt;br /&gt;Poland - Warsaw,Europe/Warsaw,Central European Time,UTC/GMT +1:00&lt;br /&gt;Portugal - Lisbon,Europe/Lisbon,Western European Time,UTC/GMT +0:00&lt;br /&gt;Puerto Rico - San Juan,America/Argentina/San_Juan,Argentine Time,UTC/GMT -3:00&lt;br /&gt;Romania - Bucharest,Europe/Bucharest,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Russia - Anadyr,Asia/Anadyr,Anadyr Time,UTC/GMT +12:00&lt;br /&gt;Russia - Kamchatka,Asia/Kamchatka,Petropavlovsk-Kamchatski Time,UTC/GMT +12:00&lt;br /&gt;Russia - Moscow,Europe/Moscow,Moscow Standard Time,UTC/GMT +3:00&lt;br /&gt;Russia - Vladivostok,Asia/Vladivostok,Vladivostok Time,UTC/GMT +10:00&lt;br /&gt;Saudi Arabia - Riyadh,Asia/Riyadh,Arabia Standard Time,UTC/GMT +3:00&lt;br /&gt;Serbia - Belgrade,Europe/Belgrade,Central European Time,UTC/GMT +1:00&lt;br /&gt;Singapore - Singapore,Asia/Singapore,Singapore Time,UTC/GMT +8:00&lt;br /&gt;South Africa - Johannesburg,Africa/Johannesburg,South Africa Standard Time,UTC/GMT +2:00&lt;br /&gt;South Korea - Seoul,Asia/Seoul,Korea Standard Time,UTC/GMT +9:00&lt;br /&gt;Spain - Madrid,Europe/Madrid,Central European Time,UTC/GMT +1:00&lt;br /&gt;Sudan - Khartoum,Africa/Khartoum,Eastern African Time,UTC/GMT +3:00&lt;br /&gt;Sweden - Stockholm,Europe/Stockholm,Central European Time,UTC/GMT +1:00&lt;br /&gt;Switzerland - Zurich,Europe/Zurich,Central European Time,UTC/GMT +1:00&lt;br /&gt;Taiwan - Taipei,Asia/Taipei,China Standard Time,UTC/GMT +8:00&lt;br /&gt;Thailand - Bangkok,Asia/Bangkok,Indochina Time,UTC/GMT +7:00&lt;br /&gt;Turkey - Ankara,Turkey,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;Turkey - Istanbul,Turkey,Eastern European Time,UTC/GMT +2:00&lt;br /&gt;U.K. - England - London,Europe/London,Greenwich Mean Time,UTC/GMT +0:00&lt;br /&gt;United Arab Emirates - Dubai - Dubai,Asia/Dubai,Gulf Standard Time,UTC/GMT +4:00&lt;br /&gt;Uruguay - Montevideo,America/Montevideo,Uruguay Time,UTC/GMT -3:00&lt;br /&gt;U.S.A. - Alaska - Anchorage,America/Anchorage,Alaska Standard Time,UTC/GMT -9:00&lt;br /&gt;U.S.A. - California - Los Angeles,America/Los_Angeles,Pacific Standard Time,UTC/GMT -8:00&lt;br /&gt;U.S.A. - Colorado - Denver,America/Denver,Mountain Standard Time,UTC/GMT -7:00&lt;br /&gt;U.S.A. - Hawaii - Honolulu,Pacific/Honolulu,Hawaii Standard Time,UTC/GMT -10:00&lt;br /&gt;U.S.A. - Illinois - Chicago,America/Chicago,Central Standard Time,UTC/GMT -6:00&lt;br /&gt;U.S.A. - Michigan - Detroit,America/Detroit,Eastern Standard Time,UTC/GMT -5:00&lt;br /&gt;U.S.A. - New York - New York,America/New_York,Eastern Standard Time,UTC/GMT -5:00&lt;br /&gt;Uzbekistan - Tashkent,Asia/Tashkent,Uzbekistan Time,UTC/GMT +5:00&lt;br /&gt;Venezuela - Caracas,America/Caracas,Venezuela Time,UTC/GMT -4:30&lt;br /&gt;Vietnam - Hanoi,Asia/Vientiane,Indochina Time,UTC/GMT +7:00&lt;br /&gt;Yemen - Aden,Asia/Aden,Arabia Standard Time,UTC/GMT +3:00&lt;br /&gt;Zimbabwe - Harare,Africa/Harare,Central African Time,UTC/GMT +2:00&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/6078706-7952566159712231352?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/7952566159712231352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=7952566159712231352' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7952566159712231352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7952566159712231352'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/08/list-of-countries-and-timezones.html' title='List of countries and timezones'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-6274494449253249870</id><published>2009-08-07T07:00:00.004Z</published><updated>2009-08-07T07:45:25.263Z</updated><title type='text'>Flex</title><content type='html'>I had an opportunity to look into Flex a few weeks back. I've been mostly focused on Swing last couple of years and before that was fairly involved with web development (pre-ajax). So it's been a nice exercise to investigate what it offers and compare and contrast.&lt;br /&gt;&lt;br /&gt;Flex has  a good out of the box widget set, similar to Swing. One of its major strengths is its UI designer - no real surprise there, given it grew out of flash. Actionscript, the ECMAScript compliant language, tries to be dynamic with optional static typing. This can be useful, especially during at development time with code completion. Debugging can be a challenge though, especially the mix between actionscript and mxml. End up falling back on Alerts which isn't the greatest thing (more so given that they don't block and you can end up with a flurry of alert boxes). I also found that there are multiple ways to do the same thing. This can be quite confusing especially when looking at samples on the web. You don't really know which is the best way or why. One other small thing -  event names don't follow "on[event_name]" convention... it's very easy to confuse them with attributes in mxml. Overall, there's a big similarity with the html/js/css style of development - mxml/as/css.&lt;br /&gt;&lt;br /&gt;Flex demos really well. For creating small simple apps involving fetching data from a remote data source and rendering it, it is probably unrivaled from a productivity perspective. Drag a datagrid onto the canvas, construct an http service and attach a result event handler to bind the result to the datagrid. Simple. Done. I think the 'Bindable' attribute is a big part of why Flex is so successful for these types of apps. It takes care of all that plumbing of syncing model with view. It's interesting to note that JavaFX has introduced the 'bind' keyword in JavaFX Script.&lt;br /&gt;&lt;br /&gt;Most of what I've come across - articles/examples deal with small apps. I'm interested in how development in Flex would scale. It can be double edged sword. Given that it is so simple to just drag/drop and attach handlers, I would think it would require &lt;span style="font-style: italic;"&gt;more&lt;/span&gt; discipline and good coding practices. It would be all too easy to keep doing this all over without really giving much thought to overall design and code hygiene. I don't particularly like the &lt;span style="font-style:italic;"&gt;script&lt;/span&gt; tag in the MXML file. There should've been strict separation between the .mxml file and the .as file. I understand this was probably done to emulate the html/js model but why not force the separation as with separate .js files.&lt;br /&gt;&lt;br /&gt;Running a fairly complicated app - like TourDeFlex which chronicles the wonders of the various flex widgets - sucks up a lot of resources. Usability suffers. The experience feels sluggish. A similarly "heavy" "ajaxy" app doesn't. What's worse is that on more than one occasion, the browser has crashed running that demo. It's no surprise I haven't seen full fledged flex apps out on the 'open web'. Enterprises can, and have, embraced it since they can dictate the environment.&lt;br /&gt;&lt;br /&gt;There's a lot of revival in interest in web standards. Just as Adobe has AIR, Microsoft has Silverlight and Sun/Oracle has JavaFX, Google is embracing and evangelizing open web standards - HTML5/CSS/Javascript - as their RIA platform. GWT is the browser independent development platform with generated Javascript as the bytecode. I've started playing around with GWT recently and am quite impressed with its abilities - especially the development environment/cycle. &lt;a href="http://code.google.com/events/io/sessions/GwtPreviewGoogleWebToolkit2.html"&gt;Version 2.0&lt;/a&gt; promises more useful features.&lt;br /&gt;&lt;br /&gt;It'll be interesting to see where these platforms end up 3-4 years from now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-6274494449253249870?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/6274494449253249870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=6274494449253249870' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6274494449253249870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6274494449253249870'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/08/flex.html' title='Flex'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-5093661791078233184</id><published>2009-07-24T21:37:00.003Z</published><updated>2009-07-24T21:51:04.766Z</updated><title type='text'>TurboStringMap for Gwt</title><content type='html'>In my previous post I did mention that Gwt has the basic Java collections emulated in Javascript. In the browser such rich interfaces may not be needed. There is a lightweight Map implementation where the keys are constrained to String types only called &lt;a href="http://code.google.com/p/google-web-toolkit/source/browse/tags/1.7.0/user/src/com/google/gwt/user/client/ui/FastStringMap.java"&gt;FastStringMap&lt;/a&gt;. It is &lt;a href="http://code.google.com/p/google-web-toolkit/source/browse/tags/1.7.0/user/src/com/google/gwt/user/client/ui/FastStringMap.java#271"&gt;directly backed&lt;/a&gt; by a Js array. Want to go even lighter then here is the derived TurboStringMap which even a thinner API over a Js array to act like a Map.&lt;br /&gt;&lt;br /&gt;The rest of the this post is Gwt Java code-&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.onyem.finance.client;&lt;br /&gt;&lt;br /&gt;import com.google.gwt.core.client.JavaScriptObject;&lt;br /&gt;&lt;br /&gt;class TurboStringMap&lt;T&gt; {&lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt; * Accesses need to be prefixed with ':' to prevent conflict with built-in&lt;br /&gt; * JavaScript properties.&lt;br /&gt; */&lt;br /&gt;@SuppressWarnings("unused")&lt;br /&gt;private JavaScriptObject map;&lt;br /&gt;&lt;br /&gt;public TurboStringMap() {&lt;br /&gt; init();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void clear() {&lt;br /&gt; init();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private native void init() /*-{&lt;br /&gt;   this.@com.onyem.finance.client.TurboStringMap::map = {};&lt;br /&gt; }-*/;&lt;br /&gt;&lt;br /&gt;// Prepend ':' to avoid conflicts with built-in Object properties.&lt;br /&gt;public native T get(String key) /*-{&lt;br /&gt;   return this.@com.onyem.finance.client.TurboStringMap::map[':' + key];&lt;br /&gt; }-*/;&lt;br /&gt;&lt;br /&gt;// Prepend ':' to avoid conflicts with built-in Object properties.&lt;br /&gt;public native T put(String key, T value) /*-{&lt;br /&gt;   key = ':' + key;&lt;br /&gt;   var map = this.@com.onyem.finance.client.TurboStringMap::map;&lt;br /&gt;   var previous = map[key];&lt;br /&gt;   map[key] = value;&lt;br /&gt;   return previous;&lt;br /&gt; }-*/;&lt;br /&gt;&lt;br /&gt;// Prepend ':' to avoid conflicts with built-in Object properties.&lt;br /&gt;public native T remove(String key) /*-{&lt;br /&gt;   key = ':' + key;&lt;br /&gt;   var map = this.@com.onyem.finance.client.TurboStringMap::map;&lt;br /&gt;   var previous = map[key];&lt;br /&gt;   delete map[key];&lt;br /&gt;   return previous;&lt;br /&gt; }-*/;&lt;br /&gt;&lt;br /&gt;// only count keys with ':' prefix&lt;br /&gt;public native int size() /*-{&lt;br /&gt;   var value = this.@com.onyem.finance.client.TurboStringMap::map;&lt;br /&gt;   var count = 0;&lt;br /&gt;   for(var key in value) {&lt;br /&gt;     if (key.charAt(0) == ':') ++count;&lt;br /&gt;   }&lt;br /&gt;   return count;&lt;br /&gt; }-*/;&lt;br /&gt;&lt;br /&gt;public boolean isEmpty() {&lt;br /&gt; return size() == 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public native String[] keys() /*-{&lt;br /&gt;   var value = this.@com.onyem.finance.client.TurboStringMap::map;&lt;br /&gt;   var keys = [];&lt;br /&gt;   for(var key in value) {&lt;br /&gt;     keys.push(key.substring(1));&lt;br /&gt;   }&lt;br /&gt;   return keys;&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/6078706-5093661791078233184?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/5093661791078233184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=5093661791078233184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/5093661791078233184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/5093661791078233184'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/07/turbostringmap-for-gwt.html' title='TurboStringMap for Gwt'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-4142781985119563363</id><published>2009-07-08T18:29:00.007Z</published><updated>2009-07-09T17:30:59.240Z</updated><title type='text'>GWT</title><content type='html'>I've been working with &lt;a href="http://code.google.com/p/google-web-toolkit/"&gt;Gwt&lt;/a&gt; since a while and in this post will dump some of my learnings&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is Gwt&lt;/b&gt;&lt;br /&gt;Gwt is a toolkit primarily to enable writing webapps in Java which will then be cross compiled into plain Javascript and Html. The core is based on this java to javascript compiler. Additionally they have libraries for purposes like web gui creation, dom manipulation, json and xml parsing, RPC calls with java server support and also unit testing. The Gwt guys are seem pretty obsessed with performance so a lot of the design choices are based on this.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To code in Gwt you use your standard Java tools. This is a great advantage as you get great tool/ide support and java's static checking for code. Java generics are also supported. To create UIs a SWT-like library has been created which can be used. The library contains both Widget classes for common controls as well as layout classes for positioning. There are some quirks which you have to be aware of but thats true for almost any new platform. The layout library is one of the first reasons which got me to Gwt as I was (and still am) simply too scared to use CSS for managing a layout. Using the UI libraries for building interfaces is a bit painful in Java just as it is in Swing and Swt. But more importantly it does not translate to the best Html/Css layout code. For example to place child elements horizontally next to each other you can use the HorizontalPanel and add elements to this. Now when this code is cross compiled the HorizontalPanel is converted to a Html table with a single tr and all the child elements will be placed in td elements. Which depending on your style may not look that good. In the next version of Gwt a new UI Binder feature is going to be added. This will allow declaring the UI in an XML format and then writing the actual event handlers in Java. I guess a lot of UI frameworks are moving to this style which really does make sense in this domain. Also the code generated may be closer to the layout code you would have written by hand (if you knew CSS). You can also create your own Widgets and Panels if you want to. I also almost forgot to mention that you have access to a subset of the Java library. The &lt;a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/index.html?overview-summary.html"&gt;API&lt;/a&gt; can be read here. Basic java.lang and other important packages like some collections are supported.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that you have written some Java code you compile it by using the GwtCompiler which can be invoked by an ant task. You get a whole bunch of files into your dist folder. Now these are plain html, js and css files. You dont need any Java support in your webserver to run these. Gwt will generate separate optimized files for each browser supported. A client using IE7 will get a file separate from a FF client and each file will manage the quirks of that browser. So a client downloads almost only what is needed. I lied a bit in this process though. When the browser first hits the entry point html file special js code will decide what browser is running the code. After that the client code for that browser is then loaded in another Http request. Search for more on deferred binding to learn more. Importantly most of the code generated can be cached with long expiration headers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Gwt compiler essentially compiles Java (source code) to Js. But from where does it get the java.lang and other code of the standard library? The Gwt team has re-written supported Java libraries in a more Js friendly fashion. The String class is based on a normal Js string but the extended Java API for the string class is supported. Similarly the &lt;a href="http://code.google.com/p/google-web-toolkit/source/browse/releases/1.6/user/super/com/google/gwt/emul/java/util/ArrayList.java"&gt;ArrayList&lt;/a&gt; class is not something that Bloch wrote but a simpler Js friendly version. Just like the layout code generated some of this is overkill for Js. You dont really need the whole Collections API most of the time. You dont need the whole class hierarchy. Like I just needed a lame Map implementation with put and get and nothing else. And since some part of the Gwt library may use the collections in some way you end up using them anyways. See my &lt;a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=3451&amp;amp;can=4"&gt;bug&lt;/a&gt; for an extended rant&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Atleast one compiler optimization has to mentioned at this point - dead code elimination. For example if you dont use the substing method in the String class.. that method will not be compiled to Js. Additionally Js code is minified and obfuscated which greatly helps in reduction of download size.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Where should you use GWT&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Gwt is great for Ajax apps like Gmail, Google calendar etc. As a Java developer I dont think I could do better/faster had I been coding Js/Html for &lt;a href="http://onyem.com"&gt;Onyem&lt;/a&gt;. There are deficiencies right now but things are improving and are already optimized enough.&lt;/div&gt;&lt;div&gt;I would not still recommend Gwt in sites that have a lot content like news sites or sites where you just want a small widget in one corner. Use jquery or yui for that.&lt;/div&gt;&lt;div&gt;Also there can be no substitute for knowing CSS and also how to build websites. With a desktop mindset you will end up just bulding really slow apps.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;More Features&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These may come in some other post-&lt;/div&gt;&lt;div&gt;Hosted mode to OOPHM&lt;/div&gt;&lt;div&gt;Async pattern&lt;/div&gt;&lt;div&gt;Jsni&lt;/div&gt;&lt;div&gt;RPC&lt;/div&gt;&lt;div&gt;&lt;div&gt;Deferred binding &lt;/div&gt;&lt;div&gt;More Compiler optimizations&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-4142781985119563363?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/4142781985119563363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=4142781985119563363' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/4142781985119563363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/4142781985119563363'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/07/gwt.html' title='GWT'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-3039515137543719020</id><published>2009-06-04T05:59:00.002Z</published><updated>2009-06-04T06:04:14.843Z</updated><title type='text'>Open Source is Magic</title><content type='html'>&lt;dl&gt;&lt;dt&gt;"Any sufficiently advanced technology is indistinguishable from magic." - Sir Arthur C. Clarke&lt;br /&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/hmZyyBVbkOQ&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;feature=player_embedded&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/hmZyyBVbkOQ&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;feature=player_embedded&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-3039515137543719020?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/3039515137543719020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=3039515137543719020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/3039515137543719020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/3039515137543719020'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/06/open-source-is-magic.html' title='Open Source is Magic'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-2486855507299127347</id><published>2009-06-01T10:41:00.002Z</published><updated>2009-06-01T10:49:14.896Z</updated><title type='text'>Anti-social</title><content type='html'>In relation with normal human behaviour I am "anti-social". Personally I know I am just different-social which is great for me.&lt;br /&gt;&lt;br /&gt;I've been emailing a few people of late whom I don't know that well. And shockingly those gmail contacts started popping up in my gtalk list. The reason was gmails default setting of over-friendly behaviour. If you want more privacy then you need to disable the "Auto-add suggested contacts" feature in chat as described in this &lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;ctx=mail&amp;answer=29795"&gt;help page&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-2486855507299127347?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/2486855507299127347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=2486855507299127347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/2486855507299127347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/2486855507299127347'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/06/anti-social.html' title='Anti-social'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-7447388820253012330</id><published>2009-05-21T20:19:00.011Z</published><updated>2009-05-24T04:02:48.750Z</updated><title type='text'>Ubuntu Remixed</title><content type='html'>I upgraded to Jaunty Jackalope (9.04) over the weekend. Technically it wasn't an upgrade, rather a clean install. My setup makes it convenient to do this... I have three partitions - Windows, Ubuntu and DATA which contains all my docs/pics/music/movies. I tend to skip every other release and when I do want to "upgrade", I just back up my home directory (which is on the Ubuntu partition) to DATA and do a clean install.&lt;br /&gt;&lt;br /&gt;Way back in Oct 2006, I &lt;a href="http://codeword.blogspot.com/2006/10/ubuntu-606-dapper-drake-on-acer.html"&gt;wrote&lt;/a&gt; about my first foray into the Ubuntu universe. Two and a half years and five releases later it's thrilling to see how far its come and how much better the experience has gotten on that same machine. All issues listed in that post are virtually non-existent. One of Jaunty's specific goals was improving startup time and they delivered superbly... &lt; 25 seconds on my laptop. I like the consistent new notification system as well. With every new release, it gets more and more polished. &lt;br /&gt;&lt;br /&gt;Anyway, I thought I'd list the steps I take to get my setup going after every clean install... &lt;ul&gt;&lt;li&gt;backup home directory: &lt;span style="font-family:courier new;"&gt;cp -R /home/mohnish /media/data/mohnish&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;clean install &lt;/li&gt;&lt;li&gt;install updates&lt;br /&gt;&lt;/li&gt;&lt;li&gt;restore home directory: &lt;span style="font-family:courier new;"&gt;cp -R /media/data/mohnish /home/mohnish&lt;/span&gt;&lt;/li&gt;&lt;li&gt;create sym links in home directory to media on DATA:&lt;br /&gt;- &lt;span style="font-family:courier new;"&gt;ln -s /media/data/Docs Docs&lt;/span&gt;&lt;br /&gt;-&lt;span style="font-family:georgia;"&gt; &lt;span style="font-family:courier new;"&gt;ln -s /media/data/Music Music&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;- &lt;span style="font-family:courier new;"&gt;ln -s /media/data/Pics Pics&lt;/span&gt; &lt;/li&gt;&lt;li&gt;install apps&lt;br /&gt;- &lt;a href="http://packages.ubuntu.com/jaunty/ubuntu-restricted-extras"&gt;media codecs&lt;/a&gt; (audio/video playback, java, flash): &lt;span style="font-family:courier new;"&gt;apt-get install ubuntu-restricted-extras&lt;/span&gt;&lt;br /&gt;- &lt;a href="http://do.davebsd.com/"&gt;gnome do&lt;/a&gt; ('crazy delicious' once you're used to it): &lt;span style="font-family:courier new;"&gt;apt-get install gnome-do gnome-do-plugins&lt;/span&gt;&lt;br /&gt;- &lt;a href="http://www.listen-project.org/"&gt;listen&lt;/a&gt; (music during setup is essential): &lt;span style="font-family:courier new;"&gt;apt-get install listen&lt;/span&gt;&lt;br /&gt;- &lt;a href="http://www.opera.com/"&gt;opera&lt;/a&gt; (small, wicked fast and built-in mouse gestures... the best browser out there): grab .deb package from opera.com&lt;br /&gt;- &lt;a href="http://www.skype.com/"&gt;skype&lt;/a&gt; (convenient, saves money for cheapies like me): grab .deb package from skype.com&lt;br /&gt;- &lt;a href="http://www.videolan.org/vlc/"&gt;vlc&lt;/a&gt; (the 'everything' media player): &lt;span style="font-family:courier new;"&gt;apt-get install vlc&lt;/span&gt;&lt;br /&gt;- &lt;a href="http://picasa.google.com/linux"&gt;picasa&lt;/a&gt; (organize pics with nice web album integration): grab .deb package from goog&lt;br /&gt;- &lt;a href="http://earth.google.com/"&gt;googleearth&lt;/a&gt; (spy on your neighbourhood) - grab .bin file from goog&lt;br /&gt;- &lt;a href="http://gnomad2.sourceforge.net/"&gt;gnomad2&lt;/a&gt; (organize music on creative nomads/zens): &lt;span style="font-family:courier new;"&gt;apt-get install gnomad2&lt;/span&gt;&lt;br /&gt;- &lt;a href="http://code.google.com/p/sopcast-player/"&gt;sopcast-player&lt;/a&gt; (for those 5am Liverpool footy matches (with chinese commentary)): grab .deb package from goog code&lt;br /&gt;- &lt;a href="http://www.getmiro.com/"&gt;miro&lt;/a&gt; (get some &lt;a href="http://codeword.blogspot.com/2008/03/constant-learning-with-miro.html"&gt;gyan&lt;/a&gt;): &lt;span style="font-family:courier new;"&gt;apt-get install miro&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;All this &lt;a href="http://blogs.sun.com/jonathan/entry/will_java_be_the_world"&gt;noise&lt;/a&gt; about "apps stores" lately... the linux distro repos are the orignial and ultimate app store aren't they? Moreover, all the app settings are in my restored home directory. So they start up like nothing's changed... firefox/opera with their last sessions, miro with the same feed list, skype with my account.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Remix&lt;/span&gt;&lt;br /&gt;I happened to have access to an Asus Eee 700 netbook. It comes with Xandros linux with a weird Windows XP like look and limited functionality ("basic mode" with no access to the terminal/can't install any app (only certain pre-selected ones)/etc...). &lt;a href="http://www.canonical.com/projects/ubuntu/unr"&gt;Ubuntu Remix&lt;/a&gt; targets these types of netbooks. It's a full ubuntu system with added packages for the UI specifically tuned for small screen sizes.&lt;br /&gt;&lt;br /&gt;With no cd/dvd drive, the way to install it is via a bootable usb drive which can easily be created using &lt;a href="https://help.ubuntu.com/community/Installation/FromImgFiles"&gt;usb-imagewriter&lt;/a&gt;. The installation process is the same good ol ubuntu wizard. It ended up sucking up ~2.5 gb of the 4gb harddisk. There are things to tune/optimize which should reclaim some of that space as well as speed things up. For now, I'm just happy to get a chance to play around with it :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-7447388820253012330?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/7447388820253012330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=7447388820253012330' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7447388820253012330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7447388820253012330'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2009/05/ubuntu-remixed.html' title='Ubuntu Remixed'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-1205362929668061109</id><published>2008-09-03T23:21:00.001Z</published><updated>2008-09-05T07:09:25.701Z</updated><title type='text'>Javascript Revisisted</title><content type='html'>When starting an expedition with a new language, (most) people take time to fully understand and learn it before attempting to program with it. Except with Javascript... almost universally, it invites people to dive in without really knowing it. I'm paraphrasing &lt;a href="http://javascript.crockford.com/" target="_blank"&gt;Douglas Crockford&lt;/a&gt; here.&lt;br /&gt;&lt;br /&gt;I've found this to be very true. Almost 10 years back I started playing around with html and then CSS. The natural final progression led me to Javascript. I clearly remember going through &lt;a href="http://www.webmonkey.com/tutorial/JavaScript_Tutorial" target="_blank"&gt;Thau's Javascript tutorials&lt;/a&gt; over at WebMonkey trying to actually figure out what I was hacking. Those were exciting times at the height of the "Browser War" with the DOM coming into its own: MS introducing &lt;span style="font-family:Courier;"&gt;document.all&lt;/span&gt; and Netscape's &lt;span style="font-family:Courier;"&gt;document.layers&lt;/span&gt;. After IE won, nothing much happened for the next 5 years. And Javascript, already considered a toy language back then was more or less ignored.&lt;br /&gt;&lt;br /&gt;With the emergence of Ajax all that changed. People actually started taking a serious look at JS. Rahul found a series of videos - &lt;a href="http://video.yahoo.com/video/play?vid=111593" target="_blank"&gt;The Javascript Programming Language&lt;/a&gt; - by the above mentioned Douglas Crockford over at YUI threatre. They are by far the &lt;b&gt;best&lt;/b&gt; material on revealing the &lt;i&gt;real&lt;/i&gt; javascript and what a wonderful dynamic language it is. It is simple, yet, deceptively powerful. I took notes and here are some language highlights:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A real language - small, so easily approachable.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Dynamic - "load and go"... i.e. &lt;b&gt;interpreted&lt;/b&gt; + &lt;b&gt;loosely typed&lt;/b&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Objects are containers... i.e. HashMaps.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Prototypical inheritance&lt;/b&gt; - No classes. Inherit directly from objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Lambda&lt;/b&gt; support - Closures. "First lambda language to go mainstream".&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Types&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Numbers - 64-bit floats. &lt;span style="font-family:Courier;"&gt;NaN&lt;/span&gt; is result of erroneous operations.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Strings - 16-bit chars. Immutable. == compares string values.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Courier;"&gt;null&lt;/span&gt; - nothing.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Courier;"&gt;undefined&lt;/span&gt; - default variable value. Missing object members.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Booleans - &lt;b&gt;falsy&lt;/b&gt;: &lt;span style="font-family:Courier;"&gt;false&lt;/span&gt;, &lt;span style="font-family:Courier;"&gt;null&lt;/span&gt;, &lt;span style="font-family:Courier;"&gt;undefined&lt;/span&gt;, empty string, 0, &lt;span style="font-family:Courier;"&gt;NaN&lt;/span&gt;. &lt;b&gt;truthy&lt;/b&gt;:!(falsy)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Objects - everything else. Including functions.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Loosely typed != Untyped. Checks at runtime. Any type can be stored in any variable &lt;b&gt;including functions&lt;/b&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Ops&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;== and != do type coersion. Use === and !== instead.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&amp;amp;&amp;amp; and || return values.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Courier;"&gt;&lt;b&gt;foreach (i in object)&lt;/b&gt;&lt;/span&gt; iterates over ALL properties. Use &lt;b&gt;hasOwnProperty&lt;/b&gt; check.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Scope&lt;/b&gt; - blocks {} don't have scope. Only functions have scope. Variables inside function are not visible outside.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Objects&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Inherit from other objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Are an unordered Map.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Object literals: &lt;b&gt;{}&lt;/b&gt; (Basis of &lt;b&gt;JSON&lt;/b&gt;: simple data exchange format)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;New empty object: new Object() == {} == object(Object.prototype)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;New members are added by simple assignment. No need for a new class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;"Linkage" to "parent" object - Simple inheritance.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When setting values, only affects current object. When getting values, access goes "up", if not found in current object.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Pass by ref.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;=== is comparison on reference.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Remove member: &lt;span style="font-family:Courier;"&gt;delete object[name]&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Arrays&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Inherit from Object.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Indexes are strings (numbers are converted).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Array literals: &lt;b&gt;[]&lt;/b&gt; (== new Array())&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Courier;"&gt;delete array[index]&lt;/span&gt; leaves a "hole" (value is &lt;span style="font-family:Courier;"&gt;undefined&lt;/span&gt;). Use &lt;span style="font-family:Courier;"&gt;Array.prototype.splice&lt;/span&gt; instead.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Functions&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Are objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Inherit from Object and &lt;b&gt;can store name/value pairs&lt;/b&gt;!&lt;/li&gt;&lt;br /&gt;&lt;li&gt;JS function == other language lambda.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:Courier;"&gt;function foo() {}&lt;/span&gt; is equivalent to &lt;span style="font-family:Courier;"&gt;var foo = function() {}&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Can have inner functions with access to parent function scope even after parent function is invoked: &lt;b&gt;Closures&lt;/b&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Misc&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Can augment built-in types by modifying prototypes.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Avoid type wrappers (added to be similar to Java).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Browser 'window' is global object. Container for all global vars and built-in objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Every object is a separate namespace.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Browser apps are all single threaded.&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;DOM&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;id&lt;/b&gt; - uniquely identifies element.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Avoid &lt;span style="font-family:Courier;"&gt;document.all&lt;/span&gt;. Use &lt;span style="font-family:Courier;"&gt;document.getElementById(id)&lt;/span&gt;, &lt;span style="font-family:Courier;"&gt;document.getElementsByName(name), &lt;/span&gt;&lt;span style="font-family:Courier;"&gt;&lt;node&gt;.getElementsByTagName(tagName)&lt;/node&gt;&lt;/span&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Document Tree Structure: &lt;b&gt;document&lt;/b&gt; is root. &lt;b&gt;document.documentElement&lt;/b&gt; is HTML tag. &lt;b&gt;document.body&lt;/b&gt; is BODY tag.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Node&lt;/b&gt;: child, sibling, parent pointers. childNodes list.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Style&lt;/b&gt;: &lt;span style="font-family:Courier;"&gt;node.className&lt;/span&gt;/&lt;span style="font-family:Courier;"&gt;node.style.styleName&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Events&lt;/b&gt;: Browser - event driven, single threaded, async programming model. Events targeted at particular nodes. Events cause invocation of event handlers. (Remove event handlers from nodes before deleting). &lt;span style="font-family:Courier;"&gt;node["on" + type] = function&lt;/span&gt; to add event handler. Event handlers send optional event object. Events bubble up from "specific" to "general".&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Dialogs&lt;/b&gt;: alert, confirm, prompt all block async model. Avoid them in ajaxy apps.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Detailed slides:&lt;br /&gt;&lt;a href="http://yuiblog.com/assets/crockford/javascript.zip" target="_blank"&gt;The Javascript Programming Langauge&lt;/a&gt;&lt;br /&gt;&lt;a href="http://yuiblog.com/assets/crockford/advancedjavascript.zip" target="_blank"&gt;Advanced Javascript&lt;/a&gt;&lt;br /&gt;&lt;a href="http://yuiblog.com/assets/crockford/theory.zip" target="_blank"&gt;DOM&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-1205362929668061109?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/1205362929668061109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=1205362929668061109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/1205362929668061109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/1205362929668061109'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2008/09/javascript-revisisted.html' title='Javascript Revisisted'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-4928765743957770646</id><published>2008-06-26T09:52:00.001Z</published><updated>2008-06-26T10:00:21.397Z</updated><title type='text'>Eclipse Ganymede is out</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://ganymede-mirror1.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/whatsnew3.4/images/workingsets.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://ganymede-mirror1.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/whatsnew3.4/images/workingsets.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;.. and one hungry Indian dude wrote a section in the &lt;a href="http://ganymede-mirror1.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/whatsnew3.4/eclipse-news-part1.html"&gt;New and Noteworthy&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-4928765743957770646?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/4928765743957770646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=4928765743957770646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/4928765743957770646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/4928765743957770646'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2008/06/eclipse-ganymede-is-out.html' title='Eclipse Ganymede is out'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-244983682564996890</id><published>2008-04-01T06:20:00.004Z</published><updated>2008-04-01T17:37:30.307Z</updated><title type='text'>Immutable locks</title><content type='html'>Immutability is something that's mentioned over and over when it comes to parallel programming. Part I of  &lt;a href="http://www.javaconcurrencyinpractice.com/" target="_blank"&gt;Java Concurrency In Practice&lt;/a&gt; is all about composing objects that "play well" in the concurrent world and those that are immutable are the "best" citizens. No wonder &lt;a href="http://www.defmacro.org/ramblings/fp.html" target="_blank"&gt;functional languages&lt;/a&gt; are coming up in a big way. Anyone want to bet on them taking over the world in the next decade? Or if not taking over outright, at least succeeding in mutating our beloved imperative ones into unrecognisable functional beasts.&lt;br /&gt;&lt;br /&gt;Anyway, check out the method below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier; font-size:80%; line-height:80%;"&gt;public class Foo {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Listener[] listeners;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Foo() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listeners = new Listener[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void addListener(Listener listener) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;synchronized (listeners) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Listener[] newListeners = new Listener[listeners.length + 1];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; listeners.length; ++i) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newListeners[i] = listeners[i];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newListeners[listeners.length] = listener;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listeners = newListeners;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So here, the first thread to obtain the lock on &lt;span style="font-family:courier;"&gt;listeners&lt;/span&gt; reassigns it to a new Array object... &lt;span style="font-family:courier;"&gt;newListeners&lt;/span&gt;. Subsequent threads would continue to lock on the old &lt;span style="font-family:courier;"&gt;listeners&lt;/span&gt; array, while new threads would lock on the "new" listeners array, and potentially corrupt the data. So I guess there's an unwritten property about locks... they need to be immutable to avoid situations like the above.&lt;br /&gt;&lt;br /&gt;So given that locks need to be constant, there's no way to have a workable solution in the above code without using an additional object as the lock. The easy "lazy" thing to do is to just synchronize the method itself. The Foo instance (&lt;span style="font-family:courier;"&gt;this&lt;/span&gt;) would then be that "additional object". But that would be wasteful since it would prevent all other synchronized method calls, even ones that have nothing to do with listeners.&lt;br /&gt;&lt;br /&gt;(If instead of an Array, a List was used, the problem wouldn't have occurred given that the List itself wouldn't change. And I think, nowadays mostly the thinking when programming in managed languages is to go for Collections, rather than mess with manually managing Arrays. But I have still seen code like the above, so it's not totally contrived.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-244983682564996890?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/244983682564996890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=244983682564996890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/244983682564996890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/244983682564996890'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2008/04/immutable-locks.html' title='Immutable locks'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-2653442840382242783</id><published>2008-03-31T03:32:00.003Z</published><updated>2008-12-09T20:10:05.920Z</updated><title type='text'>Constant Learning with Miro</title><content type='html'>In every field, it's important to continue to learn about one's discipline even after graduating from formal learning institutions. No where is this more pertinent than in the software industry where the only constant is (fast and furious) change. There's always books and articles to keep up with what's new, but videos have emerged in a big way as another avenue.&lt;br /&gt;&lt;br /&gt;And it seems like the developer communities at all the big guns... Microsoft, Sun, Google and  Yahoo... have jumped on the bandwagon and are producing great content. Microsoft had started &lt;a href="http://channel9.msdn.com/" target="_blank"&gt;channel 9&lt;/a&gt; a few years back where they'd go around interviewing key engineers. Sun has videos through the &lt;a href="http://blogs.sun.com/sdnchannel/" target="_blank"&gt;Sun Developer Network Channel&lt;/a&gt;. Google has their &lt;a href="http://www.google.com/url?sa=t&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Fvideo.google.ca%2Fvideosearch%3Fq%3DengEDU&amp;amp;ei=tGzwR9iZM6XopgSO-Ol4&amp;amp;usg=AFQjCNHuId79udc4xHMEAFcQg0ZB5m647Q&amp;amp;sig2=UMR-cIZ4qk0qpdE3-BBLsw" target="_blank"&gt;Tech Talks&lt;/a&gt; series. Rahul introduced me to Yahoo's &lt;a href="http://developer.yahoo.com/yui/theater/" target="_blank"&gt;YUI Theater&lt;/a&gt; few months back.&lt;br /&gt;&lt;br /&gt;The great thing about a lot of the talks is that although they are presented in the context of the company's platform/language/technology, they tend to transcend them and are concepts and trends that apply to general software engineering. Microsoft's channel9 for instance, has had wonderful discussions with architects and designers on everything from &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=374141" target="_blank"&gt;functional programming&lt;/a&gt; to &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=329808" target="_blank"&gt;garbage collection&lt;/a&gt; to &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=347531" target="_blank"&gt;concurrency&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In spite of all the great videos out there, it's a hassle to have to go to each of these different sites, see what's new and watch it. Enter &lt;a href="http://www.getmiro.com/"&gt;Miro&lt;/a&gt;. Miro is an amazing open source application designed specifically to consume vidcasts (it works with podcasts too). Here's a screenshot where I've subscribed to some of these "channels" (yes, I have a lot of catching up to do!).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_BANjqg1W8AI/R_B0cmeTK4I/AAAAAAAAAXU/Ac062lTnqVA/s1600-h/miro.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_BANjqg1W8AI/R_B0cmeTK4I/AAAAAAAAAXU/Ac062lTnqVA/s400/miro.png" alt="" id="BLOGGER_PHOTO_ID_5183771205816232834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;You may be wondering if this really is a huge deal. I think it is. Miro simplifies and automates the process and makes it so simple and easy. Every time you start miro, it'll tell you of the latest content available and ask if you want to download it. And the quality is generally much better what with being able to view it full screen and it also has nifty &lt;a href="http://www.getmiro.com/features/" target="_blank"&gt;features&lt;/a&gt; like remembering where you left of in case you have to pause midway through etc... The one downside is that it has to download the video bits as opposed to streaming it through flash (as is common on many sites since the emergence of youtube). So for the bandwidth constrained it can be a bit of an issue. But then again, flash still has some issues on Linux and some of the videos don't play. Plus, looks like Microsoft recently converted to Silverlight which doesn't work on Linux (haven't looked into &lt;a href="http://www.mono-project.com/Moonlight" target="_blank"&gt;Moonlight&lt;/a&gt;). So most likely you'd end up having to download it anyway.&lt;br /&gt;&lt;br /&gt;I've only mentioned few channels, but as you can imagine, there's tons of them around the web. Miro has a guide built-in which showcases some of them. Apart from tech content, many universities like &lt;a href="http://webcast.berkeley.edu/index.php" target="_blank"&gt;Berkeley&lt;/a&gt; and &lt;a href="http://www.princeton.edu/WebMedia/special/" target="_blank"&gt;Princeton&lt;/a&gt; are broadcasting some of their lectures and events. So there's definitely no lack of content. Just need to make time!&lt;br /&gt;&lt;br /&gt;Overall, I love Miro and can't say enough good things about it. Kudos to the &lt;a href="http://planet.getmiro.com/" target="_blank"&gt;guys&lt;/a&gt; who've developed it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-2653442840382242783?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/2653442840382242783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=2653442840382242783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/2653442840382242783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/2653442840382242783'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2008/03/constant-learning-with-miro.html' title='Constant Learning with Miro'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_BANjqg1W8AI/R_B0cmeTK4I/AAAAAAAAAXU/Ac062lTnqVA/s72-c/miro.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-6715175780109229628</id><published>2007-12-20T23:16:00.000Z</published><updated>2007-12-20T23:18:48.126Z</updated><title type='text'>India Web 2.0</title><content type='html'>Came across this news site tracking India's contributions to Web 2.0.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.avashya.com/"&gt;avashya.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-6715175780109229628?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/6715175780109229628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=6715175780109229628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6715175780109229628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6715175780109229628'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/12/india-web-20.html' title='India Web 2.0'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-6432796633161355824</id><published>2007-12-20T22:23:00.000Z</published><updated>2007-12-20T23:14:43.847Z</updated><title type='text'>Re: Growing Pains</title><content type='html'>&lt;span style="color: rgb(255, 0, 0);"&gt;I guess it started with the .Net guys getting aggressive with new features like annotations, generics, delegates and now Linq. They are becoming more dynamic. Something to watch out for.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I think the fact that .Net is a closed source platform controlled by Microsoft is a huge factor in them being able to be so aggressive. It seems like today, when everything is moving towards getting open sourced, this should be seen as a huge red flag. And in some sense I feel that way, but I mean you really have to marvel at the stuff they're doing. When you read the &lt;a href="http://msdn.microsoft.com/msdnmag/issues/07/06/CSharp30/"&gt;Evolution of LINQ&lt;/a&gt; you see some really neat concepts like &lt;a href="http://msdn2.microsoft.com/en-us/vcsharp/bb905825.aspx"&gt;Extension Methods&lt;/a&gt; and how they've used a previous language feature (Attributes) to actually implement it.&lt;br /&gt;&lt;br /&gt;Regarding going the dynamic direction. I'm not sure that's necessarily true in the "core language/platform philosophy" sense. Both .Net and Java were designed from the ground up to be strong typed and will stay that way. I think it's more about abstracting out some tedious typing when it's possible for the compiler to &lt;a href="http://www.interact-sw.co.uk/iangblog/2005/09/23/varisntobject"&gt;infer the type&lt;/a&gt;... i.e. it's just syntactic sugar. It's especially useful when dealing with generics (and the endless &lt;&gt;s). So it's still going to all be the same under the covers, unlike in dynamic languages where there is no type safety at all. (Again it's interesting to see how &lt;span style="font-weight: bold;"&gt;var&lt;/span&gt; in C# came about as a necessity for another feature... &lt;a href="http://blogs.msdn.com/danielfe/archive/2005/09/22/472884.aspx"&gt;Annonymous Types&lt;/a&gt;... which were needed for LINQ).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Java had to respond and got annotations and generics. Generics has been a mess with wildcards. Closures seems to be going down that route. If only we get something thats simpler and yet extensible. The memory model is simpler and concurrency API has also been a great addition.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Lets see how long before Java steals LINQ and related features ;) They're still arguing about &lt;a href="http://www.javac.info/"&gt;closures&lt;/a&gt; and how the generics implementation was overly &lt;a href="http://www.google.com/url?sa=t&amp;amp;ct=res&amp;amp;cd=5&amp;amp;url=http%3A%2F%2Fwww.javac.info%2Fbloch-closures-controversy.ppt&amp;amp;ei=XvVqR7HeAafGnAP6oMRH&amp;amp;usg=AFQjCNGX4hrO9lQfP0hZ7o8RWNdMt8Ay3Q&amp;amp;sig2=C302CdJOUVu8sb0OuRzw1Q"&gt;complicated (ppt)&lt;/a&gt;. Wonder how long the insane backward compatibility requirement will continue. Also when Java was open sourced last year there was general &lt;a href="http://codeword.blogspot.com/2006/11/java-is-now-under-gpl.html"&gt;optimism&lt;/a&gt; that there would be a lot more innovations to the language. But has it just cause a lot more arguments and disagreements about the direction? Java 5 was big release, but since then there hasn't been anything major.&lt;br /&gt;&lt;br /&gt;My 2 cents for the year.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-6432796633161355824?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/6432796633161355824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=6432796633161355824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6432796633161355824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6432796633161355824'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/12/re-growing-pains.html' title='Re: Growing Pains'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-7509894771605997559</id><published>2007-12-17T05:03:00.000Z</published><updated>2007-12-17T05:21:39.490Z</updated><title type='text'>Growing Pains</title><content type='html'>These are pretty exciting times. A lot of languages are being extended to add more features...&lt;br /&gt;&lt;br /&gt;I guess it started with the .Net guys getting aggressive with new features like annotations, generics, delegates and now Linq. They are becoming more dynamic. Something to watch out for.&lt;br /&gt;&lt;br /&gt;Java had to respond and got annotations and generics. Generics has been a mess with wildcards. Closures seems to be going down that route. If only we get something thats simpler and yet extensible. The memory model is simpler and concurrency API has also been a great addition.&lt;br /&gt;&lt;br /&gt;C++ seems be following on Java's line with a similar memory model. I dont know what else is there but C++Ox should be big.&lt;br /&gt;&lt;br /&gt;There seem to be a lot of changes coming into Javascript and they want to make it much more Java like. Just heard a talk on the proposed changes and it seems much more complicated (read crappy). There seem to be so many new keywords that it just does not make sense.&lt;br /&gt;&lt;br /&gt;Is it time to move to a language like Scala? Cause I've not been able to leave static checking for Ruby yet. Hey why not just listen to Paul Graham and code in Lisp :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-7509894771605997559?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/7509894771605997559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=7509894771605997559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7509894771605997559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7509894771605997559'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/12/growing-pains.html' title='Growing Pains'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-8714444251939404242</id><published>2007-11-21T05:25:00.000Z</published><updated>2007-11-21T05:37:27.297Z</updated><title type='text'>Profiling - Just works</title><content type='html'>I've been trying to set up a profiler for Java development.&lt;br /&gt;&lt;br /&gt;I use Eclipse primarily and my first choice was the Eclipse project &lt;a href="http://www.eclipse.org/tptp/"&gt;TPTP&lt;/a&gt;. However the damn thing just refused to work on my machine(Windows 32). I needed to primarily attach to externally launched Java programs. The Agent Controller (which collects profiling data) sample scripts works. But Eclipse is still not able to find the Java process. And the same installation/setup steps worked on another machine. But memory profiling did not work there! &lt;br /&gt;&lt;br /&gt;That's when I tried the latest RC build of Netbeans. They bundle their &lt;a href="http://profiler.netbeans.org/"&gt;Profiler&lt;/a&gt; with the IDE so no need to install anything separately. They have a pretty nice UI wizard which gives directions to start the java application for profiling. And guess what.. it Just Works. Though some of their UI is not the best like UML interaction diagrams in Eclipse who cares. Atleast I am getting some profiling data.&lt;br /&gt;&lt;br /&gt;Maybe I'll try Netbeans as my main IDE once its released.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-8714444251939404242?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/8714444251939404242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=8714444251939404242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/8714444251939404242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/8714444251939404242'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/11/profiling-just-works.html' title='Profiling - Just works'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-6939601398023571316</id><published>2007-09-05T05:27:00.000Z</published><updated>2007-09-05T05:40:30.172Z</updated><title type='text'>Fishy Serialization</title><content type='html'>In Java, "Object Serialization supports the encoding of objects and the objects reachable from them, into a stream of bytes". This representation of the object can then be used for purposes like persisting on disk or passing of objects over  the network. To serialize an object the class needs to implement the  Serializable interface which is a marker interface with no methods defined. Optionally the class may define "readObject" and &lt;a href="http://java.sun.com/javase/6/docs/platform/serialization/spec/output.html#861"&gt;"writeObject"&lt;/a&gt; methods which will be used in the serialization process as defined in &lt;a href="http://java.sun.com/javase/6/docs/platform/serialization/spec/serialTOC.html"&gt;Specification&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The signature of the read/write Object methods is what struck me recently(this implies that I've been reading serialization related code before and not realised this). The modifier is private which means that no other instance should be able to invoke that method! And yet its invoked somehow. Time for some hacking...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For a dummy class Dog the stack trace to call the writeObject from SerializeTest.main was:&lt;br /&gt;&lt;br /&gt;java.lang.RuntimeException&lt;br /&gt;  at foo.bar.Dog.writeObject(SerializeTest.java:81)&lt;br /&gt;  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;br /&gt;  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;br /&gt;  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;br /&gt;  at java.lang.reflect.Method.invoke(Method.java:597)&lt;br /&gt;  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)&lt;br /&gt;  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)&lt;br /&gt;  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)&lt;br /&gt;  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)&lt;br /&gt;  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)&lt;br /&gt;  at foo.bar.SerializeTest.main(SerializeTest.java:23)&lt;br /&gt;&lt;br /&gt;The ObjectOutputStream.writeObject is invoked from the main method and after lots of calls ObjectStreamClass.invokeWriteObject is called which does some &lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/reflection/index.html"&gt;reflection&lt;/a&gt; The writeObject method is dynamically invoked there. The interesting part of the implementation is:&lt;br /&gt;&lt;br /&gt;void invokeWriteObject(Object obj, ObjectOutputStream out) {&lt;br /&gt;  writeObjectMethod.invoke(obj, new Object[]{ out });&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;writeObjectMethod is a member variable in ObjectStreamClass of type java.lang.reflect.Method&lt;br /&gt;and is set as:&lt;br /&gt;&lt;br /&gt;writeObjectMethod = getPrivateMethod(cl, "writeObject",&lt;br /&gt;  new Class[] { ObjectOutputStream.class },&lt;br /&gt;  Void.TYPE);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The definition of ObjectStreamClass.getPrivateMethod is:&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Returns non-static private method with given signature defined by given&lt;br /&gt; * class, or null if none found.  Access checks are disabled on the&lt;br /&gt; * returned method (if any).&lt;br /&gt; */&lt;br /&gt;private static Method getPrivateMethod(Class cl, String name, Class[] argTypes,&lt;br /&gt;  Class returnType) {&lt;br /&gt;  Method meth = cl.getDeclaredMethod(name, argTypes);&lt;br /&gt;  meth.setAccessible(true);&lt;br /&gt;  int mods = meth.getModifiers();&lt;br /&gt;  return ((meth.getReturnType() == returnType) &amp;&amp; ((mods &amp; Modifier.STATIC) == 0) &amp;&amp;&lt;br /&gt;    ((mods &amp; Modifier.PRIVATE) != 0)) ? meth : null;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And there is the call to the method which does all that magic - &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible(boolean)"&gt;Method.setAccessible&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The javadoc for the method says:&lt;br /&gt;"A value of true indicates that the reflected object should suppress Java language access checking when it is used"&lt;br /&gt;&lt;br /&gt;Using Reflection and with proper access its possible to even call private methods. This was something cool that I've learnt in a long time. Certainly makes Java more dynamic in nature. Now I'll have to read more on the Java security API soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-6939601398023571316?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/6939601398023571316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=6939601398023571316' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6939601398023571316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/6939601398023571316'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/09/fishy-serialization.html' title='Fishy Serialization'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-7935265326421984343</id><published>2007-05-10T05:35:00.000Z</published><updated>2007-05-10T06:00:24.480Z</updated><title type='text'>wget Google videos</title><content type='html'>Google has some amazing tech videos at their site by the user &lt;a href="http://video.google.com/videosearch?q=user%3A%22Google+engEDU%22&amp;num=10&amp;amp;so=1&amp;start=0"&gt;Google engEDU&lt;/a&gt;. And they even allow for downloads which is great for me.&lt;br /&gt;&lt;br /&gt;But I prefer downloading files using wget to be able to resume downloads later. You can't just wget the video link url's as is because they have &amp;amp; characters which cause wget to try to download them as separate files. Instead try something like this for the "OSS Speaker Series: The State of the Linux Kernel" video..&lt;br /&gt;&lt;br /&gt; wget -c --output-document=MortonLinuxKernel.mp4 "http://vp10.video.l.google.com/videodownload?version=0&amp;secureurl=twAAAOFdafTKyCsBI7E0BCCT6060NjqUP0-3g9pfM0xl5X1YO8a1zhU5ArUNYf8PLb44VqTIrTR2hntorTVWAEL6bqWkChEIIVPqNeHV5F4PRqoHXwlvZRC0_giNoVtliPIDsfE7zAzQSPok2b8ShvvgxJVI3T3WoPwGtr6Vvmwfjj18i9wTbaZD_JGXpTjD2kJrvVIenN5CSTRBbXYMKR49YyVYLdRNu9BuY924qZaDV4zEd9YFUsoCP42JkguszqVlOg&amp;amp;sigh=hEHjkZDlhZrMiZnAQrs8O55mFdo&amp;begin=0&amp;amp;len=4897661&amp;docid=1742374580386548257&amp;amp;rdc=1"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-7935265326421984343?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/7935265326421984343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=7935265326421984343' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7935265326421984343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/7935265326421984343'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/05/wget-google-videos.html' title='wget Google videos'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-8277833342400751364</id><published>2007-03-09T18:41:00.000Z</published><updated>2007-03-09T18:50:24.857Z</updated><title type='text'>Playing with Javascript</title><content type='html'>I've pasted an early version of a recursive function to walk the DOM from a particular node in Javascript. If you run the code though.. your browser will hang as it goes into a recursive loop. So whats wrong with the code?&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;  &amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;script type="text/javascript" language="javascript"&amp;gt;&lt;br /&gt;    function walk(node) {&lt;br /&gt;      if (node) {&lt;br /&gt;        //do something with node&lt;br /&gt;        for (i=0; i&amp;lt;node.childNodes.length; i++) {&lt;br /&gt;          walk(node.childNodes[i]);&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;  &amp;lt;/head&amp;gt;&lt;br /&gt;  &amp;lt;body onLoad="walk(document.body)"&amp;gt;&lt;br /&gt;    &amp;lt;a href="http://www.parivartana.org"&amp;gt;parivartana.org&amp;lt;/a&amp;gt;&lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;The variable i in the for loop should be declared as 'var i' to fix the behaviour. Thats when I realised that I should not really code in Javascript assuming that it is a subset of Java. (But being as lazy as I am never really studied the language).&lt;br /&gt;&lt;br /&gt;Then I came across some fantastic videos on Javscript by Douglas Crockford at the &lt;a href="http://developer.yahoo.com/yui/theater/"&gt;YUI theatre&lt;/a&gt; which is a part of the Yahoo Javascript library &lt;a href="http://developer.yahoo.com/yui/"&gt;YUI&lt;/a&gt;. Some of the features of the language are explained really well. Some key features are Objects as containers, Prototypal Inheritance and Lamda. He also explains some browser and Javascript quirks.&lt;br /&gt;&lt;br /&gt;Now I am wondering if Javascript should be a part of my resume!&lt;br /&gt;&lt;br /&gt;One of his recommendations is to favour minification ie removing of whitespace to reduce download size versus obfuscation. Google actually always heavily obfuscate their Javascript. Also as part of the Google Web Toolkit, the deployable code is also obfuscated. So thats a debateable topic. Time to read some GWT generated code then.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-8277833342400751364?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/8277833342400751364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=8277833342400751364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/8277833342400751364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/8277833342400751364'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2007/03/playing-with-javascript.html' title='Playing with Javascript'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116676940246753380</id><published>2006-12-22T06:23:00.000Z</published><updated>2006-12-22T06:38:34.306Z</updated><title type='text'>Re:  Select you crazy Query</title><content type='html'>Are you saying the first query is wrong cause it did not get the results you expected? Cause I don't see anything technically wrong with it. A left outer join does not mean that at the end of the query (whatever it may be), you will get all foos. What you get in the end depends on your WHERE clause.&lt;br /&gt;&lt;br /&gt;Break the first query down and you will see how it was arrived at. The cross product of the tables based on the ON clause of the LEFT OUTER JOIN "did" contain foo(1) but the WHERE clause which was applied over the cross product eliminated that record. Hence the result.&lt;br /&gt;&lt;br /&gt;The behavior is standard and not MySQL specific. Both those queries on a different engine should return the same behavior. Also, I don't see why the ON clause should remember the composite primary key.&lt;br /&gt;&lt;br /&gt;More on left outer join &lt;a href="http://publib.boulder.ibm.com/infocenter/cldscp10/index.jsp?topic=/com.ibm.cloudscape.doc/sqlj42.htm" target="_blank"&gt;here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116676940246753380?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116676940246753380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116676940246753380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116676940246753380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116676940246753380'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/12/re-select-you-crazy-query.html' title='Re:  Select you crazy Query'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116659261390051543</id><published>2006-12-20T05:04:00.000Z</published><updated>2006-12-20T05:39:17.236Z</updated><title type='text'>Select you crazy Query</title><content type='html'>Lets try a small SQL quiz this time. We have two tables foos and bars with the definition below..&lt;br /&gt;&lt;br /&gt;CREATE TABLE foos ( foo_id INT NOT NULL, PRIMARY KEY (foo_id) ) ENGINE=InnoDB;&lt;br /&gt;&lt;br /&gt;CREATE TABLE bars ( foo_id INT NOT NULL, bar_id CHAR(1) NOT NULL, PRIMARY KEY (foo_id, bar_id), FOREIGN KEY (foo_id) REFERENCES foos(foo_id)) type=InnoDB;&lt;br /&gt;&lt;br /&gt;And lets do some sample data inserts..&lt;br /&gt;&lt;br /&gt;INSERT INTO foos VALUES (1), (2), (3), (4);&lt;br /&gt;&lt;br /&gt;INSERT INTO bars VALUES (1, 'a'), (2, 'b'), (3, 'b'), (3, 'c');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now write query to give me all foos and those bars who have a bar_id 'b' for the same foo_id. Seems like an easy OUTER JOIN. This is what I came up with initially..&lt;br /&gt;&lt;br /&gt;SELECT * FROM foos LEFT OUTER JOIN bars ON foos.foo_id = bars.foo_id WHERE bar_id = 'b' OR bar_id IS NULL;&lt;br /&gt;&lt;br /&gt;And the result set was..&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;th&gt;foo_id&lt;/th&gt;&lt;th&gt;foo_id&lt;/th&gt;&lt;th&gt;bar_id&lt;/th&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td colspan="3"&gt;&lt;br /&gt;3 rows in set (0.00 sec)&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;But the result set obtained is wrong because we did not get &lt;b&gt;all&lt;/b&gt; the foos. Get back to the query then to obtain the result set below..&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;th&gt;foo_id&lt;/th&gt;&lt;th&gt;foo_id&lt;/th&gt;&lt;th&gt;bar_id&lt;/th&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td colspan="3"&gt;&lt;br /&gt;4 rows in set (0.00 sec)&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;For the correct query just make a minor change to the above SELECT&lt;br /&gt;&lt;br /&gt;SELECT * FROM foos LEFT OUTER JOIN bars ON foos.foo_id = bars.foo_id AND (bar_id = 'b' OR bar_id IS NULL);&lt;br /&gt;&lt;br /&gt;I did not have enough time to search for the actual reason for this behaviour though and am not even sure if this is standard or MySql specific.&lt;br /&gt;&lt;br /&gt;In table bars the primary key is a composite key between foo_id and bar_id. When foo_id is compared in the ON clause, it appears as if the rest of the primary key is forgotten. foos (1) joins with something like bars (1, NULL) and so the WHERE clause fails. When the ON contains all the clauses for the whole composite key, the LEFT OUTER JOIN behaves as expected.&lt;br /&gt;&lt;br /&gt;That gives a whole new perspective to outer joins when dealing with composite primary keys then.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116659261390051543?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116659261390051543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116659261390051543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116659261390051543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116659261390051543'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/12/select-you-crazy-query.html' title='Select you crazy Query'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116582098016647871</id><published>2006-12-11T06:49:00.000Z</published><updated>2006-12-11T07:09:41.176Z</updated><title type='text'>[TrackBack]StartUps in India</title><content type='html'>&lt;a href="http://blog.sukshma.net/2006/12/10/the-desi-garage-startup-redux/"&gt;Santosh on StartUps in India&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116582098016647871?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116582098016647871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116582098016647871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116582098016647871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116582098016647871'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/12/trackbackstartups-in-india.html' title='[TrackBack]StartUps in India'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116374491397064096</id><published>2006-11-17T05:51:00.000Z</published><updated>2006-11-17T06:28:34.276Z</updated><title type='text'>Java is now under GPL</title><content type='html'>That was really some amazing news. Yesterday was like a dream thinking of how bold Sun had been. Later I was thinking of what this really means for the language.&lt;br /&gt;&lt;br /&gt;The obvious things are better community interaction with things like bug fixes and ports(palm anyone??).&lt;br /&gt;&lt;br /&gt;Java SE will soon be bundled in almost all Linux operating systems. I think Gnome was using some Mono based applications. Now they could actually have the Java VM distributed. A whole new range of Java based desktop apps will be released. Its important to note that version 7 has been released now and version 6 will also be released later. That means that all free implementations of Java will use version 5+ Api's and so the fancy features like Generics, Enums and foreach etc. Java 6 also has a whole range of desktop specific enhancements so the "feel" of Java apps should also improve.&lt;br /&gt;&lt;br /&gt;I am not sure if it is possible to deploy the Java ME VM without paying Sun any license fees. I want Sun to make money of Java, but if they can deploy Java to most phones/devices that would be great. Could this be the next platform after all.. almost making Java appear as an Operating System?&lt;br /&gt;&lt;br /&gt;Of late Java lost a bit of steam. The language is mature and there are a large number of libraries to help in most tasks but age is also showing. Dynamic languages like php and ruby(with rails) provide features for faster webapp development. Even C# has some really cool features. This announcement will provide some extra steroids. In the future it will be interesting to see how "dynamic" Java can get.&lt;br /&gt;&lt;br /&gt;To conclude.. Sun just made a lot of hackers really happy. This will definitely have some positive effects for the company and the language.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116374491397064096?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116374491397064096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116374491397064096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116374491397064096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116374491397064096'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/11/java-is-now-under-gpl.html' title='Java is now under GPL'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116357475947118914</id><published>2006-11-15T06:57:00.000Z</published><updated>2006-11-15T07:12:41.833Z</updated><title type='text'>High on Emacs!</title><content type='html'>For the past three weeks I have been playing around with Emacs. Right from learning how to do simple editing to finally getting the Java Development Environment for Emacs (JDEE) setup on my machine, its been a whirlwind tour of this awesome editor!&lt;br /&gt;&lt;br /&gt;I used to be a big "vi" fan, but the sheer amount of work that Emacs allows you to accomplish is simply superb! I'm looking at a phase of experimentation, to see if Emacs will be productive for me on a daily basis. For now, the answer seems yes!&lt;br /&gt;&lt;br /&gt;Check out:-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gnu.org/software/emacs" target="_blank"&gt;GNU Emacs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.lib.uchicago.edu/keith/tcl-course/emacs-tutorial.html" target="_blank"&gt;Emacs Tutorial&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oreilly.com/catalog/gnu2/" target="_blank"&gt;Learning GNU Emacs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jdee.sunsite.dk/" target="_blank"&gt;JDEE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy editing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116357475947118914?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116357475947118914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116357475947118914' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116357475947118914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116357475947118914'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/11/high-on-emacs.html' title='High on Emacs!'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116330590109144669</id><published>2006-11-12T04:31:00.000Z</published><updated>2006-11-12T04:31:41.946Z</updated><title type='text'>His name is Linux</title><content type='html'>&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4ZmJ63sHoKU"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4ZmJ63sHoKU" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116330590109144669?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116330590109144669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116330590109144669' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116330590109144669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116330590109144669'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/11/his-name-is-linux.html' title='His name is Linux'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116304956086871248</id><published>2006-11-09T05:18:00.000Z</published><updated>2006-11-09T06:21:01.956Z</updated><title type='text'>Re:  Free the Platform!!</title><content type='html'>Looks like someone else had the same itch&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linuxdevices.com/files/article072/sld001.html"&gt;&lt;img src="http://www.linuxdevices.com/files/article072/smp-presentation-04-med.jpg" height="325" width="425" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Yet another link to the presentation above &lt;a href="http://www.linuxdevices.com/files/article072/sld001.html"&gt;here&lt;/a&gt;. Get more info on the Linux phone &lt;a href="http://www.theinquirer.net/print.aspx?article=35590&amp;amp;print=1"&gt;here&lt;/a&gt; and &lt;a href="http://www.linuxdevices.com/news/NS2986976174.html"&gt;here&lt;/a&gt;. You can get some more information on the &lt;a href="http://www.linuxdevices.com/articles/AT8825595860.html"&gt;State of Linux phones&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;THERE HAVE BEEN a lot of phones claiming to be 'Linux phones' and those that do run a Linux kernel, but they all miss the point of Linux: to be open. FIC is about to change that in a big way with a truly open phone, the OpenMoko.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Some of these phones are already in the market from Motorola and others. Companies like WindRiver and MontaVista also make Linux based stacks but I am not sure how open they are and whether it is possible to change/upgrade everything.&lt;br /&gt;&lt;br /&gt;Within a few years more and more companies will release mobile frontends to their webapps. Just as Gmail recently did. As of now Symbian, Windows CE and Palm and the main OS'es for smart phones. Who then will win the battle for the dominant platform? Java has an enviable position right now as it has already been deployed in many phones already. If Sun opensources Java under GPL then there will be even more widescale adoption in the open source stacks. Nokia Series 60 also allow programming in C++ and Python now so thats another race.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116304956086871248?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116304956086871248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116304956086871248' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116304956086871248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116304956086871248'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/11/re-free-platform.html' title='Re:  Free the Platform!!'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116227414389884798</id><published>2006-10-31T05:51:00.000Z</published><updated>2006-10-31T05:55:44.283Z</updated><title type='text'>Free the Platform!!</title><content type='html'>Can anyone tell me why I cant upgrade my mobile phone software?? Not some Java application on the phone, but the actual operating system. How much of a difference is there between a Nokia series 40 and Nokia series 60 phone in terms of hardware? Should I not be able to swipe the existing JVM which was based on an older Java implementation to a newer one? Will I ever be able to customise the hardware in the phone? Maybe we'll have to wait a bit longer for programmable hardware.. probably through &lt;a href="http://en.wikipedia.org/wiki/Fpga"&gt;FPGA's&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In a few years the mobile phone will be more important the the average computer. More people will use handheld devices for their daily tasks like browsing the net and listening to music. Developers will follow.. creating the next generation of killer applications.. followed by hackers to free the platform.. and by then google will own all your data&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116227414389884798?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116227414389884798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116227414389884798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116227414389884798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116227414389884798'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/10/free-platform.html' title='Free the Platform!!'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116175278575334854</id><published>2006-10-25T04:43:00.000Z</published><updated>2006-10-26T06:55:41.736Z</updated><title type='text'>Ubuntu 6.06 (Dapper Drake) on Acer AS3004WLCi</title><content type='html'>I had installed Dapper Drake on my Acer AS3004WLCi Laptop a few months back. I've been happy with it but there were several things that didn't work. I've been pretty lazy but I think I've finally resolved most, if not all, of them. Here's a run down.&lt;br /&gt;&lt;br /&gt;Firstly, what didn't work:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;After booting up and picking Ubuntu from the grub menu list, a few kernel messages would show up and then there would be a blank screen until X Server started up with the login box. Similar issue when shutting down... didn't see any messages.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Same thing for &lt;b&gt;Virtual Terminals&lt;/b&gt;... Ctl-Alt-[F1-F6] would bring up a blank screen.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;b&gt;Resolution&lt;/b&gt; for the 15.4 inch screen would only bring up 640x480, 800x600 and 1024x768 options. No wide-screen 1280x800 resolution.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Touchpad&lt;/b&gt; scrolling would not work.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Suspend/Hibernate&lt;/b&gt; would work the first time after booting up, but after resuming there would be a message saying there was a problem and on subsequent attemps would fail. It would look like it's doing something, screen would go blank, then all of a sudden some garbled text would be displayed at the top of a black screen and the screen saver would start up.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Wireless&lt;/b&gt; would not work. Would not detect the card.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Issues with &lt;b&gt;sound&lt;/b&gt;... If multiple applications which use sound such as a music player, a flash site and skype were open, things would be very erratic. Skype would give errors like 'Problem with sound device'. Flash based sites like YouTube or Google Video would not have sound etc...&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;What I did to resolve these issues:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Turns out that the &lt;b&gt;blank 'bootup/shutdown screen'&lt;/b&gt; and &lt;b&gt;blank virtual terminals&lt;/b&gt; are related. When you pick Ubuntu from the grub menu list, it loads up the linux kernel which in turn loads a basic video driver to show the kernel messages. The video driver is considered to be basic and compatible with most screens. If the &lt;b&gt;vga&lt;/b&gt; parameter is not passed to the kernel it defaults to &lt;b&gt;vga=normal&lt;/b&gt;. It seems it wasn't with my Acer screen. So this needed to be changed. Edit &lt;b&gt;/boot/grub/menu.lst&lt;/b&gt;. Add &lt;b&gt;vga=792&lt;/b&gt; to the &lt;b&gt;kernel /boot/vmlinuz-&amp;lt;version&amp;gt; root=&amp;lt;hda&amp;gt; ro quiet splash&lt;/b&gt; line. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ubuntuforums.org/showthread.php?p=1541970" target="_blank"&gt;HOWTO: Change bootup resolution&lt;/a&gt; was really helpful. It goes into further details about the bootup process etc... Also read it to understand the 792 value.&lt;br /&gt;&lt;br /&gt;The kernel uses the same driver for both the 'bootup/shutdown screens' as well as the virtual terminals. The vga parameter fixed both these issues.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The &lt;b&gt;touchpad scrolling&lt;/b&gt; problem and the &lt;b&gt;screen resolution&lt;/b&gt; problem had a common resolution. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;lspci | grep VGA&lt;/b&gt; &lt;br /&gt;shows &lt;br /&gt;&lt;b&gt;VGA compatible controller: Silicon Integrated Systems [SiS] 661/741/760/761 PCI/AGP VGA Display Adapter&lt;/b&gt; &lt;br /&gt;on my Acer laptop. &lt;br /&gt;&lt;br /&gt;So we need a &lt;b&gt;sis&lt;/b&gt; driver. Looking at &lt;b&gt;/etc/X11/xorg.conf&lt;/b&gt; showed that it was loading the &lt;b&gt;vesa&lt;/b&gt; driver. To fix this run &lt;br /&gt;&lt;b&gt;sudo dpkg-reconfigure xserver-xorg&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;Go through all the screens and answer the questions. For most, the default will do. When you get to the video screen, pick the &lt;b&gt;sis&lt;/b&gt; driver and the desired resolution (1280x800). Make it the default. After this is done restart X-server (Ctl-Alt-Backspace). It should start with the crisp widescreen resolution. &lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.linuxquestions.org/questions/showthread.php?t=465994" target="_blank"&gt;Strange screen resolution&lt;/a&gt; thread got me the lead on trying dpkg-reconfigure.&lt;br /&gt;&lt;br /&gt;Check &lt;a href="http://www.winischhofer.eu/linuxsisvga.shtml" target="_blank"&gt;this&lt;/a&gt; page for some bedtime reading on sis drivers.&lt;br /&gt;&lt;br /&gt;The touchpad scroll started working after going through the reconfigure. I didn't do anything specific. I think I just picked default options for the touchpad/mouse screen.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The &lt;b&gt;Suspend/Hibernate&lt;/b&gt; issue was related to &lt;b&gt;Wifi&lt;/b&gt; not working. Funny how these things are related no? The garbled text that was displayed after a failed suspend became clear after the virtual terminal issue was resolved. It was outputting &lt;b&gt;bcm43xx: Error: Microcode "bcm43xx_microcode5.fw"&lt;/b&gt;. &lt;b&gt;dmesg&lt;/b&gt; showed the same error. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;lspci | grep Wireless&lt;/b&gt; &lt;br /&gt;shows &lt;br /&gt;&lt;b&gt;Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)&lt;/b&gt; &lt;br /&gt;on this Acer laptop. &lt;br /&gt;&lt;br /&gt;So this is the wi-fi driver. After some searching, came upon &lt;a href="http://ubuntuforums.org/showthread.php?t=185174" target="_blank"&gt; How to: Broadcom Wireless cards&lt;/a&gt; (These How-Tos are amazingly helpful!). I followed the instructions and it seemed to work. &lt;b&gt;iwconfig&lt;/b&gt; brings up the wireless network interface information + &lt;b&gt;iwlst &amp;lt;eth&amp;gt; scanning&lt;/b&gt; shows the wireless connections available.&lt;br /&gt;&lt;br /&gt;After suspending and resuming, looking at the &lt;b&gt;dmesg&lt;/b&gt; output, the errors weren't there anymore.&lt;br /&gt;&lt;br /&gt;Check &lt;a href="http://enterprise.linux.com/article.pl?sid=06/05/24/1716222&amp;tid=121&amp;tid=23" target="_blank"&gt;this&lt;/a&gt; page for some insight into the suspend/hibernate process.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The &lt;b&gt;sound issues&lt;/b&gt; took care of themselves really :) Upgrading the kernel to &lt;b&gt;2.6.15-27-386&lt;/b&gt; seemed to resolve all of them. Also upgrading to Skype &lt;b&gt;1.3.0.53&lt;/b&gt; helped.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Most problems have solutions out there. All it needs is a bit of searching/reading/trying. &lt;br /&gt;&lt;br /&gt;Lets see how many of these issues are resolved in Egdy Eft which comes out tomorrow!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116175278575334854?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116175278575334854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116175278575334854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116175278575334854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116175278575334854'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/10/ubuntu-606-dapper-drake-on-acer.html' title='Ubuntu 6.06 (Dapper Drake) on Acer AS3004WLCi'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116087627862829173</id><published>2006-10-15T01:03:00.000Z</published><updated>2006-10-15T01:37:59.673Z</updated><title type='text'>Dependency biculturalism</title><content type='html'>Nicely put: &lt;a href="http://polishlinux.org/gnu/foss-and-the-dependencies/" target="_blank"&gt;What do dependencies have to do with Free Software?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This relates closely to &lt;a href="http://www.joelonsoftware.com/articles/Biculturalism.html" target="_blank"&gt;Biculturalism&lt;/a&gt; which Joel talks about.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116087627862829173?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116087627862829173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116087627862829173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116087627862829173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116087627862829173'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/10/dependency-biculturalism.html' title='Dependency biculturalism'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116043916190814229</id><published>2006-10-10T00:10:00.000Z</published><updated>2006-10-10T00:13:57.080Z</updated><title type='text'>hd internals</title><content type='html'>A cool demo of the hardworking hd in action.&lt;br /&gt;&lt;br /&gt;&lt;object height="350" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/9eMWG3fwiEU"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;embed src="http://www.youtube.com/v/9eMWG3fwiEU" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116043916190814229?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116043916190814229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116043916190814229' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116043916190814229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116043916190814229'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/10/hd-internals.html' title='hd internals'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-116011691157918967</id><published>2006-10-06T06:39:00.000Z</published><updated>2006-10-06T06:41:51.926Z</updated><title type='text'>Ubuntu on a Dell 6400</title><content type='html'>Yipee.. I recently purchased a Dell laptop - Inspiron 6400 (also known as E1505). The first thing I had to do was to install Ubuntu. Luckily for me this is a common model and comes with some standard components and most of the things work with little or no configuration.&lt;br /&gt;&lt;br /&gt;By default I got a resolution of 1028x768 on the widescreen which supports 1280x800 natively. So things were looking pretty stretched. The &lt;a href="https://help.ubuntu.com/community/i915Driver"&gt;i915 wiki page&lt;/a&gt; explains pretty well howto get the correct resolution.&lt;br /&gt;&lt;br /&gt;Another fun thing I did was to get the GKrellM with i8kutils. GKrellM is used to monitor the system. Its something I need to look more into. i8kutils is a dell laptop specific lib for intrumentation of the processor fans. Installation was explained in the Ubuntu forums over &lt;a href="http://www.ubuntuforums.org/showpost.php?p=1529771&amp;postcount=9"&gt;here&lt;/a&gt;. However after installing everything as explained, GKrellM still does not show any fans. For that, within the GKrellM configuration, the i8k plugin needs to be enabled first. After that two fans will be visible. Clicking on the fan can be used to toggle to Manual mode for fan and set the speed as well which you can confirm by listening to the low buzzing noise!! However I dont expect the processor to burn as the author says :) as the Intel motherboard automatically sets the fan speed based on heat.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-116011691157918967?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/116011691157918967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=116011691157918967' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116011691157918967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/116011691157918967'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/10/ubuntu-on-dell-6400.html' title='Ubuntu on a Dell 6400'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115975053477842291</id><published>2006-10-02T00:39:00.000Z</published><updated>2006-10-02T01:47:01.090Z</updated><title type='text'>final by default</title><content type='html'>When talking about 'good programming practices', one thing that was recommended by a good professor of mine was to declare variables that you aren't going to modify as &lt;b&gt;final&lt;/b&gt;. It serves two purposes: &lt;br /&gt;&lt;blockquote&gt;1) A self check for yourself so you don't accidentally modify the variable down the line somewhere &lt;br /&gt;2) Self documents the code: Other's reading your code know immediately of your intent.&lt;/blockquote&gt; &lt;br /&gt;While trying to follow this (in Java) I found all these 'final' keywords all over the place. I began to feel that it wasn't really helping. Just cluttering the codebase with 'final's.&lt;br /&gt;&lt;br /&gt;So why not just have all variables be final by default?&lt;br /&gt;&lt;br /&gt;Along these lines, I feel providing all the abilities of C++'s &lt;b&gt;const&lt;/b&gt; to Java's &lt;b&gt;final&lt;/b&gt; would be a tremendous boon. Your contracts can be better defined - not just on references but on the objects themselves.&lt;br /&gt;&lt;br /&gt;&amp;lt;soapbox&amp;gt;Code maintainability - getting up to speed on a codebase and changing someone else's code is something that is done &lt;b&gt;far&lt;/b&gt; &lt;a href="http://www.codinghorror.com/blog/archives/000684.html" target="_blank"&gt;more&lt;/a&gt; than adding new code. Anything to make readability better by clearly defining contracts/intent can only be a benefit and should be strived for.&amp;lt;/soapbox&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115975053477842291?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115975053477842291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115975053477842291' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115975053477842291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115975053477842291'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/10/final-by-default.html' title='final by default'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115804187927900253</id><published>2006-09-12T06:01:00.000Z</published><updated>2006-09-12T06:17:59.510Z</updated><title type='text'>Shutup PHP @ $%!</title><content type='html'>OK.. I'm getting a bit carried away here.&lt;br /&gt;&lt;br /&gt;I saw a bit of code in PHP like ..&lt;br /&gt;$contents = @file_get_contents($filename);&lt;br /&gt;&lt;br /&gt;But what is the @ before the function call?? As bad as I am with googling I was not able to get some good docs on this. The best info I got was from &lt;a href="http://www.php.net/%7Ederick/meeting-notes.html#changes-to-the-shut-up-operator-that-disallow-ini-set"&gt;meeting notes&lt;/a&gt; which says that its called the shut-up operator.&lt;br /&gt;&lt;br /&gt;So then I backtracked to the PHP manual and found &lt;a href="http://www.php.net/manual/en/language.operators.errorcontrol.php"&gt;Error Control Operators&lt;/a&gt;. The doc says..&lt;br /&gt;"PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored."&lt;br /&gt;&lt;br /&gt;Yet another example of a lazy programmer trying to code before reading docs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115804187927900253?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115804187927900253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115804187927900253' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115804187927900253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115804187927900253'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/09/shutup-php.html' title='Shutup PHP @ $%!'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115742918663121844</id><published>2006-09-05T04:06:00.000Z</published><updated>2006-09-05T04:06:26.720Z</updated><title type='text'>Re: On the road</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7565/281/1600/CA%20Trip%202006%20131.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7565/281/320/CA%20Trip%202006%20131.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Took this on ride to San Francisco on Sunday. It's directly across the Oracle HQ. There are infact two billboards along the highway. Really nice to see Ubuntu get some (well deserved) publicity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115742918663121844?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115742918663121844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115742918663121844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115742918663121844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115742918663121844'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/09/re-on-road_05.html' title='Re: On the road'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115657640552600986</id><published>2006-08-26T07:12:00.000Z</published><updated>2006-08-26T07:13:27.250Z</updated><title type='text'>Internet Explorer on Linux??</title><content type='html'>You mostly want to check for web page compatibility with IE if you're doing some web app stuff. So whats the solution if you prefer to use a linux distro rather than Windoz??&lt;br /&gt;&lt;br /&gt;Enter &lt;a href="http://www.tatanka.com.br/ies4linux/index-en.html"&gt;ies4linux&lt;/a&gt;. ies4linux installs IE binaries over &lt;a href="http://www.winehq.com/"&gt;Wine&lt;/a&gt;. Wine is an Open Source implementation of the Windows API on top of X and Unix. ies4linux has a script which will download the IE setup files right from the microsoft site, and install over Wine. The best part is that you can install multiple versions of IE as well ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115657640552600986?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115657640552600986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115657640552600986' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115657640552600986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115657640552600986'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/08/internet-explorer-on-linux_26.html' title='Internet Explorer on Linux??'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115577476101675771</id><published>2006-08-17T00:23:00.000Z</published><updated>2006-08-17T00:32:42.026Z</updated><title type='text'>On the road</title><content type='html'>&lt;img src="http://ubuntu.wordpress.com/files/2006/08/ubuntubillboard.jpg"&gt;&lt;br /&gt;&lt;br /&gt;See details about it &lt;a href="http://ubuntu.wordpress.com/2006/08/03/first-ubuntu-billboard-spotted/" target="_blank"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115577476101675771?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115577476101675771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115577476101675771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115577476101675771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115577476101675771'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/08/on-road.html' title='On the road'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115575864647425545</id><published>2006-08-16T20:00:00.000Z</published><updated>2006-08-16T20:04:07.346Z</updated><title type='text'>Re:  Right to Information</title><content type='html'>Via &lt;a href="http://indianeconomy.org/2006/08/17/tamso-ma-jyotirgamaya/" target="_blank"&gt;The Indian Economy Blog&lt;/a&gt; came across &lt;a href="http://www.parivartan.com/Home.asp" target="_blank"&gt;Parivartan&lt;/a&gt;. Check some of the &lt;a href="http://www.parivartan.com/success_stories.asp" target="_blank"&gt;'Success Stories'&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115575864647425545?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115575864647425545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115575864647425545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115575864647425545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115575864647425545'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/08/re-right-to-information.html' title='Re:  Right to Information'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115480639373505885</id><published>2006-08-05T19:00:00.000Z</published><updated>2006-08-07T10:57:51.840Z</updated><title type='text'>Circular dependency between Tables in SQL</title><content type='html'>Update: Added a new way to solve the problem&lt;br /&gt;&lt;br /&gt;Q) How had to create Tables with a circular dependency between them. Like&lt;br /&gt;&lt;br /&gt;CREATE TABLE A (&lt;br /&gt;....A_ID INT,&lt;br /&gt;....PRIMARY KEY A_ID,&lt;br /&gt;....B_FK INT,&lt;br /&gt;....FOREIGN KEY B_FK&lt;br /&gt;....REFERENCES B(B_ID)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE TABLE B (&lt;br /&gt;....B_ID INT,&lt;br /&gt;....PRIMARY KEY B_ID,&lt;br /&gt;....A_FK INT,&lt;br /&gt;....FOREIGN KEY A_FK&lt;br /&gt;....REFERENCES A(A_ID)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;... now this will not work as during create, table B does not exist&lt;br /&gt;&lt;br /&gt;A) So one solution is ...&lt;br /&gt;&lt;br /&gt;CREATE TABLE A (&lt;br /&gt;....A_ID INT,&lt;br /&gt;....PRIMARY KEY A_ID&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE B (&lt;br /&gt;....B_ID INT,&lt;br /&gt;....PRIMARY KEY B_ID,&lt;br /&gt;....A_FK INT,&lt;br /&gt;....FOREIGN KEY A_FK&lt;br /&gt;....REFERENCES A(A_ID)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;ALTER TABLE A ADD COLUMN B_FK INT AFTER A_ID;&lt;br /&gt;ALTER TABLE A ADD FOREIGN KEY B_FK REFERENCES B(B_ID);&lt;br /&gt;&lt;br /&gt;A little bit of cheating does the trick :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A) Another mysql specific solution is to use the FOREIGN_KEY_CHECKS variable.&lt;br /&gt;&lt;br /&gt;mysql&gt; SET FOREIGN_KEY_CHECKS = 0;&lt;br /&gt;mysql&gt; SOURCE dump_file_name;&lt;br /&gt;mysql&gt; SET FOREIGN_KEY_CHECKS = 1;&lt;br /&gt;&lt;br /&gt;In the dump_file_name, tables can be created in any order without checking of Foreign Key constraints. So we can create tables with circular depenndencies&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115480639373505885?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115480639373505885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115480639373505885' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115480639373505885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115480639373505885'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/08/circular-dependency-between-tables-in.html' title='Circular dependency between Tables in SQL'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115378174872424479</id><published>2006-07-24T22:54:00.000Z</published><updated>2006-07-24T22:55:48.970Z</updated><title type='text'>Java Generics FAQ</title><content type='html'>&lt;a href="http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html" target="_blank"&gt;Java Generics FAQs - Frequently Asked Questions&lt;/a&gt; - This is a collection of answers to frequently asked questions (FAQs) about Java Generics, a new language feature added to the Java programming language in version 5.0 of the Java Standard Edition (J2SE 5.0).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115378174872424479?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115378174872424479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115378174872424479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115378174872424479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115378174872424479'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/07/java-generics-faq.html' title='Java Generics FAQ'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115364579487219034</id><published>2006-07-23T09:09:00.000Z</published><updated>2006-07-23T09:14:58.466Z</updated><title type='text'>midday</title><content type='html'>I've always liked &lt;a href="http://ww3.mid-day.com/" target="_blank"&gt;Mid-Day&lt;/a&gt;. I was pretty happy to find their site. But the format they have is pretty sucky. They provide a pdf for each page. So to read the entier paper, each page has to be downloaded separately. Not the most convenient thing. &lt;br /&gt;&lt;br /&gt;I had started looking at Python a bit (going from the previous post). This seemed to be a pretty good project to use it for. The script - &lt;a href="http://mohn3310.googlepages.com/midday.py" target="_blank"&gt;midday&lt;/a&gt; - automates the process. Given the paper you want (sunday|mumbai|vashi), it downloads each paper's pdf pages to your machine. It also uses a third party app - &lt;a href="http://www.accesspdf.com/pdftk/" target="_blank"&gt;pdftk&lt;/a&gt; - to combine all the pages into one pdf. It needs to be downloaded and the location it was installed in needs to be passed into the script, but its not necessary. The script still works w/o it, but the pages are in separate pdfs. Should work on both Windows and Linux, but I've tested it only on Linux. &lt;br /&gt;&lt;br /&gt;Overall, I liked Python quite a bit. Definitely more productive that Java... for something like this. Less upfront design needed, but is still structured. All the data structures mentioned in the last post came into play. Also, being interpreted, it's pretty easy to make it work on multiple platforms. The &lt;a href="http://docs.python.org/lib/" target="_blank"&gt;library&lt;/a&gt; is pretty extensive and with the easy ability to call other programs (especially in the linux environment where the culture is to create small programs that can be stiched together), python can be used for a wide range of applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115364579487219034?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115364579487219034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115364579487219034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115364579487219034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115364579487219034'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/07/midday_23.html' title='midday'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115364572284062998</id><published>2006-07-23T09:08:00.000Z</published><updated>2006-07-23T09:10:57.276Z</updated><title type='text'>Re: One Array to rule them all</title><content type='html'>Pretty late reply... I've been doing a bit of python of late. And although there isn't 'one array to rule them all' there are some similarities. In python there are three main data structures - lists, dictionaries and tuples. Lists are growable arrays (ArrayList in Java) and Dictionaries are associative arrays (HashMap in Java). Tuples are just containters to hold other objects (No equivalent in Java). They are immutable.&lt;br /&gt;&lt;br /&gt;People always talk of productivity with dynamic languages. These built-in data structures are one of the main reasons for it. Sure Java has an amazing collections framework, but it's not a language feature. It's a framework built on top of the language. In python, these are part of the language... [] creates a list, {} creates a dictionary and () creates a tuple.&lt;br /&gt;&lt;br /&gt;Having these be part of the language makes a huge difference. In Java, if you want to return multiple values from a method... either do something ugly like return an array with the values (the values have to be of the same type) or define a new class to hold the values and return an instance of that class. Quite a pain. In python, you just put the values (of any type) inside a tuple and return. As simple as that. And as you can imagine, lists are used a lot to hold collections of data. But probably the most used data structure is the dictionary. It's a dumping ground in all sorts of situations. You would think it would be a readability nightmare but it isn't. It's almost a convention in python and when you come across code, it is immediately recognizable. And these ds's combined make for more productivity gains. Tuples, being immutable, can be used as keys. Also, python has support for sets as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115364572284062998?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115364572284062998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115364572284062998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115364572284062998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115364572284062998'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/07/re-one-array-to-rule-them-all.html' title='Re: One Array to rule them all'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115330525974182304</id><published>2006-07-19T10:29:00.000Z</published><updated>2006-07-19T10:34:20.070Z</updated><title type='text'>Some Windows installation tips</title><content type='html'>&lt;a href="http://www.informationweek.com/shared/printableArticle.jhtml?articleID=189400897"&gt;XP's No-Reformat, Nondestructive Total-Rebuild Option&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.informationweek.com/shared/printableArticle.jhtml?articleID=47212312"&gt;How To Save An Hour (Or More) On XP Installs by integrating SP2 with XP&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115330525974182304?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115330525974182304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115330525974182304' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115330525974182304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115330525974182304'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/07/some-windows-installation-tips.html' title='Some Windows installation tips'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115303122105322901</id><published>2006-07-16T06:26:00.000Z</published><updated>2006-07-16T06:27:01.396Z</updated><title type='text'>Right to Information</title><content type='html'>The Right to Information Act (RTI) was passed in 2005 which empowers Indians to ask the Government about anything that concerns them. You can ask questions like why the road outside your house is not repaired or why some facility is polluting your city. The official is under an obligation to respond to your query within a stipulated period.&lt;br /&gt;&lt;br /&gt;Now things are amazing on paper. I doubt that information comes so fast and easily. There are a few sites, organisations which assist in this.&lt;br /&gt;&lt;br /&gt;See &lt;a href="http://www.righttoinformation.org/"&gt;http://www.righttoinformation.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Maybe such a wiki like community site would better serve this purpose&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115303122105322901?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115303122105322901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115303122105322901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115303122105322901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115303122105322901'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/07/right-to-information.html' title='Right to Information'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115218726437237684</id><published>2006-07-06T11:56:00.000Z</published><updated>2006-07-06T12:01:04.673Z</updated><title type='text'>[Trackback]How to concentrate on writing</title><content type='html'>Something to think about..&lt;br /&gt;&lt;br /&gt;&amp;lt;quote&amp;gt;&lt;br /&gt;When I am up against a deadline and I absolutely, definitely have to get on with my work, I use a few tactics to force myself to concentrate:&lt;br /&gt;&lt;br /&gt;1. Switch off email. I don’t start Outlook (or if I do, I disable all the notifications that tell me I have new mail).&lt;br /&gt;&lt;br /&gt;2. Isolate myself. I use Bose noise-cancelling headphones but don’t plug them into anything. The silence really is golden.&lt;br /&gt;&lt;br /&gt;3. Greed and guilt. I remind myself how much money I’m getting paid for a particular assignment and how ashamed I will be if I miss the deadline. This actually works sometimes.&lt;br /&gt;&lt;br /&gt;4. Stop with the blog already. When I’m pressed for time, distractions like blogging and hoovering become very compelling. Knowing this makes it easier to resist.&lt;br /&gt;&lt;br /&gt;5. Get up early. 6am is the most productive time of day for writing. No distractions. It also feels more virtuous than staying up late with work.&lt;br /&gt;&lt;br /&gt;6. Little treats. I bribe myself: ‘Matthew, if you write another 500 words, you can have a cup of tea and a biscuit.’&lt;br /&gt;&lt;br /&gt;7. Chunking. Setting a timer or alarm clock for 15, 20, 30, 50 minutes and doing nothing but writing until it goes off and then taking a break seems like a good way to make progress.&lt;br /&gt;&lt;br /&gt;8. Go full screen. Switching Word into full screen mode (from the view menu) eliminates all distractions but the piece I’m working on.&lt;br /&gt;&lt;br /&gt;9. Shitty first draft. Splitting the work into distinct writing and editing phases breaks the job down nicely and it takes off some of the pressure to ‘get it right first time’.&lt;br /&gt;&lt;br /&gt;10. Change location. Sometimes, if I’m really struggling to get started, taking a laptop or my notebook to a cafe and scribbling out something there - a fresh new location - is a good way to jolt-start an assignment.&lt;br /&gt;&lt;br /&gt;&amp;lt;/quote&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115218726437237684?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115218726437237684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115218726437237684' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115218726437237684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115218726437237684'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/07/trackbackhow-to-concentrate-on-writing.html' title='[Trackback]&lt;a href=&quot;http://www.badlanguage.net/?p=185&quot;&gt;How to concentrate on writing&lt;/a&gt;'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115160763652978300</id><published>2006-06-29T19:00:00.000Z</published><updated>2006-06-30T05:48:44.390Z</updated><title type='text'>One Array to rule them all</title><content type='html'>I've been coding in php of late. So some thoughts on that...&lt;br /&gt;&lt;br /&gt;Most languages have a few Data Structures (ds). Java has the excellent Collections framework which contains quite a few types of ds as shown in the figure&lt;br /&gt;&lt;br /&gt;&lt;img src="http://java.sun.com/docs/books/tutorial/figures/collections/colls-coreInterfaces.gif" /&gt;&lt;br /&gt;&lt;br /&gt;What I found in php was the array();&lt;br /&gt;&lt;br /&gt;It can be used like...&lt;br /&gt;&lt;br /&gt;$pasta = array('spaghetti', 'penne', 'macaroni');&lt;br /&gt;&lt;br /&gt;In this case the array can be compared to a &lt;b&gt;List&lt;/b&gt; or an &lt;b&gt;Array&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can also add an element to the end of an existing array with the array_push() function or remove an element from the end by using the array_pop() function.&lt;br /&gt;&lt;br /&gt;Using the array_shift() and the array_unshift() function removing or adding elements to the beginning of the array can be done.&lt;br /&gt;&lt;br /&gt;So now the array can work both as a &lt;b&gt;Queue&lt;/b&gt; and a &lt;b&gt;Stack&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Additionally it is possible to declare an array like..&lt;br /&gt;&lt;br /&gt;$menu = array('breakfast' =&gt; 'bacon and eggs', 'lunch' =&gt; 'roast beef', 'dinner' =&gt; 'lasagna');&lt;br /&gt;&lt;br /&gt;Here 'breakfast' is a key and 'bacon and eggs' is the value. Usually keys are numbers from 0 onwards. In effect our innocent array is now a &lt;b&gt;Map&lt;/b&gt; as well.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All this is extremely great for learners. A few thoughts ..&lt;br /&gt;&lt;br /&gt;1. The array exposes an API for all these ds'es. How can I enforce an array to act only as a Queue? Is the leakage of the abstraction too much.&lt;br /&gt;&lt;br /&gt;2. How do they optimize? In Java I know the costs when I create a LinkedList or an ArrayList. Or use a TreeMap or HashMap. How is it done in php?&lt;br /&gt;&lt;br /&gt;3. Also are there Sets in php where one object cannot be added twice. Maybe I am missing some ds library in php ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115160763652978300?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115160763652978300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115160763652978300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115160763652978300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115160763652978300'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/06/one-array-to-rule-them-all.html' title='One Array to rule them all'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115109759254958312</id><published>2006-06-23T21:18:00.000Z</published><updated>2006-06-23T21:19:52.893Z</updated><title type='text'>Talk about complexity</title><content type='html'>Sheesh - &lt;a href="http://ptrthomas.wordpress.com/2006/06/06/java-call-stack-from-http-upto-jdbc-as-a-picture/" target="_blank"&gt;Java call stack - from HTTP upto JDBC as a picture&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115109759254958312?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115109759254958312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115109759254958312' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115109759254958312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115109759254958312'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/06/talk-about-complexity.html' title='Talk about complexity'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115094189624673565</id><published>2006-06-22T02:02:00.000Z</published><updated>2006-06-22T02:04:56.303Z</updated><title type='text'>Binary Search is broken</title><content type='html'>Courtesy Joshua Bloch (aka Java god) - &lt;a href="http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html" target="_blank"&gt;Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Can be filed for the next edition of Java Puzzlers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115094189624673565?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115094189624673565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115094189624673565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115094189624673565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115094189624673565'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/06/binary-search-is-broken.html' title='Binary Search is broken'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-115085051771315841</id><published>2006-06-21T00:39:00.000Z</published><updated>2006-06-21T00:41:57.736Z</updated><title type='text'>Get Functional</title><content type='html'>This article - &lt;a href="http://www.defmacro.org/ramblings/fp.html" target="_blank"&gt;Functional Programming for the rest of us&lt;/a&gt; - is like Argentina's performance against Serbia-Montenegro... beautiful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-115085051771315841?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/115085051771315841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=115085051771315841' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115085051771315841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/115085051771315841'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/06/get-functional.html' title='Get Functional'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114973803562191156</id><published>2006-06-08T03:38:00.000Z</published><updated>2006-06-08T03:41:04.646Z</updated><title type='text'>Re: Have you ever felt this?</title><content type='html'>The "there's got to be more to life than this" deamon thread gets activated often. It's still at a way low priority level as compared to that dude but dunno for how long.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114973803562191156?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114973803562191156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114973803562191156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114973803562191156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114973803562191156'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/06/re-have-you-ever-felt-this.html' title='Re: Have you ever felt this?'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114933295950835432</id><published>2006-06-03T11:06:00.000Z</published><updated>2006-06-03T11:09:19.570Z</updated><title type='text'>Have you ever felt this?</title><content type='html'>&lt;a href="http://be-hold.blogspot.com/2006/06/its-been-fun.html"&gt;It's been fun...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114933295950835432?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114933295950835432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114933295950835432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114933295950835432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114933295950835432'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/06/have-you-ever-felt-this.html' title='Have you ever felt this?'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114826656555235416</id><published>2006-05-22T02:42:00.000Z</published><updated>2006-05-22T02:56:05.570Z</updated><title type='text'>Is India at the Tipping Point?</title><content type='html'>Here's the article... &lt;a href="http://www.alwayson-network.com/comments.php?id=15024_0_38_0_C" target="_blank"&gt;http://www.alwayson-network.com/comments.php?id=15024_0_38_0_C&lt;/a&gt;. It's by a Microsoft employee, but talks generally about whats good/bad about the Indian market. He covers pretty much the entire spectrum. Specifically, I thought this statement holds very true... &lt;br /&gt;&lt;br /&gt;"It's also interesting to note that many Indians from the Valley are returning to India to set up their startup companies as well as to leverage the engineering/labor-cost advantages. While many startups we talked with have big ideas, they will need coaching to pitch ideas for funding and must be willing to accept possible failure, a normal part of the entrepreneurial culture.". &lt;br /&gt;&lt;br /&gt;I've been following a few blogs by Indians who worked in software companies in the US and have gone back to start companies (startups) of their own. These are proper software companies, products based not services/bpo companies, targeting the Indian market. I feel this is an important trend. The backbone of the Indian IT industry is services, but it probably won't be able to sustain the growth in the years to come especially as salaries increase. &lt;br /&gt;&lt;br /&gt;But at the same time, there are challenges. You have to think differently from if you were starting a co in the US because the market is so different. Broadband penetration is not high, payment procedures are different... credit card usage is not that common etc... But the guys who go back are smart and seem to take all this into account. Another thing is that the mobile market is booming and growing way faster than pc/broadband. So what about targeting mobile devices? That would be a huge market to target right off. I'm sure the big players like google, yahoo are already planning things, but there maybe opportunities to start some small super specific services?? What dyou think?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114826656555235416?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114826656555235416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114826656555235416' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114826656555235416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114826656555235416'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/05/is-india-at-tipping-point.html' title='Is India at the Tipping Point?'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114681659944238107</id><published>2006-05-05T07:59:00.000Z</published><updated>2006-05-05T08:09:59.460Z</updated><title type='text'>Bruce Eckel interviews.....</title><content type='html'>Bruce Eckel interviews.....&lt;br /&gt;&lt;br /&gt;AndersHejlsberg&lt;br /&gt;GuidoVanRossum&lt;br /&gt;JoshuaBloch&lt;br /&gt;MartinFowler&lt;br /&gt;BillVenners&lt;br /&gt;&lt;br /&gt;and others.&lt;br /&gt;&lt;br /&gt;If you want descriptions.. go &lt;a href="http://www.mindviewinc.com/mediacast/interviews/Index.php"&gt;here&lt;/a&gt; else for direct mp3's go &lt;a href="http://mindview.theunixman.com/"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114681659944238107?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114681659944238107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114681659944238107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114681659944238107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114681659944238107'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/05/bruce-eckel-interviews.html' title='Bruce Eckel interviews.....'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114633355130825105</id><published>2006-04-29T17:53:00.000Z</published><updated>2006-04-30T00:27:09.230Z</updated><title type='text'>Cool Calendar - Javascript  Web Based Calendar Application</title><content type='html'>Last term for a user interface design class, I made the a web-based calendar.  The calendar was about 3000 lines of Javascript.  It emulates Outlook in that you can drag and drop select and so forth.  The calendar however was just built for the user interface and has no backend.  Therefore any changes you make are only held in the client machine's memory.  When you reload they are reset.  Also its only Firefox 1.0* + compatible.  To see pre-populated events , go back to Dec. 2005.&lt;a href="http://people.csail.mit.edu/pawand/CoolCal/"&gt;Try it out here&lt;/a&gt;. &lt;a href="http://people.csail.mit.edu/pawand/"&gt;-Pawan&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114633355130825105?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114633355130825105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114633355130825105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114633355130825105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114633355130825105'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/04/cool-calendar-javascript-web-based.html' title='Cool Calendar - Javascript  Web Based Calendar Application'/><author><name>Pawan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114525976093836387</id><published>2006-04-17T07:35:00.000Z</published><updated>2006-04-17T18:29:59.160Z</updated><title type='text'>Phew</title><content type='html'>I have been coding in JSP for a while now and worked on the Struts framework as well. The servlet API's allow adding of instances to various levels of scope within the webapp. Like Application scope for the entire webapp, Session scope for the user session, Request scope for a particular request. Request scope is useful as the particular request response can be generated in parts by chaining servlets together. Now these methods make life pretty easy. Something which will used throughout the webapp can be kept at application scope and similarly at varying degrees of granularity at other scope. Like on correct credentials for a login form, a String can be stored in session scope.&lt;br /&gt;&lt;br /&gt;This would always disturb me. Simply because client specific data was being stored in-memory. Upto how many users can be supported in such an architecture? even if 10 bytes are stored per client, that can count to a lot of memory for say 10k users. Then the overhead of caching, maintaining state of live data and associating it with the client.&lt;br /&gt;&lt;br /&gt;Initially storing stuff in scope would make me think of the size of the objects I used to store. Then I realised frameworks like Struts store huge amounts of data at various scope. Like the action form etc in the request scope. So that made me feel that this is not such an issue. If such relatively heavy objects can be stored then that must be fine. And now with JSF etc these object are just getting larger.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then I read on the &lt;a href="http://www.zefhemel.com/archives/2004/09/01/the-share-nothing-architecture"&gt;Php Share-Nothing architecture&lt;/a&gt;. So the Share-Nothing architecture advocates... simply sharing nothing about the client on the server. As simple as that. Instead of storing stuff in memory, store details in a DB and make DB calls always. Now I am not actually sure how performant this is. But DB's have been around for a long while and have been well tuned. Plus DB's can be easily made to work in parallel redundant mode and have very good features.&lt;br /&gt;&lt;br /&gt;Again I know I am being premature to be so anti-in-memory stuff. Many large systems have been built, especially in the enterprise. But it just does not feel right. In the end it seems easier to scale horizontally with the Share-Nothing approach. The in-memory approach seems to force towards vertical scaling.&lt;br /&gt;&lt;br /&gt;Some examples... Flickr and Yahoo are two php based webapps. And they dont get bigger than them. Ebay is the biggest java based webapp i know of. But Google for ebay architecture and they too have a custom Share-Nothing like system in place. Gmail too uses Java, but have some super optimizations in place.&lt;br /&gt;&lt;br /&gt;Rails is one very hot webapp framework right now. &lt;a href="http://www.37signals.com/svn/archives/000606.php"&gt;This&lt;/a&gt; is one of the more intelligent discussions I have read. Coupled with &lt;a href="http://beust.com/weblog/archives/000382.html"&gt;this blog post&lt;/a&gt; Rails seems like something I would like to learn soon. These guys seem to be aware of both php and Java webapp dev. Any idea on their principles on this issue?&lt;br /&gt;&lt;br /&gt;What dyu guys think? Any of you really stick to the Share-Nothing principle?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114525976093836387?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114525976093836387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114525976093836387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114525976093836387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114525976093836387'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/04/phew.html' title='Phew'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114445876802615894</id><published>2006-04-08T01:02:00.000Z</published><updated>2006-04-08T03:01:17.636Z</updated><title type='text'>C# futures</title><content type='html'>Its been interesting to see the path static languages like C# and Java have taken over the past year with their 2.0 and 5.0 releases respectively. There has been a drive towards more 'staticness' with generics i.e. more type specification at compile time. This has generally been seen as a good thing... more descriptive, more type safe and more performant (in the case of C# ;-) code. But then you have dynamic languages like Python and Ruby which are essentially the complete opposite with no static type specification at all. All the variables only have dynamic types with everything being inferred.&lt;br /&gt;&lt;br /&gt;What's even more interesting is that inspite of this core difference C# has borrowed features for its 2.0 release from dynamic languages with more on the way for 3.0.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Iterators&lt;/b&gt; are a well known design pattern for traversing collections. They are a good way to loosley couple collections from the actual iterating process. So one can have multiple iterators, iterating collections in different ways. Iterators are sprinkled all throughout the Java Collection Framework and similarly C# has Enumerators having pretty much the same interface. Creating these iterators/enumerators invovles creating classes which keep track of state. Thats pretty much all they do... some logic to know where you are and to provide the next element. C# 2.0 introduced the &lt;b&gt;yield&lt;/b&gt; keyword which generates iterators dynamically that manage the state automatically. Ruby and Python both have it. Here's a simple ex...&lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;class MyCollection {&lt;br /&gt;&amp;nbsp; private int[] myElements;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; public IEnumerator GetEnumerator() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; foreach ( int i in this.myElements ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;yield&lt;/b&gt; i;&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Thats it. No creating a class which implements IEnumerator. It's all generated automatically dynamically. Huge productivity booster. Complements the foreach functionality nicely.&lt;br /&gt;&lt;br /&gt;C# 3.0 which is a ways off from being released has a lot more in store. Probably the biggest annoucement was about LINQ (Language Integrated Query) which introduces new syntax within the language to work with datasets - collections, relational databases (DLINQ) and xml (XLINQ). This major feature brings with it many smaller ones which again seem to borrow a lot from dynamic languages...&lt;br /&gt;&lt;br /&gt;Probably, the most surprising one is &lt;b&gt;Implicit Typing&lt;/b&gt;. You can do things like&lt;br /&gt; &lt;br /&gt;&lt;font face="courier"&gt;var i = 1; &lt;br /&gt;var s = "string";&lt;br /&gt;var d = 1.11;&lt;br /&gt;var numbers = new int[] { 0, 1, 2 };&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Surprising since it goes against what C#/Java type languages have been known for. But this is a feature needed to make LINQ work since you don't know the final type which will be the result of queries.&lt;br /&gt;&lt;br /&gt;Another interesting one is &lt;b&gt;Extension Methods&lt;/b&gt;. Ruby has this feature. You can add new methods to existing types without being part of any type hierarchy. You can even add methods to sealed classes like String. As an example, think about a method that checks if a string is a palindrome. Normally, one would create something like a Palindrome class which has a static isPalindrome method which takes a string... &lt;font face="courier"&gt;Palindrome.IsPalindrome( text )&lt;/font&gt;. Pretty inelegant. With extension methods, you can define a method like this &lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;static boolean IsPalindrome( &lt;b&gt;this&lt;/b&gt; string text ) { ... }&lt;/font&gt;&lt;br /&gt;And call it like this&lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;string text = "civic"; &lt;br /&gt;bool palindrome = text.IsPalindrome();&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;It's a pretty cool feature which, again, is needed to add some LINQ funtionality. But I think there is potential for abuse here and without proper documentation it might cause some confusion.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Lambda Expressions&lt;/b&gt; have been available in many languages for a while. C# is finally getting this feature in 3.0. These expressions are popular when filtering datasets and as you can imagine would be an integral part of LINQ. Here's a simple example...&lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;List&amp;lt;int&amp;gt; numbers = new List&amp;lt;int&amp;gt;;&lt;br /&gt;numbers.add( 0 );&lt;br /&gt;numbers.add( 1 );&lt;br /&gt;numbers.add( 2 );&lt;br /&gt;numbers.add( 3 );&lt;br /&gt;numbers.add( 4 );&lt;br /&gt;&lt;br /&gt;List&amp;lt;int&amp;gt; evenNumbers = numbers.FindAll( &lt;b&gt;i =&gt; ( i % 2 ) == 0 &lt;/b&gt; );&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;So FindAll() will filter the list based on the lambda expression. Syntax seems a bit strange.&lt;br /&gt;&lt;br /&gt;A final interesting feature was &lt;b&gt;Anonymous Types&lt;/b&gt;. Languages like Python and Ruby have this concept of a tuple which can hold multiple values. So you can have methods returning multiple values. In C# or Java this isn't possible. What many end up doing is to return an array with 2 or more values. Pretty inelegant. Or you have to actually define a type which just holds those values and return that. It's a hassle. With anonymous types you can again dynamically create types without (as the name would suggest) giving it a name...&lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;var person = new { Name = "C Sharp", Age = 4 };&lt;br /&gt;Console.WriteLine( "Name: {0}, Age: {1}", person.Name, person.Age );&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Again, as you can guess this is another needed feature for LINQ.&lt;br /&gt;&lt;br /&gt;I haven't mentioned much about LINQ itself since I've only read a little about it and seen a &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=114680" target="_blank"&gt;video&lt;/a&gt; by &lt;a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg" target="_blank"&gt;the man&lt;/a&gt;. So dunno a lot of details myself. What would be interesting is to see all the IL that is generated to make all these abstractions work. &lt;br /&gt;&lt;br /&gt;Anyway, it's something to look out for. Maybe Java will also be including some data related features for their Dolphin release.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114445876802615894?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114445876802615894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114445876802615894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114445876802615894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114445876802615894'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/04/c-futures.html' title='C# futures'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114345163447416873</id><published>2006-03-27T08:54:00.000Z</published><updated>2006-03-27T09:27:14.540Z</updated><title type='text'>Bombay</title><content type='html'>A podcast on the city I call home - Bombay, by Suketu Mehta Author, "Maximum City".&lt;br /&gt;&lt;br /&gt;http://www.itconversations.com/shows/detail769.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114345163447416873?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114345163447416873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114345163447416873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114345163447416873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114345163447416873'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/03/bombay.html' title='Bombay'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114246117729376425</id><published>2006-03-15T22:13:00.000Z</published><updated>2006-03-15T22:19:37.306Z</updated><title type='text'>Java tip - Get the method call hierarchy</title><content type='html'>So here's a small tip I learnt recently which I find useful at times. Quite often it is a pain to debug an application. You just want to have a trace from where a particular method was called.&lt;br /&gt;&lt;br /&gt;Simply use this&lt;br /&gt;&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MyClass() {&lt;br /&gt;    myMethod() {&lt;br /&gt;        new RuntimeException().printStackTrace();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;Now whenever myMethod is called; a stack trace will be printed. So you can easily get the hierarchy of the calls made to reach that execution point. Notice that the Exception was not thrown; hence no handling is needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114246117729376425?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114246117729376425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114246117729376425' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114246117729376425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114246117729376425'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/03/java-tip-get-method-call-hierarchy.html' title='Java tip - Get the method call hierarchy'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114170387116328467</id><published>2006-03-07T03:15:00.000Z</published><updated>2006-03-07T03:57:51.240Z</updated><title type='text'>JUnit Revelation</title><content type='html'>I stumbled upon &lt;a href="http://martinfowler.com/bliki/JunitNewInstance.html" target="_blank"&gt;this&lt;/a&gt; post by Martin Fowler via another blog. It's a bit dated (2004), but interesting. It reveals that JUnit creates a new instance of &lt;b&gt;TestCase&lt;/b&gt; for each &lt;i&gt;test&lt;/i&gt; method defined within it. The primary reason for doing this is so that tests are isolated from each other. That is tests don't share the state of objects. So they can be run in any order needed.&lt;br /&gt;&lt;br /&gt;JUnit has two special methods &lt;b&gt;setUp&lt;/b&gt; and &lt;b&gt;tearDown&lt;/b&gt; (these I guess can be called anything in the newer version using Annotations) that are automatically run (if defined) before each test method. I wondered how they did this. Now it makes sense.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114170387116328467?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114170387116328467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114170387116328467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114170387116328467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114170387116328467'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/03/junit-revelation.html' title='JUnit Revelation'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114109973383187051</id><published>2006-02-28T03:35:00.000Z</published><updated>2006-02-28T06:23:26.676Z</updated><title type='text'>Re: JSTL - What's the point?</title><content type='html'>Chris,&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;But I think the JSTL was meant to be a base framework, allowing developers to extend and write their own tags. They're called "custom tags", and they can be pretty useful.&lt;br /&gt;&lt;br /&gt;For example, I can write a tag that handles the logic for displaying a set of page number links. Then the web designer just needs to know how to place [foo:pagination style="xyz"/] on the page, and voila, the pagination comes out. Or, you could log an advertisement impression with a simple tag like "[ads:logImpression position="${pos}"/]. Then the code behind this tag can do whatever it needs to do -- in this case, log an impression to the database. The former example results in HTML output, and the latter doesn't.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;The examples you give make perfect sense. Placing custom tags which &lt;b&gt;encapsulate all the display logic&lt;/b&gt; within them is fine. The designer and the presentation layer don't see any of that logic. This is precisely the idea behind ASP.NET web controls like &amp;lt;asp:DataGrid&amp;gt; or &amp;lt;asp:Calendar&amp;gt;. I only took issue with having tags like &amp;lt;c:if&amp;gt; and &amp;lt;c:foreach&amp;gt; ingrained within the html. I didn't see them as being any improvement over scriptlets within html.&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;(I had to use [ and ] above instead of less-than and greater-than - blogger wouldn't let me enter less-than and greater-than!)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Yeah &amp;lt; and &amp;gt; are special characters. The browser interprets it as being an html tag and tries to parse it. To actually display it you have to use &amp;amp;lt; and &amp;amp;gt;.&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;There are some frameworks built on top of servlets/JSP/JSTL that provide higher-level custom tags, such as Struts and JSF, as you mentioned. Components such as "DataGrid" as nice for rapid development, but if you need to customize that component, the built-in tags may not work well. (I don't know much about DataGrid in particular, as I'm not familiar with .NET)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;I dunno how custom tags like &amp;lt;ads:logImpression&amp;gt; are developed (I assume using JSTL/EL?), but in ASP.NET these web controls are basically classes. So the &lt;b&gt;&amp;lt;asp:Calendar&amp;gt;&lt;/b&gt; control is actually implemented in &lt;b&gt;System.Web.UI.WebControls.Calendar&lt;/b&gt; within the .NET framework. Its 'real' code - as in implemented using C#. So all the rules of OOP apply here. All web controls directly or indirectly inherit from the base &lt;b&gt;System.Web.UI.Control&lt;/b&gt; class which provides some common functionality. And it's really easy to customize any functionality you would want. Just create your own custom controls that inherit from one of these base controls and override away. These controls also allow you to hook in callbacks for certain events which is another way to customize the controls. Check out &lt;a href="http://aspnet.4guysfromrolla.com/articles/100103-1.aspx" target="_blank"&gt;this&lt;/a&gt; article which provides a nice explanation of both processes.&lt;br /&gt;&lt;br /&gt;&lt;font color="blue"&gt;Could you post or link a simple ASP.NET example showing this separation of UI/model?&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;One of the areas where the Servlet/JSP model wins is in the clear separation between the control code and the presentation. There are two &lt;i&gt;separate&lt;/i&gt; components. Requests (generally) hit Servlets after which they are forwarded to independent JSPs. In ASP.NET, there is only one component - the Page. Although this page is separated between into a &lt;b&gt;.aspx&lt;/b&gt; file (UI) and a &lt;b&gt;.cs/.vb&lt;/b&gt; file (code) using the &lt;b&gt;Code Behind Model&lt;/b&gt;, these are compiled down to one component. So basically all requests go to a Page and then could potentially be forwarded elsewhere. It's sort of "backwards" to the MVC model. So the Servlet/JSP API model is richer in that sense. Having said this, the Code Behind model does have its advantages. Probably the biggest one being all the UI components are represented as objects which can be manipulated in the code behind page. &lt;a href="http://support.microsoft.com/kb/303247/EN-US/" target="_blank"&gt;Here&lt;/a&gt; is a simple explanation of the concept.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114109973383187051?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114109973383187051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114109973383187051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114109973383187051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114109973383187051'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/re-jstl-whats-point_28.html' title='Re: JSTL - What&apos;s the point?'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114106649903413586</id><published>2006-02-27T18:33:00.000Z</published><updated>2006-02-27T18:55:49.630Z</updated><title type='text'>Re:  JSTL - What's the point?</title><content type='html'>&lt;font color="red"&gt;What is the logic behind separating presentation from code? Apart from the "MVC pattern"/"loosely coupled principle", it is also to accommodate designers and coders....The "logic" is still ingrained within the presentation. It is still code, just with tags, instead of java. How is this any better for designers or code maintenance? Somehow this made no sense to me.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;What you mentioned is very right. See &lt;a href="http://today.java.net/pub/a/today/2003/11/27/jstl2.html"&gt;this&lt;/a&gt; post section Using the SQL Actions&lt;br /&gt;&lt;br /&gt;&amp;lt;excerpt&amp;gt;&lt;br /&gt;The JSTL includes a number of actions that provide a mechanism for interacting with databases. The previous sentence should, at a very minimum, send up a red flag in your architectural visions. One might ask, "Do I really want to be able to perform SQL actions such as queries, updates, and transactions from my JSP? Isn't that business logic that belongs in the model?" The answer is yes. Yes, yes, yes. To follow a Model-View-Controller (MVC) architecture, which is the predominant design pattern used in building web applications today, you definitely want to keep your model information in your business logic. This means that you don't  want it in your JSPs. Why then are these actions even provided in the JSTL? Good question and one that I've discussed with various members of the JSR-53 expert group. The reason is the "C" or community in the Java Community Process (JCP). The community has asked for it, the community has gotten it.&lt;br /&gt;&amp;lt;/excerpt&amp;gt;&lt;br /&gt;&lt;br /&gt;So thats that. Even the tags Mohnish mentioned are not that great. But... its fine.&lt;br /&gt;&lt;br /&gt;Adding to the &lt;a href="http://codeword.blogspot.com/2006/02/jstl-whats-point.html#c114101592642120299"&gt;comment&lt;/a&gt; ; JSTL was a another step. Jsp did something better than Servlets. Jstl added something. Then Jstl EL was added which was purposefully given a more JavaScript like syntax. Now we have JSF which gives a more component based web dev feel. I don't know much on JSF though. Also there are actually competing web frameworks in the Java world like Struts, Tapestry... So again loads of choice :)&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;ASP.NET has the right solution for separation with web controls.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Could you post or link a simple ASP.NET example showing this separation of UI/model?&lt;br /&gt;&lt;br /&gt;How is webapp dev in php? Do they too generally look out for such MVC stuff?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114106649903413586?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114106649903413586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114106649903413586' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114106649903413586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114106649903413586'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/re-jstl-whats-point.html' title='Re:  JSTL - What&apos;s the point?'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114083715184629603</id><published>2006-02-25T02:33:00.000Z</published><updated>2006-02-25T03:21:02.593Z</updated><title type='text'>JSTL - What's the point?</title><content type='html'>I've been taking a look at Web related stuff in Java lately. Nothing too complex, just your basic Servlets/JSP. The general concepts behind these web frameworks (ASP[.NET], PHP, Ruby etc...) are all similar. The book I'm reading (&lt;a href="http://www.amazon.com/gp/product/0596005407/sr=8-4/qid=1140837220/ref=pd_bbs_4/103-1189862-3799827?%5Fencoding=UTF8" target="_blank"&gt;Head First Servlets and JSP&lt;/a&gt;) has a nice way of explaining the components of the Java system. It starts with the simplest way to accomplish your goal, then shows what's wrong with it and finally how to improve upon it.&lt;br /&gt;&lt;br /&gt;First you got your basic requests hitting a &lt;b&gt;Servlet&lt;/b&gt; that does some processing and spits out HTML to the client. Nice and simple, but writing all that HTML code within the Servlet is horrible. Enter &lt;b&gt;JSP&lt;/b&gt;. JSPs can contain the presentation (HTML). So now your requests hit a Servlet that does the processing after which it redirects to your JSP which has all the HTML code. Now there's a nice separation between code (Servlet) and presentation (JSP). But the JSP is pretty static. What if the presentation needs to be dynamic and depends on the processing done in the Servlet. Enter &lt;b&gt;Scriptlets&lt;/b&gt;. These are code segments within JSP that can make the page dynamic. Great... you get nice dynamic pages now, but your presentation is cluttered with code. Enter &lt;b&gt;JSTL (Java Server Tag Library)&lt;/b&gt;. This is a tag library which is to replace those scriplets. So instead of code you have 'html like' tags. &lt;br /&gt;&lt;br /&gt;This is pretty new to me, so I was trying to understand the rational behind it all. The progression made sense from Servlets to JSP to Scriptlets. But somehow the point of JSTL was completely lost on me. &lt;br /&gt;&lt;br /&gt;What is the logic behind separating presentation from code? Apart from the "MVC pattern"/"loosely coupled principle", it is also to accommodate designers and coders. Designers can work on the presentation and not have to deal with code. But when you look at JSTL, its core tags are &amp;lt;c:if&amp;gt;, &amp;lt;c:choose&amp;gt;, &amp;lt;c:forEach&amp;gt;, &amp;lt;c:set&amp;gt;, &amp;lt;c:remove&amp;gt; etc... It's just replacing code statements with tags. The "logic" is still ingrained within the presentation. It is still code, just with tags, instead of java. How is this any better for designers or code maintenance? Somehow this made no sense to me.&lt;br /&gt;&lt;br /&gt;ASP.NET has the right solution for separation with web controls. You can place these components within a page. These are plain tags like &amp;lt;asp:DataGrid&amp;gt;, &amp;lt;asp:Textbox&amp;gt;, &amp;lt;asp:Labels&amp;gt; etc... They are just responsible for rendering plain html. The logic to decide WHAT they render is placed in a 'code behind' page. Complete separation of code from presentation. Designers don't need to see any logic disguised as tags. I've heard of Java Server Faces which is something that's similar to this thats come up recently. Rahul can expand on it. But I can't believe JSTL was considered a solution at some stage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114083715184629603?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114083715184629603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114083715184629603' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114083715184629603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114083715184629603'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/jstl-whats-point.html' title='JSTL - What&apos;s the point?'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114066744394643768</id><published>2006-02-23T03:55:00.000Z</published><updated>2006-02-23T04:04:03.963Z</updated><title type='text'>Outsourcing and Globalization</title><content type='html'>Seems like stories about outsourcing have cooled a bit. Atleast sources I check haven't been making too much noise about it lately. One of the podcasts I listen to had an interview with a guy who has a small co in NY and outsources to two cos in India - Pune and Delhi. I thought his story was pretty good. Check it out &lt;a href="http://www.dotnetrocks.com/default.aspx?showID=165" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114066744394643768?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114066744394643768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114066744394643768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114066744394643768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114066744394643768'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/outsourcing-and-globalization.html' title='Outsourcing and Globalization'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-114042067122531667</id><published>2006-02-20T07:11:00.000Z</published><updated>2006-02-20T07:32:42.593Z</updated><title type='text'>Broadband as a utility</title><content type='html'>Really blows my mind... &lt;a href="http://money.cnn.com/magazines/business2/business2_archive/2006/01/01/8368133/index.htm" target="_blank"&gt;100 megabits for $25 per month&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Rahul had recently sent me a link to an interview with Josh Bloch/Neal Gafter (java gods) over at &lt;a href="http://www.javapolis.com/confluence/display/JP05/Home" target="_blank"&gt;javapolis&lt;/a&gt;. One of the questions asked was about future directions about the language. Neal Gafter talked about doing more on the client side. He mentioned how the gmail experience would be much better if it could be used as a client app with better offline support. You really have to wonder if this is going to be an issue moving forward with services like what City Telecom is offering - always on connectivity at huge speeds.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-114042067122531667?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/114042067122531667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=114042067122531667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114042067122531667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/114042067122531667'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/broadband-as-utility.html' title='Broadband as a utility'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113954128646916452</id><published>2006-02-10T03:13:00.000Z</published><updated>2006-02-10T03:14:46.486Z</updated><title type='text'>Re: One Thread to rule them all</title><content type='html'>Since we're having a discussion on threads, this article seemed topical - &lt;a href="http://www.acmqueue.org/modules.php?name=Content&amp;pa=showpage&amp;pid=348" target="_blank"&gt;Threads Without the Pain&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113954128646916452?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113954128646916452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113954128646916452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113954128646916452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113954128646916452'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/re-one-thread-to-rule-them-all_10.html' title='Re: One Thread to rule them all'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113952649637286816</id><published>2006-02-09T21:00:00.000Z</published><updated>2006-02-09T23:08:16.443Z</updated><title type='text'>Re: One Thread to rule them all</title><content type='html'>I've used threads in C and Java. In C, I used the pthreads (POSIX threads) library. Of course, it's not as peaceful as threads in Java. &lt;br /&gt;&lt;br /&gt;Synchronization is done using mutexes and condition variables. Mutexes allow you to avoid race conditions. Condition variables allow you to wait until any specified condition is satisfied. There's a bunch of functions that are used to do this - pthread_mutex_init/lock/unlock/trylock etc. and pthread_cond_init/wait/broadcast etc. &lt;br /&gt;&lt;br /&gt;Of course, thread operations are completely procedural in nature - pthread library functions that take as arguments function pointers/thread variables (pthread_t) and such other stuff.&lt;br /&gt;&lt;br /&gt;򪪪򪪪򪪪򪪪򪪪&lt;a href="http://yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html"&gt;Here&lt;/a&gt;'s a decent tutorial for pthreads.&lt;br /&gt;&lt;br /&gt;Sometimes, it's better to just fork() processes and have them communicate using pipes, semaphores in shared memory etc. &lt;br /&gt;&lt;br /&gt;Just a personal opinion - while a lot of things are much easier to do in Java, I would still recommend trying them out in C (or C++) atleast once. You just get a slightly 'inside' view of things... not just threads, even stuff like socket programming. However, for day to day use, Java's a better bet.&lt;br /&gt;&lt;br /&gt;Have never used threads in Lisp but I do know that there's a package for threads. While Lisp is projected as an AI language, it has support for a whole lot of things from threads, sockets, interfacing with the OS etc. (OT - While the 'biggest deal' about lisp is its natural use to do functional programming, it also supports procedural and object oriented programming)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113952649637286816?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113952649637286816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113952649637286816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113952649637286816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113952649637286816'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/re-one-thread-to-rule-them-all_09.html' title='Re: One Thread to rule them all'/><author><name>Hrishikesh Tapaswi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113929224239533971</id><published>2006-02-07T05:57:00.000Z</published><updated>2006-02-08T22:14:05.450Z</updated><title type='text'>Re: One Thread to rule them all</title><content type='html'>&lt;font color="red"&gt;The generic question now. Have you guys come across any similar stuff in other languages? Java has had good support for threading since the early days and now in Java 5 this has been greatly enhanced. What about other languages? C++, C#. And anyone have info about dynamic languages like Lisp, Python etc?&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;I haven't seen the pattern (WorkerThread) that you wrote about... having one worker thread manage multiple tasks. I don't think this pattern is there in .NET. From what I understand, .NET has a different framework. There is probably a one to one similarity with the Threading package (atleast pre Java 5.0). However, .NET has an asynchronous framework built into all delegates. You can invoke delegates with myDelegate.BeginInvoke() and it will run asynchronously. That is, control will be immediately returned. I believe it picks a thread from a ThreadPool and executes it on that in the background. It's pretty nice in that all your own custom delegates get this feature for free.&lt;br /&gt;&lt;br /&gt;When talking about UIs and threads there's another important aspect. Any updates to UI controls should only be made by the thread that created it. So if you have a background thread doing some work and you want to display a message in the UI when it's done, you can't simply access the control and update it directly. You need to marshal any updates through the 'owner' thread. Here's an example in C#... &lt;br /&gt;&lt;br /&gt;// UI&lt;br /&gt;&lt;font face="courier" size="2"&gt;public class ClientUI : System.Windows.Forms.Form&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;private System.Windows.Forms.Label lblStatus;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;private void UpdateStatus() &lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ( this.lblStatus.InvokeRequired ) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.lblStatus.Invoke( new MethodInvoker( this.UpdateStatus ) );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.lblStatus.Text = "Done!";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;All UpdateStatus() is doing is setting a property on a Label. UpdateStatus() would likely be registered as a callback. So when the background thread is done with its processing, it would raise an event and UpdateStatus() would get called. When it does, it can't just update the control since it is not the 'owner' thread. So it needs to marshal the call. This is done with this.lblStatus.Invoke(). MethodInvoker() is just a delegate which takes methods that don't have any arguments and returns nothing. Invoke() takes care of the marshalling. &lt;br /&gt;&lt;br /&gt;What's the if/then statement for? &lt;b&gt;InvokeRequired&lt;/b&gt; is a property on every UI control. It will tell you if the call was made from the thread that owns the control or not. If it does own it, it's just a direct update, if not, it needs to be marshalled.&lt;br /&gt;&lt;br /&gt;All UI elements inherit from the &lt;b&gt;Control&lt;/b&gt; class and all of them in turn have the &lt;b&gt;InvokeRequired&lt;/b&gt; property and &lt;b&gt;Invoke()&lt;/b&gt; method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113929224239533971?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113929224239533971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113929224239533971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113929224239533971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113929224239533971'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/re-one-thread-to-rule-them-all.html' title='Re: One Thread to rule them all'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113922480742159777</id><published>2006-02-06T11:06:00.000Z</published><updated>2006-02-06T11:53:29.136Z</updated><title type='text'>One Thread to rule them all</title><content type='html'>In UI Applications it is a requirement to run some tasks in different threads so that the user will not notice a lag while performing some operations. Also often these threads are either of not very long duration or need to be run one after the other. So how do we solve this?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A small diversion to Threads in Java&lt;br /&gt;&lt;br /&gt;Now in Java the Runnable interface is used to create threads. Runnable contains a single method run() which needs to be implemented.&lt;br /&gt;&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;public class MyThread implements Runnable {&lt;br /&gt;public void run() {&lt;br /&gt;//do some task&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;To execute the above as a separate thread you need to call the start method of the Thread class. The Thread class can accept a Runnable instance&lt;br /&gt;&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;new Thread(new MyThread()).start()&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;start() internally performs some housekeeping to actually create the new thread. After performing the necessary operations, Runnable.run() is called.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Back to our UI Application.&lt;br /&gt;&lt;br /&gt;What is done is a simple event queue is built for handling all non-ui tasks. Which internally contains a Queue and a single thread.&lt;br /&gt;&lt;br /&gt;&amp;lt;code&amp;gt;&lt;br /&gt;public class Worker implements Runnable {&lt;br /&gt;&lt;br /&gt;private Queue queue;&lt;br /&gt;private boolean running;&lt;br /&gt;&lt;br /&gt;private Worker INSTANCE = new Worker();&lt;br /&gt;&lt;br /&gt;private Worker() {&lt;br /&gt;new Thread(this).start();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static Worker getInstance() {&lt;br /&gt;return INSTANCE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void run() {&lt;br /&gt;if(!running) {&lt;br /&gt;running = true;&lt;br /&gt;while(true) {&lt;br /&gt;if( queue.peek() ) {&lt;br /&gt;Runnable runnable = queue.pop();&lt;br /&gt;runnable.run();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void addRunnable(Runnable runnable) {&lt;br /&gt;queue.push(runnable);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/code&amp;gt;&lt;br /&gt;&lt;br /&gt;I have just given a basic skeleton here and left out the most important part of synchronizing the class. The running boolean was added to prevent new Thread(Worker.getInstance()).start(). You guys see any more errors? Threads are one of my primary weaknesses which I hope to rectify by learning about the new Java 5 Concurrency features.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For small tasks it is more efficient to use a Worker like this which internally doesn't create a new Thread for each task and re-uses a Thread or even a thread pool. This is because the start() method does quite a bit internally.&lt;br /&gt;&lt;br /&gt;In Swing it's suggested to use a SwingWorker class which does something similar. Also Java 5 (Tiger) has added a new SwingWorker class which is additionally Generic.&lt;br /&gt;&lt;br /&gt;The generic question now. Have you guys come across any similar stuff in other languages? Java has had good support for threading since the early days and now in Java 5 this has been greatly enhanced. What about other languages? C++, C#. And anyone have info about dynamic languages like Lisp, Python etc?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113922480742159777?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113922480742159777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113922480742159777' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113922480742159777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113922480742159777'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/one-thread-to-rule-them-all.html' title='One Thread to rule them all'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113909412248046966</id><published>2006-02-04T22:59:00.000Z</published><updated>2006-02-04T23:02:02.493Z</updated><title type='text'>Refactoring enhanced</title><content type='html'>Probably the single most common refactoring one does when writing code is renaming variables. Saw this cool feature in Visual Studio 2005...&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.codinghorror.com/blog/images/smart-tag-rename-demo-movie.gif"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113909412248046966?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113909412248046966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113909412248046966' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113909412248046966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113909412248046966'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/02/refactoring-enhanced.html' title='Refactoring enhanced'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113861446938958786</id><published>2006-01-30T09:39:00.000Z</published><updated>2006-01-30T09:48:39.796Z</updated><title type='text'>Re: Google China</title><content type='html'>I think Diana Hsieh puts it very eloquently &lt;a href="http://www.dianahsieh.com/blog/2006/01/meaning-of-censorship.html" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I wish Google had taken a stand and said no to the Chinese Government, but ultimately its their company and they have a right to do what they wish with their search results.&lt;br /&gt;&lt;br /&gt;Dinesh.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113861446938958786?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113861446938958786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113861446938958786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113861446938958786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113861446938958786'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/re-google-china.html' title='Re: Google China'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113838928884329098</id><published>2006-01-27T19:01:00.000Z</published><updated>2006-01-27T19:14:48.903Z</updated><title type='text'>Google China</title><content type='html'>Found this article (on yahoo ;-) - &lt;a href="http://sg.biz.yahoo.com/060126/15/3y7zo.html" target="_blank"&gt;Google's Action Makes A Mockery Of Its Values&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You must have heard about Google sensoring their search results to meet China's demands. What dyou think? Once a company goes public, it takes on many more responsibilities. Although an admirable motto - Do No Evil - it was always going to be hard to stick to that when you have to satisfy shareholders. Growth in revenues and profits becomes your number one goal. That is automatically seen as 'evil'. Which is another interesting point... you think a super successful company can ever be seen in a favorable light?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113838928884329098?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113838928884329098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113838928884329098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113838928884329098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113838928884329098'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/google-china.html' title='Google China'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113829538242124802</id><published>2006-01-26T17:06:00.000Z</published><updated>2006-01-26T17:30:26.333Z</updated><title type='text'>Re: Another greasemonkey script....</title><content type='html'>A few minor changes... Instead of an alert, a message is displayed at the top left of the screen for 5 seconds. In the code, the literal "constants" are moved outside of the for loop. The check for presence of both reference and code is moved inside the loop.&lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;&lt;br /&gt;// ==UserScript==&lt;br /&gt;// @name Google Analytics Detector&lt;br /&gt;// @namespace http://codeword.blogspot.com&lt;br /&gt;// @description Detects if a page uses Google Analytics&lt;br /&gt;// @include *&lt;br /&gt;// ==/UserScript==&lt;br /&gt;&lt;br /&gt;var URL = "http://www.google-analytics.com/urchin.js";&lt;br /&gt;var TRACKER = "urchinTracker()";&lt;br /&gt;&lt;br /&gt;var scripts = document.getElementsByTagName( "script" );&lt;br /&gt;&lt;br /&gt;var refPresent = false, codePresent = false, log = false;&lt;br /&gt;&lt;br /&gt;for ( var i = 0; i &lt; scripts.length; ++i ) {&lt;br /&gt;  var script = scripts[ i ];&lt;br /&gt;&lt;br /&gt;  // Check reference if not already found&lt;br /&gt;  if ( !refPresent ) {&lt;br /&gt;    var ref = script.src;&lt;br /&gt;&lt;br /&gt;    if ( ref != null ) {&lt;br /&gt;      refPresent = ( ref.search( URL ) != -1 );&lt;br /&gt;&lt;br /&gt;    if( log )&lt;br /&gt;      GM_log( "Tested ref: " + ref + " Result: " + refPresent );&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Check code if not already found&lt;br /&gt;  if ( !codePresent ) {&lt;br /&gt;    var code = script.innerHTML;&lt;br /&gt;&lt;br /&gt;    if ( code != null ) {&lt;br /&gt;      codePresent = ( code.search( TRACKER ) != -1 );&lt;br /&gt;&lt;br /&gt;    if( log )&lt;br /&gt;      GM_log( "Tested code: " + code + " Result: " + codePresent );&lt;br /&gt;    } &lt;br /&gt;  }  &lt;br /&gt;&lt;br /&gt; if ( refPresent &amp;&amp; codePresent ) {&lt;br /&gt;  var logo = document.createElement("div");&lt;br /&gt;  logo.id = "logo";&lt;br /&gt;  logo.innerHTML = '&amp;lt;div style="position: absolute; left: 0px; top: 0px;' +&lt;br /&gt;   'border-bottom: 1px solid #000000; margin-bottom: 5px; ' +&lt;br /&gt;   'font-size: small; background-color: #000000; z-index: 100;' +&lt;br /&gt;   'color: #ffffff; width:200px; opacity: .75;"&amp;gt;&amp;lt;p style="margin: 2px 0 1px 0;"&amp;gt; ' +&lt;br /&gt;   '&amp;lt;b&amp;gt;Google Analytics enabled&amp;lt;/b&amp;gt;' +&lt;br /&gt;   '&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;';&lt;br /&gt;  &lt;br /&gt;  document.body.insertBefore( logo, document.body.firstChild );&lt;br /&gt;  &lt;br /&gt;  window.setTimeout(&lt;br /&gt;   function() {&lt;br /&gt;    var logo = document.getElementById( "logo" );&lt;br /&gt;    if ( logo ) {&lt;br /&gt;     logo.parentNode.removeChild( logo );&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   , 5000 );&lt;br /&gt;  return;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113829538242124802?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113829538242124802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113829538242124802' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113829538242124802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113829538242124802'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/re-another-greasemonkey-script_26.html' title='Re: Another greasemonkey script....'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113826440409521110</id><published>2006-01-26T08:22:00.000Z</published><updated>2006-01-26T08:33:24.106Z</updated><title type='text'>Re:  Another greasemonkey script....</title><content type='html'>Here's the first attempt...&lt;br /&gt;&lt;br /&gt;&lt;font face="courier"&gt;// ==UserScript==&lt;br /&gt;// @name          Google Analytics Detector&lt;br /&gt;// @namespace     http://codeword.blogspot.com&lt;br /&gt;// @description   Detects if a page uses Google Analytics&lt;br /&gt;// @include       *&lt;br /&gt;// ==/UserScript==&lt;br /&gt;&lt;br /&gt;var scripts = document.getElementsByTagName( "script" );&lt;br /&gt;&lt;br /&gt;var refPresent = false, codePresent = false;&lt;br /&gt;&lt;br /&gt;for ( var i = 0; i &lt; scripts.length; ++i ) {&lt;br /&gt;  var script = scripts[ i ];&lt;br /&gt;&lt;br /&gt;  // Check reference if not already found&lt;br /&gt;  if ( !refPresent ) {&lt;br /&gt;    var ref = script.src;&lt;br /&gt; &lt;br /&gt;    if ( ref != null ) {&lt;br /&gt;      var URL = "http://www.google-analytics.com/urchin.js";&lt;br /&gt;&lt;br /&gt;      refPresent = ( ref.search( URL ) != -1 );&lt;br /&gt;&lt;br /&gt;      GM_log( "Tested ref: " + ref + " Result: " + refPresent );&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Check code if not already found&lt;br /&gt;  if ( !codePresent ) {    &lt;br /&gt;    var code = script.innerHTML;&lt;br /&gt;&lt;br /&gt;    if ( code != null ) {&lt;br /&gt;      var ACCT = "_uacct";&lt;br /&gt;      var TRACKER = "urchinTracker()";&lt;br /&gt;&lt;br /&gt;      codePresent = ( ( code.search( ACCT ) != -1 ) &amp;&amp; ( code.search( TRACKER ) != -1 ) );&lt;br /&gt;&lt;br /&gt;      GM_log( "Tested code: " + code + " Result: " + codePresent );&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ( refPresent &amp;&amp; codePresent ) {&lt;br /&gt;  alert( "This smart bastard is using Google Analytics" );&lt;br /&gt;}&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Save as analyticsDetector.user.js, open in Firefox and then "Install This User Script..."&lt;br /&gt;&lt;br /&gt;Couple things... Besides the code snippet Rahul posted, there is also an external js file that is referenced (http://www.google-analytics.com/urchin.js). I check that both code as well as reference are present. Also in the code, I think "_udn" is optional. It's there on slashdot, but not on codeword, so I don't check for that. Didn't test this very much. Just on codeword, slashdot (detected) and yahoo, microsoft (undetected).&lt;br /&gt;&lt;br /&gt;Any improvements?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113826440409521110?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113826440409521110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113826440409521110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113826440409521110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113826440409521110'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/re-another-greasemonkey-script.html' title='Re:  Another greasemonkey script....'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113825758720541675</id><published>2006-01-26T06:31:00.000Z</published><updated>2006-01-26T17:45:10.936Z</updated><title type='text'>Introduction to Great Design</title><content type='html'>Joel Spolsky is at it again. He's started a series of articles on &lt;a href="http://www.joelonsoftware.com/design/1stDraft/00.html" target="_blank"&gt;design&lt;/a&gt;. This one was a bit of deja vu for me. On the flight from Bangalore to Bombay, they made the announcement to switch off all electronic devices. So off goes my cell phone. After landing, I starred at the phone for a minute before giving up and asking Rahul how to turn it on. After reading Joel's article I don't feel like as big a dumbass. How long before we see an Apple cell phone?&lt;br /&gt;&lt;br /&gt;Also check &lt;a href="http://www.thisisbroken.com" target="_blank"&gt;This is Broken&lt;/a&gt; - "A project to make businesses more aware of their customer experience, and how to fix it". It's a nice site with daily postings on design mistakes seen everywhere.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113825758720541675?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113825758720541675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113825758720541675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113825758720541675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113825758720541675'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/introduction-to-great-design.html' title='Introduction to Great Design'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113812725965476464</id><published>2006-01-24T18:16:00.000Z</published><updated>2006-01-24T18:27:39.696Z</updated><title type='text'>Another greasemonkey script....</title><content type='html'>I submitted the following as a greasemonkey script (&lt;a href="http://userscripts.org"&gt;http://userscripts.org&lt;/a&gt;) idea proposal&lt;br /&gt;&lt;br /&gt;&amp;lt;idea&amp;gt;&lt;br /&gt;&lt;br /&gt;Quite a few sites use the Google Analytics service. Sites insert javascript code like - &lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt; _uacct = "UA-32013-5";&lt;br /&gt; _udn = "slashdot.org";&lt;br /&gt; urchinTracker();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;(The above code is from slashdot ).&lt;br /&gt;&lt;br /&gt;A script could be written which shows a simple notification whenever a site visited ; contains Google Analytics javascript.&lt;br /&gt;&lt;br /&gt;&amp;lt;/idea&amp;gt;&lt;br /&gt;&lt;br /&gt;Any takers??&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113812725965476464?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113812725965476464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113812725965476464' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113812725965476464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113812725965476464'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/another-greasemonkey-script.html' title='Another greasemonkey script....'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113803823442666007</id><published>2006-01-23T17:31:00.001Z</published><updated>2006-01-24T03:19:08.936Z</updated><title type='text'>Some free books....</title><content type='html'>I'm trying to read a bit on Lisp. This interest was spurred by an &lt;a href="http://www.paulgraham.com/avg.html"&gt;essay&lt;/a&gt; and a &lt;a href="http://www.itconversations.com/shows/detail188.html"&gt;podcast&lt;/a&gt; by &lt;a href="http://www.paulgraham.com"&gt;Paul Graham&lt;/a&gt;. Dunno how far i'll go... but trying to get a feel of other languages as well.... Also try reading some of his essays.&lt;br /&gt;&lt;br /&gt;Basically I got a few books at &lt;a href="http://www.freetechbooks.com"&gt;http://www.freetechbooks.com&lt;/a&gt;. You guys could also get something on your topic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113803823442666007?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113803823442666007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113803823442666007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113803823442666007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113803823442666007'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/some-free-books_23.html' title='Some free books....'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113758595797486538</id><published>2006-01-18T12:05:00.000Z</published><updated>2006-01-18T12:11:02.630Z</updated><title type='text'>Book Reviews</title><content type='html'>&lt;p class="mobile-post"&gt;Trying to gauge how good a book before you buy it can be a pretty hard task! Money doesn't exactly grow on trees ;o) One site I have found useful and insanely accurate in terms of their book reviews is &lt;a href="http://www.accu.org" target="_blank"&gt;www.accu.org&lt;/a&gt;. This is primarily a C++ site but they also give reviews for C# and Java.&lt;/p&gt;&lt;p class="mobile-post"&gt;Before buying any book, I usually run a search through there to see how its rated.&lt;/p&gt;&lt;p class="mobile-post"&gt;Dinesh.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113758595797486538?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113758595797486538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113758595797486538' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113758595797486538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113758595797486538'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/book-reviews.html' title='Book Reviews'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113757786283677367</id><published>2006-01-18T09:51:00.000Z</published><updated>2006-01-18T10:35:04.566Z</updated><title type='text'>Modern C++ Design</title><content type='html'>&lt;p class="mobile-post"&gt;I would really recommend you to try out "Modern C++ Design by Andrei&lt;br /&gt;Alexandrescu". It is a fantastic book delving deep into C++ Template&lt;br /&gt;Techniques. Its not something a novice can read, but yet if you are&lt;br /&gt;comfortable with C++ templates, then you should definitely give it a&lt;br /&gt;shot!&lt;/p&gt;&lt;p class="mobile-post"&gt;He opens your eyes to a lot of interesting techniques and in the process&lt;br /&gt;also unravels "Loki", the library (written by him) which implements all&lt;br /&gt;of the techniques!&lt;/p&gt;&lt;p class="mobile-post"&gt;Policy class, local classes, typelists - the list just goes on, its all&lt;br /&gt;there!! He shows what you can do with even the most simple template&lt;br /&gt;classes viz :-&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;template&amp;lt;bool&amp;gt;&lt;br /&gt;struct CompileTimeChecker&lt;br /&gt;{&lt;br /&gt;   CompileTimeChecker(...) {}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;template&amp;lt;&amp;gt; struct CompileTimeChecker&amp;lt;false&amp;gt; {};&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;This relatively simple struct can achieve compile time assertions for&lt;br /&gt;you!&lt;/p&gt;&lt;p class="mobile-post"&gt;Read it! Its worth it!&lt;/p&gt;&lt;p class="mobile-post"&gt;Dinesh.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113757786283677367?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113757786283677367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113757786283677367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113757786283677367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113757786283677367'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/modern-c-design.html' title='Modern C++ Design'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113686920273879220</id><published>2006-01-10T05:00:00.000Z</published><updated>2006-01-10T05:00:02.800Z</updated><title type='text'>Use that extra bit of vegetable oil at home</title><content type='html'>&lt;p class="mobile-post"&gt;This is really one of the most hilarious things I've ever seen -&lt;br /&gt;http://www.tomshardware.com/2006/01/09/strip_out_the_fans/&lt;/p&gt;&lt;p class="mobile-post"&gt;Keep it cool ;o)&lt;/p&gt;&lt;p class="mobile-post"&gt;Dinesh.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113686920273879220?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113686920273879220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113686920273879220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113686920273879220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113686920273879220'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2006/01/use-that-extra-bit-of-vegetable-oil-at.html' title='Use that extra bit of vegetable oil at home'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113480510788932451</id><published>2005-12-17T07:37:00.000Z</published><updated>2005-12-17T07:38:27.900Z</updated><title type='text'>Re; Free UML Tool?</title><content type='html'>There is an experimental one being developed at MIT:&lt;br /&gt;&lt;br /&gt;http://relo.csail.mit.edu/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113480510788932451?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113480510788932451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113480510788932451' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113480510788932451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113480510788932451'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/12/re-free-uml-tool_17.html' title='Re; Free UML Tool?'/><author><name>Pawan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113480337196533341</id><published>2005-12-17T07:06:00.000Z</published><updated>2005-12-17T07:20:37.983Z</updated><title type='text'>Singleton design pattern</title><content type='html'>Mohnish &amp; I had a small discussion recently about Singleton vs static method only class.&lt;br /&gt;&lt;br /&gt;A few advantages of Singleton we came up with were..&lt;br /&gt;&lt;br /&gt;Singletons can be subclassed. And preferably used with Factories or Registries.&lt;br /&gt;&lt;br /&gt;Another subtle difference was usage. When you have a singleton, you get back a class instance on which you then perform operations. Like..&lt;br /&gt;&lt;br /&gt;Singleton singleton = Singleton.getInstance();&lt;br /&gt;singleton.doSomething();&lt;br /&gt;singleton.doSomethingMore();&lt;br /&gt;&lt;br /&gt;Compare this to ..&lt;br /&gt;&lt;br /&gt;Math.cos(..);&lt;br /&gt;Math.round(..);&lt;br /&gt;&lt;br /&gt;The Singleton is just more correct because it allows to think in terms of a type and its behaviour and limits the instances. The static method form does not exhibit the same level of coherent behaviour. It's not the most cleanest distinction but I guess you know what I mean.&lt;br /&gt;&lt;br /&gt;I was in the mood to read more on this and stumbled on an article on Javaworld - &lt;a href="http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns_p.html"&gt;Simply Singleton&lt;/a&gt;. Definitely worth a read. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;...which reminded me of a basic feature of Singletons we missed - controlled instance creation&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113480337196533341?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113480337196533341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113480337196533341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113480337196533341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113480337196533341'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/12/singleton-design-pattern.html' title='Singleton design pattern'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113470857753541579</id><published>2005-12-16T04:49:00.000Z</published><updated>2005-12-16T04:49:37.576Z</updated><title type='text'>RE:  Free UML Tool?</title><content type='html'>&lt;p class="mobile-post"&gt;Revo, Most of the reverse engineering software's that can be found for&lt;br /&gt;UML are not freely available. There's EclipseUML @&lt;br /&gt;http://www.omondo.com/ that you can try. The free version does not have&lt;br /&gt;reverse engineering capabilities and the Enterprise Edition has a 30-day&lt;br /&gt;evaluation limit.&lt;/p&gt;&lt;p class="mobile-post"&gt;There are others too, but more or less the story stays the same, go to -&lt;br /&gt;http://eclipse-plugins.2y.net/eclipse/plugins.jsp?category=UML&lt;/p&gt;&lt;p class="mobile-post"&gt;If you do decide to evaluate EclipseUML (which is a plug-in for Eclipse)&lt;br /&gt;make sure you have the dependencies of the EMF, UML and GEF packages&lt;br /&gt;right.&lt;/p&gt;&lt;p class="mobile-post"&gt;Dinesh.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113470857753541579?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113470857753541579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113470857753541579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113470857753541579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113470857753541579'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/12/re-free-uml-tool.html' title='RE:  Free UML Tool?'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113437256976674814</id><published>2005-12-12T07:24:00.000Z</published><updated>2005-12-12T07:29:29.776Z</updated><title type='text'>Free UML Tool?</title><content type='html'>Do any of you use any UML tools? I was looking for a tool which would convert existing code (again Java) to a UML Diagram - Class and sequence diagrams.&lt;br /&gt;&lt;br /&gt;Preferably the tool should be light on resources.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113437256976674814?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113437256976674814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113437256976674814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113437256976674814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113437256976674814'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/12/free-uml-tool.html' title='Free UML Tool?'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113264292205082191</id><published>2005-11-22T07:01:00.000Z</published><updated>2005-11-22T07:02:02.060Z</updated><title type='text'>Ajax &amp; PHP without using the XmlHttpRequest Object</title><content type='html'>Much cleaner....&lt;br /&gt;&lt;br /&gt;http://www.phpit.net/article/ajax-php-without-xmlhttprequest/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113264292205082191?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113264292205082191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113264292205082191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113264292205082191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113264292205082191'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/ajax-php-without-using-xmlhttprequest.html' title='Ajax &amp; PHP without using the XmlHttpRequest Object'/><author><name>Pawan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113248385818187609</id><published>2005-11-20T10:20:00.000Z</published><updated>2005-11-20T11:31:06.000Z</updated><title type='text'>Re: Generics in Java</title><content type='html'>&lt;font color="red"&gt;The other thing is that unlike C++, in Java all the checks (as you said) are done at runtime. Add to this the fact that it has a unified type system where all types (except primitives) inherit from Object makes it even more complicated. Both these are the reason for things like "? extends X" and "? super Y". You don't find these in C++ templates. Everything is checked at compile time so the compiler will warn you if the parameter types don't have expected methods. There's no need to specify that you want parameter types to extend or be the super type of some class.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;This generics thread is just going to get more and more complicated. In Java, the compiler checks all* generic code at compilation time.&lt;br /&gt;&lt;br /&gt;So if I say,&lt;br /&gt;List&amp;lt;Integer&amp;gt; ints = new ArrayList&amp;lt;Integer&amp;gt;();&lt;br /&gt;ints.add("a String"); //Oops... compilation error&lt;br /&gt;&lt;br /&gt;But the bytecode generated will be similar to that generated pre Java 5 with casts inserted by the compiler.&lt;br /&gt;&lt;br /&gt;Now there are some cases where you have no option but to make an unchecked cast to make code work. In such cases the compiler is not sure that the code/cast is wrong. So compilation is allowed with an unchecked cast warning.&lt;br /&gt;&lt;br /&gt;class UncheckedCast&amp;lt;E&amp;gt; {&lt;br /&gt;&amp;nbsp;private E[] arr;&lt;br /&gt;&amp;nbsp;public void meth() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;arr = (E[])new Object[5]; // unchecked cast&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Also....&lt;br /&gt;&amp;lt;excerpt&amp;gt;&lt;br /&gt;Generics for Java are accompanied by a cast-iron guarantee: no cast inserted by erasure will fail, so long as there are no unchecked warnings. The above illustrates the converse: if there are unchecked warnings, then casts inserted by erasure may fail.&lt;br /&gt;&amp;lt;/excerpt&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"? extends X" and "? super Y" are Wildcards. They are used to increase the range of Types that can be put in or removed from Generic methods/classes. This is a hack to reduce the effects of Erasure. I do not think this will be there in C++ or C#.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A slight diversion..&lt;br /&gt;Does C# too have primitives? I have come across a few instances where having primitives in Java has hurt. Primitives requires having to make all special conversions and stuff. I suppose SmallTalk, Ruby are pure-OOPs wrt this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;I haven't delved too deep into how C# (.NET) has handled these situations. But I think there will be differences since the two implementations are different... no erasure, so type info is preserved. There is something called a constraint which basically allows you to declare an interface you want the parameter type to implement or inherit from some base class or specify that it has a default constructor...&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Java too supports Constraints and its called Bounds. So the example Mohnish mentioned for max can be written in Java as...&lt;br /&gt;&lt;br /&gt;public static &amp;lt;T extends Comparable&amp;lt;T&amp;gt;&amp;gt; T max (T a, T b) {&lt;br /&gt;&amp;nbsp;if( a.compareTo(b) &amp;lt; 0 )&lt;br /&gt;&amp;nbsp;&amp;nbsp;return b;&lt;br /&gt;&amp;nbsp;return a;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Btw Comparable is an interface which takes a generic type T.&lt;br /&gt;&lt;br /&gt;I don't remember reading about Bounds/Constraints in C++... How is a similar thing done?&lt;br /&gt;&lt;br /&gt;About the C# Constraints...&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;&lt;br /&gt;where T : new() T must have a no-parameter constructor&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Java doesn't have anything similar. It seems to be an interesting constraint which should be useful in creating types of T even though the Type T is only known at runtime.&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;&lt;br /&gt;where T : class T must be reference type (a class)&lt;br /&gt;where T : class_name T may be either class_name or one of its sub-classes (or is below class_name in the inheritance hierarchy)&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Could you give an example of the usage of the above Constraints. To clarify; the first constraint only takes T, and the second takes T or its sub-class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113248385818187609?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113248385818187609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113248385818187609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113248385818187609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113248385818187609'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/re-generics-in-java_20.html' title='Re: Generics in Java'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113247150431569813</id><published>2005-11-20T06:53:00.000Z</published><updated>2005-11-20T08:11:56.633Z</updated><title type='text'>Re: Generics in Java</title><content type='html'>This blog post made me realize how little I really know about Generics in Java. Conceptually, I feel generics are easy to understand but when looking at these details, it becomes interesting i.e. confusing. &lt;br /&gt;&lt;br /&gt;But having said this, I think it's important to take some perspective. Most Java programmers are 'consumers' of APIs. Using these generic classes isn't very difficult. It actually makes better type guarantees and is more natural to use (no messing with casts). The complications of generics only occur when you write generic APIs - this burden is borne by the 'producers'. This is in a way good since there are generally more consumers than producers, so fewer people have to understand the complexities of covariants, contravariants and invariants etc... When was the last time you wrote a generic class?&lt;br /&gt;&lt;br /&gt;The other thing is that unlike C++, in Java all the checks (as you said) are done at runtime. Add to this the fact that it has a unified type system where all types (except primitives) inherit from Object makes it even more complicated. Both these are the reason for things like "? extends X" and "? super Y". You don't find these in C++ templates (Atleast I haven't seen them - can someone confirm?). Everything is checked at compile time so the compiler will warn you if the parameter types don't have expected methods. There's no need to specify that you want parameter types to extend or be the super type of some class.&lt;br /&gt;&lt;br /&gt;I haven't delved too deep into how C# (.NET) has handled these situations. But I think there will be differences since the two implementations are different... no erasure, so type info is preserved. There is something called a &lt;b&gt;constraint&lt;/b&gt; which basically allows you to declare an interface you want the parameter type to implement or inherit from some base class or specify that it has a default construtor...&lt;br /&gt;&lt;br /&gt;&lt;font face="courier" size="2"&gt;public T genericMethod&amp;lt;T&amp;gt;() where T : constraint&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;where constraints can be...&lt;br /&gt;&lt;br /&gt;&lt;font face="courier" size="2"&gt;where T : struct          T must be a value type (a struct)&lt;br /&gt;where T : class           T must be reference type (a class)&lt;br /&gt;where T : new()           T must have a no-parameter constructor&lt;br /&gt;where T : class_name      T may be either class_name or one of its&lt;br /&gt;                          sub-classes (or is below class_name &lt;br /&gt;                          in the inheritance hierarchy)&lt;br /&gt;where T : interface_name  T must implement the specified interface&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Why the need for constraints? Consider this simple ex.&lt;br /&gt;&lt;br /&gt;&lt;font face="courier" size="2"&gt;public static T Max&amp;lt;T&amp;gt;( T a, T b ) &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( a.CompareTo( b ) &lt; 0 )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return a;&lt;br /&gt;        &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return b;&lt;br /&gt;}&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;This will fail at compile time. The compiler doesn't know whether a and b support the CompareTo method. There needs to be a way to limit what the parameter types can be... some constraint.&lt;br /&gt;&lt;br /&gt;&lt;font face="courier" size="2"&gt;public static T Max&amp;lt;T&amp;gt;( T a, T b )  &lt;b&gt;where T : IComparable&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( a.CompareTo( b ) &lt; 0 )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return a;&lt;br /&gt;        &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return b;&lt;br /&gt;}&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;This satiates the compiler since it will make sure that when you call this method, the types of objects used as parameters implement Icomparable.&lt;br /&gt;&lt;br /&gt;This seems like a bit of a sidetrack. I'll try and read up some more on C# generics and post any differences/similarities to covariants, contravariants and invariants.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113247150431569813?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113247150431569813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113247150431569813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113247150431569813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113247150431569813'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/re-generics-in-java.html' title='Re: Generics in Java'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113232924057486787</id><published>2005-11-18T15:53:00.000Z</published><updated>2005-11-18T15:54:00.586Z</updated><title type='text'>Re: codeWord changes??</title><content type='html'>&lt;font color="red"&gt;Also I was thinking of opening codeWord more. First we can allow Anyone to post comments.&lt;br /&gt;&lt;br /&gt;We could also publish codeWord in a few blog directories.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Both are fine by me. Anybody have objections?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113232924057486787?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113232924057486787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113232924057486787' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113232924057486787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113232924057486787'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/re-codeword-changes.html' title='Re: codeWord changes??'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113229166101068259</id><published>2005-11-18T05:22:00.000Z</published><updated>2005-11-18T05:27:57.290Z</updated><title type='text'>codeWord changes??</title><content type='html'>I added Google Analytics to codeWord. See &lt;a href="http://www.google.com/analytics/"&gt;Google Analytics&lt;/a&gt;. If any of you want the info let me know.&lt;br /&gt;&lt;br /&gt;Also I was thinking of opening codeWord more. First we can allow Anyone to post comments.&lt;br /&gt;&lt;br /&gt;We could also publish codeWord in a few blog directories.&lt;br /&gt;&lt;br /&gt;Suggestions?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113229166101068259?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113229166101068259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113229166101068259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113229166101068259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113229166101068259'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/codeword-changes.html' title='codeWord changes??'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113228464642732751</id><published>2005-11-18T03:24:00.000Z</published><updated>2005-11-18T03:30:46.443Z</updated><title type='text'>Re: Happy Birthday CodeWord</title><content type='html'>&lt;font color="red"&gt;Its been 2 yrs since CodeWord was started..&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Happy (Belated) Birthday indeed!&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;..lets try and write blogs more often.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;I'm happy we've kept it up this long, but the posts have been lean and infrequent of late. I've been a big culprit myself. We should all try to get back to the ol days of having long discussions on topics of interest. There's certainly no shortage on things to talk about.&lt;br /&gt;&lt;br /&gt;So this is my great rallying call for the troops ala Bill Gates who does it every five years.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113228464642732751?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113228464642732751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113228464642732751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113228464642732751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113228464642732751'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/re-happy-birthday-codeword.html' title='Re: Happy Birthday CodeWord'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113196680575798589</id><published>2005-11-14T10:38:00.000Z</published><updated>2005-11-14T11:13:27.530Z</updated><title type='text'>Happy Birthday CodeWord</title><content type='html'>Its been 2 yrs since CodeWord was started..&lt;br /&gt;&lt;br /&gt;..lets try and write blogs more often.&lt;br /&gt;&lt;br /&gt;Btw. I posted the Generics blog so that I could say the above line!!&lt;br /&gt;&lt;br /&gt;Also I suppose I made the Generics blog a bit cryptic. Ask questions incase.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113196680575798589?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113196680575798589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113196680575798589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113196680575798589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113196680575798589'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/happy-birthday-codeword.html' title='Happy Birthday CodeWord'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113186431721078356</id><published>2005-11-13T05:56:00.000Z</published><updated>2005-11-13T07:00:50.713Z</updated><title type='text'>Generics in Java</title><content type='html'>I've finally started trying to learn about the new Java 5 features...&lt;br /&gt;&lt;br /&gt;Generics is one of the most important. There is a draft book by Oreilly at java.net - &lt;a href="https://java-generics-book.dev.java.net/"&gt;Generics and Collections in Java 5&lt;/a&gt;. And there are quite a few do's and dont's with Java generics. Definitely makes the language more complicated but it is needed too. Thought of sharing a few interesting excerpts here...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Array subtyping is &lt;b&gt;covariant&lt;/b&gt;, meaning that type S[] is considered to be a subtype of T[] whenever S is a subtype of T. Consider the following code fragment, which allocates an array of integers, assigns it to an array of numbers, and then attempts to assign a float into the array. &lt;br /&gt;&lt;br /&gt;Integer[] ints = new Integer[] {1,2,3};&lt;br /&gt;Number[] nums = ints;&lt;br /&gt;nums[2] = 3.14; // array store exception&lt;br /&gt;assert Arrays.toString(ints).equals("[1, 2, 3.14]"); // uh oh!&lt;br /&gt;&lt;br /&gt;The subtyping relation for generics is &lt;b&gt;invariant&lt;/b&gt;, meaning that type List&amp;lt;S&amp;gt; is not considered to be a subtype of List&amp;lt;T&amp;gt; except in the trivial case where S and T are identical. Here is a code fragment analogous to the one above, with lists replacing arrays.&lt;br /&gt;&lt;br /&gt;List&amp;lt;Integer&amp;gt; ints = Arrays.asList(1,2,3);&lt;br /&gt;List&amp;lt;Number&amp;gt; nums = ints; // compile-time error&lt;br /&gt;nums.put(2, 3.14);&lt;br /&gt;assert ints.toString().equals("[1, 2, 3.14]"); // uh oh!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It is obvious that &lt;b&gt;invariant&lt;/b&gt; behavior in generic limits is usefulness. So wildcards can be used to introduce covariant behavior.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Wildcards reintroduce &lt;b&gt;covariant&lt;/b&gt; subtyping for generics, in that type List&amp;lt;S&amp;gt; is considered to be a subtype of List&amp;lt;? extends T&amp;gt;, when S is a subtype of T. Here is a third variant of the fragment.&lt;br /&gt;&lt;br /&gt;List&amp;lt;Integer&amp;gt; ints = Arrays.asList(1,2,3);&lt;br /&gt;List&amp;lt;? extends Number&amp;gt; nums = ints;&lt;br /&gt;nums.put(2, 3.14); // compile-time error&lt;br /&gt;assert ints.toString().equals("[1, 2, 3.14]"); // uh oh!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;And it gets even more interesting when...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Wildcards also introduce &lt;b&gt;contravariant&lt;/b&gt; subtyping for generics, in that type List&amp;lt;S&amp;gt; is considered to be a subtype of List&amp;lt;? super T&amp;gt;, when S is a supertype of T (as opposed to a subtype). Arrays do not support contravariant subtyping.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So there are quite a few differences between Arrays and Generic Collections in Java and the author suggests using only Collections. The covariant and contravariant behavior is used to increase the range of Types that can be used by a Collection of type &amp;lt;T&amp;gt;.&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;covariant&lt;/b&gt; behavior (&amp;lt;? extends T&amp;gt;) is used to &lt;b&gt;get&lt;/b&gt; types from a colletion.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here is a method that takes a collection of numbers, converts each to a double, and sums them up.&lt;br /&gt;&lt;br /&gt;public static double sum(Collection&amp;lt;? extends Number&amp;gt; nums) {&lt;br /&gt;double s = 0.0;&lt;br /&gt;for (Number num : nums) s += num.doubleValue();&lt;br /&gt;return s;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Since this uses extends, all of the following calls are legal.&lt;br /&gt;List&amp;lt;Integer&amp;gt; ints = Arrays.asList(1,2,3);&lt;br /&gt;assert sum(ints) == 6.0;&lt;br /&gt;&lt;br /&gt;List&amp;lt;Number&amp;gt; nums = Arrays.&amp;lt;Number&amp;gt;asList(1,2,2.78,3.14);&lt;br /&gt;assert sum(nums) == 8.92;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So if I have a Collection of a type which extends Number, I know I can atleast safely remove type Number. This is what the author calls the Get principle.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;contravariant&lt;/b&gt; behavior (&amp;lt;? super T&amp;gt;) is used to &lt;b&gt;put&lt;/b&gt; types into a colletion; which is analogous to the above behavior.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here is a method that takes a collection of numbers and an integer n, and puts the first n integers, starting from zero, into the collection.&lt;br /&gt;&lt;br /&gt;public static void count(Collection&amp;lt;? super Integer&amp;gt; ints, int n) {&lt;br /&gt;for (int i = 0; i &lt; n; i++) ints.add(i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Since this uses super, all of the following calls are legal.&lt;br /&gt;&lt;br /&gt;List&amp;lt;Integer&amp;gt; ints = new ArrayList&amp;lt;Integer&amp;gt;();&lt;br /&gt;count(ints, 5);&lt;br /&gt;assert ints.toString().equals("[0, 1, 2, 3, 4]");&lt;br /&gt;&lt;br /&gt;List&amp;lt;Object&amp;gt; objs = new ArrayList&amp;lt;Object&amp;gt;();&lt;br /&gt;count(objs, 5); objs.add("five");&lt;br /&gt;assert objs.toString().equals("[0, 1, 2, 3, 4, five]");&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/excerpt&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So if I have a Collection of a type which super Integer, I know I can safely add type Integer. This is what the author calls the Put principle.&lt;br /&gt;&lt;br /&gt;Incase a method has to both Get and Put into a same Collection, then wildcards cannot be used. Btw in this blog wherever I have used interesting you can substitute confusing. Yet with a little time and practice generic in Java should not be that tough.&lt;br /&gt;&lt;br /&gt;A lot of this is caused because generic in Java is implemented using Erasure in which the type (&amp;lt;T&amp;gt;) is basically removed and casts are added by the compiler. So at runtime there is no info of the type. There are many more quirks caused due to Erasure... but this much is scary enough for one blog.&lt;br /&gt;&lt;br /&gt;Could you guys compare generic in C# and C++. Also Mohn what are the new features in C#??&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113186431721078356?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113186431721078356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113186431721078356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113186431721078356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113186431721078356'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/generics-in-java.html' title='Generics in Java'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113135114252731641</id><published>2005-11-07T08:01:00.000Z</published><updated>2005-11-07T08:12:22.536Z</updated><title type='text'>open source</title><content type='html'>&lt;a href="http://news.bbc.co.uk/2/hi/programmes/click_online/4407742.stm"&gt;http://news.bbc.co.uk/2/hi/programmes/click_online/4407742.stm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113135114252731641?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113135114252731641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113135114252731641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113135114252731641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113135114252731641'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/11/open-source.html' title='open source'/><author><name>Hrishikesh Tapaswi</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113047543202053536</id><published>2005-10-28T04:50:00.000Z</published><updated>2005-10-28T04:57:12.030Z</updated><title type='text'>Re:  War on Terror - bash style</title><content type='html'>When I first read the title "War on Terror - &lt;b&gt;bash&lt;/b&gt; style".. i thought it was a typo instead of  "War on Terror - &lt;b&gt;bush&lt;/b&gt; style"&lt;br /&gt;&lt;br /&gt;Good read... I meant the bash one&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113047543202053536?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113047543202053536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113047543202053536' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113047543202053536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113047543202053536'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/10/re-war-on-terror-bash-style.html' title='Re:  War on Terror - bash style'/><author><name>Rahul Revo</name><uri>https://profiles.google.com/114987133213908099889</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113046102889040998</id><published>2005-10-28T00:55:00.000Z</published><updated>2005-10-28T00:57:08.900Z</updated><title type='text'>War on Terror - bash style</title><content type='html'>Seriously (geeky) hilarious - &lt;a href="http://blogs.sun.com/roller/page/ThinGuy?entry=the_war_on_terror_as" target="_blank"&gt;http://blogs.sun.com/roller/page/ThinGuy?entry=the_war_on_terror_as&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113046102889040998?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113046102889040998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113046102889040998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113046102889040998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113046102889040998'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/10/war-on-terror-bash-style.html' title='War on Terror - bash style'/><author><name>Mohnish Rao</name><uri>http://www.blogger.com/profile/06259133405943378088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6078706.post-113041092810556235</id><published>2005-10-27T11:02:00.000Z</published><updated>2005-10-27T11:02:08.170Z</updated><title type='text'>Charles Petzold on Visual Studio</title><content type='html'>&lt;DIV&gt;&lt;SPAN class=172415810-27102005&gt;&lt;FONT face=Arial size=2&gt;Check it out  &amp;gt;&amp;gt; &lt;A  href="http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.html"&gt;http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.html&lt;/A&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;SPAN class=172415810-27102005&gt;&lt;FONT face=Arial  size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;SPAN class=172415810-27102005&gt;&lt;FONT face=Arial size=2&gt;Avalon's dynamic  layout sounds interesting. I actually may be doing a POC on Avalon sooner or  later for one the projects here! Hoping the work comes through  soon!!&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;SPAN class=172415810-27102005&gt;&lt;FONT face=Arial  size=2&gt;Dinesh.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;SPAN class=172415810-27102005&gt;&lt;FONT face=Arial  size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6078706-113041092810556235?l=codeword.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeword.blogspot.com/feeds/113041092810556235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6078706&amp;postID=113041092810556235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113041092810556235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6078706/posts/default/113041092810556235'/><link rel='alternate' type='text/html' href='http://codeword.blogspot.com/2005/10/charles-petzold-on-visual-studio.html' title='Charles Petzold on Visual Studio'/><author><name>Dinesh Pillay</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
