Recent Notes
Displaying keyword search results 91 - 100
Created by Dr. Xi on July 29, 2010 18:46:57
Last update: July 29, 2010 18:48:15
This is an example of using java.beans.XMLEncoder and java.beans.XMLDecoder to serialize/deserialize Java objects to XML. Java code TestXMLEncoder.java:
import java.io.*; import java.beans.XMLEncoder;... SimpleBean.java: public class SimpleBean { private String na... CompositeBean.java: public class CompositeBean { private Simple... NotABean.java: public class NotABean { private String name... Test Output By default, only Java beans can be serialized using XMLEncoder . Exception occurs when you try to deserialize an object which is not a Java bean. Errors actually occur when you try to serialize, but they are ignored. As a result, an XML file is generated by the serialization but the file is useless! Console output: C:\>java TestXMLEncoder Testing simple bean ... simplebean.xml: <?xml version="1.0" encoding="UTF-8"?> <java v... compositebean.xml: <?xml version="1.0" encoding="UTF-8"?> <java v... nodefault.xml: <?xml version="1.0" encoding="UTF-8"?> <java v......
Created by Dr. Xi on May 31, 2009 03:19:00
Last update: July 16, 2010 19:37:07
For old-style classes: BaseClassName.methodname(self, arguments)
>>> class A:
... def hello(self):
... ...
For new-style class (any class which inherits from object ): super(ClassName, self).method(args)
>>> class M(object):
... def hello(self):
...
Reference:
Things to Know About Python Super
Created by meiu on July 07, 2010 15:16:34
Last update: July 07, 2010 15:17:08
Example:
<%@ taglib prefix="fmt" uri="http://java.sun.com/j...
Full attributes:
Attribute Meaning
value Date object to be formatted
type Format time only ('time'), date only ('date'), or both date and time ('both')?
dateStyle Style to format date, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat)
timeStyle Style for format time, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat)
pattern User defined pattern, e.g., MM/dd/yyyy
timeZone Which time zone to display the date for?
var If the var attribute is specified, then a String value containing the formatted date is assigned to the named variable. Otherwise, the <fmt:formatDate> tag will write out the formatting results.
scope When the var attribute is present, the scope attribute specifies the scope of the resulting variable.
.
Created by magnum on June 23, 2010 22:24:01
Last update: June 23, 2010 22:24:01
Required:
Apache web server
mod_proxy_html
proxy_html.conf:
# Load mod_proxy_html required SOs
LoadFile /us...
httod.conf
# load proxy_html conf
Include conf/extra/proxy...
Created by James on June 22, 2010 21:09:20
Last update: June 22, 2010 21:10:14
Inside event handlers refer to the DOM element as this :
$('#theButton').click(function() {
this.inn...
Or, use the .get() method outside:
// return the whole list
$('li').get();
...
Created by James on June 22, 2010 19:09:07
Last update: June 22, 2010 19:09:50
The first form iterates over a jQuery object and executes a function for each matched element. This is an example from jQuery documentation:
<!DOCTYPE html>
<html>
<head>
<style>
...
The second form iterates over a general collection (examples from jQuery documentation):
$.each([52, 97], function(index, value) {
al...
Created by Dr. Xi on June 20, 2010 14:35:17
Last update: June 20, 2010 14:35:17
This XML signature validator comes from the Apache XML Security project. It validates the signature according to the core validation processing rules .
It does not verify that the key used to generate the signature is a trusted key. You can override the KeySelector class to make sure that the signing key is from a trusted store.
import javax.xml.crypto.*;
import javax.xml.cry...
Created by Fang on April 03, 2010 20:21:15
Last update: April 04, 2010 03:30:22
The tags <c:out> The <c:out> tag evaluates an expression and outputs the result on the page. The syntax is:
<c:out value="value" [escapeXml="{true|false}"] ... where escapeXml defaults to true and default defaults to empty string "". <c:out value="${expr}" escapeXml="false"/> is equivalent to ${expr} . If a variable is set in multiple scopes, the lower scope wins. In the following example code, attribute1 is set in request, session, and application scopes; attribute2 is set in session and application scopes; attribute3 is set in the application scope. The results are: <c:out value="${attribute1}"/> : Attribute1 request scope <c:out value="${attribute2}"/> : Attribute2 session scope <c:out value="${attribute3}"/> : Attribute3 application scope To access values in higher scopes, you have to specify the scope explicitly, like this: <c:out value="${sessionScope.attribute1}"/> : Attribute1 session...
Created by Dr. Xi on March 31, 2010 15:35:53
Last update: March 31, 2010 15:35:53
DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting.
Column Datatype Description
HOLDING_SESSION NUMBER Session holding a lock
SQL> select * from dba_blockers;
HOLDIN...
Created by James on March 16, 2010 16:55:51
Last update: March 16, 2010 19:29:28
I had this seemingly innocent code that did not work:
<html>
<body>
<script language="JavaScript"...
I fired up the Chrome JavaScript console and it told me that:
Uncaught TypeError: object is not a function .
When the name sameAsInputName appeared in the inline event handler, the browser thinks that it refers to the input field(s), not the JavaScript function!
It works as expected if you attach the event handler later:
<html>
<body>
<script language="JavaScript"...