QTP – Identify renderers within DataGrid

Monday, March 30th, 2015 - Articles, Flex

Recently, I came across a problem in QTP automation – failing to identify controls within DataGrid. The problem was occurring with one of our legacy application, using Flex SDK 3.5 (yes, its truly legacy). The issue was almost driving nuts, as DataGrid in quite a few other modules were working proplery with QTP, while one of the screen was failing in object detection.

continue reading

GSON as JAX-RS json provider in CXF

Sunday, September 21st, 2014 - Articles

While there are many frameworks for parsing JSON structured data, I was looking for a framework which will provide a generic object. I was expecting a returned object to be more like a property holder (no Hashmaps, please). I came across GSON and found it is the perfect candidate for what I am looking for.
But my problem was not addressed completely, I was looking for embedding GSON inside CXF as JAX-RS provider. The default implementation which comes with CXF, was returning a concrete object which was impossible for me to build and make available to the provider. Hence, I needed a way to configure GSON as JAX-RS provider and capitalize the features which I was more interested in.
This led the way to build my own JAX-RS provider using GSON. Fortunately, it is much easier with CXF to create JAX-RS provider and plug it in the framework.
Step 1
Create a class “GSONJAXRSProvider” and implement

Step 2
Override the method to parse incoming data.

public Object readFrom(Class object, Type arg1, Annotation[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, InputStream inputStream) throws IOException, WebApplicationException

I have used following code to deserialize data

InputStreamReader streamReader = new InputStreamReader(inputStream);
JsonElement jsonObject = parser.parse(streamReader);
return (Object)jsonObject;

Step 3
Override the method to serialize outgoing data.

public void writeTo(Object object, Class arg1, Type arg2, Annotation[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, OutputStream responseStream) throws IOException, WebApplicationException

And here goes code for serializing JSONObject to string.

PrintWriter printWriter = new PrintWriter(responseStream);
JsonObject json = (JsonObject)object;

Step 4
Configure the newly created class as JAX-RS provider in CXF. Refer following configuration snippet.

That’s all!

continue reading

Windows 8.1 upgrade

Monday, August 4th, 2014 - Articles, personal

I was bit excited waiting for new upgrade of Windows 8 – Version 8.1. I have Samsung Ativ Smart PC Pro – XE700T1C model, bought almost 2 years back. The strong feature of this model is that it can be detached from the keyboard and has i5 processor with 128gb SSD. I found its quite handy while reading books, surfing, listening music and yes sometimes even coding Java-Eclipse. Overall this is the best purchase, I have ever made. There is only one thing that bugs me – is the keyboard docking. Anyways, lets move to what I experienced after upgrading to Windows 8.1.
Few months back one of senior manager has indicated in the post that he is bit obsessed with the Windows 8.1 upgrade. But I still thought of upgrading my laptop cum tablet without even thinking what was waiting for me. It was just a week old story that I started seeing windows 8.1 upgrade was waiting for me in the store. I thought lets just upgrade it and see what new features are available.

continue reading

Eclipse product export with features

Wednesday, May 21st, 2014 - Eclipse

Sometime back, I started doing a formal release of one of the Eclipse RCP product, I was working on. While doing the release, I came across lot of problems. My product has very simple structure and it consists of

  1. Plug-in (Core functionality for RCP)
  2. A Feature (Contains above plug-in)
  3. Another feature (To list all the eclipse dependencies)
  4. Product definition plug-in (Contains branding and workbench details)
  5. Product definition (Created inside above plug-in)

That seems pretty simple huh!!! But while exporting above structure, I came across lot of things that one may find useful. Let evaluate everything from the beginning.

continue reading

Eclipse Context Help – Complete

Sunday, March 9th, 2014 - Articles

You may be confused as why I am posting about the feature which is covered by so many posts/articles/documentation. Though there are many sites which does this job, I found one or the other configuration aspect is missing from either of the site. I personally followed many articles and could never able to get the context help worked. I had to visit many sites and understand what are all combined configuration aspects are required to get it done. This provoked a thought to put all those things together. Here we go

continue reading

I am lost

Wednesday, December 25th, 2013 - personal

Long time, no see. Nothing came from my side, for a long time. Hmm, thats bit scary and even made me think, as what I am doing? I am bit lost these days, lost in the plethora of information, reading lot of books on topics ranging from Javasript, Java, .Net, performance, coding best practices etc. (list will not end and the backlog is still increasing). The sad part is I am not able to use my knowledge at my workplace and mostly it is fact that I must accept I am working in a country where management is more of value than hard-core technical skills (hmm god knows, I can tell you from my experience).

continue reading

Nodejs and custom modules on windows

Tuesday, August 20th, 2013 - Articles

It has been a long time, I was planning to hit on Node.js, but I got stuck with other topics and somehow it slipped my mind. Few days back, I thought to give it a try and check what Node.js offers. I like the idea of using JavaScript to write code for Node.js (After all thats my first programming language and the most fav. language :P ).
The first baby step with “Hello World” and writing your own web server, made me comfortable and I realised its so much of fun to write code for nodejs as you have to just learn the APIs and start modularizing them. As soon as I started making the progress, I found an example making use of Node.js’s custom module “connect”.

continue reading

Books that help to write better code

Sunday, July 14th, 2013 - Articles

I have been reading lot of books on various frameworks and technologies from my college days. I am always fascinated by new technologies and frameworks that help to ease developer’s life by writing less and manageable code. While all these years, I was spending too much time on reading syntaxes and APIs exposed by various languages and frameworks, from last 2 months, things have taken different turn. I put too much emphasis on using design patterns, but I was introduced to quite a few good books by my seniors and I was really surprised, the way these books have changed my thoughtprocess. No, I dont mean stop using design patterns or blah blah… but before start using all those geeky words like scalability, design patterns and other stuffs, you need to first learn to write clean code. Yes! here are some of the best books, I have been reading.

continue reading

Firefox 22 Installer – usability

Saturday, July 6th, 2013 - Articles

It was just like a regular day and I was going through few sites, suddenly I felt to checkout if there is any new version of Firefox has came up (I check bi-weekly). And yeah, there was new version available. As usual, I tried to upgrade using the Help > About firefox menu and it showed that there is new version is availble. While usually it updates the firefox without doing much and just by opening About box, but this time it failed. So to get the latest version, I tried to download it manually. Hmm… and then I was bit shocked by the installer.

continue reading

Is it wise to use unsafe – Hidden secret of Java

Saturday, June 15th, 2013 - Articles

I have been visiting quite a few sites and going through few forums, when I stumbled upon an article talking about the hidden weapon of Java, not made publicly known due to some reasons. But it is claimed that many of the Java internals and third party softwares do use this API to gain monstrous power.
While we have learned from academic days that heap space is home for Java objects, it is a place where the objects come to life and die. JVM with its GC algorithm makes the kill and creates space for new objects. While in the process of moving objects from various places (eden, young generator etc), it sometimes may bring down the application performance to its knees and can prove costly affair.
Whlie GC has been seen as life savior for people who dont want to worry about memory management, it also imposed restriction in terms of no control over deciding fate of the object as when it will get garbage collected. While this may not sound so serious problem as people end up allocating higher heap space for JVM (without realising the fact that it is actually hampering performance), some felt it bit uncomfortable (geeks from C, C++ playing with memory functions).

continue reading