Archive for the ‘Java’ Category

What GUICE (juice) do..

What Guice do. while working in layers their are several ways to connect presentation classes to service and data classes. one ways is direct Constructor calls. for example in our scenario. if we have serverside class PurchaseHandler.java which performs different functions for on purchasing an item, like delete, add, etc. we need it to access [...]

GWT/GAE File Upload Using Guice and Gin

Client Side: 1- create Upload form in new dialog box public class UploadDialog extends DialogBox {                 private void createForm(){                 VerticalPanel panel = new VerticalPanel();                   form = new FormPanel();     [...]

Object to Bytes and Bytes to Object Transformer

public static class Transformer {    public static byte[] toBytes(Object obj) {    byte[] data = null;    try {    ByteArrayOutputStream bos = new ByteArrayOutputStream();    ObjectOutputStream oos = new ObjectOutputStream(bos);    oos.writeObject(obj);    oos.flush();    oos.close();    bos.close();    data = bos.toByteArray();    } catch (IOException ex) {    throw new IllegalStateException(“Object is [...]

HadoopMapReduce – Hadoop Wiki

How Map and Reduce operations are actually carried out Introduction This document describes how MapReduce operations are  carried out in Hadoop. If you are not familiar with the Google MapReduceprogramming model you should get acquainted with it first. Map As the Map operation is parallelized the input file set is first split to several pieces called FileSplits. If an [...]

New Google Apps Channel API

The Channel API creates a persistent connection between your application and Google servers, allowing your application to send messages to JavaScript clients in real time without the use of polling. This is useful for applications designed to update users about new information immediately. Some example use-cases include collaborative applications, multi-player games, or chat rooms. In [...]

SAXParser Example

// —————————————————————————– // SAXExample.java // —————————————————————————– // imports import java.io.*; import java.net.URL; import org.xml.sax.*; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; /** * —————————————————————————– * Demonstrate how to use SAX. * * @version 1.0 * @author Muhammad Abid (abidshafiq479@hotmail.com) * @author http://www.techstop.abidshafiq.com * —————————————————————————– */ public class SAXExample extends HandlerBase{ // Store the locator [...]

SOAP- Simple Object Access Protocol

What is SOAP? SOAP stands for Simple Object Access Protocol SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending messages SOAP communicates via Internet SOAP is platform independent SOAP is language independent SOAP is based on XML SOAP is simple and extensible SOAP allows you to get [...]

Java XML API comparison

Feature StAX SAX DOM TrAX API Type Pull, streaming Push, streaming In memory tree XSLT Rule Ease of Use High Medium High Medium XPath Capability Not supported Not supported Supported Supported CPU and Memory Efficiency Good Good Varies Varies Forward Only Supported Supported Not supported Not supported Read XML Supported Supported Supported Supported Write XML [...]

I want you…!

stars are shinning in the black hearts are beating in the mind life is running on the way i am missing you all the way. come to see me i can see you come to hug me i can hug you life or dead whats you want i can give if you not. think you [...]

Work, Family, Health, Friends and Spirit

Imagin life as game in which you are juggling some five balls in the air. You name them – Work, Family, Health, Friends and Spiri and you are keeping all of these in the Air.

You will soon understand that work is a rubber ball. If you drop it, it will bounce back.

But the other four balls – Family, Health, Friends, and spirit – are made of glass. If you drop one of these; they will be irrevocably scuffed, marked, nicked, damaged or even shattered. They will never be the same. You must understand that and strive for it.

WORK EFFICIENTLY DURING OFFICE HOURS AND LEAVE ON TIME. GIVE THE REQUIRED TIME TO YOUR FAMILY, FRIENDS AND HAVE PROPER REST.