Posts

Ever wondered how to script "Closures" in JS ?

Anonymous / Inner Classes in Java are quite famous, with event handlers. Closures in JS are similar, not quite the same. Closures are expressions, usually functions, which can work with variables set within a certain context. Or, to try and make it easier, inner functions referring to local variables of its outer function create closures. Read it here as explained quite nicely by Morris Johns.

Classy JS => Prototypes

An excellent read about how to make an otherwise class-less java script emulate classes. Read it here . -Thanks Morris

Android - Cheezy name

Wow !!! this is truly a cheezy technological innovation by folks at Google and little known "Open Alliance" group. Read more about it here or Watch it here.

Ajax Men with TOOLS

GWT is headed by Bruce Johnson. JQuery by John Resig. Prototype by Sam Stephenson. Script.aculo.us by Thomas Fuchs Ajax by James Garret of Adaptive Path. Dojo by Alex Russel

GWT 101

What is GWT? A set of tools to write AJAX applications in JAVA. GWT is an open source, cross-browser framework that allows developers to write AJAX applications in Java and get the bytecode compiled into JavaScript. What makes GWT interesting is Java to JavaScript compiler? GWT is more than just a Java-JavaScript Compiler. Based on the code that you write in Java, it performs dead code elimination, code optimization etc straightening polymorphic calls, method call in lining and string interning. basically the features of what a "compiler" does. Well why Java ? Because Java is a strongly typed language unlike python and that is when you get benefit of the compiler optimizations. But then again Java is the chosen one, because of the availability of IDE's, debugging tools etc and not that its the only best language in the world. Google didn't choose Java because of a particular attachment to the language, but because of the abundance of tools out there available for Java...

Exceptions - To check or uncheck

Image
To decide whether to throw a checked exception or an unchecked runtime exception , you must look at the abnormal condition you are signalling. If you are throwing an exception to indicate an improper use of your class, you are signalling a software bug. The class of exception you throw probably should descend from RuntimeException, which will make it UNCHECKED . Otherwise, if you are throwing an exception to indicate not a software bug but an abnormal condition that client programmers should deal with every time they use your method, your exception should be CHECKED .

The Moody Thread States

Image
Understanding the moods of threads is critical to programming with threads. 1. New state – After the creations of Thread instance the thread is in this state but before the start() method invocation. At this point, the thread is considered not alive. 2. Runnable (Ready-to-run) state – A thread start its life from Runnable state. A thread first enters runnable state after the invoking of start() method but a thread can return to this state after either running, waiting, sleeping or coming back from blocked state also. On this state a thread is waiting for a turn on the processor. 3. Running state – A thread is in running state that means the thread is currently executing. There are several ways to enter in Runnable state but there is only one way to enter in Running state: the scheduler select a thread from runnable pool. 4. Dead state – A thread can be considered dead when its run() method completes. If any thread comes on this state that means it cannot ever run agai...