Show me the code! – By Davanum Srinivas

September 20, 2011

IBM SDK Java(TM) Technology Edition Version 7.0 is now available IBM DeveloperWorks

Filed under: Uncategorized — Davanum Srinivas @ 7:07 am

New Java features include:

  • NIO2 asynchronous I/O, JSR 203
  • New java.util.concurrent features including the fork/join framework
  • Better support for dynamic languages with the implementation of Invoke Dynamic, JSR 292
  • Small language changes (Project Coin)

IBM is introducing:

  • Balanced GC policy targeting short and consistent pause times on large heaps
  • More detailed and efficient format for verbose GC
  • Significant diagnostic improvements, including enhancements to javacore.txt contents
  • Shared classes cache supports additional content, better diagnostics, a programmable interface and improved control over file permissions and displaying cache contents
  • Real-time, incremental GC policy included for evaluation
  • Significant improvements in throughput, footprint and startup performance
  • Exploitation of Power7 and z196 hardware
  • Closer alignment with OpenJDK

IBM DeveloperWorks:


September 19, 2011

Apache Axis – 10 years

Filed under: Uncategorized — Davanum Srinivas @ 7:19 pm

My very first patch to Apache Axis was 10 years + 1 week ago:

Apache Axis was started 10 years + 9 months ago:

Roller coaster ride through life in general since then. Good friendships and Good times!

September 13, 2011

Compile/Install msn-pecan on ubuntu

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

msn-pecan is an alternative to the MSN plugin in pidgin. But the versions in the ubuntu repos are old. Here’s a quick 5 steps to compile/install msn-pecan on ubuntu.

  • sudo apt-get install libpurple-dev git-core
  • git clone git://
  • cd msn-pecan
  • make
  • sudo make install

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:

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 –

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 »

Create a free website or blog at