Wednesday, October 24, 2007

Web2.0 Comics/Cartoons


Web20comics


From: ryanbretag, 1 week ago








SlideShare Link

Cricinfo with Plusmo.

If u are a cricket fan here is a good news for u. You can now to Cricinfo’s ball-by-ball update of cricket scores on ur mobile phones as well :)

For those stuck in offices during cricket matches, Cricinfo has been a popular destination to check scores and their live textual commentary has been a welcome consolation. Now, thanks to a tie-up with the US based Plusmo, the live commentary and score updates can now be subscribed on mobile phones. They call it the Cricinfo MobiCast.

Unlike other existing VAS services, the scores are not sent via SMS. Instead, one needs to key into http://ci.plusmo.com into the WAP browser to start receiving the scores. The catch here is that you need to have a GPRS enabled mobile phone. That leavs out a majority of mobile phone users.

While the service is free, the charges towards data connection as charged by the mobile operator still applies.

Tuesday, October 23, 2007

Good example of Garbage Collection.

If u are very much confused with how garbage collection works in Java, then the following example might really be helpful to u in understanding the concept clearly.

class Animal {}
class Cat extends Animal {}
class Dog extends Animal {}

public class GarbageCollection
{
public static void main(String[] args)
{
Animal a1 = new Cat();
Animal a2 = new Dog();
Animal a3 = a1;
a1 = null;
Animal a4 = a1;
Animal a5 = a2;
a1 = a2;
a2 = a4;
a5 = null;
a3 = a1;

// Here
}
}


When that code reaches the comment "Here," how many objects will be eligible for garbage collection? Well, like I said before, it's all about drawing pictures. Let me take you through my process for solving such a problem. I'll go line my line and, after each line, I'll draw a picture (I'll do my best using ASCII art) to reflect what has happened thus far. Just keep in mind that an object is eligible for garbage collection as soon as there are no active references to it.


Animal a1 = new Cat();

+-----+
a1 ---> | Cat |
+-----+


As you can see, we now have a variable named a1 that references a Cat object. That's easy enough, let's move on to the next line.


Animal a2 = new Dog();

+-----+
a1 ---> | Cat |
+-----+

+-----+
a2 ---> | Dog |
+-----+


Now, we still have a1 referencing that Cat object but we now have a new variable, a2, which references a Dog object. Let's move on.


Animal a3 = a1;

+-----+
a1 ---> | Cat | <--- a3 +-----+ +-----+ a2 ---> | Dog |
+-----+


The new variable a3 now also references the Cat object.


a1 = null;

a1 ---> null

+-----+
a3 ---> | Cat |
+-----+

+-----+
a2 ---> | Dog |
+-----+


a1 now references null, but, as you can see, nothing is yet eligible for garbage collection as both the Cat and Dog objects have an active reference to them.


Animal a4 = a1;

a1 ---> null
a4 ---> null

+-----+
a3 ---> | Cat |
+-----+

+-----+
a2 ---> | Dog |
+-----+


That line didn't change our picture much. We now have a new variable, a4, that also references null.


Animal a5 = a2;

a1 ---> null
a4 ---> null

+-----+
a3 ---> | Cat |
+-----+

+-----+
a2 ---> | Dog | <--- a5 +-----+


We have a new variable, a5, introduced to the mix and it now also references the Dog object.


a1 = a2;

a4 ---> null

+-----+
a3 ---> | Cat |
+-----+

+-----+ <--- a5 a2 ---> | Dog |
+-----+ <--- a1


Now we have three references to the Dog object, but that one reference to the Cat object, a3, keeps it from being eligible for garbage collection.


a2 = a4;

a4 ---> null
a2 ---> null

+-----+
a3 ---> | Cat |
+-----+

+-----+
a1 ---> | Dog | <--- a5 +-----+


We've lost one of our references to the Dog object, but we've still got two left.


a5 = null;

a4 ---> null
a2 ---> null
a5 ---> null

+-----+
a3 ---> | Cat |
+-----+

+-----+
a1 ---> | Dog |
+-----+


Well, we've lost yet another reference to the Dog object. We're down to one, but one reference is still enough to keep that object from being garbage collected.


a3 = a1;

a4 ---> null
a2 ---> null
a5 ---> null

+-----+
| Cat |
+-----+

+-----+
a1 ---> | Dog | <--- a3 +-----+


Our final line of code and we finally have an object available for garbage collection. By assigning the reference to the Dog object to a3, we no longer have any variables that reference our Cat object. Therefore, the Cat object is now available for garbage collection.

That's it, really. I know it seems simple, but if you keep drawing pictures, I think you'll find that you have little trouble with questions regarding garbage collection. Hopefully, this little tip helps you out along the way.

Thanks to Corey! for this wonderful example.

Thursday, October 18, 2007

Meebo Firefox Extension.

Meebo now has a Firefox extension that lets you add instant messaging to the web browser. The basic meebo features are all there, so you’ll still get access to your friends across multiple IM clients like AIM, Yahoo, MSN, ICQ, GTalk and Jabber.

There’s also automatic sign-on, the ability to share links, and meebo alerts, which lets you see when you get a new message, or when a friend signs on or offline. A sidebar option lets you see your most recent messages as you browse the web as well. Drag and drop links and images from web pages right onto your friends!

Monday, October 15, 2007

Google Extensions for Firefox

If u use firefox then extensions will be of much helpful to u. I have already discussed many such extensions in this blog. If u use Google in Firefox then these extensions will be useful for u.

1. Google Browser Sync:

Google Browser Sync for Firefox is an extension that continuously synchronizes your browser settings – including bookmarks, history, persistent cookies, and saved passwords – across your computers. It also allows you to restore open tabs and windows across different machines and browser sessions. For more info, please visit our FAQ. Install here.

2. Google Notebook Extension:

Installing this browser extension enables you to use the mini Google Notebook. The mini Google Notebook allows you to clip information from the web without ever leaving the page you're on. You'll never again need to toggle between windows, or copy and paste info from your browser window to another application.

3. Blogger Web Comments:

Blogger Web Comments for Firefox is an extension that makes it easy to see what bloggers are saying about a page you're viewing in Firefox and even make your own blog post about it, all without leaving the page you're on. For more information, see the FAQ. Download it here.

4. Google Send to Phone:

Google Send to Phone for Firefox is an extension that enables you to send short text messages of web page content to your mobile phone. For example, you might text message yourself a phone number, an address, or directions that you find on the Web. Download it here.

These extensions are a part of Google Labs.

Sunday, October 14, 2007

Java

If u are looking for a job in Java, then check out the below set of questions. It might be useful for ur interview.

What if the main method is declared as private?

The program compiles properly but at runtime it will give "Main method not public." message.

What is meant by pass by reference and pass by value in Java?

Pass by reference means, passing the address itself rather than passing the value. Pass by value means passing a copy of the value.

If you’re overriding the method equals() of an object, which other method you might also consider?

hashCode()

What is Byte Code?

Or

What gives java it’s “write once and run anywhere” nature?


All Java programs are compiled into class files that contain bytecodes. These byte codes can be run in any platform and hence java is said to be platform independent.

Expain the reason for each keyword of public static void main(String args[])?

public- main(..) is the first method called by java environment when a program is executed so it has to accessible from java environment. Hence the access specifier has to be public.

static: Java environment should be able to call this method without creating an instance of the class , so this method must be declared as static.

void: main does not return anything so the return type must be void

The argument String indicates the argument type which is given at the command line and arg is an array for string given during command line.

What are the differences between == and .equals() ?

Or

what is difference between == and equals

Or

Difference between == and equals method

Or

What would you use to compare two String variables - the operator == or the method equals()?

Or

How is it possible for two String objects with identical values not to be equal under the == operator?

The == operator compares two objects to determine if they are the same object in memory i.e. present in the same memory location. It is possible for two String objects to have the same value, but located in different areas of memory.

== compares references while .equals compares contents. The method public boolean equals(Object obj) is provided by the Object class and can be overridden. The default implementation returns true only if the object is compared with itself, which is equivalent to the equality operator == being used to compare aliases to the object. String, BitSet, Date, and File override the equals() method. For two String objects, value equality means that they contain the same character sequence. For the Wrapper classes, value equality means that the primitive values are equal.

public class EqualsTest{

public static void main(String[] args){
String s1 = "abc";
String s2 = s1;
String s5 = "abc";
String s3 = new String("abc");
String s4 = new String("abc");
// if we remove the brackets around "s1 == s5' it gives a different result.
System.out.println("== comparison : " +(s1 == s5));
System.out.println("== comparison : " +(s1 == s2));
System.out.println("Using equals method : " +s1.equals(s2));
System.out.println("== comparison : " +s3 == s4);
System.out.println("Using equals method : " +s3.equals(s4));
}
}
Output
== comparison : true
== comparison : true
Using equals method : true
false
Using equals method : true

What if the static modifier is removed from the signature of the main method?

Or

What if I do not provide the String array as the argument to the method?

Program compiles. But at runtime throws an error "NoSuchMethodError".

Why oracle Type 4 driver is named as oracle thin driver?

Oracle provides a Type 4 JDBC driver, referred to as the Oracle “thin” driver. This driver includes its own implementation of a TCP/IP version of Oracle’s Net8 written entirely in Java, so it is platform independent, can be downloaded to a browser at runtime, and does not require any Oracle software on the client side. This driver requires a TCP/IP listener on the server side, and the client connection string uses the TCP/IP port address, not the TNSNAMES entry for the database name.

What is the difference between final, finally and finalize? What do you understand by the java final keyword?

Or

What is final, finalize() and finally?

Or

What is finalize() method?

Or

What is the difference between final, finally and finalize?

Or

What does it mean that a class or member is final?

o final - declare constant
o finally - handles exception
o finalize - helps in garbage collection

Variables defined in an interface are implicitly final. A final class can't be extended i.e., final class may not be subclassed. This is done for security reasons with basic classes like String and Integer. It also allows the compiler to make some optimizations, and makes thread safety a little easier to achieve. A final method can't be overridden when its class is inherited. You can't change value of a final variable (is a constant). finalize() method is used just before an object is destroyed and garbage collected. finally, a key word used in exception handling and will be executed whether or not an exception is thrown. For example, closing of open connections is done in the finally method.

What is the Java API?

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.

What is the GregorianCalendar class?

The GregorianCalendar provides support for traditional Western calendars.

What is the ResourceBundle class?

The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program's appearance to the particular locale in which it is being run.

Why there are no global variables in Java?

Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:
* The global variables breaks the referential transparency
* Global variables creates collisions in namespace.

How to convert String to Number in java program?

The valueOf() function of Integer class is is used to convert string to Number. Here is the code example:
String numString = "1000";
int id=Integer.valueOf(numString).intValue();

What is the SimpleTimeZone class?

The SimpleTimeZone class provides support for a Gregorian calendar.

What is the difference between a while statement and a do statement?

A while statement (pre test) checks at the beginning of a loop to see whether the next loop iteration should occur. A do while statement (post test) checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the loop body at least once.

What is the Locale class?

The Locale class is used to tailor a program output to the conventions of a particular geographic, political, or cultural region.

Describe the principles of OOPS.

There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.

Explain the Inheritance principle.

Inheritance is the process by which one object acquires the properties of another object. Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places

What is implicit casting?

Implicit casting is the process of simply assigning one entity to another without any transformation guidance to the compiler. This type of casting is not permitted in all kinds of transformations and may not work for all scenarios.

Example

int i = 1000;

long j = i; //Implicit casting

Is sizeof a keyword in java?

The sizeof operator is not a keyword.

What is a native method?

A native method is a method that is implemented in a language other than Java.

In System.out.println(), what is System, out and println?

System is a predefined final class, out is a PrintStream object and println is a built-in overloaded method in the out object.

What are Encapsulation, Inheritance and Polymorphism

Or

Explain the Polymorphism principle. Explain the different forms of Polymorphism.

Polymorphism in simple terms means one name many forms. Polymorphism enables one entity to be used as a general category for different types of actions. The specific action is determined by the exact nature of the situation.

Polymorphism exists in three distinct forms in Java:
• Method overloading
• Method overriding through inheritance
• Method overriding through the Java interface

What is explicit casting?

Explicit casting in the process in which the complier are specifically informed to about transforming the object.

Example

long i = 700.20;

int j = (int) i; //Explicit casting

What is the Java Virtual Machine (JVM)?

The Java Virtual Machine is software that can be ported onto various hardware-based platforms

What do you understand by downcasting?

The process of Downcasting refers to the casting from a general to a more specific type, i.e. casting down the hierarchy

What are Java Access Specifiers?

Or

What is the difference between public, private, protected and default Access Specifiers?

Or

What are different types of access modifiers?

Access specifiers are keywords that determine the type of access to the member of a class. These keywords are for allowing privileges to parts of a program such as functions and variables. These are:
Public: accessible to all classes
Protected: accessible to the classes within the same package and any subclasses.
Private: accessible only to the class to which they belong
Default: accessible to the class to which they belong and to subclasses within the same package

Which class is the superclass of every class?

Object.

Name primitive Java types.

The 8 primitive types are byte, char, short, int, long, float, double, and boolean.

What is the difference between static and non-static variables?

Or

What are class variables?

Or

What is static in java?

Or

What is a static method?

A static variable is associated with the class as a whole rather than with specific instances of a class. Each object will share a common copy of the static variables i.e. there is only one copy per class, no matter how many objects are created from it. Class variables or static variables are declared with the static keyword in a class. These are declared outside a class and stored in static memory. Class variables are mostly used for constants. Static variables are always called by the class name. This variable is created when the program starts and gets destroyed when the programs stops. The scope of the class variable is same an instance variable. Its initial value is same as instance variable and gets a default value when its not initialized corresponding to the data type. Similarly, a static method is a method that belongs to the class rather than any object of the class and doesn't apply to an object or even require that any objects of the class have been instantiated.
Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can't override a static method with a non-static method. In other words, you can't change a static method into an instance method in a subclass.

Non-static variables take on unique values with each object instance.

What is the difference between the boolean & operator and the && operator?

If an expression involving the boolean & operator is evaluated, both operands are evaluated, whereas the && operator is a short cut operator. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. If the first operand evaluates to false, the evaluation of the second operand is skipped.

How does Java handle integer overflows and underflows?

It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

What if I write static public void instead of public static void?

Program compiles and runs properly.

What is the difference between declaring a variable and defining a variable?

In declaration we only mention the type of the variable and its name without initializing it. Defining means declaration + initialization. E.g. String s; is just a declaration while String s = new String ("bob"); Or String s = "bob"; are both definitions.

What type of parameter passing does Java support?

In Java the arguments (primitives and objects) are always passed by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object.

Explain the Encapsulation principle.

Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. Objects allow procedures to be encapsulated with their data to reduce potential interference. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper.

What do you understand by a variable?

Variable is a named memory location that can be easily referred in the program. The variable is used to hold the data and it can be changed during the course of the execution of the program.

What do you understand by numeric promotion?

The Numeric promotion is the conversion of a smaller numeric type to a larger numeric type, so that integral and floating-point operations may take place. In the numerical promotion process the byte, char, and short values are converted to int values. The int values are also converted to long values, if necessary. The long and float values are converted to double values, as required.

What do you understand by casting in java language? What are the types of casting?

The process of converting one data type to another is called Casting. There are two types of casting in Java; these are implicit casting and explicit casting.

What is the first argument of the String array in main method?

The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name. If we do not provide any arguments on the command line, then the String array of main method will be empty but not null.

How can one prove that the array is not null but empty?

Print array.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print array.length.

Can an application have multiple classes having main method?

Yes. While starting the application we mention the class name to be run. The JVM will look for the main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple classes having main method.

When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in Java?

Static variable are loaded when classloader brings the class to the JVM. It is not necessary that an object has to be created. Static variables will be allocated memory space when they have been loaded. The code in a static block is loaded/executed only once i.e. when the class is first initialized. A class can have any number of static blocks. Static block is not member of a class, they do not have a return statement and they cannot be called directly. Cannot contain this or super. They are primarily used to initialize static fields.

Can I have multiple main methods in the same class?

No the program fails to compile. The compiler says that the main method is already defined in the class.

Explain working of Java Virtual Machine (JVM)?

JVM is an abstract computing machine like any other real computing machine which first converts .java file into .class file by using Compiler (.class is nothing but byte code file.) and Interpreter reads byte codes.

How can I swap two variables without using a third variable?

Add two variables and assign the value into First variable. Subtract the Second value with the result Value. and assign to Second variable. Subtract the Result of First Variable With Result of Second Variable and Assign to First Variable. Example:

int a=5,b=10;a=a+b; b=a-b; a=a-b;

What is data encapsulation?

Encapsulation may be used by creating 'get' and 'set' methods in a class (JAVABEAN) which are used to access the fields of the object. Typically the fields are made private while the get and set methods are public. Encapsulation can be used to validate the data that is to be stored, to do calculations on data that is stored in a field or fields, or for use in introspection (often the case when using javabeans in Struts, for instance). Wrapping of data and function into a single unit is called as data encapsulation. Encapsulation is nothing but wrapping up the data and associated methods into a single unit in such a way that data can be accessed with the help of associated methods. Encapsulation provides data security. It is nothing but data hiding.

What is reflection API? How are they implemented?

Reflection is the process of introspecting the features and state of a class at runtime and dynamically manipulate at run time. This is supported using Reflection API with built-in classes like Class, Method, Fields, Constructors etc. Example: Using Java Reflection API we can get the class name, by using the getName method.

Does JVM maintain a cache by itself? Does the JVM allocate objects in heap? Is this the OS heap or the heap maintained by the JVM? Why

Yes, the JVM maintains a cache by itself. It creates the Objects on the HEAP, but references to those objects are on the STACK.

What is phantom memory?

Phantom memory is false memory. Memory that does not exist in reality.

Can a method be static and synchronized?

A static method can be synchronized. If you do so, the JVM will obtain a lock on the java.lang. Class instance associated with the object. It is similar to saying:

synchronized(XYZ.class) {

}

What is difference between String and StringTokenizer?

A StringTokenizer is utility class used to break up string.

Example:

StringTokenizer st = new StringTokenizer("Hello World");

while (st.hasMoreTokens()) {

System.out.println(st.nextToken());

}

Output:

Hello

World

Ajax Frameworks

If u dont know anything about Ajax then check out my previous post here

Once u learned Ajax and how it works, its now time to choose Ajax frameworks for implementation purpose. By using Ajax frameworks u need not worry about cross browser compatibility and issues. But choosing the right one is really a big task :)

Here are the various frameworks that I found on the web

Pure Javascript frameworks:

1. Mootools:
is a compact, modular, Object-Oriented javascript framework designed to make writing extensible and compatible code easier and faster. MooTools lets you get the job done efficiently and effectively.
  • Pros
    • It is lightweight, powerful and makes use of many of the new javascript coding functions that we’ve become accustomed to (such as $()).
    • The FX library is incredibly solid, doesn’t require div-itis, and uses the same physics easing equations as most flash users.
  • Browser Compatibility -mootools is compatible and fully tested with Safari, internet explorer 6 and 7, Firefox (and its mozilla friends), Opera and Camino.
  • License - mooTools is released under the Open Source MIT license, which permits you to use it and modify it in every circumstance.
2. Open Rico

Open Rico is a multi-purpose framework with support for Ajax infrastructure and user interaction.

  • An XMLHttpRequest response can be routed to one or more callback operation, DOM object, or Javascript object.
  • Easy drag-and-drop.
  • Ajax animation such as scaling and transitions (and presumably the increasingly common idioms such as progress indicators and fading technique?)
  • "Behaviors" - Essentially a widget library.
  • External tutorial by Yonah Russ of Mirimar?
  • Builds on prototype library.
  • Open-source. From Sabre Airline Solutions. By Bill Scott, Darren James, and others.
3. Prototype:

Prototype makes it easy to use object-oriented concepts like classes and inheritance within Javascript. It also supports basic Ajax functionality such as web remoting.
  • A project run in conjunction with Ruby on Rails, but can be (and certainly is) used independent of Ruby or RoR.
  • Open-source by Sam Stephenson.
  • Animation and effects can be added on using the Scriptaculous library.
4. DOJO:

DOJO offers comprehensive widget and browser-server messaging support.

  • Extensive deployment support: dependency-based packaging, compression of required libraries into a single download. (See On-Demand Javascript pattern).
  • Framework for creation of custom Javascript widgets.
  • Library of pre-built widgets.
  • Solid drag-and-drop, effects, and generic animation support
  • Browser-server messaging support - XMLHttpRequest and other mechanisms.
  • Event management. (See Distributed Events pattern).
  • Support for bookmarkability and manipulating URLs in the browser.
  • Open-source license (Academic Free License 2.1). Led by Alex Russell of SitePen.
5. BackBase:

Backbase is a comprehensive browser-side AJAX framework with cross browser support. The Backbase AJAX framework is compatible with any server-side platform (e.g. Java, .NET, PHP, Coldfusion).

  • Free Community Edition for non-commercial / non-institutional use
  • Advanced tooling for .NET Developers - Visual Studio 2005 plug-in
  • Advanced tooling for Java Developers - JSF taglib / Eclipse integration
  • Over 80 AJAX widgets / components Backbase Explorer
  • Active AJAX developer community Backbase DevNet
  • Online AJAX demo's / starterkits Check Out
  • Commercial from Backbase (formed in 2003)( You have to pay in order to use this software !).
  • Backbase supports the following browsers:
    • Internet Explorer 5+ on Windows
    • Firefox 0.8+ on any platform
    • Mozilla 1.5+ on any platform
    • Netscape 7.2+ on any platform
    • Camino 0.8+ on Mac OS X
6. YUI (Yahoo User Interface)

Yahoo! User Interface Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. The library is released under the BSD license (Open Source)

You can choose anyone from the above list as all of them are trustable. If u would like to know more on Ajax Frameworks then this is the right place to look at.

Saturday, October 13, 2007

AMASS

AMASS: Ajax MAssive Storage System

After AJAX, AHAH, AMASS is current buzzword

The AJAX MAssive Storage System (AMASS) uses a hidden flash applet to allow JavaScript AJAX applications to store an arbitrary amount of sophisticated information on the client side. This information is permanent and persistent; if a user closes their browser or navigates away from the web site, the information
is still present and can be retrieved later by the web page. Information stored by web pages is private and locked to a single domain, so other web sites can not access this information.

AMASS makes it possible to store an arbitrary amount of sophisticated data, way pass the 4K limit of cookies or the 64K limit of Internet Explorer's proprietary client-side storage system. An AMASS-enabled web site can store up to 100K without user permission. After 100K, users are prompted on whether the web site can store the requested amount of information. Users can approve or deny the storage request. The AMASS system informs the client-side application on whether the storage request was allowed or denied. In my own testing I have been able to store up to ten megabytes with good performance; I'm sure even more information can be stored, I just have never tried beyond this amount.

AMASS works on Internet Explorer 6+ and Gecko-based browsers, like Firefox. Users must have the Flash plugin version 6+ installed to use AMASS; Flash 6+ is installed in 95% of machines, however.

AMASS is available under a BSD license.


How Do I Use This?

Working with AMASS is simple. The AMASS framework creates the abstraction of a permanent hash table that persists even after the user has left the page or closed their browser.

The first step in working with AMASS is to load the AMASS script:

AMASS must wait for its internal machinery to finish loading. In order to use AMASS, you must wait until it is finished loading by adding a listener:

storage.onLoad(initialize);

function initialize() {
}

Once AMASS is loaded, you can begin to work with it by using it's hash table methods, such as put, get, and hasKey:

var keyName = "message";
var keyValue = new Object();
keyValue.message = "hello world";
keyValue.testArray = ["test1", "test2", "test3"];
keyValue.testObject = {someProperty: "someValue"};

if (storage.hasKey(keyName) == false) {
storage.put(keyName, keyValue, statusHandler);
}
else {
var results = storage.get(keyName);
}

The AMASS framework makes it possible for you to serialize entire JavaScript objects into the storage system, such as the keyValue object we serialize above. Note that DOM nodes and browser objects, such as the XMLHttpRequest object, will not be serialized.

Applications can store up to 100K without user permission. After this, a popup generated by the underlying Flash system is created that prompts the user for permission. The AMASS framework knows when the popup appears, generating a DIV and bringing the Flash file to the forefront of the application, centering
it on the screen:

Users can either APPROVE or DENY a storage request. You must create your application ready to have its storage request denied. The put() method takes a status handler as its third argument that informs your code on whether the storage request was successful or not. In the code above, statusHandler is a callback function that will receive whether the request was successful or failed:
function statusHandler(status) {
if (status == Storage.SUCCESS) {
var results = storage.get(keyName);
alert("Results from statusHandler="+results);
}
else if (status == Storage.PENDING) {
alert("Results pending approval of storage space from user");
}
else if (status == Storage.FAILED) {
alert("Storage request denied");
}
};

Status can be one of three values: Storage.SUCCESS, Storage.PENDING, or Storage.FAILED. If the popup
appears, you will get a callback of Storage.PENDING. Later, if the user approves the request, you will receive a Storage.SUCCESS; if the request was denied, you will receive Storage.FAILED. When the user approves the request, they can also indicate whether they give permission to future requests to automatically store information without having to popup the permission dialog again.

When working with giant strings or XML, you should not use the default put() or get() methods. Instead,
you should use the putString() and getString()methods. The put and get methods attempt to unserialize a stringified JavaScript object back into a real one, using eval(). If you are just storing a dumb string or XML than this will major impact your performance, especially for large datasets. For very large datasets you should definently storage your information as XML strings or just plain strings using the putString and
getString methods.

How Does It Internally Work?

Internally, we use a hidden Flash file and Flash's SharedObject functionality to permanently store the information. We script the Flash file using it's ActiveX methods on IE and it's LiveConnect methods on
Firefox. We use Flash's SharedObject's callbacks to detect when the request storage dialog is on the screen, and pass these back to the JavaScript application. We also center these values on screen.

Conditional GET

The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.

The semantics of the GET method change to a "conditional GET" if the request message includes an If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring multiple requests or transferring data already held by the client.

Lets look at the real time example on how Conditional GET is useful.

Conditional GET is probably useful to check out RSS feed. For instance, if a RSS feed gets updated only twice a day, but users download the whole thing every hour to see if it's changed yet. This is obviously a waste of bandwidth. What they really should do, is first ask whether it's changed or not, and only download it if it has.

The people who invented HTTP came up with something even better. HTTP allows you to say to a server in a single query: “If this document has changed since I last looked at it, give me the new version. If it hasn't just tell me it hasn't changed and give me nothing.” This mechanism is called “Conditional GET”, and it would reduce 90% of those significant 24,000 byte queries into really trivial 200 byte queries

Client implementation

The mechanism for performing a conditional get has changed slightly between HTTP versions 1.0 and 1.1. Like many things that changed between 1.0 and 1.1, you really have to do both to make sure you're satisfying everybody.

When you receive the RSS file from the webserver, check the response header for two fields: Last-Modified and ETag. You don't have to care what is in these headers, you just have to store them somewhere with the RSS file.

Next time you request the RSS file, include two headers in your request.. Your If-Modified-Since header should contain the value you snagged from the Last-Modified header earlier. The If-None-Match header should contain the value you snagged from the ETag header.

If the RSS file has changed since you last requested it, the server will send you back the new RSS file in the perfectly normal way. However, if the RSS file has not changed, the server will respond with a ‘304’ response code (instead of the usual 200), where 304 means ‘Not Modified’. In the case of a 304, the response will have an empty body and the RSS file won't be sent back to you at all.

There's a temptation for clients to put their own date in the If-Modified-Since header, instead of just copying the one the server sent. This is a bad thing, what you should be sending back is exactly the same date the server sent you when you received the file. There's two reasons for this. Firstly, your computer's clock is unlikely to be exactly synchronised with the webserver, so the server could still send you files by mistake. Secondly, if the server programmer has followed this guide (see below), it'll only work if you send back exactly what you received.

Server Implementation for Static Files

If you are using one of those weblogging tools that just sticks regular files on a regular webserver (e.g. or Moveable Type), your webserver will almost certainly already follow the get standard. HTTP 1.1 has been around 31 years now, and there's really not much of an excuse for anyone to not be following it.

One thing you'll have to watch out for, though, is if your site's RSS file is regenerated frequently even when it's not changed. If that happens, the server won't be able to keep track of the last modified time properly, and you'll get people downloading the file even when it's not changed. The solution is for the writers of weblogging tools to optimise their software to make sure that files are only updated if they've actually changed in some way. (i.e. have them generate the new file, compare it with the old one, and if they're the same leave the old one untouched.)

Server Implementation for Dynamic Content

If you've got a weblogging tool that re-generates the RSS file every time a request is made, there's a little more work to do. This section is aimed more at the writers of the tools than at the user, because it's the tool writers that need to fix their software so that it follows the specs.

I'll concentrate purely on RSS files, but the concepts used here can be applied to any page in the weblog, and may further reduce the bandwidth usage for your users.

In your RSS feed generator, you'll have to keep track of two values: the time the file was last modified (converted to Greenwich Mean Time), and an “etag”. According to RFC2616, the etag is an “opaque value”, which means you can put anything you like in it, providing you stick double-quotes around the whole lot. The time in the Last-Modified header needs to be formatted in a certain way, though, the same format used in email headers. For example, ‘Mon, 17 Sep 2001 11:54:29 GMT’.

Whenever someone requests your RSS file, send those values for the Last-Modified and Etag headers. Every web scripting language allows you to add and remove headers like that at will, just check the manual if you don't know how.

Now for the other bit. Whenever someone requests your RSS file, check the headers of their request for an If-Modified-Since header, or an If-None-Match header. If either of them are there, and if [deleted either ] both of them match the values you were planning to send out with the file, then don't send the file. Once again, consult your manual to see how to send back a "304 Not Modified" reply instead of the "200 OK" that you normally would. If you send back the 304 reply, you don't have to generate the RSS file at all. Just send out the headers, followed by two linefeeds to show the headers are done, and the client will know there's nothing else coming.

Technically, what you should do with an If-Modified-Since header is convert it to a date, and compare it with your stored date. However, 90% of the time you can get away with just doing a straight match, so it's probably not worth the effort.

How do I calculate the Last-Modified date?

Easy. It's the time that the most-recently-changed item in the RSS file was modified. Something like that should be pretty easy to store and fetch.

What should I put in an etag?

The Apache server uses a hash of the contents of the file. This isn't necessary though. All the eTag has to be is something that changes every time the file changes. So it could be a version number, or it could even be exactly the same as the Last-Modified date, just in double-quotes.

Many thanks to Fishbowl site for providing this information.

If u would like to know more on Conditional GET check out the url here



Thursday, October 11, 2007

CSS Tricks

If u are a web designer and work in CSS most of the time then the following 10 tricks might be of useful to u.

1. CSS font shorthand rule

When styling fonts with CSS you may be doing this:

font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-variant: small-caps;
font-family: verdana,serif;

There's no need though as you can use this CSS shorthand property:

font: 1em/1.5em bold italic small-caps verdana,serif

Much better! Just a couple of words of warning: This CSS shorthand version will only work if you're specifying both the font-size and the font-family. Also, if you don't specify the font-weight, font-style, or font-varient then these values will automatically default to a value of normal, so do bear this in mind too.

2. Two classes together

Usually attributes are assigned just one class, but this doesn't mean that that's all you're allowed. In reality, you can assign as many classes as you like! For example:

...

Using these two classes together (separated by a space, not with a comma) means that the paragraph calls up the rules assigned to both text and side. If any rules overlap between the two classes then the class which is below the other in the CSS document will take precedence.

3. CSS border default value

When writing a border rule you'll usually specify the colour, width and style (in any order). For example, border: 3px solid #000 will give you a black solid border, 3px thick. However the only required value here is the border style.

If you were to write just border: solid then the defaults for that border will be used. But what defaults? Well, the default width for a border is medium (equivalent to about 3 to 4px) and the default colour is that of the text colour within that border. If either of these are what you want for the border then you can leave them out of the CSS rule!

4. !important ignored by IE

Normally in CSS whichever rule is specified last takes precedence. However if you use !important after a command then this CSS command will take precedence regardless of what appears after it. This is true for all browsers except IE. An example of this would be:

margin-top: 3.5em !important; margin-top: 2em

So, the top margin will be set to 3.5em for all browsers except IE, which will have a top margin of 2em. This can sometimes come in useful, especially when using relative margins (such as in this example) as these can display slightly differently between IE and other browsers.

(Many of you may also be aware of the CSS child selector, the contents of which IE ignores.)

5. Image replacement technique

It's always advisable to use regular HTML markup to display text, as opposed to an image. Doing so allows for a faster download speed and has accessibility benefits. However, if you've absolutely got your heart set on using a certain font and your site visitors are unlikely to have that font on their computers, then really you've got no choice but to use an image.

Say for example, you wanted the top heading of each page to be ‘Buy widgets’, as you're a widget seller and you'd like to be found for this phrase in the search engines. You're pretty set on it being an obscure font so you need to use an image:

Buy widgets

This is OK but there's strong evidence to suggest that search engines don't assign as much importance to alt text as they do real text (because so many webmasters use the alt text to cram in keywords). So, an alternative would be:

Buy widgets

Now, this obviously won't use your obscure font. To fix this problem place these commands in your CSS document:

h1
{
background: url(widget-image.gif) no-repeat;
}

h1 span
{
position: absolute;
left:-2000px;
}

The image, with your fancy font, will now display and the regular text will be safely out of the way, positioned 2000px to the left of the screen thanks to our CSS rule.

6. CSS box model hack alternative

The box model hack is used to fix a rendering problem in pre-IE 6 browsers, where by the border and padding are included in the width of an element, as opposed to added on. For example, when specifying the dimensions of a container you might use the following CSS rule:

#box
{
width: 100px;
border: 5px;
padding: 20px;
}

This CSS rule would be applied to:

...

This means that the total width of the box is 150px (100px width + two 5px borders + two 20px paddings) in all browsers except pre-IE 6 versions. In these browsers the total width would be just 100px, with the padding and border widths being incorporated into this width. The box model hack can be used to fix this, but this can get really messy.

A simple alternative is to use this CSS:

#box
{
width: 150px;
}

#box div
{
border: 5px;
padding: 20px;
}

And the new HTML would be:

...

Perfect! Now the box width will always be 150px, regardless of the browser!

7. Centre aligning a block element

Say you wanted to have a fixed width layout website, and the content floated in the middle of the screen. You can use the following CSS command:

#content
{
width: 700px;
margin: 0 auto;
}

You would then enclose

around every item in the body of the HTML document and it'll be given an automatic margin on both its left and right, ensuring that it's always placed in the centre of the screen. Simple... well not quite - we've still got the pre-IE 6 versions to worry about, as these browsers won't centre align the element with this CSS command. You'll have to change the CSS rules:

body
{
text-align: center;
}

#content
{
text-align: left;
width: 700px;
margin: 0 auto;
}

This will then centre align the main content, but it'll also centre align the text! To offset the second, probably undesired, effect we inserted text-align: left into the content div.

8. Vertically aligning with CSS

Vertically aligning with tables was a doddle. To make cell content line up in the middle of a cell you would use vertical-align: middle. This doesn't really work with a CSS layout. Say you have a navigation menu item whose height is assigned 2em and you insert this vertical align command into the CSS rule. It basically won't make a difference and the text will be pushed to the top of the box.

Hmmm... not the desired effect. The solution? Specify the line height to be the same as the height of the box itself in the CSS. In this instance, the box is 2em high, so we would insert line-height: 2em into the CSS rule and the text now floats in the middle of the box - perfect!

9. CSS positioning within a container

One of the best things about CSS is that you can position an object absolutely anywhere you want in the document. It's also possible (and often desirable) to position objects within a container. It's simple to do too. Simply assign the following CSS rule to the container:

#container
{
position: relative;
}

Now any element within this container will be positioned relative to it. Say you had this HTML structure:

To position the navigation exactly 30px from the left and 5px from the top of the container box, you could use these CSS commands:

#navigation
{
position: absolute;
left: 30px;
top: 5px;
}

Perfect! In this particular example, you could of course also use margin: 5px 0 0 30px, but there are some cases where it's preferable to use positioning.

10. Background colour running to the screen bottom

One of the disadvantages of CSS is its inability to be controlled vertically, causing one particular problem which a table layout doesn't suffer from. Say you have a column running down the left side of the page, which contains site navigation. The page has a white background, but you want this left column to have a blue background. Simple, you assign it the appropriate CSS rule:

#navigation
{
background: blue;
width: 150px;
}

Just one problem though: Because the navigation items don't continue all the way to the bottom of the screen, neither does the background colour. The blue background colour is being cut off half way down the page, ruining your great design. What can you do!?

Unfortunately the only solution to this is to cheat, and assign the body a background image of exactly the same colour and width as the left column. You would use this CSS command:

body
{
background: url(blue-image.gif) 0 0 repeat-y;
}

This image that you place in the background should be exactly 150px wide and the same blue colour as the background of the left column. The disadvantage of using this method is that you can't express the left column in terms of em, as if the user resizes text and the column expands, it's background colour won't.

Source here

Google acquires Jaiku

Jaiku, the activity streaming and presence service (also referred to as micro blogging), has been acquired by Google. Some days back Google entered into mobile space by acquiring a company called Zingku. If u would like to be acquried add "ku" at the end of ur company name :)

Here's a message from the founders:

Jaiku is joining Google. While it's too soon to comment on specific plans, we look forward to working with our new friends at Google over the coming months to expand in ways we hope you'll find interesting and useful. Our engineers are excited to be working together and enthusiastic developers lead to great innovation. We look forward to accomplishing great things together. In order to focus on innovation instead of scaling, we have decided to close new user sign-ups for now.

But fear not, all our Jaiku services will stay running the way you are used to and you will be able to invite your friends to Jaiku. We have put together a quick Q&A about the acquisition .

Background

Q: What is Jaiku?

A. Jaiku is an activity stream and presence sharing service that works from the Web and mobile phones. Jaiku, Ltd. was founded in February, 2006 by Jyri Engeström and Petteri Koponen from Finland. The service was released on the Web in July 2006. Jaiku is based in Helsinki.

Q: Why did Google acquire Jaiku?

A: Activity streams and mobile presence are important areas where we believe Google can add a lot of value for users. Jaiku's technology and talented team are a great addition to Google's current application and mobile teams.

Q. What are the terms of the acquisition? How much did Google pay?

A. The terms of the acquisition are confidential and the deal is officially closed.

Q: What are Google's plans for Jaiku?

A: We are excited to welcome the Jaiku employees into Google. While it's too soon to comment on specific products and development plans, we'll be working with the Jaiku team over the coming months to expand their technology in ways we hope you'll find interesting and useful. Check back in a few months to see what we've developed.

Jaiku users

Q: Will Google continue to support Jaiku users?

A: Jaiku will continue to support its existing user base. Jaiku users will be able to invite new friends, but new user registrations have been closed for the time being. We are working on exciting new products and our Jaiku users will be among the first to try them out!

Q: Can I still sign up for a new Jaiku account?

A: A limited number of users will be able to sign up for an invitation to participate in continued beta-testing of the service. You can request an invite code here.



Saturday, October 6, 2007

Yahoo! Music Player Plug-in.

Yahoo Music Player plugin enables streaming of full-length tracks with the Yahoo! Music Player. It works with Yahoo! Music web playlists, but full-length playback may not be available on other pages of Yahoo! Music at present. You need to have a subscription to Yahoo! Music to listen to tunes from Yahoo.

But alaas Yahoo! Music Player Plug-in (Beta) is not available for Linux users :(

Click here for more information

VideoDownloader

If u use YouTube, Google, Metacafe and other video sites then VideoDownloader will be a useful extension.

You can download videos from Youtube, Google, Metacafe, iFilm, Dailymotion, Pornotube... and other 60+ video sites ! And all embedded objects on a webpage (movies, mp3s, flash, quicktime, etc) ! directly !

VideoDownloader add a small icon on the status bar at the bottom of your firefox window, and a toolbar button. Just click that and download the video you are watching !

For a example of what this Add-on has to offer, visit the following...

http://videodownloader.net/help/vd04.htm

Sites supported:
Youtube, Google Video, iFilm, Metacafe, Dailymotion, Myspace, Angry Alien, AnimeEpisodes.Net, Badjojo, Blastro, Blennus, Blip.tv, Bofunk, Bolt, Break.com, Castpost, CollegeHumor, Current TV, Dachix, Danerd, DailySixer.com, DevilDucky, Double Agent, eVideoShare, EVTV1, FindVideos, Free Video Blog, Grinvi, Grouper, Hiphopdeal, Kontraband, Lulu TV, Midis.biz, Music.com, MusicVideoCodes.info, MySpace Video Code, Newgrounds, NothingToxic, PcPlanets, Pixparty, PlsThx, Putfile, Revver, Sharkle, SmitHappens, StreetFire, That Video Site, TotallyCrap, VideoCodes4U, VideoCodesWorld, VideoCodeZone, vidiLife, Vimeo, vSocial, Yikers, ZippyVideos... and any other webpage with embedded objects.

If u would like to install this extension then click here

Tuesday, October 2, 2007

Types of US Visa's

This is a must to know information for students or those who are trying to go to US for education/work etc.,

A - Official Visa

  • A-1: For Ambassadors, public ministers & consular officers
  • A-2: For immediate family members of A-1
  • A-3: Attendants & servants of A-1 and A-2 holders

    B - Business/Visitor Visa

  • B-1: Temporary visitor for business
  • B-2: Temporary visitor for leisure

    C & D Visa (For Aliens in transit)

  • C-1,2: Alien in transit directly through US
  • C-3: Family of C-1,C-2 in transit
  • C-4: Transit without Visa(TWOV)
  • D-1: Sailors departing on vessel of arrival
  • D-2: Sailors departing by other means

    E - Visa (For Traders/Investors)

  • E-1: Treaty Trader, spouse and children
  • E-2: Treaty Investor, spouse and children

    F Visa (Students)

    Want to study or research at a U.S. college? Then F is the visa for you -

  • F-1: Academic Student
  • F-2: Spouse or child of F-1

    H (Temporary Worker) Visa

  • H-1B: Persons in a specialty occupation
  • H-2B: Seasonal nonagricultural workers
  • H-3: Trainees other than medical/academic; also training of handicaps
  • H-4: Dependants of H visa holders

    I Visa (Mediapersons)

    Are you a reporter, film person, Editor? Then you require an I-visa -
    Essential documents: Your press ID, a letter from the editor.

    J & Q Exchange Visitor Visa

  • J-1: Visas for exchange visitors. exchange visitors may be academics, scientists, businesspeople or students.
  • J-2: Spouse or ‘child’ of J-1 under 21

    K Fiance(e) of US Citizen

  • K-1: Fiance(e)
  • K-2: Minor child of K-1
  • K-3: Spouse of a U.S. Citizen (LIFE Act)
  • K-4: Child of K-3 (LIFE Act)Essential documents: Marriage certificate & Photos, Intent of marrying within 90 days in US(for K1).

    L Visa (Intracompany Transferees)

  • L-1A: Executive, managerial
  • L-1B: Specialized knowledge
  • L-2: Spouse or child of L-1

    M Visa - Vocational and Language Students

  • M-1: Vocational student or other non-academic student
  • M-2: Spouse or child of M-1

    O Visa - For Prodigies

  • O-1: For a Genius in Sciences, Arts, Education, Business, or Athletics.
  • O-2: Alien’s (support) accompanying O-1
  • O-3: Spouse or child of O-1 or O-2

    P Visa - Athletes and Entertainers

  • P-1: Athletes & Entertainment groups
  • P-2: Entertainers in exchange programs
  • P-3: Entertainers in cultural programs
  • P-4: Spouse or child of P-1, 2, or 3

    R Visa - Religious Workers

  • R-1: Religious workers
  • R-2: Spouse or child of R-1

  • I would like to thank Bhuvana for this information.

    GSpace

    GSpace Firefox extension allows you to use your Gmail Space (2.8 GB and growing) for file storage. It acts as an online drive, so you can upload files from your hard drive and access them from every Internet capable system. The interface will make your Gmail account look like a FTP host.

    After the installation, you'll get an option called "Gspace" in your "Tools" menu, which opens the GSpace window.

    It's great for storing/sharing files with your friends. Also very good to backup photos and music files (as you can view/listen to them from Gspace). It can turn your gmail account into online storage tool stuffed with handy features.

    Gspace has four different operational modes;

    1. File Transfer Mode: download/upload
    2. Player Mode: listen to your stored music files using gspace’s built-in media player
    3. Photo Mode: view and browse through pictures and albums stored on gspace
    4. Gmail Drive: manage Gdrive files

    If you experience any kind of problems check out gspace faq section

    Click here to install the extension.

    CustomizeGoogle.

    CustomizeGoogle - Improve ur Google Experience.

    CustomizeGoogle is a Firefox extension that enhance Google search results by adding extra information (like links to Yahoo, Ask.com, MSN etc) and removing unwanted information (like ads and spam). All features are optional and can be easily configured.

    The below are some of the features of CustomizeGoogle:
    Click here to install the extension.

    Check out CustomizeGoogle blog for more information. Happy surfing with CustomizeGoogle

    FileUploader!!!

    Fireuploader is a Firefox extension that allows you to upload/download files from any website using a friendly interface. This tool will let you automate uploading photo’s to a whole lot of sites. These sites include, Flickr, Box.net, Picasa and YouTube.


    There are so many instances where you had to upload files from your local computer to a website. The standard upload mechanism in any website has many limitations like:
    • They allow you to upload 1 file or a maximum of 10 files at a time.
    • They don't show any upload progress i.e how much was already uploaded and how much is still remaining.

      Fireuploader extension addresses these limitations by providing a intuitive way to upload the files.
    Here are some key features of "Fireuploader":
    • Fireuploader shows the local folders and remote folders which enables you to upload files by single click.
    • You can upload any number of files at a time.
    • You can upload files to multiple websites using a single interface (using only one extension).
    • Ability to add multiple accounts and upload files to each account independently.
    • Site specific features are also included and will be improved in the coming versions. eg. Box.net: giving public/private access to files.
    If you would like to download this extension check out this site

    Firefox - Make it fast!!

    If u use Firefox most of the time and have lots of extensions installed and if u cant imagine life without Firefox then this post is for u.

    If ur Firefox hangs for no reason and take 90% of ur CPU usage then it might be due to Memory Leak problems.

    About memory leak - a process that over time can gradually eat away at system resources. In worst-case scenarios, a memory leak could cause an application to become unstable.

    The following are some of the reasons that may cause memory leaks in Firefox
    • Bad live bookmark causes Firefox memory usage to grow endlessly and make the browser unstable

    • Memory leak (especially in graphics-intensive webpages), freed upon minimize

    • When saving a picture, HUGE memory leak! Also slows machine down!

    • memory leak if page contains a refresh meta-tag

    • Memory leak when I leave firefox up with a few sub tabs open

    • Firefox begin to eat memory and hangs after opening this URL

    • very slow restore from minimize after memory growth compared to other applications
    The following points are pretty useful to speed up Firefox

    1. Disable prefetch: go to about:config. Search for prefetch, you'll find network.prefetch-next. Double click it to turn it false if it is on.

    2. Limit the memory cache: about:config, new integer, browser.cache.memory.capacity, set it to the memory in KB you want to limit the memory cache to.

    3. You can Install FasterFox tweaking extension - It allows you to prefetch links and tweak many network and rendering settings such as simultaneous connections, pipelining, cache, DNS cache, and initial paint delay.

    4. If Mozilla Firefox hangs as soon as you launch the browser, the issue is probably either with an installed extension or a theme. Try running Firefox in Safe Mode (firefox.exe -safe-mode) - If it runs normally, disable or uninstall the problem causing theme or extension.

    5. Firefox can hang is there is a memory leak. Installing too many extensions or opening lot of browser tabs can hog memory. Disable all extension that you haven't used since the past week

    6. Adobe Reader browser plugin can consume huge amounts of memory. To disable the Adobe Reader Firefox plugin, open the Firefox plugins directory and delete or rename the nppdf32.dll file.

    7. Firefox can also crash when you close a tab that is loading or playing a Java Applet - Always disable Java plugin, it will also reduce the CPU usage.

    8. In certain configurations, disabling Mouse Gesture in Firefox helps curb memory spikes.

    9. Don't install Adblock extension with Firefox 1.5 as it causes an increase in Firefox memory usage. Instead use AdBlock Plus.

    10. Setting the browser history to extremely large values will increase memory usage. Keeping the history to a reasonable level is a good idea for this reason.

    If u want to know more on fixing memory leaks check out the following links

    http://forums.mozillazine.org/viewtopic.php?t=354828 http://labnol.blogspot.com/2006/01/solutions-to-common-firefox-15.html
    http://www.informationweek.com/shared/printableArticle.jhtml?articleID=175800132

    WebDeveloper Extension!!!

    The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

    Click here to download for Firefox/Flock

    Click here to download for Mozilla/SeaMonkey

    It is a "must-install" for website designers/developers.

    Check out FireBug and YSlow which I mentioned earlier in previous posts.

    YSlow - Another Webdevelopment helper...

    I wrote about Firebug in my previous post which is integrated with Firefox to put a wealth of development tools at your fingertips while you browse.

    In addition to Firebug I use YSlow which is a firefox add-on integrated with the popular Firebug web development tool. YSlow analyzes web pages and tells you why they're slow based on the following rules for high performance Web Sites

    1. Make Fewer HTTP Requests
    2. Use a Content Delivery Network
    3. Add an Expires Header
    4. Gzip Components
    5. Put CSS at the Top
    6. Move Scripts to the Bottom
    7. Avoid CSS Expressions
    8. Make JavaScript and CSS External
    9. Reduce DNS Lookups
    10. Minify JavaScript
    11. Avoid Redirects
    12. Remove Duplicate Scripts
    13. Configure ETags

    YSlow gives u the following:

    • Performance report card
    • HTTP/HTML summary
    • List of components in the page
    • Tools including JSLint
    Research conducted by the Exceptional Performance team is documented in the following Yahoo! User Interface Blog articles.
    If you dont have Firebug Install it here and YSlow here