Monday, April 13, 2009

emerging technologies conference in philadelphia

Glenn Mazza: emerging technologies conference in philadelphia

Don’t Invent XML Languages

Don’t Invent XML Languages
Tim Bray in 06 suggested that you shouldn't reinvent any XMl language, unless you can prove it doesn't fit the "BIG 5":
The Big Five
Suppose you’ve got an application where a markup language would be handy, and you’re wisely resisting the temptation to build your own. What are you going to do, then? ¶

The smartest thing to do would be to find a way to use one of the perfectly good markup languages that have been designed and debugged and have validators and authoring software and parsers and generators and all that other good stuff. Here’s a radical idea: don’t even think of making your own language until you’re sure that you can’t do the job using one of the Big Five: XHTML, DocBook, ODF, UBL, and Atom.

XHTML + Microformats:
If you’re delivering information to humans over the Web, even if you don’t think of it as “Web Pages”, it’s almost certainly insane not to use XHTML. Yes, XHTML is semantically weak and doesn’t really grok hierarchy and has a bunch of other problems. That’s OK, because it has a general-purpose class attribute and ignores markup it doesn’t know about and you can bastardize it eight ways from center without anything breaking. The Kool Kids call this “Microformats” and in fact I accidentally invented one on ongoing last November; look at that template and its class attributes. ¶

And of course, if you use XHTML you can feed it to the browsers that are already there on a few hundred million desktops and humans can read it, and if they want to know how to do what it’s doing, they can “View Source”—these are powerful arguments.

DocBook
Suppose you’re building something that needs to go bigger and deeper and richer than XHTML is comfy with, and you want to repurpose it for print and electronic and voice, and you need chapters and sections and appendices and bibliographies and footnotes and so on. DocBook is what you need. It’s got everything you could possibly begin to imagine already built-in, and there are lots of good tools out there to do useful things with it. ¶

ODF
Suppose you’re working with material that’s going to have a lot of workflow around it, and be complex, visually if not structurally, and maybe some day will be printed out and have signatures at the bottom. ODF is what you want. Not the most Web-oriented approach, but on the other hand the authoring tools are more human-friendly than anything else on this list. ¶

UBL
If you’re working with invoices and purchase orders and that kind of stuff (and who isn’t?), do not even think of inventing anything. A whole bunch of smart people have put hundreds of person-years into pulling together the basics, and they did a good job, and it’s ready to go today. Look no further. ¶

Atom
Suppose you think of your data as a list of, well, anything: stock prices or workflow steps or cake ingredients or sports statistics. Atom might be for you. Suppose the things in the list ought to have human-readable labels and have to carry a timestamp and might be re-aggregated into other lists. Atom is almost certainly what you need. And for a data format that didn’t exist a year ago, there’s a whole great big butt-load of software that understands it. ¶

Wednesday, April 01, 2009

weirdness with java 6 JAX-WS

strange error occuring with Jax-ws on Java JDK 1.6.0_06 or lower. after building the stubs with wsimport and writing a trivial client, you get javax.xml.ws.WebServiceException: unexpected XML reader state. expected: END_ELEMENT but found: START_ELEMENT when running against a document/literal web service However, upon upgrading to JDK 1.6.0_07 (or higher) it now works? seems there was a bugfix in 07 update

Tomcat security

One painful thing I'm learning is the restrictions tomcat has when running under the -security option.Basically many things (eg: jaxb, jax-ws, axis) can't run.
Locating the appropriate permissions is pretty daunting.Now lhttp://www.onjava.com/pub/a/onjava/2007/01/03/discovering-java-security-requirements.html has a tool calledProfilingSecurityManager (which is just a custom SecurityManager class) which displays the permissions required(basically start catalina with -Djava.security.manager=secmgr.ProfingSecurityManager)You then use a perl script
Another reference is http://www.petrovic.org/blog/2006/05/07/tomcat-security-option-and-catalinapolicy-file
Basically export CATALINA_OPTS=-Djava.security.debug=access,failurethen run catalina.sh run -security
Look in catalina.out for denied.Then seek for "domain that failed ProtectionDomain" for the codebase or domain.
http://www.jchains.org/ also allows you to do the same for standard java execution.

Tuesday, March 31, 2009

Java Logging API and How To Use It

Java Logging API and How To Use It

On tomcat 5.5 we have the JULI library which replaces the standard java logger.
So to get per-context logging, put
logging.properties into WEB-INF/classes with the following contents:
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = myapp-prefix.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

ps: here are the standard set of JULI properties:
  • org.apache.juli.FileHandler.directory
  • org.apache.juli.FileHandler.prefix
  • org.apache.juli.FileHandler.suffix
  • org.apache.juli.FileHandler.level
  • org.apache.juli.FileHandler.filter
  • org.apache.juli.FileHandler.formatter

Tuesday, March 24, 2009

Disabling Certificate Validation in an HTTPS Connection (Java Developers Almanac Example)

Whilst suffering extreme pain due to self-signed certificates (hint: UTS IT ?) here is a nify trick to roll your own non certificate checking class:
Disabling Certificate Validation in an HTTPS Connection (Java Developers Almanac Example E502)

e502. Disabling Certificate Validation in an HTTPS Connection
By default, accessing an HTTPS URL using the URL class results in an exception if the server's certificate chain cannot be validated has not previously been installed in the truststore. If you want to disable the validation of certificates for testing purposes, you need to override the default trust manager with one that trusts all certificates.
exception if the server's certificate chain cannot be validated has not previously been installed in the truststore. If you want to disable the validation of certificates for testing purposes, you need to override the default trust manager with one that trusts all certificates.

// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};

// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception e) {
}
   


Client:

// Now you can access an https URL without having the certificate in the truststore
try {
URL url = new URL("https://hostname/index.html");
} catch (MalformedURLException e) {
}

Friday, March 20, 2009

Critical Steps to Secure Tomcat on Windows NT/2K/XP

Critical Steps to Secure Tomcat on Windows NT/2K/XP

wow, running tomcat can really cause security holes.
fancy
Runtime rt = Runtime.getRuntime();
rt.exec("c:\\SomeDirectory\\SomeUnsafeProgram.exe")

running under the system context (As Administrator!!) of windows.

boo yaa!

Wednesday, March 18, 2009

this is a blog post using w.bloggar http://wbloggar.com/download.php

A quick way of entering blog entries.

chris

Tuesday, March 17, 2009

converting unix date to excel date

been bugged by this for while - on unix the date timestamp is number of seconds since 1/1/1970
On excel, it's 1/1/1900
So to convert the unix timestamp to microsoft excel, use the formula:
=timestamp/86400 + "1/1/1970"
(where 86400 = 24 * 60* 60 ie: # seconds in a day).
Oh you might also want to add/subtract an offset for the timezone (depending on the timezone settings of your unix box). eg: for +10 GMT (sydney, melbourne, canberra) add 10/24 ie: 0.416667

ps: make the cell format Date or Time or Custom format.
Personally I prefer ddd dd/mm/yyyy HH:mm:ss (ie: Tue 03/03/1999 23:59:43)

Sunday, March 15, 2009

2008 SOA magazine readers choice

I'm personally a bit dubious about the readers choice result from SOA magazine ( http://soa.sys-con.com ) since it gives very high rankings to IBM websphere software.

Some make sense and some don't.
Best App server:
  1. IBM websphere (yeah, huge number of commercial, plus ambigous since this includes WASCE and probably Apache Geronimo)
  2. Glassfish (big push from SUN)
  3. Weblogic (ol' favorite, but Oracle owns this now and god knows how they market it)
  4. WSO2 (** weird?? Where did this come from? Maybe manipulation?)
  5. JBoss (huh, would have thought this near #2 or #4)
Best IDE
  1. NetBeans (assuming 6.1, which is excellent)
  2. Rational Application Developer (eclipse)
  3. Oracle JDeveloper (not eclipse)
What's weird is where are all the other Eclipse-oid based IDE's?

Best Integration Server
  1. Websphere Integration Developer
  2. Fiorano ESB
  3. Java CAPS (glassfish++)
Agree with IBM being the big gorilla here. What's surprising is the gain of Sun servers, which traditionally are a pile of dog sh*t (since Sun never seemed to understand the enterprise and hence the dogs breakfast of J2EE 1.3/1.4)

Best Opensource SOA
  1. WASCE (does this include Apache Geronimo??)
  2. Sun openESB
  3. SoapUI
Since where was WASCE SOA? This is yet another Java EE server. Also what the heck is SoapUI doing here? This is just a test/development IDE (although as a JNLP java applet)

Best Portal
  1. IBM Websphere Portal
  2. Sun Portal
  3. Weblogic Portal 10.2
Yeah yea, Websphere blah blah. IBM must have stacked the whole review with their internal staff. or fanboys. Still surprising Sun is in the list. Maybe they gave staff a couple of hours to fill the survey too :-)



Best Security
  1. IBM Datapower XML security gateway XS40
  2. Sun access manager/open SSO
  3. oracle web services management
  4. Metro
No surprises about IBM, Datapower is a damned good appliance. IBM liked it so much they bought the company. Big surprise to see Sun in there twice (#2 and #4). Though metro is actually quite good.

Best SOA platform
  1. IBM Websphere
  2. Fiorano SOA
  3. Sun Java CAPS
IBM, IBM, IBM, IBM. Sigh, this report is so biased it's getting tedious.

Best SOA Testing tool
  1. Rational Tester for SOA
  2. SoapUI
Ditto. Though rational is pretty good, SoapUI is a hell of a lot more lightweight, yet pays it's way (the community edition is free :-). Could do with more test management though.

Best SOA Tool
  1. Fiorano ESB
  2. Sun Java CAPS
  3. Rational Software Architect
  4. Rational Team concert
What, IBM *NOT* at the top? Someone at IBM messed up (and probably got forced to move to Bangaldore as punishment).
It's a bit weird to mix development tools (#3 RSA & #4 Rational Team) with servers (#1, #2). Maybe that's why IBM got pushed down, staff got confused..

Best SOA training site
  1. IBM SOA Sandbox
  2. SOA Training Curriculum (MomentumSI)
IBM SOA Sandbox is great, so this choice actually makes sense.

Best SOA Book
  1. IBM"The New Language of Business: SOA & Web 2.0"
  2. Amberpoint et al An Implementorメs Guide to SOA ヨ Getting it Right
  3. IONA Understanding SOA with Web Services
All vendor "books". Basically a "white" paper advertorial disguised as a book.

Best SOA or XML Site:
  1. IBM's SOA Microsite
  2. www.fiorano.com
Yeah they are ok. What about non-vendor stuff.

Con-clusion:

sys-con SOAWorld magazine tries to be a vendor neutral but they need some mechanism to do a real unbiased report. Maybe if Gartner or any of the reputable firms would run the survey I would be less skeptical.




Thursday, February 26, 2009

Do's and don'ts with babies :: Hilarious pics

Do's and don'ts with babies :: Hilarious pics

Made me cry with laughter. Though I didn't see what's wrong with the last 2 ones..

Tuesday, October 21, 2008

Dustin's Software Development Cogitations and Speculations: Standardization: The Dangerous Relationship for Open Source

An interesting post about how standardisation can destroy open source software
eg: xdoclet eg: log4j

Dustin's Software Development Cogitations and Speculations: Standardization: The Dangerous Relationship for Open Source

The main factor of course with open source is the commitment of the developers, supporters, vendors and community of users. Like every fad, they can come and go really quickly....

FUD rulez!

Sunday, October 19, 2008

Aarne-Thompson classification system - Wikipedia, the free encyclopedia

Good grief. As kids we used to joke about how movies all seemed to follow basic plotlines.
So star wars was standard plot 5 & 17 with subplots 3 with twist 8.

Well... at the turn of last century, Aarne & Thompson developed the Aarne-Thompson classification system for classifying folktales!!


Good grief I say!
After all, the classic stories about clever foxes is "The Clever Fox (Other Animal) 1–69"

or how about Realistic Tales (Novelle) : "The Man Marries the Princess 850–869"

omg. Now for a phD for my classification system for movies and tv plots. .

mmm

nice.

Thursday, October 16, 2008

most popular programming language

Well it seems Java is still #1 for programming languages according to the TIOBE Software: Tiobe Index October 08 edition

The rest are:

Oct 2008
Position
Oct 2007
Delta in PositionProgramming LanguageRatings
Oct 2008
Delta
Oct 2007
Status
1 1 Java 20.949% -0.67% A
2 2 C 15.565% +0.97% A
3 4 C++ 10.954% +1.37% A
4 3 (Visual) Basic 9.811% -1.35% A
5 5 PHP 8.612% -0.89% A
6 8 Python 4.565% +1.13% A
7 6 Perl 4.419% -0.93% A
8 7 C# 3.767% +0.03% A
9 13 Delphi 3.288% +1.75% A
10 10 Ruby 2.860% +0.47% A
11 9 JavaScript 2.670% -0.01% A
12 12 D 1.333% -0.26% A
13 11 PL/SQL 1.024% -0.94% A-
14 14 SAS 0.600% -0.78% B
15 17 Lua 0.551% -0.04% B
16 21 Pascal 0.520% +0.10% B
17 22 ActionScript 0.506% +0.14% B
18 16 COBOL 0.491% -0.19% B
19 18 Lisp/Scheme 0.485% -0.09% B
20 15 ABAP 0.445% -0.40% B
What's happened to ABAP (SAP)??