April 17, 2009
April 15, 2009
March 16, 2009
Post/Update Twitter status snippet (from java)
Snippet to post to twitter. Using sun.misc to avoid introducing another jar (say commons codec). Please feel free to use another Base64 implementation. Rest of the details will remain the same.
import sun.misc.BASE64Encoder;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStreamWriter;
import java.net.URLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class Twitter {
public static void main(String[] args) throws Exception {
if (args.length < 3) {
System.out.println("Twitter <userid> <password> <message>");
System.exit(-1);
}
URL url = new URL("https://twitter.com/statuses/update.xml");
URLConnection connection = url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
String authorization = args[0] + ":" + args[1];
BASE64Encoder encoder = new BASE64Encoder();
String encoded = new String
(encoder.encodeBuffer(authorization.getBytes())).trim();
connection.setRequestProperty("Authorization", "Basic " + encoded);
OutputStreamWriter out = new OutputStreamWriter(
connection.getOutputStream());
out.write("status=" + URLEncoder.encode(args[2], "UTF-8"));
out.close();
BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));
String response;
while ((response = in.readLine()) != null) {
System.out.println(response);
}
in.close();
}
}
March 12, 2009
Technotes about Axis2 and IBM Websphere co-existence
If you are deploying Axis2 in a WAR/EAR under Websphere 6.1 with Web services feature pack or Websphere 7.0, please read the following tech notes:
- The Apache Axis2 servlet is not accessible after deploying the Apache Axis2 engine
- Deploying an application that contains the Apache Axis2 runtime might create a class cast exception
You can search for newer technotes here:
http://www.ibm.com/support/us/en/
Exceptions like the following:
SRVE0026E: [Servlet Error]-[javax.servlet.UnavailableException: SRVE0201E:
Servlet [org.apache.axis2.transport.http.AxisServlet]: not a servlet class
java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMTextImpl incompatible with org.apache.axiom.om.impl.OMNodeEx
SRVE0100E: Did not realize init()
exception thrown by servlet AxisServlet: java.lang.StackOverflowError
January 22, 2009
Top 10 WebSphere Trends and Directions (Bonus – skit with David Letterman)
Details here : http://www.infoq.com/news/2009/01/cuomo-websphere-trends-2009
and here : http://www.ibm.com/developerworks/blogs/page/gcuomo
Video on Youtube here : http://www.youtube.com/watch?v=eiPQwDkL7hE
December 29, 2008
Updated XMPP Client for Android
Updated the sources to latest android version – Android 1.0 SDK, Release 2
Original article:
http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/
Updated screen shots:


Download Source and APK from here – XMPPClient-2.zip
December 14, 2008
BlueTwit Firefox sidebar (supports Twitter too)
here are some screen shots of what i was working on the side:
![]() |
![]() |
![]() |
![]() |
December 13, 2008
[Websphere] Article on securing web services using ws-security and policies in WAS7
here’s the link:
http://www.ibm.com/developerworks/webservices/library/ws-offload/?ca=drs-&ca=dgf-my
here are the highlights:
- Deploying and configuring a secure Web service using asymmetric
encryption. - Using Rational Application Developer to import a sample EAR file and
configure Web services security policies and binding attachments for a
Web service Client - Using the WebSphere Application Server console to configure the Web
service Security policies for a sample service - Preparing Java™ Cryptography Extension (JCE) and JCEKS
security credentials.
October 23, 2008
[android] Building and running Android from source
- Use the repo script to pull down the source as explained in
- Make sure you install ncurses headers using “sudo apt-get install ncurses-dev”
- run make from the root directory
- run the emulator using “out/host/linux-x86/bin/emulator -system out/target/product/generic/ -kernel prebuilt/android-arm/kernel/kernel-qemu”
PS: Many thanks to massiveRobot on #android IRC channel for the tip for running the emulator.
October 22, 2008
Greasemonkey script for Summize search on Twitter Home page
// ==UserScript==
// @name Summize / Twitter
// @namespace dims
// @include http://twitter.com/
// ==/UserScript==
var summize = document.createElement("div");
summize.innerHTML = '<div style="margin: 0 auto 0 auto; ' +
'border-bottom: 1px solid #000000; margin-bottom: 5px; ' +
'font-size: small; background-color: #000000; ' +
'color: #ffffff;">'+
' <form action="http://search.twitter.com/search" id="searchForm" method="get"> ' +
' <input autosave="com.twitter.search" id="searchBox" ' +
' name="q" placeholder="Enter your query" results="10" type="search" />' +
' <input type="submit" value="Search" />' +
' </form>' +
'</div>';
document.body.insertBefore(summize, document.body.firstChild);
click here to subscribe to the greasemonkey script.



