Tuesday, December 16, 2008
Perl programmers
Thursday, October 30, 2008
Everyone is fit to drive a bike now
HANOI, Vietnam — Faced with mounting public criticism, Vietnam's Health Ministry suspended a widely ridiculed plan to ban short, thin and small-chested drivers.
The ministry had recommended that people whose chests measure less than 28 inches be prohibited from driving motorbikes _ as well as those who are too short (less than 4 -foot-8) or too thin (less than 88 pounds).
When the media revealed the plan this week, it prompted disbelief and scorn among members of the public, who envisioned the police pulling over female drivers to measure their breasts.
Thursday's state-run Tuoi Tre newspaper quoted ministry official Nguyen Huy Quang as saying the proposal would be suspended.
Copyright 2008 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.
Tuesday, October 28, 2008
Monday, October 27, 2008
Sunday, September 28, 2008
Feeling Homesick
"Vietnam offers some of the most charming tropical scenery in the world. The mist rising from the land against the morning sky is resplendent. The lush mountains and gorges and verdant valleys and endless rivers create a colorful landscape. A coast line that stretches for hundreds of miles along the South China Sea makes it a marvel of geography."
Wonder if this is a case of 'opportunities missed are opportunities gain'.
Sunday, September 7, 2008
Oracle8 and INNER JOIN
All the more reason to move to Oracle9i. Especially since Oracle did announce End of Life for 8i.
Monday, September 1, 2008
XStream and Dynamic Proxies
public interface MyObjectInterface { void doSomething(); }
public class MyObjectBase { public void intialize() {} }
public class MyObjectImpl extends MyObjectBase implements MyObjectInterface {
public void doSomething() {}
}
The solution is to clone DynamicProxyConverter.java and replace the last line of code in the unmarshall() method:
return Proxy.newProxyInstance(classLoader, interfacesAsArray, handler);
With
return newProxyInstance(superClass, interfacesAsArray, handler);
Where newProxyInstance is a method which utilized javaassist package to create the proxy instance in the cloned DynamicProxyConverter:
private Object newProxyInstance(Class superClass, Class[] interfaces, InvocationHandler handler)
{
ProxyFactory factory = new ProxyFactory();
if (superClass != null) {
factory.setSuperclass(superClass);
}
factory.setInterfaces(interfaces);
Class clazz = factory.createClass();
Object proxy = clazz.getConstructor().newInstance();
((ProxyObject) proxy).setHandler((MethodHanlder) handler);
return proxy;
}
For this to work, your InvocationHandler class should also need to implement MethodHandler interface, ie.
public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args)
throws Throwable
{
if (proceed == null) {
return invoke(self, thisMethod, args);
} else {
return proceed.invoke(self, args);
}
}
Sunday, August 31, 2008
XStream Deserialization
XStream xstream = XStream(new PureJavaReflectionProvider());
Cheap journalism
"The Governor of the US’s California State, Arnold Schawarzeneger, on August 28 sent a message of greetings to the Vietnamese Consul General in San Francisco, expressing his thanks for the Vietnamese community’s contributions to the state’s development."
Is Arnold losing it? What the fuck does the Vietnamese Consul General have anything to do with the Viet's contributions to the state of CA and how it's related to Vietnam's National Day celebration is out of grasp. Cheap, cheap journalism at its worst.