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: https://www.ibm.com/developerworks/java/jdk/

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:

http://markmail.org/message/3c6bppbw23gyhj4v

Apache Axis was started 10 years + 9 months ago:

http://markmail.org/message/3oi5dogfn2xzcvrk

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://github.com/felipec/msn-pecan.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! – http://bit.ly/pwk4iwd

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

The pdk-1.0.0.0.zip 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
-IBMWorkloadPluginDevKit_.zip: contains build libraries and build scripts to build plugins and pattern types
-pdk-samples_.zip: contains sample plugins and pattern type
-pdk-javadoc_.zip: contains Javadocs

If you ask, What is IBM Workload Deployer? see here http://www-01.ibm.com/software/webservers/workload-deployer/

April 29, 2011

What is JSONx?

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

[SOURCE] Please see Slide #37 in http://mmpcgroup.com/doc/datapower-in-web20-world.pdf

What is JSONx?

• IBM Internal Standardization of JSON modeled in XML
– xmlns:json=http://www.ibm.com/xmlns/prod/2009/jsonx
– 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:

https://w3.tap.ibm.com/w3ki07/display/pureXML/jsonxArticles

[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

Example:
Here’s an exact AJAX DataPower Appliance SOAP scenario:
http://publib.boulder.ibm.com/infocenter/wsdatap/v3r8m1/index.jsp?topic=/xb60/dqx1webgui_web2_web2json_concept.htm

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();
        item.style.display = (item.style.display != '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.

x

Notes



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

  • Choose any 3gp file from http://daily3gp.com/ 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
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.android.media;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

import android.app.Activity;
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;

	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.main);
		mVideoView = (VideoView) findViewById(R.id.surface_view);

		mPath = (EditText) findViewById(R.id.path);
		mPath.setText("http://daily3gp.com/vids/747.3gp");

		mPlay = (ImageButton) findViewById(R.id.play);
		mPause = (ImageButton) findViewById(R.id.pause);
		mReset = (ImageButton) findViewById(R.id.reset);
		mStop = (ImageButton) findViewById(R.id.stop);

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

	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",
						Toast.LENGTH_LONG).show();

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

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

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

Download Source and APK from here – VideoView.zip

« Newer PostsOlder Posts »

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 131 other followers