Archive

Archive for the ‘Technology’ Category

Gmail as free online file storage

September 8, 2009 Abhijeet Iraj Leave a comment

If you want free online file storage then you can use  GMail Drive. It creates a virtual file system around your Google GMail account, allowing you to use GMail as a storage medium. It enables you to save and retrieve files stored on your GMail account directly from inside Windows Explorer. It adds a new drive to your computer under the My Computer folder, where you can copy and drag n drop files.

Here are the steps you can follow

  • Create one Gmail account for your storage. You can use your existing Gmail account but its better to have separate account for your online file storage.
  • Download and install GMail drive shell extension from here
  • After installation you will see new GMail Drive

GMailDrive

  • Double click on GMail Drive it will prompt for your GMail credentials

GMailDriveLogin

  • After login you can copy files which you want to store into your new GMail drive.GMailDriveCopy
  • Now if you want to access your files from some other machine you can setup GMail Drive and you will have access to all those files.

GMailDriveAccess

  • You can also access those files from your GMail account. Login to your account and you will see a separate message for each one of your file as an attachment.

GMailDriveAccount

Categories: Tools Tags: ,

Spring MVC Web Portal

September 2, 2009 Abhijeet Iraj Leave a comment

Recently we migrated from Backbase based portal to Spring MVC based portal for our kiosk transaction system. This will evolve as Offline system (see davids post on this here).

We mainly used Spring to build this offline system because it’s lightweight, easy to use, easy to test and it allows to configure and compose complex application from simpler components.

portal

Here is the technology stack which we are using to build this offline system

  • Spring MVC: Part of spring and MVC  based Framework for building robust web applications
  • Spring Webflow: Built on Spring MVC and provides the infrastructure for building and running rich web application.
  • JQuery: Fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
  • Blueprintcss: CSS framework which aims to cut down on your development time.
  • JMesa: Dynamic HTML table rendering API/Tag library that allows you to filter, sort, paginate, export and edit your data however you need to.
  • Sitemesh: Web-page layout and decoration framework and web-application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.
  • Hibernate: Powerful, high performance object/relational persistence and query service.
  • Maven: Software project build and  management tool.
  • MySQL: Most popular open source database.
  • SpringSource ToolSuite: Eclipse-powered development environment for building Spring-powered enterprise applications.
Categories: Spring, web Tags: , , , ,

Swing Event Dispatcher Thread

September 1, 2009 Abhijeet Iraj Leave a comment

Even though swing is very important part of the Java platform, truth is that its not thread safe. That means swing component methods called from multiple threads can cause thread interference or memory consistency errors. There are some exceptions to this. There are some swing component methods which are “thread safe” which can be safely invoked from any thread.

Reason why swing is not thread safe is that any attempt to create a thread-safe GUI library faces some fundamental problems. For more on this issue, see the following entry in Graham Hamilton’s blog: MultiThreaded toolkits: A failed dream?

Because of this swing event handling code execution as well as component repaint happens on a special thread known as the event dispatch thread. All the Swing component methods which are not thread safe must be invoked from this event dispatch thread. Programs that ignore this rule may function correctly most of the time, but are subject to unpredictable errors that are difficult to reproduce.

EDT

There are two fundamental things to understand about Swing and threads:

  1. Time-consuming tasks should not be run on the Event Dispatch Thread. Otherwise the application becomes unresponsive. The EDT is busy executing your task and hence can’t process GUI events.
  2. Swing components should be accessed on the Event Dispatch Thread only. To access components from other threads, you must use SwingUtilities. invokeAndWait, SwingUtilities. invokeLater or SwingWorker.
Categories: Java, RIA, Swing Tags: , , ,

MEI Cash Acceptor with Bunch Note Feeder

August 29, 2009 Abhijeet Iraj Leave a comment

Frankly speaking i had never used cash acceptor in my life since in India that technology is not used much. But recently i got a chance to integrate MEI CASHFLOW® SC Series note acceptor with BNF in our system at work and it was really a nice experience. This is one of the world’s most technically advanced cash acceptor.

Cash Acceptor

Because of bunch note feeder (BNF) user can deposit cash more efficiently by placing a bundle of up to 30 notes into a BNF.

Before starting integration, one thing which was really important was to change MEI Cash Acceptor from Stand-Alone mode to EBDS mode. In Stand-Alone mode the communication between the SC and API will not work.

Integration using MEI provided java api was straightforward..

/**
 * @author airaj
 *
 */
public class MEICashAcceptor extends CashAcceptor
                                           implements AcceptorEventListener
{
    // serial port to which device is connected
    private String serialPort = "/dev/ttyS3";

    private Acceptor cashAcceptor = null;

    // connect to the device
    public void connect()
    {
        cashAcceptor = new Acceptor();
        cashAcceptor.addAcceptorEventListener(this);
        Acceptor.listPorts();
        try
        {
            cashAcceptor.open(serialPort, PowerUp.A);
        }
        catch (AcceptorException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    // enable acceptor so that it accepts bills
    public void enable()
    {
        cashAcceptor.setEnableAcceptance(true);
    }

    // disable acceptor so that it stops accepting bills
    public void disable()
    {
        cashAcceptor.setEnableAcceptance(false);
    }

    // This method gets called when any device event occurs
    public void acceptorEventOccurred(AcceptorEvent evt)
    {
        if (evt.getDescription() == null)
        {
            return;
        }
        if (evt instanceof EscrowEvent)
        {
            // Event generated for bill Escrow
            if (DocumentType.Bill.equals(cashAcceptor.getDocType()))
            {
                Bill b = cashAcceptor.getBill();
                try
                {
                    // stack the bill
                    cashAcceptor.escrowStack();
                }
                catch (AcceptorException e)
                {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
        else if (evt instanceof StackedEvent)
        {
            // Event generated when a document is stacked.
            if (DocumentType.Bill.equals(cashAcceptor.getDocType()))
            {
                Bill bill = cashAcceptor.getBill();
                String country  = bill.getCountry();
                String value = bill.getValue();
            }
        }
        else if (evt instanceof CheatedEvent)
        {
             // Event generated when the device detects a cheat attempt.
        }
        else if (evt instanceof JamDetectedEvent)
        {
            // Event generated when the device detects a jam.
        }
        else if (evt instanceof StackerFullEvent)
        {
            // Event generated when the device stacker is full.
        }
    }

}

You can view MEI CASHFLOW Bill acceptor with BNF demo here

Open Flash Chart

August 27, 2009 Abhijeet Iraj Leave a comment

Charts are very popular and powerful tools for communicating important information in data centric applications. Flash is the right technology to create such charts because of their interactive and aesthetic features like animation, effects etc. There are lot of commercial charting libraries in the market but if you are looking for free open source flash charting library then you should consider Open Flash Chart.

I have seen its use in wordpress blog dashboard for showing blog stats

Open Flash Chart
Open Flash charts reads data in JSON format which is a text format and is completely language independent. So you can use any language of your choice on server side to generate chart data in JSON format.

There are libraries available in lot of languages to help you generate JSON file for the chart to use here

Charts supported by Open Flash Chart:

  • Data Lines Chart
  • Bar Chart
  • 3D Bar Chart
  • Glass Bar Chart
  • Fade Bar Chart
  • Sketch Bars Chart
  • Area Chart
  • Bars + Lines Chart
  • Pie Chart
  • Scatter Chart
  • Candle Chart

I will write some tutorials about how to use Open Flash Chart in the future.

Categories: RIA, web Tags: , , ,

Web 3.0 – Semantic web

August 26, 2009 Abhijeet Iraj Leave a comment

Web 2.0 is now part of our daily lives. Web 2.0 helps us to collaborate, share information on the web through user centric web applications, social networking sites, video sharing sites, blogs etc. I personally spend good amount of time on orkut, twitter, youtube and blogging.

But the problem with this is that computers don’t understand what they are doing they just follow our instructions . They just blindly retrieve the web pages. Computers (browsers) only understand the syntax of a web page, they don’t understand meaning behind it.

web30.jpg

This is where semantic web comes in to picture. If somehow computers could understand meaning behind web page syntax they can help us to find what we want. In semantic web computers will be able to correlate the words and learn from the past experiences.

Categories: web Tags: ,

Throbber

August 24, 2009 Abhijeet Iraj Leave a comment

I enjoy doing User Interface Oriented Application Development.  I normally use throbber in Ajax  enabled web application development. Throbber is an animated graphic which is normally used on user interfaces to convey the user that the application is performing an action. On all Apple products it is known as an “activity indicator”.

throbber

Throbbers are mostly used in Ajax enabled applications because these  applications retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. So its important to convey the user that the application is performing an action.

There is an online throbber generator web 2.0 service at http://www.ajaxload.info/

ajaxload

There is also one Jquery plugin for this http://www.systemantics.net/en/throbber

Categories: RIA Tags: , , ,

Rich Internet Applications

August 23, 2009 Abhijeet Iraj Leave a comment

At the start of career I used to work on Rich Internet Application using JFC Swing based java applets. I really liked kind of desktop user experience this application provided but at the cost of delayed startup. System was responsible for provisioning all the components of a distributed control switch. It was designed to give the network administrator all the necessary information to properly monitor and operate the system. It was supporting multiple aspects of system monitoring, including real-time alarms, call tracing and diagnostics, performance statistics and traffic reports and browsing of Call Detail Records.

Imagine providing all such real time functionality using traditional web applications. How will you support inline editing? How will you show real-time alarms? How will you show call trace graphs? For such systems RIAs are best choice rather than traditional web applications.

Macromedia coined the term Rich Internet Applications (RIA) in 2002. Macromedia defines RIAs as combining the best user interface functionality of desktop software applications with the broad reach and low-cost deployment of Web applications and the best of interactive, multimedia communication. The end result: an application providing a more intuitive, responsive, and effective user experience.

In simple terms Rich internet applications are web applications with features, functionality, responsiveness, and user experience similar to that of desktop applications.

Best of desktop includes providing interactive user interface, single page model with no page refresh, drag and drop kid of behaviors and the ability to run online and offline. Best of Web includes low-cost deployment and broad reach.

Creating RIA is latest trend. There are lot of methods and techniques available for developing RIAs. Very big players like Microsoft, Sun and Adobe are targeting RIA and new tools are arriving very fast.

adobe-air

Here is the list of important methods and techniques available

Ajax: Ajax is latest buzzword. Everybody knows Ajax now. It became popular when Google used it in there applications like Gmail and Google maps. Ajax is not a rocket science. Its just combination technologies like HTML, CSS, DOM, XMLHttpRequest objects and XML.

Adobe Flex: I am very impressed with this technology. This is flash based solution from adobe. Flex allows us to create rich flash user interfaces using MXML, a XML based interface description language and ActionScript. MXML and ActionScript get compiled in to Flash applications (SWF files) on the fly.

JavaFX: Sun has recently announced JavaFX at Java one as a family of products to create Rich Internet Application. Currently JavaFX consists of JavaFX script and JavaFX mobile.

Java: Java based RIA can be applets embedded in web browser or as a stand alone application via Java Web start technology. Most important advantage Java based RIAs can take is that they can full power of Java Platform like Swing, Java 2D etc

Microsoft Silverlight: It’s a runtime for browser based RIAs and has capabilities like animation and vector graphics. Version 1.1 of Silverlight includes .NET CLR that means Silverlight RIAs can be written any .NET language.

Adobe Integrated Runtime (AIR): Adobe AIR, formerly code-named Apollo, is a cross-operating system runtime that allows developers to use their existing web development skills to build and deploy rich Internet applications to the desktop.

Categories: RIA, Technology Tags: , , , ,

Card Reader

August 23, 2009 Abhijeet Iraj Leave a comment

Five years back when i came to pune for a job after completing my B.E. i had no idea how to use debit card in ATM to withdraw money. One of my good friend taught me to use the card for doing transaction.

Few days back i integrated ID Tech card reader in our system at work. It’s a Really Long Way Down.

IDTech Card Reader

This is how card reader works.

When you swipe the card, card reader reads all the data from card to the system. Tracks of data on the magnetic stripe include the cardholder’s name and other personal information, credit card number and security and verification codes.

magnetic-card

Normally there are three tracks on magnetic strip on the back of the card.

Track1

This is the only track that can contain text data.Track one stores the primary account number, account holder’s name, card expiration date, service code, discretionary data (data to verify pin and security code) and the longitudinal redundancy check (LRC).

e.g.

%B4625555555555004^ABHIJEET IRAJ /^110310100524000000?

Track2

This track only allows for numbers and six other characters. This track stored the data mainly for banking industry.Track two stores primary account number, expiration date, service code, discretionary data and the LRC.

e.g.

;4633333333333304=1103104444524?

Track3

Track three is almost never used.Track1 and Track2 can only read data, Track3 allows for ‘write-back’ of information.

When you swipe the card, card reader reads the track data on magnetic stripe and is sent to the organization that actually authorizes purchases by authenticating the request. Using the data from the magnetic strip, the organization validates the request by making sure that the card has enough of the available limit to cover the purchase. It also checks to make sure that the card hasn’t been reported lost or stolen.The system comes back with an answer; either accepting or denying the request.