Recent Notes

Displaying keyword search results 1 - 8
Created by freyo on May 13, 2011 15:45:29    Last update: September 20, 2011 08:08:12
This is an Android app that dumps any binarized xml file as plain text - to the sdcard on the device or emulator. build.xml : <?xml version="1.0" encoding="UTF-8"?> <project... AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <man... res/layout/main.xml <?xml version="1.0" encoding="utf-8"?> <Lin... res/values/strings.xml : <?xml version="1.0" encoding="utf-8"?> <res... src/com/android/xmltool/ package; import java.ut... Screenshot Pre-built APK can be downloaded from:
Created by Dr. Xi on January 14, 2010 00:28:27    Last update: March 30, 2011 15:37:44
A task that a Java developer does so frequently is to find out where a certain class can be found - to resolve compilation errors, classpath issues, or version conflicts of the same class introduced by multiple class loaders. A long while back I wrote a simple Perl script to perform the task. Later I was informed that there are Swing based Jar Browser and Jars Browser . Then, there are a couple of shell one-liners: # one liner 1 find -name "*.jar" -print0 | xarg... But all of them share the same problem: if a class is in a jar nested in another jar, it cannot be found. Such is the case for a class inside a jar under the WEB-INF/lib directory of a...
Created by Dr. Xi on June 19, 2010 04:34:01    Last update: June 19, 2010 04:39:13
Java SE 6 contains built-in utilities to generate XML signatures. This is an example that generates XML signatures using a Java keystore. It has options to generate signature for the whole document, for an element with a specific ID, or for elements matched by an XPATH expression. The XML document used to test is taken from Getting Started with XML Security : <?xml version="1.0"?> <PatientRecord> ... This is the Java code: import; import However, it looks like the XPATH transform is not working. The digest generated with XPATH filter is exactly the same as that without it (i.e., the whole document)! Another reference: Programming With the Java XML Digital Signature API
Created by Dr. Xi on June 01, 2010 16:44:12    Last update: June 01, 2010 16:45:52
I installed JDK 1.6 under C:\jdk1.6.0_20 and unpacked Eclipse GALILEO in C:\local\eclipse . When I launched Eclipse with eclipse.exe , it simply displayed a splash page and shutdown. Running eclipsec.exe displayed some vague errors: C:\local\eclipse>eclipsec Error occurred during... Turning on debug: C:\local\eclipse>eclipsec -debug Start VM: -Dos... The Solution: add -vm option to eclipse.ini : -startup plugins/org.eclipse.equinox.launcher_1...
Created by google.P3SY7GMD on January 25, 2010 16:11:01    Last update: January 25, 2010 16:11:01
Simple have your project in eclipse, and your jars in the build path. Type CTRL-SHIFT-T... Just entre the name of the class and eclipse show from where it come from.
Created by Dr. Xi on October 14, 2008 23:02:29    Last update: October 14, 2008 23:03:50
Wrap JWhich in a servlet: Implement the servlet: package com.example; import*; ... Add this to web.xml : <servlet> <servlet-name>jwhich</servlet... Request the path for a class or properties file:
Created by Dr. Xi on September 25, 2008 02:58:27    Last update: October 14, 2008 22:49:32
This following code came from a JavaWorld tip, with some minor modifications. public class JWhich { /** * Retu...
Created by Dr. Xi on December 12, 2007 20:30:01    Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf : LoadModule python_module modules/ ... Python script: import time, os from os.path import basename ...