Saturday, January 26, 2013

Soundgarden setlist @ Orpheum Theatre, Boston, MA in 2013

Searching With My Good Eye Closed
Spoonman
Jesus Christ Pose
Outshined
By Crooked Steps
Taree
My Wave
Been Away Too Long
The Day I Tried to Live
Blow Up the Outside World
Fell on Black Days
Ugly Truth
Drawing Flies
Hunted Down
Non-State Actor
Blood on the Valley Floor
Mailman
A Thousand Days Before
Burden in My Hand
Head Down
Loud Love
4th of July

Encore:
Incessant Mace
Rusty Cage
Black Hole Sun
Slaves & Bulldozers

source: www.setlist.fm

Saturday, January 12, 2013

Ibatis return custom java object from query as List

Using IBatis if a sql query returns a number of rows and you need to IBatis to convert these rows to a java Object then you need to

1) create a resultMap entry where you map the propery in the java object to a column in a table
2) create a statement which contains the query and specify a resultMap (This is has been defined by above step 1)

using the above two configurations, Ibatis converts each row into a new MyClass() object and then populates it with the data from that row.

java code snippet
Map parameterMap = new HashMap();
parameterMap.put("inputNames", "abc");
      
List nameList = (List) getSqlMapClientTemplate().queryForList("getEmpDetails", parameterMap);
       
 

ibatis config       
<sqlMap namespace="myQueries">

    <resultMap id="idMap" class="com.test.MyClass">
        <result property="myId" column="ID_COLUMN_IN_DATABASE_TABLE"/>
        <result property="name" column="NAME_COLUMN_IN_DATABASE_TABLE"/>
    </resultMap>
   
    <statement id="getEmpDetails" resultMap="idMap"
        parameterClass="java.util.Map">
        select mytable.ID_COLUMN_IN_DATABASE_TABLE, mytable.NAME_COLUMN_IN_DATABASE_TABLE
        from mytable
        where mytable.name = #inputNames#
    </statement>
   
</sqlMap>

Using XStream to set xmlns attribute (xml namespace)

Thoughtworks xstream does not have an API to add xmlns attribute to xml root element. There is a work around to do the same using their useAttributeFor() API. Its a bit of hack but serves the purpose.

java pojo
public class TestXmlns {
    private String name;
    private String address;
    private String xmlns;
   
    ...get/set for above attributes.
   
}

create an instance of xstream and add below configuration
xstream.useAttributeFor(TestXmlns.class, "xmlns");

Example:
TestXmlns x1 = new TestXmlns();
x1.setName("abc");
x1.setAddress("zyx");
z1.setXmlns("http://com.company.mytest");

XStream xstream = new XStream();
xstream.useAttributeFor(TestXmlns.class, "xmlns");

String xmlString = xstream.toXML(x1);

output
<TestXmlns xmlns="http://com.company.mytest">
    <name>abc</name>
    <address>xyz</address>
</TestXmlns>

Convert java.util.Date to xsd:dateTime xml format

When converting java.util.Date to xml xsd dateTime format, one of the approaches is to use XMLGregorianCalendar class to format it to xml xsd format specifications.

input
new java.util.Date()

output
2013-01-12T10:30:09.274-05:00

code snippet:
String convertedDate = "";
GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("EST"));
//use below line to pass in a java.util.Date as an argument
//gc.setTime(date);
try {
       convertedDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc).toXMLFormat();
} catch (DatatypeConfigurationException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Tuesday, December 25, 2012

Slayer setlist for Rock in India 2012 on 20th October @ Bangalore


World Painted Blood
War Ensemble
Die by the Sword
Chemical Warfare
Hate Worldwide
Spirit in Black
Epidemic
Disciple
Mandatory Suicide
Altar of Sacrifice
Jesus Saves
Seasons in the Abyss
Hell Awaits
Postmortem
Snuff
Angel of Death

Encore:
South of Heaven
Silent Scream
Dead Skin Mask
Raining Blood

source: setlist.fm

Monday, December 17, 2012

The Killers setlist for their battle born world tour 2012

Smile Like You Mean It
Somebody Told Me
Here With Me
From Here On Out
Read My Mind
Spaceman
For Reasons Unknown
Runaways
Miss Atomic Bomb
Human
When You Were Young
Mr. Brightside

Encore:
All These Things That I've Done
Jenny Was a Friend of Mine
Battle Born

Monday, November 26, 2012

Sum41 setlist in Boston, MA


Setlist for Sum41 gig at the Paradise rock club in Boston,MA - 20th Nov 2012

Mr. Amsterdam
Motivation
In Too Deep
A.N.I.C.
We're All To Blame
Walking Disaster
Screaming Bloody Murder
Skumfuk
The Hell Song
My Direction
Over My Head (Better Off Dead)
Still Waiting
Underclass Hero

Encore:
We Will Rock You (Queen cover)
Sabotage (Beastie Boys cover) (tease)
Fat Lip
Pain For Pleasure

source: setlist.fm