Your Ad Here

Monday, July 28, 2008

Charts For Web Development

Charts For Web Development

This supports all the languages even JavaScript.


FusionCharts is a flash charting component that can be used to render data-driven animated charts. Made in Adobe Flash 8 (formerly Macromedia Flash), FusionCharts can be used with any web scripting language like HTML, .NET, ASP, JSP, PHP, ColdFusion etc., to deliver interactive and powerful charts. Using XML as its data interface, FusionCharts makes full use of fluid beauty of Flash to create compact, interactive and visually-arresting charts.


Advantages of using FusionCharts

Animated and interactive Charts Using FusionCharts, you can quickly and easily render animated charts that have a lot of interactive options for the end users. Different chart types support different forms of animation and interactivity, thereby providing a different experience to the end users. Easy yet powerful AJAX/JavaScript integration FusionCharts offers advanced options to integrate charts with AJAX applications or JavaScript modules. You can update charts on client side, invoke JavaScript functions as hotspot links, or make dynamic calls for XML data to server without involving any page refreshes. No installation hassles To use FusionCharts, you do not have to install anything on your server. All you need to do is copy paste the SWF files (the core files of FusionCharts) to your server, just like you would do to any image files - and you’re ready to go! So, even on those servers which do not allow installation of ActiveX or any other form of components, FusionCharts can run without any hassles. Easy to use FusionCharts makes the chart creation process a painless experience for you. Since it uses XML as its data, all you need to do is convert your data into XML using a programming language or using the visual GUI provided in FusionCharts - and that’s all what is required to create interactive and animated charts. Runs on a variety of platforms Irrespective of what server side scripting language you’re using, FusionCharts can be used to create charts in that. Since FusionCharts uses XML as the data interface, you can run it on any server and against any scripting language. Also, to view the charts, your users just need to have Adobe Flash Player 8, which is one of the most used browser plugins on the planet. Reduces load on your servers In traditional image based charting systems, the charts are generated as image at the server side. So, for each chart that you need to serve to a user, you’ll have to build complex images on the server and then stream it to the client. When the need of hour is high, this can be an expensive resource on the server, as image creation takes a lot of toll on the server.

FusionCharts brings you great relief - all the charts are rendered at client side using the widely installed Adobe Flash Platform. The server is just responsible for streaming the pre-built SWF files and your XML data files to the end viewers. From there on, Flash Player takes the onus of rendering the charts. Also, the chart SWF Files can be cached so that you can just update the data, and not send chart SWF files every time.

A plethora of chart types FusionCharts v3 offers you a plethora of chart types. From the basic bar, column, line, pie etc. to the advanced combination and scroll charts, you can build all the charts with the same ease of use.


Saturday, July 26, 2008


Using jQuery with Other Libraries
From jQuery JavaScript Library
Jump to: navigation, search

The jQuery library, and virtually all of its plugins are constrained
within the jQuery namespace. As a general rule, "global" objects are
stored inside the jQuery namespace as well, so you shouldn't get a clash
between jQuery and any other library (like Prototype, MooTools, or YUI).

That said, there is one caveat: By default, jQuery uses "$" as a shortcut
for "jQuery"
Overriding the $-function

However, you can override that default by calling jQuery.noConflict() at
any point after jQuery and the other library have both loaded. For

<script src="prototype.js"></script>
<script src="jquery.js"></script>

// Use jQuery via jQuery(...)

// Use Prototype with $(...), etc.
$('someid').style.display = 'none';

This will revert $ back to its original library. You'll still be able to
use "jQuery" in the rest of your application.

Additionally, there's another option. If you want to make sure that jQuery
won't conflict with another library - but you want the benefit of a short
name, you could do something like this:

<script src="prototype.js"></script>
<script src="jquery.js"></script>
var $j = jQuery.noConflict();

// Use jQuery via $j(...)

// Use Prototype with $(...), etc.
$('someid').style.display = 'none';

You can define your own alternate names (e.g. jq, $J, awesomeQuery -
anything you want).

Finally, if you don't want to define another alternative to the jQuery
name (you really like to use $ and don't care about using another
library's $ method), then there's still another solution for you. This is
most frequently used in the case where you still want the benefits of
really short jQuery code, but don't want to cause conflicts with other

<script src="prototype.js"></script>
<script src="jquery.js"></script>

// Put all your code in your document ready area
// Do jQuery stuff using $

// Use Prototype with $(...), etc.
$('someid').style.display = 'none';

This is probably the ideal solution for most of your code, considering
that there'll be less code that you'll have to change, in order to achieve
complete compatibility.

Also see: Custom Alias
Referencing Magic - Shortcuts for jQuery

If you don't like typing the full "jQuery" all the time, there are some
alternative shortcuts:

* Reassign jQuery to another shortcut
o var $j = jQuery;
o (This might be the best approach if you wish to use different
* Use the following technique, which allows you to use $ inside of a
block of code without permanently overwriting $:
o (function($) { /* some code that uses $ */ })(jQuery)
o Note: If you use this technique, you will not be able to use
Prototype methods inside this capsuled function that expect $ to
be Prototype's $, so you're making a choice to use only jQuery
in that block.
* Use the argument to the DOM ready event:
o jQuery(function($) { /* some code that uses $ */ });
o Note: Again, inside that block you can't use Prototype methods

COmpare DOJO, MOCHI KIT, MOO Tools,Yahoo! UI,Prototype and JQuery

JQuery is the BEST






- Built in functionality / Power / ease of use --- many compatibility issues, ease of use -- not good

- add ons / widgets       -- simple -- no widgets

- Size of footprint          ---23KB

- Documentation / Community --- community supported by many companies like IBM, AOL, Sun

Documentation-- not good






- Built in functionality / Power / ease of use -- compatibility good, ease of use    -- good

- add ons / widgets       -- not so many , no widgets

- Size of footprint          ---111KB

- Documentation / Community   -- Documentation good, still a little community








- Built in functionality / Power / ease of use -- good

- add ons / widgets       -- good

- Size of footprint          ---43KB

- Documentation / Community -- had some good community

Documentation -- good



Yahoo! UI


- Built in functionality / Power / ease of use -- ease of use -- some restrictions to use its functions and more time need to learn the functions

- add ons / widgets       -- ok

- Documentation / Community   --

Community       good

Documentation--Very good docs


Some bugs have to be fixed some compatibility issues




- Built in functionality / Power / ease of use

- add ons / widgets       -- ok

- Size of footprint          ---122KB

- Documentation / Community  

Had some community

Documentation--Very good docs

ease of use -- some restrictions to use its functions and more time need to learn the functions

Compatibility fine

Design is not good


Prototype does not provide any widgets or controls





- Built in functionality / Power / ease of use

- add ons / widgets       -- good widgets from jquery UI

- Size of footprint          ---26.5 KB

- Documentation / Community  

had lot of communities behind

Documentation--Very good docs

Ease of use -- very good, performance is better that all the other tools

Ease to read and simplified code

Compatibility good except Konqueror







jQuery was the first toolkit to support chaining and that it executes it nicely.


Commnets over comparition

Selectors                                              Prototype 1.6  MooTools 1.2 beta1     JQuery 1.21

IE 6.0 final time (less is better)              2098                1477                1239 

mozilla 1.5 final time (less is better)                    299                  346                  935


From the above results we can see that for IE jquery is better

For prototype some tags are not working

This url checks  JQuery,Dojo,Yahoo! UI,Prototype,Mochikit

From the above url we can see that Jquery supports  all the features



Saturday, July 12, 2008

How to set JNDI in Hibernate?

How to set JNDI in Hibernate?

Configuration for Tomcat and Jboss is almost same.

I did check in both it is working.

Set the following in Hibernate.hbm and then set the datasource in jndi config file.

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"

<!-- a SessionFactory instance listed as /jndi/name -->

<!-- properties -->
<property name="connection.datasource">java:/comp/env/jdbc/MyDB</property>
<property name="dialect">org.hibernate.dialect.SCJASQLDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
<property name="jta.UserTransaction">java:comp/UserTransaction</property>

<!-- mapping files -->

<!-- cache settings -->



server.xml configuration

Configure the JNDI DataSource in Tomcat by adding a declaration for your resource to $CATALINA_HOME/conf/server.xml.

Add this in between the </Context> tag of the examples context and the </Host> tag closing the localhost definition.

<Context path="/DBTest" docBase="DBTest"
        debug="5" reloadable="true" crossContext="true">
  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_DBTest_log." suffix=".txt"
  <Resource name="jdbc/MyDB"
  <ResourceParams name="jdbc/MyDB">
    <!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.
    <!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit.
    <!-- Maximum time to wait for a dB connection to become available
         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded.  Set to -1 to wait indefinitely.
    <!-- MySQL dB username and password for dB connections  -->
    <!-- Class name for mm.mysql JDBC driver -->
    <!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
         connection.  mysqld by default closes idle connections after 8 hours.

Friday, July 11, 2008

Warn if not Subject in outlook mail

This is really useful………

Forgot to mention subject, while writing an official mail and feel bad later???????

Yes…. It’s a concern for all…. A mail without a subject brings a bad impression on us.

To avoid this, Just follow the simple steps mentioned below and see the result.

Here below are the steps: -

1. Open your outlook

2. Press Alt+F11. This opens the Visual Basic editor

3. On the Left Pane, one can see "Microsoft Outlook Objects" or "Project1", expand this. Now one can see the "ThisOutLookSession".

4. Double click on "ThisOutLookSession". It will open up a code pane.

5. Copy and Paste the following code in the right pane. (Code Pane)


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim strSubject As String

strSubject = Item.Subject

If Len(Trim(strSubject)) = 0 Then

Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"

If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then

Cancel = True

End If

End If

End Sub


6. Save this and now close the VB Code editor.

From now on, this macro will make sure you do not make the mistake of sending a mail without a subject.

Wednesday, July 2, 2008

Hibernate Dielect example

Hibernate Dielect example

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"

<property name="hibernate.connection.driver_class">

<property name="hibernate.connection.url">

<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>

In the above configuration file we specified to use the "hibernatetutorial" which is running on localhost and the user of the database is root with no password. The dialect property is org.hibernate.dialect.MySQLDialect which tells the Hibernate that we are using MySQL Database. Hibernate supports many database. With the use of the Hibernate (Object/Relational Mapping and Transparent Object Persistence for Java and SQL Databases), we can use the following databases dialect type property:

  • DB2- org.hibernate.dialect.DB2Dialect
  • HypersonicSQL - org.hibernate.dialect.HSQLDialect
  • Informix - org.hibernate.dialect.InformixDialect
  • Ingres - org.hibernate.dialect.IngresDialect
  • Interbase - org.hibernate.dialect.InterbaseDialect
  • Pointbase - org.hibernate.dialect.PointbaseDialect
  • PostgreSQL - org.hibernate.dialect.PostgreSQLDialect
  • Mckoi SQL - org.hibernate.dialect.MckoiDialect
  • Microsoft SQL Server - org.hibernate.dialect.SQLServerDialect
  • MySQL - org.hibernate.dialect.MySQLDialect
  • Oracle (any version) - org.hibernate.dialect.OracleDialect
  • Oracle 9 - org.hibernate.dialect.Oracle9Dialect
  • Progress - org.hibernate.dialect.ProgressDialect
  • FrontBase - org.hibernate.dialect.FrontbaseDialect
  • SAP DB - org.hibernate.dialect.SAPDBDialect
  • Sybase - org.hibernate.dialect.SybaseDialect
  • Sybase Anywhere - org.hibernate.dialect.SybaseAnywhereDialect

The <mapping resource="contact.hbm.xml"/> property is the mapping for our contact table.

Writing First Persistence Class
Hibernate uses the Plain Old Java Objects (POJOs) classes to map to the database table. We can configure the variables to map to the database column. Here is the code for

package com.hibernate;

public class Contact {
private String firstName;
private String lastName;
private String email;
private long id;

* @return Email
public String getEmail() {
return email;

* @return First Name
public String getFirstName() {
return firstName;

* @return Last name
public String getLastName() {
return lastName;

* @param string Sets the Email
public void setEmail(String string) {
email = string;

* @param string Sets the First Name
public void setFirstName(String string) {
firstName = string;

* @param string sets the Last Name
public void setLastName(String string) {
lastName = string;

* @return ID Returns ID
public long getId() {
return id;

* @param l Sets the ID
public void setId(long l) {
id = l;


Mapping the Contact Object to the Database Contact table
The file contact.hbm.xml is used to map Contact Object to the Contact table in the database. Here is the code for contact.hbm.xml:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"

<class name="example.hibernate.Contact" table="CONTACT">
<id name="id" type="long" column="ID" >
<generator class="assigned"/>

<property name="firstName">
<column name="FIRSTNAME" />
<property name="lastName">
<column name="LASTNAME"/>
<property name="email">
<column name="EMAIL"/>

Setting Up MySQL Database
In the configuration file(hibernate.cfg.xml) we have specified to use hibernatetutorial database running on localhost. So, create the databse ("hibernatetutorial") on the MySQL server running on localhost.

Developing Code to Test Hibernate example
Now we are ready to write a program to insert the data into database. We should first understand about the Hibernate's Session. Hibernate Session is the main runtime interface between a Java application and Hibernate. First we are required to get the Hibernate Session.SessionFactory allows application to create the Hibernate Sesssion by reading the configuration from hibernate.cfg.xml file. Then the save method on session object is used to save the contact information to the database:

Here is the code of

package com.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class FirstExample {
public static void main(String[] args) {
Session session = null;

// This step will read hibernate.cfg.xml

and prepare hibernate for use
SessionFactory sessionFactory = new

session =sessionFactory.openSession();
//Create new instance of Contact and set

values in it by reading them from form object
System.out.println("Inserting Record");
Contact contact = new Contact();
}catch(Exception e){
// Actual contact insertion will happen at this step



Web stats- Urchin

This software is used to track the logs of IIS and apache and displays reports.

  • In-house Flexibility: Configure Urchin to fit your specific requirements and process/reprocess log files as frequently as you wish.
  • Great for intranets: Analyze firewall-protected content, such as corporate intranets, without any outside internet connection.
  • Pagetags or IP+User Agent: Choose which methodology works best for you. You can even have the pagetags make a call to your Google Analytics account and run both products together allowing you to audit the pre and post processed data.
  • Advanced Visitor Segmentation: Cross segment visitor behavior by language, geographic location, and other factors.
  • Geo-targeting: Find out where your visitors come from and which markets have the greatest profit potential.
  • Funnel Visualization: Eliminate conversion bottlenecks and reduce the numbers of prospects who drift away unconverted.
  • Complete Conversion Metrics: See ROI, revenue per click, average visitor value and more.
  • Keyword Analysis: Compare conversion metrics across search engines and keywords.
  • A/B Test Reporting: Test banner ads, emails, and keywords and fine-tune your creative content for better results.
  • Ecommerce Analytics: Trace transactions to campaigns and keywords, get loyalty and latency metrics, and see product merchandising reports.
  • Search engine robots, server errors and file type reports: Get the stuff that only log data can report on.
  • Visitor History Drilldown: dig into visitor behavior with the ability to view session/path, platform, geo-location, browser/platform, etc. data on an individual-visitor basis (note: this data is anonymous).
Feature Urchin 6 Google Analytics
Install and manage on your own servers Yes No
Can be used on firewall-protected corporate intranets Yes No
Reprocess historical data (from logfiles) Yes No
Can process/re-process your log files locally Yes No
Can collect information through tags No Yes
Reports on robot/spider activity Yes No
Reports on server errors/status codes Yes No
Tightly integrated with AdWords No Yes
Can report on paid search campaigns Yes Yes
Ecommerce/Conversion reporting Yes Yes
Geotargeting Yes Yes
Free No Yes
Visitor session/navigation path analyses Yes No
Raw data accessible for custom report-building Yes No
Exclusively supported by authorized consultants Yes No

Web Statistics -AWStats

AWStats is short for Advanced Web Statistics. AWStats is powerful log analyzer which creates advanced web, ftp, mail
and streaming server statistics reports based on the rich data contained in server logs. Data is graphically presented in
easy to read web pages.
Designed with flexibility in mind, AWStats can be run through a web browser CGI (common gateway interface) or directly
from the operating system command line. Through the use of intermediary data base files, AWStats is able to quickly
process large log files, as often desired. With support for both standard and custom log format definitions, AWStats can
analyze log files from Apache (NCSA combined/XLF/ELF or common/CLF log format), Microsoft's IIS (W3C log format),
WebStar and most web, proxy, wap and streaming media servers as well as ftp and mail server logs.

AWStats' reports include a wide range of information on your web site usage:
* Number of Visits, and number of Unique visitors.
* Visit duration and latest visits.
* Authenticated Users, and latest authenticated visits.
* Usage by Months, Days of week and Hours of the day (pages, hits, KB).
* Domains/countries (and regions, cities and ISP with Maxmind proprietary geo databases) of visitor's hosts (pages, hits, KB,
269 domains/countries detected).
* Hosts list, latest visits and unresolved IP addresses list.
* Most viewed, Entry and Exit pages.
* Most commonly requested File types.
* Web Compression statistics (for Apache servers using mod_gzip or mod_deflate modules).
* Visitor's Browsers (pages, hits, KB for each browser, each version, 123 browsers detected: Web, Wap, Streaming Media
browsers…, around 482 with the "phone browsers" database).
* Visitor's Operating Systems (pages, hits, KB for each OS, 45 OS detected).
* Robots visits, including search engine crawlers (381 robots detected).
* Search engines, Keywords and Phrases used to find your site (The 122 most famous search engines are detected like
Yahoo, Google, Altavista, etc…)
* HTTP Errors (Page Not Found with latest referrer, …).
* User defined reports based on url, url parameters, referrer (referer) fields extend AWStats' capabilities to provide even
greater technical and marketing information.
* Number of times your site is added to Bookmarks / Favorites.
* Screen size (to capture this, some HTML tags must be added to a site's home page).
* Ratio of integrated Browser Support for: Java, Flash, Real G2 player, Quicktime reader, PDF reader, WMA reader (as
above, requires insertion of HTML tags in site's home page).
* Cluster distribution for load balanced servers.
In addition, AWStats provides the following:
* Wide range of log formats. AWStats can analyze: Apache NCSA combined (XLF/ELF) or common (CLF) log files,
Microsoft IIS log files (W3C), WebStar native log files and other web, proxy, wap, streaming media, ftp and mail server log
files. See AWStats F.A.Q. for examples.
* Reports can be run from the operating system command line and from a web browser as a CGI (common gateway
interface). In CGI mode, dynamic filter capabilities are available for many charts.
* Statistics update can be run from a web browser as well as scheduled for automatic processing.
* Unlimited log file size
What is AWStats / Features Overview 2/87 13/04/2008
* Load balancing system split log files.
* Support 'nearly sorted' log files, even for entry and exit pages.
* Reverse DNS lookup before or during analysis; supports DNS cache files.
* Country detection from IP location (geoip) or domain name.
* Plugins for US/Canadian Regions, Cities and major countries regions, ISP and/or Organizations reports (require non free
third product geoipregion, geoipcity, geoipisp and/or geoiporg database).
* WhoIS lookup links.
* Vast array of configurable options/filters and plugins supported.
* Modular design supports inclusion of addition features via plugins.
* Multi−named web sites supported (virtual servers, great for web−hosting providers).
* Cross Site Scripting Attacks protection.
* Reports available in many international languages. See AWStats F.A.Q. for full list. Users can provide files for additional
languages not yet available.
* No need for esoteric perl libraries. AWStats works with all basic perl interpreters.
* Dynamic reports through a CGI interface.
* Static reports in one or framed HTML or XHTML pages; experimental PDF export through 3rd party "htmldoc" software.
* Customize look and color scheme to match your site design; with or without CSS (cascading style sheets).
* Help and HTML tooltips available in reports.
* Easy to use − all configuration directives are confined to one file for each site.
* Analysis database can be stored in XML format for easier use by external applications, like XSLT processing (one xslt
transform example provided).
* A Webmin module is supplied.
* Absolutely free (even for web hosting providers); source code is included (GNU General Public License).
* Works on all platforms with Perl support.
* AWStats has a XML Portable Application Description.
AWStats usage has the following requirements:
* You must have access to the server logs for the reporting you want to perform (web/ftp/mail).
* You must be able to run perl scripts (.pl files) from command line and/or as a CGI. If not, you can solve this by
downloading latest Perl version at ActivePerl (Win32) or (Unix/Linux/Other).

reference :

Your Ad Here