Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Author Archive

Image Compression using Java JAI API

April 24th, 2010 fanand 2 comments

This post explains how to do the gif, jpg, bmp, png image compression using JAI APIs.  We are not using image compression software but using open source Java Api’s to achieve compression.

The preferred method for reading an image file of any format into a RenderedImage is:

String filename = “// path and name of the file to be read,

that is on an accessible filesystem //”;

RenderedImage image = JAI.create(“fileload”, filename);

or:

URL url = “// URL of the remote image to be read //”;

RenderedImage image = JAI.create(“url”, url);

and for writing a RenderedImage to an image file in a format whose encoder is supported by an ancillary codec, using the default encoding algorithm, is:

RenderedImage image = “// the image to be stored //”;

String filename = “// path and name of the file to be writen //”;

String format = “// the format of the file //”;

RenderedOp op = JAI.create(“filestore”, image,

filename, format); Read more…

JQuery Validation Tutorial

April 18th, 2010 fanand 15 comments

This JQuery CSS validation tutorial explain how to do client-side validation using jQuery’s validation plugin. This is how the validation snapshot of the validation page. The link to download the code is at end of this tutorial.

snapshot

Read more…

Categories: Programming / tutorials Tags: , , ,

Creating a dynamic tooltip with AJAX

April 10th, 2010 fanand 3 comments

The Tooltip is a common graphical user interface element. It is used in conjunction with a cursor, usually a mouse pointer. The User hovers the cursor over an item, without clicking it, and tooltip may appear – a small hoverbox with information about the being hovered over.

Ajax Tool tip : AJAX is the art of exchanging data with a server, and update parts of a web page – without reloading the whole page. By Using the Ajax tool tip we can show the content of the tooltip is retrieved by Ajax from external files.

  • Files to be used in the Ajax Tool tip
    • ajax-tooltip.html = Main HTML file
    • js/ajax-tooltip.js = Main JS file for the script
    • js/ajax.js = Ajax (SACK library)
    • js/ajax-dynamic-content.js = The dynamic content script from this site
    • css/ajax-tooltip.css = CSS for tooltip
    • images/arrow.gif = Arrow used in the tooltip
    • demo-pages = External files loaded by the tooltip

The files used for demo can be downloaded from here http://www.dhtmlgoodies.com/scripts/ajax-tooltip/ajax-tooltip.zip

Configuration : First, you need to include the js files and css files as in the demo (ajax-tooltip.html). Read more…

Categories: Programming / tutorials Tags: , ,

Getting started with Drupal Content Management System

April 6th, 2010 fanand 6 comments

Drupal is complete open source Content Management System (CMS) which can be used to run your website, set up forums, shopping carts etc In this post we will cover the following.

guides you step by step on downloading, installing and setting up the drupal content management system module in your local or remote php supported servers.  Drupal will help you to manage the internet/intranet website contents.

Why should I use Drupal/ Advantages of Drupal

1) User authentication /registration individually (Add FB connect/OpenID)
2) User profiles (they can edit/update/view only their own profile and not the profile of any other users. Let’s call these users agents.
3) Client login
4) Clients can have campaigns. They can have one or more campaigns running at any given time. Campaigns have timeframe
5) When a campaign is available, the admin can send request to join to agents. Agents can choose to accept or decline campaigns.
6) Agents to be chosen for campaign based on target search criteria’s like demographics or any other criteria’s we choose. Number of agents/campaign to be fixed.
7) Agents take part in campaigns. As per of the campaigns they take part in offline activity and then they have to fill out online feedback reports, surveys, questionnaires etc and post campaign poll
8)The results of these campaigns are available to be viewed by the client. Different analytical reports required based on feedback/questionnaires/polls etc available to clients
9) All feedback has to be moderated through admin or campaign manager.
10) Point system for agents. They start with level 0 and each time they engage in feedback or any activity they are assigned points. If they don’t fill up something, points are deducted.
11) Clients can view profiles of agents who are part of their campaign individually and collectively in summarized reports. Read more…

Generating JUnit Test Results as HTML Report

March 26th, 2010 fanand 6 comments

Junit is one the most popular unit testing framework around . I am assuming you would have gone through the first tutorial Getting Started with Junit

This tutorial is going to introduce you to a new aspect of junit not known to many of you , Generating Reports. If you use build tools like confluence etc, they generate the html report for you but if want to see the out put as beautiful html output, keep reading below.

This Junit tutorial is structured as follows

  • Introduction
    • About Unit testing tools
    • About JUnit
    • Generating HTML reports in JUnit
  • Three ways of generating HTML reports
    • Way 1 – Simple Redirect
    • Way 2 – Simple Output Stream Redirect
      • Sample JUnit Test Results HTML Report
    • Way 3 – Advanced Output Stream Redirect
  • JUnit Links and References
  • Conclusion Read more…

Categories: Programming / tutorials Tags: ,

Junit Tutorial with examples

March 25th, 2010 fanand 4 comments

Junit is one the most popular unit testing framework around .  This tutorial will help you in getting started with Junit setup on eclipse with some code examples . The Junit tutorial is structured as follows

  • Introduction
    • About Unit testing tools
    • About JUnit
    • For first time developers
  • Inside JUnit
    • JUnit API’s
  • Settings to be done in eclipse for JUnit
  • Sample Codes
    • Sample Java Calculation Engine.
    • Sample JUnit code to run in GUI mode.
    • Sample JUnit code to run in text mode (CLI – command line).
      • JUnit Execution procedure
        • Execution in GUI mode.
        • Execution in Text mode.
      • JUnit Links and References.
      • Conclusion Read more…

Categories: Programming / tutorials Tags: ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes