Show me the code! – By Davanum Srinivas

August 29, 2011

iPhone and a bit of Rain

Filed under: Uncategorized — Davanum Srinivas @ 5:29 pm

Last week we were at the Animal Kingdom down in florida we ran into a bit of rain. I quickly wore a rain jacket and transferred the iPhone to the more drier pocket of the rain jacket, but the iPhone got a bit wet anyway. The iPhone shut off by itself and i could feel the battery draining. Back at the hotel, after a bit of research, found that thankfully the sensors had not tripped. I popped open the sim card and dried it with a hair dryer for about 5-10 mins and dropped it into a snack bag with rice. Left the iPhone alone for a couple of days with periodic drying with the hair dryer and it’s now working as well as it was. Whew!

August 16, 2011

Plugin Development kit for IBM Workload Deployer

Filed under: Uncategorized — Davanum Srinivas @ 8:39 am

is now live! –

The Plugin_Developers_Guide- is as the name suggests developers’ guide for plug-ins and pattern types (virtual applications).

The contains the actual IBM Workload Plug-in Development Kit, the contents are as follows:
-docs/PDKSampleUsersGuide.pdf: contains user guide for sample plugins and pattern type contains build libraries and build scripts to build plugins and pattern types contains sample plugins and pattern type contains Javadocs

If you ask, What is IBM Workload Deployer? see here

April 29, 2011

What is JSONx?

Filed under: Uncategorized — Davanum Srinivas @ 11:57 am

[SOURCE] Please see Slide #37 in

What is JSONx?

• IBM Internal Standardization of JSON modeled in XML
– xmlns:json=
– Spec was developed by DP with input from the Data Web Service Team (DB2)
– Strict model of RFC 4627 – application/json
– Productized by DP and Data Web Service Team
• Developed to be generically schema validateable (json is validated)
– Not an arbitrary representation of JSON data as XML
– Not at attempt to model any XML as JSON
• Developed to be a non-lossy transformation of JSON types/data
• Useful for everything DataPower
– RESTful json bridge to SOAP
– Threat protection for Ajax clients that use eval(json)
• Data Web Service details:

[My Notes]
• Datapower devices live on the edge of your network
• Customers perform bridging/proxying/aggregation of various data formats and protocols
• It’s in this narrow use case that JSONx is aimed at IMHO

Here’s an exact AJAX DataPower Appliance SOAP scenario:

April 28, 2010

Call for Participation: Technical Talks — ApacheCon North America 2010

Filed under: ASF — Davanum Srinivas @ 5:28 pm

ApacheCon North America 2010
1-5 November 2010 — Westin Peachtree in Atlanta

Technical Tracks: Call For Participation
All submissions must be received by Friday, 28 May 2010 at midnight Pacific Time.
The official conference, trainings, and expo of The Apache Software Foundation (ASF) returns to Atlanta this November, with dozens of technical, business, and community-focused sessions at the beginner, intermediate, and advanced levels.

Over the past decade, the ASF has gone from strength to strength, developing and shepherding nearly 150 Top-Level Projects and new initiatives in the Apache Incubator and Labs. This year’s ApacheCon celebrates how Apache technologies have sparked creativity, challenged processes, streamlined development, improved collaboration, launched businesses, bolstered economies, and improved lives.

We are proud of our achievements and recognize that the global Apache community –both developers and users– are responsible for the success and popularity of our products.

The ApacheCon Planning Team are soliciting 50-minute technical presentations for the next conference, which will focus on the theme “Servers, the Cloud, and Innovation”.

We are particularly interested in highly-relevant, professionally-directed presentations that demonstrate specific probrlems and real-world solutions. Part of the technical program has already been planned; we welcome proposals based on the following Apache Projects and related technical areas:

- Cassandra/NoSQL
- Content Technologies
- (Java) Enterprise Development
- Felix/OSGi
- Geronimo
- Hadoop + friends/Cloud Computing
- Lucene, Mahout + friends/Search
- Tomcat
- Tuscany
Submissions are open to anyone with relevant expertise: ASF affiliation is not required to present at, attend, or otherwise participate in ApacheCon.

Please keep in mind that whilst we encourage submissions that the highlight the use of specific Apache solutions, we are unable to accept marketing/commercially-oriented presentations.

Other proposals, such as panels, or those longer than 50 minutes in duration have been considered in the past. You are welcome to submit an alternate presentation, however, such sessions are accepted under exceptional circumstances. Please be as descriptive as possible, including names/bios of proposed panelists and any related details.

All accepted speakers (not co-presenters) qualify for general conference admission and a minimum of two nights lodging at the conference hotel. Additional hotel nights and travel assistance are possible, depending on the number of presentations given and type of assistance needed.

To submit a presentation proposal, please send an email to submissions AT apachecon DOT com containing the following information in plaintext (no attachments, please):

1. Your full name, title, and organization

2. Contact information, including your address

3. The name of your proposed session (keep your title simple and relevant to the topic)

4. The technical category of the intended presentation (Cassandra/NoSQL; Content Technologies; (Java) Enterprise Development; Felix/OSGi; Geronimo; Hadoop + friends/Cloud Computing; Lucene, Mahout + friends/Search; Tomcat; or Tuscany)

5. The classification for each presentation (Servers, Cloud, or Innovation) – some presentations may have more than one theme (e.g., a next-generation server can be classified both as “Servers” and “Innovation”

6. The intended audience level (beginner, intermediate, advanced)

7. A 75-200 word overview of your presentation

8. A 100-200-word speaker bio that includes prior conference speaking or related experience

9. Feedback or references (with contact information) on presentations given within the last three years

To be considered, proposals must be received by Friday, 28 May 2010 at midnight Pacific Time. Please email any questions regarding proposal submissions to cfp AT apachecon DOT com.

Technical Tracks Key Dates

23 April 2010: Call For Participation Open
28 May 2010: Call For Participation Closes
11 June 2010: Speaker Acceptance/Rejection Notification
1-5 November 2010: ApacheCon NA 2010
We look forward to seeing you in Atlanta!

For the ApacheCon Planning team,
Sally Khudairi, Program Lead

February 11, 2010

Hide/Toggle GMail Decorations (esp for Google Buzz) using a bookmarklet

Filed under: Code Snippets — Tags: , , , , — Davanum Srinivas @ 10:57 pm

Create link in your tool bar and cut-n-paste the code below into the link, then you can just click on it when logged into GMail to hide the decorations around the center.

javascript: void((function () {
    function hide(doc, xpath) {
        var items = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
        var item = items.iterateNext(); = ( != 'none' ? 'none' : '');
    var items = document.evaluate('//iframe[5]', document, null, XPathResult.ANY_TYPE, null);
    var frame = items.iterateNext();
    var doc = (frame.contentWindow || frame.contentDocument);
    if (doc.document) doc = doc.document;
    hide(doc, '/html/body/div/div[2]/div/table/tr/td');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[2]');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[4]');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[5]');
    hide(doc, '/html/body/div/div[2]/div/div/div/div[2]');
    hide(doc, '/html/body/div/div[2]/div/div/div/div[3]');
    hide(doc, '/html/body/div/div[2]/div/table/tr/td[3]/div[2]/div[2]');

December 21, 2009

Book on IBM WebSphere eXtreme Scale 6

Filed under: Uncategorized — Tags: , , , — Davanum Srinivas @ 10:29 am

The Packt folks have a new book out on IBM WebSphere eXtreme Scale 6

There’s a sample chapter available for free download as well – The DataGrid API

PS: Thanks to Ryan for sending me a copy of this book.

December 4, 2009

Android – Video/Music player sample (Take #2)

Filed under: Uncategorized — Davanum Srinivas @ 12:55 am

NOTE: Since many folks were looking for it…Here’s the updated version of code originally posted here

Here is a screen shot.



  • You can specify a directory path or a remote URL in the edit box

  • Choose any 3gp file from to view videos

  • The 4 buttons are for play, pause, reset and stop

  • When you specify a http or https url, we save the url contents to hard disk first and then play it

  • The icons are from here

Here’s the code

 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.


import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.URLUtil;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;
import android.widget.VideoView;

public class VideoViewDemo extends Activity {
	private static final String TAG = "VideoViewDemo";

	private VideoView mVideoView;
	private EditText mPath;
	private ImageButton mPlay;
	private ImageButton mPause;
	private ImageButton mReset;
	private ImageButton mStop;
	private String current;

	public void onCreate(Bundle icicle) {
		mVideoView = (VideoView) findViewById(;

		mPath = (EditText) findViewById(;

		mPlay = (ImageButton) findViewById(;
		mPause = (ImageButton) findViewById(;
		mReset = (ImageButton) findViewById(;
		mStop = (ImageButton) findViewById(;

		mPlay.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
		mPause.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				if (mVideoView != null) {
		mReset.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				if (mVideoView != null) {
		mStop.setOnClickListener(new OnClickListener() {
			public void onClick(View view) {
				if (mVideoView != null) {
					current = null;
		runOnUiThread(new Runnable(){
			public void run() {

	private void playVideo() {
		try {
			final String path = mPath.getText().toString();
			Log.v(TAG, "path: " + path);
			if (path == null || path.length() == 0) {
				Toast.makeText(VideoViewDemo.this, "File URL/path is empty",

			} else {
				// If the path has not changed, just start the media player
				if (path.equals(current) && mVideoView != null) {
				current = path;

		} catch (Exception e) {
			Log.e(TAG, "error: " + e.getMessage(), e);
			if (mVideoView != null) {

	private String getDataSource(String path) throws IOException {
		if (!URLUtil.isNetworkUrl(path)) {
			return path;
		} else {
			URL url = new URL(path);
			URLConnection cn = url.openConnection();
			InputStream stream = cn.getInputStream();
			if (stream == null)
				throw new RuntimeException("stream is null");
			File temp = File.createTempFile("mediaplayertmp", "dat");
			String tempPath = temp.getAbsolutePath();
			FileOutputStream out = new FileOutputStream(temp);
			byte buf[] = new byte[128];
			do {
				int numread =;
				if (numread <= 0)
				out.write(buf, 0, numread);
			} while (true);
			try {
			} catch (IOException ex) {
				Log.e(TAG, "error: " + ex.getMessage(), ex);
			return tempPath;

Download Source and APK from here –

December 1, 2009

Webpshere XML Feature pack – Looking for a XSLT 2.0 implementation other than Saxon?

Filed under: websphere — Tags: — Davanum Srinivas @ 6:38 am

Details are here:

The thin client is pretty interesting as it can be used with non-IBM JDK’s and outside the Websphere environment. Also, don’t forget to poke around the samples in xmlfepsamples.ear.

If you want to try this out just get the free Websphere for developers:

and install the XML Feature Pack using instructions here:
Installing and uninstalling the XML feature pack on distributed operating systems

UPDATED : (11:30 AM EST) A colleague pointed out that customers should check their license for exact/specific scenarios that they are allowed to use the thin client for their production scenarios.

November 20, 2009

Debug code running on IBM Websphere using Eclipse / Intellij IDEA

Filed under: Uncategorized — Davanum Srinivas @ 1:39 pm

NOTE: Please back up the files before you modify them.

Step #1 : Edit the server.xml (for example $WAS_HOME/profiles/AppSrv01/config/cells/AppSrv01/nodes/AppSrv01/servers/server1/server.xml). Find the processDefinitions element and look for the jvmEntries under it. A typical entry looks like this:

  <processDefinitions xmi:type="processexec:JavaProcessDef" 
    <execution xmi:id="ProcessExecution_1183122130078" 
    <ioRedirect xmi:id="OutputRedirect_1183122130078" 
    <monitoringPolicy xmi:id="MonitoringPolicy_1183122130078" 
		maximumStartupAttempts="3" pingInterval="60" 
		pingTimeout="300" autoRestart="true" 
    <jvmEntries xmi:id="JavaVirtualMachine_1183122130078" 
		verboseModeJNI="false" runHProf="false" 
      <systemProperties xmi:id="Property_1" name="" value="off" required="false"/>
      <systemProperties xmi:id="Property_2" name="" value="off" required="false"/>

Step #2: Do you see the debugMode in the jvmEntries section? switch it from false to true and save the file.


Step #3: Restart the server as usual using say the command line

root@dims-desktop:/opt/WAS70/profiles/AppSrv01/bin# ./ server1
ADMU0116I: Tool information is being logged in file
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 6913

Step #4: Using latest IntelliJ or Eclipse, you can use Remote debugging to attach to the running Websphere server. Please specify the same port (“7777″ in example above) as mentioned in the server.xml. Here are screen shots from Eclipse and Intellij on how to set up the debug configuration.

Step #5: Use the debug configuration created in the previous step, set up break points in your application and attach to the running Websphere process.

That’s it!

November 6, 2009

Better RSS feed for IBM WebSphere Application Server forum

Filed under: Uncategorized — Davanum Srinivas @ 6:21 pm

The websphere forum (see below) feeds are truncated

You need to add “&Full=true” to get all the content as shown below:

« Newer PostsOlder Posts »

The Shocking Blue Green Theme Blog at


Get every new post delivered to your Inbox.

Join 131 other followers