Sunday, December 16, 2007

Programming Language Inventor Or Serial Killer?

Can you tell a coder from a cannibal? Try to work out the quiz named 'Programming Language Inventor Or Serial Killer'!

Link: http://www.malevole.com/mv/misc/killerquiz/

I scored 8 out of 10.



AdvertisementGet great discounts on Amazon.com Textbooks

Sunday, October 28, 2007

Investment Options in India

Bank FDs
  • Very low risk and low liquidity.
  • Low returns, but assured. Depending on the tenure and bank, could be around 6-9%
  • Since returns are fully taxable, the post-tax returns will be still lower.
  • Good for very low risk investors and those in the nil or low tax brackets. As interest rate scenario seems to be peaking, one could consider investing in 3-5 year FDs.
FMPs
  • Low risk and low Liquidity.
  • No assured returns but depending on tenure and the MF, could be around 6-9%. (Ability to deliver the indicative returns).
  • MFs attract much lower taxation and hence give better post-tax returns vis-à-vis Bank FDs.
  • Good for low risk investors, but in high tax brackets. Good for investing the debt portion of one’s portfolio.
Floating Rate Funds
  • Low risk and high liquidity.
  • Market linked. Today could be around 5-7%.
  • Lower taxation of MFs makes Floating Rate funds attractive.
  • Good for investing short-term money where one needs higher liquidity.
Debt Funds
  • Low to Medium risk. High Liquidity.
  • Returns are market-linked. Today could be around 5-7%, but susceptible to interest rate risk.
  • Lower taxation of MFs makes such funds attractive.
  • Can be avoided in a rising interest rate scenario but is good in a falling interest rate scenario.
Post Office Schemes
  • Low risk and low Liquidity.
  • MIS scheme give 8% interest. Time deposit 6.25-7.5%.
  • Since returns are taxable, the post-tax returns will be still lower.
  • Good for very low risk investors and those in the nil or low tax brackets.
PPF
  • Low risk with very low liquidity (15-year lock-in period. Partial withdrawal allowed after 6 years).
  • 8% assured returns. Interest is tax-free. Also Sec 80C benefit. Hence a good scheme.
  • Good tax saving investment option. Good for investing the debt portion of one’s portfolio.
NSC
  • Low risk with low liquidity (6 years lock-in).
  • 8% assured returns.
  • Interest fully taxable. But eligible for Sec 80C benefit.
  • Not very attractive vis-à-vis other options like 5-year Bank FDs.
Equity
  • High risk and high liquidity.
  • Market linked returns. Good potential.
  • Attractive tax treatment. No Long Term (investment of more than 1 year) Capital Gain Tax and 10% Short Term Capital Gains Tax.
  • Needs high risk appetite. Ideal for those investors who have a good corpus, good knowledge and time to track the markets regularly. Care should be taken to invest in good profit making companies. Penny stocks should be avoided.
Equity Funds
  • High risk and high liquidity in open-ended funds.
  • Market linked returns. Good potential.
  • Attractive tax treatment. No Long Term Capital Gain Tax and 10% Short Term Capital Gains Tax.
  • Ideal for small and common investors, but with high risk appetite. SIP and a long term investment horizon can cut down risk and increase the probability of making good returns. Ideally, one should build a well-diversified portfolio with say 40-50% money in 5-7 diversified funds (large cap oriented), 20-30% money in 3-4 mid/small-cap funds, 10-15% in 3-4 sector funds and 10-20% in balanced funds.
ELSS Funds
  • High risk with low liquidity (3 years lock-in period).
  • Market linked returns. Good potential.
  • Attractive tax treatment. No Long Term Capital Gain Tax and 10% Short Term Capital Gains Tax. Also Sec 80C benefit.
  • Good tax saving investment option. Amounts beyond Rs.1 lakh limit could be invested in open-ended funds. SIP in ELSS would reduce the volatility risk.
Balanced Funds
  • Medium to High risk. High Liquidity.
  • Medium to high returns. Market linked.
  • Attractive tax treatment. No Long Term Capital Gain Tax and 10% Short Term Capital Gains Tax.
  • Though convenient as both debt and equity investment is covered under one fund, it may be better to invest separately in equity and debt funds for better control.
ULIPs
  • Low to High Risk depending on the investment option i.e. Pure Debt or Mixed or Pure Equity. Low Liquidity (3-5 years lock-in period).
  • Low to high depending on the investment option. Market linked returns.
  • Tax free returns.Allso Sec 80 C benefit available.
  • Not an attractive option due to high charges, low flexibility and low diversification. There are other better similar investment products like MFs with low charges, high flexibility and high diversification. As regards life cover, the same could be done through a term policy.
Endowment/Moneyback Plan
  • Low risk and very low liquidity
  • Low returns. Generally around 6-6.5%.
  • Tax free returns. Also Sec 80 C benefit available.
  • Not an attractive option due to low returns. There are other better similar investment products like PPF. As regards life cover, the same could be done through a term policy.
Real Estate
  • Variable risk and variable liquidity depending on the type and location of property.
  • Market linked returns. Good potential.
  • No tax advantages, except attractive tax benefits on the home loans.
  • High initial investment required which could make one’s portfolio lopsided; high transactions costs like title-search, registration brokerage etc.; and cannot be partly liquidated. Therefore, real-estate MFs (expected in the near future) may be a better alternative than direct property investment. If investing directly, it is important to assess the potential and clear title.
Commodities
  • High risk with high liquidity.
  • Market linked returns.
  • No tax advantages.
  • Highly cyclical.
Gold
  • Low long-term risk. But volatile in short term. High Liquidity.
  • Has traditionally been a hedge against inflation. So returns could be around inflation levels.
  • No tax advantages.
  • Not an attractive investment option. Can be used for portfolio diversification to partly hedge against inflation. Gold MFs are better than buying physical gold.


AdvertisementGet great discounts on Amazon.com Textbooks

Monday, October 8, 2007

JConfig

jConfig is an extremely helpful utility, arming the developer with a simple API for the management of properties. Parts of the implementation are based on the idea that Properties, from Java's perspective, are a good thing, but can be better. jConfig employs the use of XML files for storing and retrieving of property information. The information can be stuffed into nice categories, which makes management quite a bit simpler. The ability to load from a URL is also a nice feature. It allows for a central repository where multiple instances of jConfig can read a single file. The nifty ability to switch between XML and Properties files isn't fully exploited yet, but will be coming soon. That will mean that the developer would take their existing Properties files and export them to XML. That means less time to get up and get going with jConfig.

My team is planning to use JConfig in one of the upcoming projects. If you have a view on JConfig, plz share that experience. Or, if you are using some alternative, that would also be helpful.

Link: JConfig(1) JConfig(2)


AdvertisementGet great discounts on Amazon.com Textbooks

Tuesday, October 2, 2007

Monitor and diagnose performance in Java SE 6

Java™ Platform, Standard Edition 6 (Java SE) focuses on performance, with expanded tools for managing and monitoring applications as well as diagnosing common problems. This article outlines the basis of monitoring and management in the Java SE platform and provides detailed information about the relevant enhancements in Java SE 6.

Java SE 6 provides an in-depth focus on performance, offering expanded tools for managing and monitoring applications and for diagnosing common problems. The improvements include:

  • Monitoring and management API enhancements
  • Official support for an improved graphical monitoring tool called JConsole
  • Enhanced instrumentation of the Java virtual machine (JVM)

This article outlines the basis of monitoring and management in the Java SE platform and provides detailed information about the performance monitoring and management enhancements in the latest release. It also describes the diagnostic and troubleshooting tools available in the Java SE 6 platform.


Link: Monitor and diagnose performance in Java SE 6



AdvertisementGet great discounts on Amazon.com Textbooks

Saturday, September 29, 2007

Mash - Yahoo's Social Network

Finally, Yahoo! has introduced its next generation social-network. Named Mash, the network is in beta, and is invite only as of now.

Mash borrows some features from Facebook, MySpace, and My Yahoo.
You can load a set of modules onto your profile page and move them around drag-and-drop style. The modules include Flickr RSS, Ego Boost, Common Friends, MyMoshLog2, Blog Feeds (RSS 2.0), Asteroids, Astrology, PimpMyPet, Hover, Kaleidescope, Guestbook, and My Stuff. Seems 3rd party developers would also able to develop modules for mash soon.

One of the interesting change from the rest of the social-networking-gang is the ability to edit friends' pages. Each time you visit your profile page, you may see new modules that others have loaded for you. This capability certainly adds to the “mashing” aspect of the social network!

Though access to Mash is invite only, invites are easily available now. If you want one, just drop your name and email id in the comments.

Link: Y! Mash


AdvertisementGet Amazon.com Textbooks at great discounts!

Sunday, September 9, 2007

$4,800 iPhone Bill

Jay Levy and his family took their iPhones on a Mediterranean cruise. Now the Hewlett Harbor entrepreneur feels as if he got taken for a ride, receiving a 54-page monthly bill of nearly $4,800 from AT&T Wireless.

via Erik's Weblog

Amazon.com Textbooks

Sunday, September 2, 2007

Java 1.5 - Application Memory Monitoring Made Easy

There is a new tool called Java Monitoring & Management Console in 1.5 edition of J2SE (available as %JDK_HOME%\bin\jconsole.exe). Simply set
JAVA_OPTS=-Dcom.sun.management.jmxremote

and start your Application Server or Servlet Container. Launch JConsole tool, and when asked for attaching, pick the appropriate process to attach.

[Pic 1 - Choose a Process to attach to.]

[Pic 2 - JConsole in Action]

I have a JDK 1.6 on W2K machine.

Here is a link from Sun's Java website.


AdvertisementAmazon.com Textbooks

Copyright Vs. Contract

With the increasing use of open source softwares around the globe, multiple interpretations of the licensing is causing a lot of heart-burns. The Free Software Foundation has always claimed that Open Source Licenses are copyrights, and not mere contracts. Now, a San Fransisco court has ruled that the said license violation was only a contract violation and not a copyright infringement. The case involves Artistic License. This ruling is contrary to that belief and creates more confusion in an already confused open source license space.

This ruling indicates that the courts and the legal experts do not fully understand the concept of Open Source. What is going to be more interesting is to see how if impacts other licenses.

eWeek Article

AdvertisementAmazon.com Textbooks

Wednesday, August 29, 2007

Replacing DisplayTag

I have been involved in an Intranet application for a big SCM client for around 2 years now. This application is being build on JBoss with Struts 1.1. Since the days of its prototype, DisplayTag has been used for the Grid type functionality. There are a couple of screens which require Grid. Some of the Grids are editable as well. Moreover, there are various complex scenarios attached with them e.g. pressing escape should bring revert the changes done to selected row or tabbing off the row should result in saving of the row among others.
However, now, we are replacing Display Tag with a Grid Applet. The reason being that it is slow to render pages (through pagination).
So, do you have a view here. Any suggestions which applets can be considered?

AdvertisementAmazon.com Textbooks

Tuesday, August 28, 2007

5 ways to speedup javascript

From http://www.whenpenguinsattack.com/2007/08/20/5-ways-to-speedup-javascript/

1) use a compressor
JSMin is a filter which removes comments and unnecessary whitespace from JavaScript files. It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation.

2) Minimize the number of .js files
Each .js file reference on a web page means another http request from a client's browser. Although it may decrease the readability/maintainability of your code, it is faster to have one larger .js file than multiple smaller ones.

3) use profiler and timer tools
Firebug offers a suite of profiler and timing tools that allows you to see exactly how long your scripts take to execute and gives you the ability to tweak and optimize them.

4) asynchronize your code
Browsers run Javascript code synchronously. This means that when a <script></script> tag has been found, everything on the page stops until the end script tag has been found. If a script doesn't finish executing within a certain amount of time, then the user gets a warning that says, "A script on this page is taking a long time to complete."

example:

function testfunc(){
var x1="test1";
var x2="test2";

alert(x1+x2);
}

testfunc(); //normal way to execute the function
window.setTimeout(testfunc,0); //asynchronous execution of testfunc()


The setTimeout function takes 2 parameters. The first is the name of the function that will be executed and the second is the number of milliseconds to wait until it is called. Since 0 is used for the second parameter, the function is called immediately (it will be forked in the background and the rest of your page will continue to load). This is useful for functions that take a long time to load.

5) cache DOM variables
Every binding in Javascript is late. This means each time you access a property, variable, or method a look-up is performed. Within the IE DOM, this could mean an extensive search of the element to find the same property over and over again, only to be returned to the JScript engine unchanged from the previous request.

Here is an example of a function that can be optimized:


function buildString(){
var newElement = document.getElementById("myitem");
newElement.innerHTML = ""; // Clear out the previous
newElement.innerHTML += addHeader();
newElement.innerHTML += addBody();
}



Here is the optimized function:

function buildString() {
var newText = addHeader() + addBody();
document.getElementById("myitem").innerHTML = newText;
}



http://www.whenpenguinsattack.com/2007/08/20/5-ways-to-speedup-javascript/

AdvAmazon.com Textbooks

Saturday, August 18, 2007

Reference Guide: HProf

InformIT has published a user guide to HProf, the Java profiling tool from Sun.


Sun includes a profiling tool built into the JVM called HProf that can provide you with method-level response times as well as heap information. The JVM provide various programmatic interfaces that allow you to obtain runtime information, and as of Java 5.0 SE, the newest and least invasive is the Java Virtual Machine Tool Interface(JVMTI), which HProf is based on. HProf can be invoked by providing a command line option when you start your Java application and then it generates a log file as output, which you can either examine manually or programmatically parse. Furthermore, HProf executions can be integrated into a build script in order to generate reports automatically.


http://www.informit.com/guides/printerfriendly.aspx?g=java&seqNum=363


Using Ajax across multiple domains

From http://www.whenpenguinsattack.com/2007/08/13/using-ajax-across-multiple-domains/

XMLHttpRequest, the main component behind AJAX, does not automatically work across multiple domains. This means that you cannot make a request to an ovject on a domain that is different from the web page’s domain. There is an easy solution to this issue: apache’s mod_rewrite module.

Example

function getXMLHttpObject() {
if (window.XMLHTTPRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
return null;
}
}

function handleHTTPResponse() {
if (http.readyState == 4) {
results = http.responseText;
}
}

var http = getXMLHttpObject();

http.open("POST"."http://www.yahoo.com/service");
http.onreadystatechange = handleHttpResponse;

The above example will fail with both Firefox and Internet Explorer (unless you are running it on a web page located on the yahoo domain). There are other ways to allow cross site ajax. Within Internet Exporer, the default security settings can be changed or a host can be added to the “trusted hosts” list. Firefox, on the other hand, has a concept called signed scripts. Both of these methods will not work for most websites on the Internet. This is because it would involve every user coming to your site adding your page to their trusted host list.

Apache setup
  1. Install apache with both mod_rewrite and proxy enabled.
  2. Create the following rule: RewriteRule ^/yahoo_proxy http://www.yahoo.com/service [P]

Note: The [P] indicates a pass-through proxy.

Replace the above line: (http.open("POST"."http://www.yahoo.com/service")) with

http.open("POST"."http://your_host/yahoo_proxy") and a connection will be made to the yahoo domains through your apache server while not violating the security restrictions of IE or Firefox.

http://www.whenpenguinsattack.com/2007/08/13/using-ajax-across-multiple-domains/

Thursday, August 9, 2007

Secret of success

"Sir, What is the secret of your success?" a reporter asked the President of a Bank.

"Two words."

"And, Sir, what are they?"

"Right decisions."

"And how do you make right decisions?"

"One word.'

"And, sir, What is that?"

"Experience. "

"And how do you get Experience?"

"Two words"

"And, Sir, what are they?"

"Wrong decisions ."


Monday, August 6, 2007

12 skills that employers can't say no to

There is an interesting article on Javaworld.com titled "12 skills that employers can't say no to"by Mary Brandel, listing skills, some of which are already essential to succeed on-job, some are acquiring that status, and few could acquire that status.
  • Machine learning
  • Mobilizing applications
  • Wireless networking
  • Human-computer interface
  • Project management
  • General networking skills
  • Network convergence technicians
  • Open-source programming
  • Business intelligence systems
  • Embedded security
  • Digital home technology integration
  • .Net, C #, C ++, Java -- with an edge
Javaworld.com

Sunday, August 5, 2007

Online Hindi Radio Stations

Here is the list of Online Hindi Radio Stations. Copy the URL in your media player and enjoy !!


106.2 HUMFM - UAE ==> http://www.humfm.com/humfm.asx

AajKal - Asian Network ==> http://stream.servstream.com/ViewWeb/BBCRadio_music/Event/BBCAsianNetwork_hi.asx

Amrit Bani - UK ==> http://62.25.97.192/amritbani?MSWMExt=.asf

ApnaRadio - USA ==> http://www.apnaradio.com/live/media24/ApnaRadio.asx

Asian Gold Radio - UK ==> http://62.25.96.7/asiangold

Asian Sound Radio - UK ==> http://www.vtuner.com/vtunerweb/mms/mms15278.asx

BBC News ==> http://www.bbc.co.uk/worldservice/meta/tx/nb/live_news_au_nb.asx

BombayBeats FM ==> http://www.1.fm/player/energybbfm32k.asx

City 101.6 FM - Dubai ==> http://asx.abacast.com/arabian_radio-city-24.asx

DDLive Video - India ==> http://164.100.51.209/ddlive?MSWMExt=.asf

DesiSoundz - India ==> http://desisoundz.com:8000

Haagstad Radio - Holand ==> mms://81.205.146.32:21/haagstadradio

kismatradio.com ==> http://www.kismatradio.com/newmedia/live.asx

nimboodamusic.com ==> http://www.nimboodamusic.com/nim128.wax

Punjabi Radio - UK ==> http://azul.streamguys.com/panjabradio?MSWMExt=.asf

Radio Apni Awaz ==> mms://67.15.80.29/radioapniawaz

Radio India - Canada ==> mms://live.radioindiabroadcasting.com/liveradio

Radio XL - UK ==> http://www.vtuner.com/vTunerweb/mms/m3u13219.m3u

RadioOfIndia - Bhajans ==> http://www.radioofindia.com/asf/bhajans.asx

RadioOfIndia - Bollywood ==> http://www.radioofindia.com/asf/bollywood.asx

RadioOfIndia - Classical ==> http://66.238.65.109/classical

RadioTarana-NewZealand ==> mms://l1.r2.co.nz/tarana-1

RadioTeenTaal - Paris ==> http://www.radioteentaal.com/masala128.wax

Sabras radio - UK ==> http://ct1.fast-serv.com:8744

Sanskar Radio - UK ==> http://www.vtuner.com/vTunerweb/mms/m3u18290.m3u

Sunrise FM - UK ==> http://62.25.96.7/sunrise

Trishul 90.5 FM ==> http://www.vtuner.com/vtunerweb/mms/mms14734.asx

Yarr Radio - UK ==> mms://193.218.160.20/yaarradio



Sunday, July 22, 2007

Scrum Vocabulary

  • A Product Owner compiles all the changes planned for the product and prioritizes the possible functionalities.
  • Sprint is A 1-6 week period in which the delivery team produces (mutually agreed)acceptable product features. Also called Iteration in the Agile methodology.
  • The result of the Product Owner’s work is a Product Backlog. It is a to-do list that is constantly reprioritized. Before each Sprint, the highest prioritized goals are transferred to a Sprint Backlog.
  • Together with a user, the project members form a Scrum Team. During discussions with the Product Owner, the goal of the Sprint is determined and the prioritized functionality is broken down into detailed tasks.The team is self-organized and the members have a joint responsibility for the results.
  • The Scrum Master coaches the development team, removes any possible impediments and constantly works to ensure that the team has the best possible circumstances for realizing the goals fixed for the Sprint.

Wednesday, July 18, 2007

Scrum in Five Minutes - Executive Summary

In his blog entry, Jeff Sutherland introduces an exceptionally concise introduction to the Scrum development process, titled "Scrum in Five Minutes" . This document is created by Swedish consulting firm Softhouse, and gives a brief outline of the pieces and players of Scrum in whole 16 pages.



For those to Scrum, such summaries can serve as a useful introduction.

Summaries like this can facilitate comparisons between the various flavors of agile development. Some others available are

http://www.softhouse.se/Uploades/Scrum_eng_webb.pdf

Sunday, July 15, 2007

What Is Dojo?

Dojo is an Open Source JavaScript UI toolkit. It makes writing JavaScript easier, building great interfaces faster, and deploying dynamic UIs at scale much easier. The foundation of Dojo is "Dojo Base", a single tiny library which contains Ajax, event handling, effects, blazing fast CSS queries, language utilities, and a lot more. On top of this Base, the rest of Dojo Core adds high-quality facilities for Drag and Drop, extended forms of Ajax and I/O, JSON-RPC, internationalization, and back-button handling.

Layered on Dojo Core is a widget system, Dijit, which makes developing and reusing interface components a snap. If you can write HTML and CSS, Dijit allows you to quickly build reusable client-side components. Similarly, Dojo can use extended attributes on HTML in order to declare where widgets should be placed and how to configure them. Placing a graphical date picker in a page is as easy as adding an attribute to an <input> element. By upgrading standard HTML instead of inventing a new markup language, Dojo makes building degradeable user interfaces easy. It's "progressive enchancement" in the extreme, and it allows you to build UIs that look good, work well, and run fast. Dojo has also been built with great care. From the unit test harness all the way to the data binding system, to its portable 2D drawing API, Dojo has been engineered as a coherent system which means that the Dojo Team's single-minded attention to consistency and quality ensures your applications will not only look good but will stand the test of time. Dojo features built-in internationalization and localization support, full accessibility hinting in all Dijit widgets, infrastructure to support coherent keyboard event handling, and the ability to theme all Dijit components using only CSS.

The Core and Dijit projects are fanatical about quality and consistency and the bar for new code to be accepted in them is very high. As a result, new "edge of the web" features are being developed in the DojoX namespace. DojoX features portable 2D drawing APIs which paper over the differences between the browsers as well as Comet support (among other amazing projects). DojoX provides a sandbox where these new systems can evolve without always being constrained by the high standards of testing, documentation, and support to which Core and Dijit are held. Individual projects in DojoX contain a README file so that you can know what state they're in. Many are at or near the quality, testing, and documentation level required for inclusion in Core already!

Source: The Dojo Book

Yahoo! User Interface Library

The Yahoo! User Interface (YUI) Library is a rich set of utilities and controls, written in JavaScript. It is used for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. The YUI Library also includes several core CSS resources.

The YUI Library components fall into three groups: Utilities, UI Controls, and CSS resources.

YUI Utilities

The YUI Utilities simplify in-browser devolvement that relies on cross-browser DOM scripting, as do all web applications with DHTML and AJAX characteristics. Various utilities are:
  • Event
  • Dom Collection
  • Connection Manager
  • Drag & Drop
  • Animation


YUI Controls

The YUI Library Controls provide highly interactive visual design elements for your web pages. These elements are created and managed entirely on the client side and never require a page refresh.

YUI Controls include:
  • AutoComplete
  • Container
  • DataTable Control
  • Logger
  • TabView
  • TreeView
  • Slider
  • Calendar

YUI CSS Resources
  • CSS Grids
  • CSS Fonts
  • CSS Reset
YUI Library is open sourced under BSD license and is free for all uses. YUI is available at http://developer.yahoo.com/yui/index.html

Friday, July 13, 2007

New Look n Feel

I have started using a new Blogger template called TypoXP 2, all courtesy Ustadz.Net. I think it is an adaptation from Wordpress theme by the same name.
I am liking this new template a lot, especially its color combinations.
Also, it has a widget for Recent Posts. It has expandable post summaries. Author comments are highlighted. I am also liking its sidebar a lot. Just check it out!

http://typoxp.blogspot.com/2007/05/typoxp-blogger-new-blogger-template.html

Saturday, July 7, 2007

HTTP Status Codes

In a web app, whenever there is a communication between the browser (i.e client) and (web) server, there is a back-and-forth transfer of data. The client sends data to Server for processing. Data is then processed at the server side, and a response is sent back to client, indicating the status of the sent request. The response sent by Server to browser, typically, has a status line, some response headers, blank line, and the document, e.g.

HTTP/1.1 200 OK
Content-Type: text/plain

This is an example of status codes.

Here, the first line indicates the HTTP Version (HTTP/1.1), a status code (200) and a short description of status code (ok). Second line consists of the various headers sent by Server. At mimimal, it has a content type. The data after the blank line indicates the document itself, though not all responses may have a document. If a document is present, the content type indicates its MIME type.

Given below is a list of the commonly used status codes. The status codes are all three-digit numbers that are grouped by the first digit into 5 groups.

1xx: Informational

100 Continue
Continue with partial request.

101 Switching Protocols
Server will comply with Upgrade header and change to different protocol.


2xx: Successful

200 OK
Means that the server did whatever the client wanted it to, and all is well.

Others
The rest of the 2xx status codes are mainly meant for script processing and are
not often used.


3xx: Redirection
Means that the resource is somewhere else and that the client should try again at
a new address.

301 Moved permanently
The resource the client requested is somewhere else, and the client should go there
to get it. Any links or other references to this resource should be updated.

302 Moved temporarily
This means the same as the 301 response, but links should now not be updated, since
the resource may be moved again in the future.

304 Not modified
This response can be returned if the client used the if-modified-since header field
and the resource has not been modified since the given time. Simply means that the
cached version should be displayed for the user.


4xx: Client error
Means that the client screwed up somehow, usually by asking for something it should
not have asked for.

400 Bad request
The request sent by the client didn't have the correct syntax.

401 Unauthorized
Client tried to access password-protected page without proper authorization. Response should include a WWW-Authenticate header that the browser would use to pop up a username/password dialog box, which then comes back via the Authorization header.

403 Forbidden
The client is not allowed to access the resource and authorization will not help.
Often the result of bad file or directory permissions on the server.

404 Not found
Seen this one before? :) It means that the server has not heard of the resource
and has no further clues as to what the client should do about it. In simpler
words: dead link.

405 Method Not Allowed
The request method not allowed for this particular resource.


5xx: Server error
This means that the server screwed up or that it couldn't do as the client requested.

500 Internal server error
Something went wrong inside the server. It is often the result of Servlets or CGI
programs or (Any Other Server Side Technology) that crash or return improperly
formatted headers.

501 Not implemented
The request method is not supported by the server.

503 Service unavailable
This sometimes happens if the server is too heavily loaded and cannot service the
request. Usually, the solution is for the client to wait a while and try again.
A servlet might return this header if some thread or database connection pool is
currently full. Server can supply a Retry-After header.

505 HTTP Version Not Supported
Server doesn't support version of HTTP indicated in request line.


Just keep in mind that some of the status codes may be available only in HTTP/1.1 version though some of the browsers may still support only HTTP/1.0 version.
The general method of setting status codes is simply to call response.setStatus(int), there are two common cases where a shortcut method in HttpServletResponse is provided. The sendError method generates a 404 response along with a short message formatted inside an HTML document. The advantage of sendError over setStatus is that, with sendError, the server automatically generates an error page showing the error message. And the sendRedirect method generates a 302 response along with a Location header indicating the URL of the new document.


Advertisement
Fund Literacy, Care for the Environment, and get a Fair Price on the Books you Want.
http://www.betterworld.com/

Sunday, June 24, 2007

Jar, War and Ear files

Jar, War and Ear files are essentially the archived files. There are no structural differences among the three types, though these are intended for different purposes.

Jar: Jar files (Java Archive file : .jar extension) stores of Java classes, resources, auxiliary files, etc. Java source files are compiled and then distributed in jar format.

War files (Web Archive File : .war extension) are intended to contain complete Web applications. A Web Application is a collection of files, classes, resources, .jar files that can be packaged and accessed as one servlet context. Usually, sample web applications are distributed using war format.

Ear files (Enterprise Archive file : .ear extension) are intended to contain complete Enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.

All three types of files can be generated using Ant.

Advertisement

Thursday, June 21, 2007

Optical Illusion

Aoccdrnig to rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.

Find this book at Biblio.com

Saturday, June 16, 2007

River Crossing in Manali

Here is a video of my recent trip to Manali. Manali is a popular north Indian tourist spot.
This video was shot at Manali Club and features me doing a river crossing.



Thursday, June 7, 2007

Top Ten Reasons AJAX is Here to Stay

Andre Charland at developer.com has compiled a list of reasons that make AJAX a hot property in tech-crazy world.

Top Ten Reasons for AJAX

10. XAML, XUL, XForms...Not Yet.
9. Server Technology Agnostic
8. Web 2.0
7. Adoption Is Strong with Industry Leaders
6. Plays Nicely with Flex and Flash
5. Low Incremental Cost
4. Benefits of Regular Web Applications
3. Cross Browser and Cross Platform
2. Usability and User Experience Are King
1. Open Standards Based


Top Ten Reasons AJAX is Here to Stay

Thursday, May 31, 2007

[Humor] Copy n Paste

A well known motivational speaker gathering the entire crowd's attention, said "The best years of my life were spent in the arms of a woman who wasn't my wife"
The crowd was shocked...
He followed up by saying, "That woman was my mother"
The crowd burst into laughter and he gave his speech, which was well received.
About a week later, one of the top managers of an organization who had attended the speech decided to use that joke at his house. He tried to rehearse the joke in his head. It was a bit foggy to him.
He said loudly, "The greatest years of my life were spent in the arms of a woman who was not my wife"
Naturally, his wife was shell shocked, murmuring.
After standing there for almost 10 seconds trying to recall the second half of the joke, the manager finally blurted out "... and I can't remember who she was"
As expected, he got the thrashing of his life time...

Moral of the story:
Don't copy if you can't paste J J J

[Received in an email]

Sunday, May 20, 2007

Show'em Who's Boss

Received this seriously funny pic in an email forward :)





How true it is!

Monday, May 14, 2007

If you just focus on fixing someone...

Rajesh Setty of Life Beyond Code has this inspiring entry about 'fixing' people.

Your spouse wants to fix you.

You want to fix your spouse.

Your parents want to fix you.

You want to fix your children.

Your teachers want to fix you.

You want to fix your teachers.

Your boss wants to fix you.

You want to fix your boss.

Your colleagues want to fix you.

You want to.. well you get the point.

Wanting to fix someone whether right or not has one problem. In your quest to fix that someone, you forget to leverage the strengths of the that person for the benefit of both.

Next time, before you attempt to "fix" someone, why not focus on what that person brings to the table and see how best both of you can benefit from it?


http://blog.lifebeyondcode.com/blog/_archives/2007/5/10/2941581.html

Sunday, May 6, 2007

Java 6 Feature : Working with Derby Database

The Java 5 and Java 6 releases have introduced some significant changes. While Java 5 introduces new features (e.g. Generics, Variable arguments, Enhanced for loop, Boxing/unboxing, Type-safe enumerations, Static import, Metadata), Java 6 installation includes a lightweight database known as Derby.
Derby is actually an Apache Database project. Derby is a transactional, relational database and provides a small footprint on disk. When you install Java 6, core libraries, example programs, and a sample database gets automatically installed.
Derby has a command-line tool called ij. This tool provides a way to connect to and manipulate Derby databases.

To connect to Derby is quite easy. You need to have following jar files in the classpath to enable you to access Derby:
D:\tools\jdk1.6.0_01\db\lib\derby.jar
D:\tools\jdk1.6.0_01\db\lib\derbytools.jar

The derby.jar has JDBC drivers, while derbytools.jar contains the ij tool.

Once you have configured the classpath for Derby, open the command prompt, and start ij tool:
C:\Documents and Settings\Administrator>java org.apache.derby.tools.ij
ij version 10.2
ij>

You are now connected to Derby db.
Connect to the supplied example database (toursdb):
ij> connect 'jdbc:derby:Absolute_Path_to_the_connecting_database';
ij>

You can create a new database from the ij tool.
connect 'jdbc:derby:DB4MyApplication;create=true';

A semicolon (;) at the end of each command is also required.
You can get a list of Derby commands by issuing help command.
ij> help;

Supported commands include:

PROTOCOL 'JDBC protocol' [ AS ident ];
-- sets a default or named protocol
DRIVER 'class for driver'; -- loads the named class
CONNECT 'url for database' [ PROTOCOL namedProtocol ] [ AS connectionName ];
-- connects to database URL
-- and may assign identifier
SET CONNECTION connectionName; -- switches to the specified connection
SHOW CONNECTIONS; -- lists all connections
AUTOCOMMIT [ ON OFF ]; -- sets autocommit mode for the connection
DISCONNECT [ CURRENT connectionName ALL ];
-- drop current, named, or all connections;
-- the default is CURRENT

SHOW SCHEMAS; -- lists all schemas in the current database
SHOW [ TABLES VIEWS PROCEDURES SYNONYMS ] { IN schema };
-- lists tables, views, procedures or synonyms
SHOW INDEXES { IN schema FROM table };
-- lists indexes in a schema, or for a table
DESCRIBE name; -- lists columns in the named table

COMMIT; -- commits the current transaction
ROLLBACK; -- rolls back the current transaction

PREPARE name AS 'SQL-J text'; -- prepares the SQL-J text
EXECUTE { name 'SQL-J text' } [ USING { name 'SQL-J text' } ] ;
-- executes the statement with parameter
-- values from the USING result set row
REMOVE name; -- removes the named previously prepared statement

RUN 'filename'; -- run commands from the named file

ELAPSEDTIME [ ON OFF ]; -- sets elapsed time mode for ij
MAXIMUMDISPLAYWIDTH integerValue;
-- sets the maximum display width for
-- each column to integerValue

ASYNC name 'SQL-J text'; -- run the command in another thread
WAIT FOR name; -- wait for result of ASYNC'd command

GET [SCROLL INSENSITIVE] CURSOR name AS 'SQL-J query';
-- gets a cursor (JDBC result set) on the query
-- SCROLL cursors are only available
-- in JDBC 2.0 and higher.
-- (Cursor scroll type is ignored in JDBC 1.X.)
NEXT name; -- gets the next row from the named cursor
FIRST name; -- gets the first row from the named scroll cursor
LAST name; -- gets the last row from the named scroll cursor
PREVIOUS name; -- gets the previous row from the named scroll cursor
ABSOLUTE integer name; -- positions the named scroll cursor at the absolute row number
-- (A negative number denotes position from the last row.)
RELATIVE integer name; -- positions the named scroll cursor relative to the current row
-- (integer is number of rows)
AFTER LAST name; -- positions the named scroll cursor after the last row
BEFORE FIRST name; -- positions the named scroll cursor before the first row
GETCURRENTROWNUMBER name; -- returns the row number for the current position of the named scroll cursor
-- (0 is returned when the cursor is not positioned on a row.)
CLOSE name; -- closes the named cursor
LOCALIZEDDISPLAY [ ON OFF ];
-- controls locale sensitive data representation

EXIT; -- exits ij
HELP; -- shows this message

Any unrecognized commands are treated as potential SQL-J commands and executed directly.

So, now you have a lightweight DB installed alongwith the JDK. You can use this database for Proof-of-Concepts (POC), sample applications, demos among other things. To connect to Derby from Java, use the supplied driver
org.apache.derby.jdbc.EmbeddedDriver
. Connect to DB as shown earlier.

Saturday, May 5, 2007

Developing a Spring Framework MVC application step-by-step

Recently, I started reading on Spring. I was looking for an example application code, and then, I came across this article on springframework.org. The article is quite old (first written in July 2003, and then revised in April 2005), but quite relavent to topic. This is a hand-holding type of tutorial and develops an application from scratch, covering various Spring components, and even talks to HSqlDB, with JUnit test cases. Ant is used for deployment. It takes not more than 2-3 hours to develop the complete application.

Application is covered in 4 steps:
  • Basic Application and Environment Setup
  • Developing and Configuring the Application
  • Adding Unit Tests and a Form to the Application
  • Implementing Database Persistence

The tutorial assumes a Tomcat installation, but then u can develop it for any servlet engine or application server (e.g. i did it for JBoss).

it is a good exercise if u r new to Spring, or want to have a first hand look at Spring.

http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step.html

Tuesday, May 1, 2007

Java 5 Feature: Static Imports

Static imports are another convenience feature added to version 1.5 that extends the way imports work in Java. For example, consider the code fragment shown below that calls the static ceil() method on the java.lang.Math class


// x is a number of type double such as 98.765
double y = Math.ceil(x);


With static imports in 1.5, you can ask the Java compiler to import only a class's static portions, as shown, for example, in the rewritten code fragment below:


// Import declaration at the top of the class along with the other imports
import static java.lang.Math.ceil;

// And then somewhere in the code...

// x is a number of type double such as 5.345
double y = ceil(x);

In the above fragment, I used the new static import feature to import the static method ceil() from the Math class. Now when I call the method, I don't have to qualify it with Math. If I wanted to use multiple static methods from the Math class, I could import them individually or all at once as shown below:

// Import all static methods from Math
import static java.lang.Math.*;


This also applies to any constants declared within Math, such as E and PI. With the above declaration, I can use these constants as if they were declared locally within my class (or superclass).

Use it when you require frequent access to static members from one or two classes. If you overuse the static import feature, it can make your program unreadable and unmaintainable, polluting its namespace with all the static members you import. Readers of your code (including you, a few months after you wrote it) will not know which class a static member comes from. Importing all of the static members from a class can be particularly harmful to readability; if you need only one or two members, import them individually. Used appropriately, static import can make your program more readable, by removing the boilerplate of repetition of class names.

Sunday, April 22, 2007

Free eBooks on your cell

The jkOnTheRun blog points out a mobile e-book service, in Free eBooks on your cell:
Manybooks is mobile!, which points out that "Manybooks.net (a public domain / free eBook site) provides a mobile version of their offerings for Java-based cellphones! Point your browser to http://mnybks.net and you can download an eBook in .jar format for reading on the go. If you use Mobipocket reader on a handheld, you can also use the mobile site for Mobipocket format books."
Though these are non-DRM titles, Manybooks states that there are over 16,000 titles available.

Links

Wednesday, April 18, 2007

New Features in Java 5

Several useful features have been introduced in Java 5.
  • Generics: A way to make classes type-safe that can work on any type, such as narrowing an instance of a collection to hold a specific object type and eliminating the need to cast objects when taking an object out of the collection.
  • Enhanced for loop: A cleaner and less error-prone version of the for loop for use with iterators.
  • Variable arguments: Support for passing an arbitrary number of parameters to a method.
  • Boxing/unboxing: Direct language support for automatic conversion between primitive types and their reference types (such as int and Integer).
  • Type-safe enumerations: Clean syntax for defining and using enumerations, supported at the language level.
  • Static import: Ability to access static members from a class without need to qualify them with a class name.
  • Metadata: Coupled with new tools developed by third-party companies, saves developers the effort of writing boilerplate code by automatically generating the code.

Better GMail : Cool Firefox extension

Found Better GMail firefox extension (via delicious). Adds a menu of optional extra features to Gmail (Macros, Label Colors, Filter Assistant, Conversation Preview, Attachment Reminder, Attachment Icons, Saved Searches).

Better GMail Firefox extension

Saturday, April 14, 2007

Management Lessons for Developers

Others may say that developers can't be managers, but I fail to accept that; I just think developers need to get the basics about management in short, easy-to-remember doses. With that, I now offer the "Five-Minute Manager":

Lesson #1: Communication

A man is getting into the shower just as his wife is finishing up her shower, when the doorbell rings. The wife quickly wraps herself in a towel and runs downstairs. When she opens the door, there stands Bob, the next-door neighbor.

Before she says a word, Bob says, "I'll give you $800 to drop that towel."

After thinking for a moment, the woman drops her towel and stands naked in front of Bob. After a few seconds, Bob hands her $800 and leaves.

The woman wraps back up in the towel and goes back upstairs. When she gets to the bathroom, her husband asks, "Who was that?"

"It was Bob the next door neighbor," she replies.

"Great," the husband says, "did he say anything about the $800 he owes me?"

Moral: If you share critical information with your coworkers and employees in a timely fashion, you may be in a position to prevent avoidable exposure.

Lesson #2: Knowledge

A priest offered a Nun a lift. She got in and crossed her legs, forcing her gown to reveal a leg. The priest nearly had an accident. After controlling the car, he stealthily slid his hand up her leg.

The nun said, "Father, remember Psalm 129?"

The priest removed his hand. But, changing gears, he let his hand slide up her leg again.

The nun once again said, "Father, remember Psalm 129?"

The priest apologized "Sorry, sister, but the flesh is weak."

Arriving at the convent, the nun sighed heavily and went on her way.

On his arrival at the church, the priest rushed to look up Psalm 129. It said, "Go forth and seek, further up you will find glory."

Moral: If you are not well informed, you might miss a great opportunity.


Lesson #3: Politics

A sales rep, an administration clerk, and the manager are walking to lunch when they find an antique oil lamp. They rub it and a Genie comes out and says, "I'll give each of you just one wish."

"Me first! Me first!" says the admin clerk. "I want to be in the Bahamas, driving a speedboat, without a care in the world." Puff! She's gone.

"Me next! Me next!" says the sales rep. "I want to be in Hawaii, relaxing on the beach with my personal masseuse, an endless supply of Pina Coladas and the love of my life." Puff! He's gone.

"OK, you're up," the Genie says to the manager.

The manager says, "I want those two back in the office after lunch."

Moral: Always let your boss (or your customer) have the first say.


Lesson #4: Relativity

An eagle was sitting on a tree, resting, doing nothing. A small rabbit saw the eagle and asked him, "Can I also sit like you and do nothing?"

The eagle answered: "Sure, why not."

So, the rabbit sat on the ground below the eagle and rested.

All of a sudden, a fox appeared, jumped on the rabbit and ate it.

Moral: To be sitting and doing nothing, you must be sitting very, very high up.


Lesson #5: Sincerity

A turkey was chatting with a bull. "I would love to be able to get to the top of that tree," sighed the turkey, "but I haven't got the energy."

"Well, why don't you nibble on some of my droppings?", replied the bull. "They're packed with nutrients."

The turkey pecked at a lump of dung, and found it actually gave him enough strength to reach the lowest branch of the tree. The next day, after eating some more dung, he reached the second branch. Finally after a fourth night, the turkey was proudly perched at the top of the tree.

He was promptly spotted by a farmer, who shot him out of the tree.

Moral: BS might get you to the top, but it won't keep you there.

Management Lessons for Developers
http://blogs.tedneward.com/2007/04/11/Management+Lessons+For+Developers.aspx

Thursday, April 12, 2007

Process Improvement – Is it a Lottery?

The Methods & Tools newsletter has just released in its html archive section the article "Process Improvement – Is it a Lottery?" by Paul Morgan। This article provides an overview of the approach utilized to implement process improvement across its global organization without losing focus of its business drivers। It provides a practical overview of how over a four year period an organization moved from CMM® Level 1 to Level 3 and is currently transitioning to CMMI® Level 4. It will provide a candid insight including lessons learned and approaches adopted to achieve success. It will also provide examples of significant and measurable business benefits that can be accrued from adopting a documented and repeatable process improvement framework.

A common mistake made by companies when implementing process improvement is to allow the chosen model to dictate the process design. The CMMI® is a model that needs to be interpreted based upon the business environment and technical needs of the project; it is not a standard that must be implemented exactly as documented. A failure to recognize this might still result in maturity levels being attained; however, the end product is unlikely to be a process suite which complements your operating needs.

Sunday, March 18, 2007

Blogging in Hindi

रजनीश अपने ब्लोग पर आप का सवागत कर्ता है! अब आप ब्लॉगर पर हिंदी में भी ब्लोग्गिंग कर सकते है! आप यहाँ कुछ भी हिंदी में लिख सकते है, और हिंदी और इंग्लिश को मिक्स करके भी लिख सकते है।

Now, u can post Hindi entries on your blogspot blog.

"Blogger offers an automatic transliteration option for converting Roman characters to the Devanagari characters used in Hindi. This lets you type Hindi words phonetically in English script and still have them appear in their correct alphabet. Note that this is not the same as translation -- it is the sound of the words that are converted from one alphabet to other, not their meaning."
All u r required to do is to enable transliteration option in settings, and u r all set to blog in Hindi!
http://help।blogger.com/bin/answer.py?answer=58226&topic=8911

This is a good step, though a bit late, by Google to allow Hindi on its products. I wish 2 see more regional languages (not only from India, but across the world) on various Google products.
थैंक्स गूगल!

Sunday, February 4, 2007

An Overview of Object-Relational Mapping (ORM)

It is no secret that RDBMS' are the most common type of databases in a majority of organizations today when compared to other formats (e.g. object-oriented, hierarchical, network).

A majority of the software applications that use relational database and OO languages end up writing code to map the relational model to the OO model. This can involve anything from cumbersome mapping code (because of the use of embedded SQL or SP calls) to heavy-handed technology, such as EJB's entity beans.

Because most of us seem to like both relational databases and OO, Object-Relational Mapping (ORM) has become a natural choice for working with POJOs (plain old Java objects), especially if you don't need the distributed and secure execution of EJB's entity beans (which also map object attributes to relational database fields).

Although you still need to map the relational model to the OO model, the mapping is typically done outside of the programming language, such as in XML files. Also, once this mapping is done for a given class, you can use instances of this class throughout your applications as POJOs. For example, you can use a save method for a given object and the underlying ORM framework will persist the data for you instead of you having to write tedious INSERT or UPDATE statements using JDBC.

Hibernate is one such ORM framework. Hibernate also supports the EJB 3.0 standard, so should you need to move to EJB 3.0, it'll be an easy transition (in fact, EJB 3.0 is based on many of the concepts and techniques found in Hibernate). EJB 3.0, as you might already know, aims to simplify working with EJB technology. However, if you do not need the many services provided by EJB technology, you can use the Hibernate core technology by itself (without needing a big EJB container product such as an application server).

Sunday, January 14, 2007

What is perl.com? pm.org? perl.org? cpan.org?

  • The Perl Foundation is an advocacy organization for the Perl language which maintains the web site http://www.perl.org/ as a general advocacy site for the Perl language. It uses the domain to provide general support services to the Perl community, including the hosting of mailing lists, web sites, and other services. The web site http://www.perl.org is a general advocacy site for the Perl language, and there are many other sub-domains for special topics, such as
  • Perl Mongers uses the pm.org domain for services related to Perl user groups, including the hosting of mailing lists and web sites. See the Perl user group web site at http://www.pm.org/group for more information about joining, starting, or requesting services for a Perl user.
  • http://www.cpan.org/ is the Comprehensive Perl Archive Network, a replicated worldwide repository of Perl software.

What is service-oriented architecture?

Service-oriented architecture (SOA) is an evolution of distributed computing based on the request/reply design paradigm for synchronous and asynchronous applications. An application's business logic or individual functions are modularized and presented as services for consumer/client applications. What's key to these services is their loosely coupled nature; i.e., the service interface is independent of the implementation. Application developers or system integrators can build applications by composing one or more services without knowing the services' underlying implementations. For example, a service can be implemented either in .Net or J2EE, and the application consuming the service can be on a different platform or language.

Service-oriented architectures have the following key characteristics:
  • SOA services have self-describing interfaces in platform-independent XML documents. Web Services Description Language (WSDL) is the standard used to describe the services.
  • SOA services communicate with messages formally defined via XML Schema (also called XSD). Communication among consumers and providers or services typically happens in heterogeneous environments, with little or no knowledge about the provider. Messages between services can be viewed as key business documents processed in an enterprise.
  • SOA services are maintained in the enterprise by a registry that acts as a directory listing. Applications can look up the services in the registry and invoke the service. Universal Description, Definition, and Integration (UDDI) is the standard used for service registry.
  • Each SOA service has a quality of service (QoS) associated with it. Some of the key QoS elements are security requirements, such as authentication and authorization, reliable messaging, and policies regarding who can invoke services.
Read the complete article at JavaWorld.com

A

Popular Posts (Last 30 days)

This is a personal blog and I do not speak for my employer.