Recent Notes
Displaying keyword search results 11 - 20
Created by Fang on August 10, 2010 21:37:36
Last update: October 25, 2010 20:18:47
The tags <fmt:formatNumber> Format a numeric value as number , currency or percentage - controlled by the type attribute (defaults to number if type is missing). Syntax:
<fmt:formatNumber value="numericValue" [type="... Attributes: Name Dynamic? Type Description value true String or Number Numeric value to be formatted. type true String Specifies whether the value is to be formatted as number, currency, or percentage. pattern true String Custom formatting pattern, must follow the pattern syntax specified by the class java.text.DecimalFormat . currencyCode true String ISO 4217 currency code. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. currencySymbol true String Currency symbol. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. It is used only when currencyCode is...
Created by Dr. Xi on September 10, 2010 22:53:42
Last update: September 10, 2010 22:54:06
The sort operation for a Python list sorts a list in place . It takes three optional arguments to control the comparisons:
s.sort([cmp[, key[, reverse]]]) cmp specifies a custom comparison function of two arguments (list items) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, or larger than the second argument: cmp=lambda x,y: cmp(x.lower(), y.lower()) . The default value is None . key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower . The default value is None . reverse is a boolean value. If set to True , then the list elements are sorted as if each comparison were reversed. Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC...
Created by voodoo on July 11, 2009 15:14:55
Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations.
It's really easy to see HTTP headers with curl:
C:\>curl --head http://www.google.com
HTTP/1.0 ...
or, headers and page together (dump headers to stdout):
$ curl --dump-header - http://www.google.com HTTP/...
Download openssl from openssl.org:
curl http://www.openssl.org/source/openssl-0.9.6m....
C:\>curl --help
Usage: curl [options...] <url>
...
Created by Fang on April 04, 2010 04:12:14
Last update: July 21, 2010 14:52:58
The tags <c:if> The <c:if> tag may be used with or without body content:
<!-- Without body content, used to export vari... In my opinion, the version without body content is pretty much useless (the <c:set> tag is a lot more meaningful for this purpose). If body content exists, it is inserted into the page if the testCondition is true . Optional attributes var and scope may be specified. If var is specified, a variable whose name is the value of var is exported to the associated scope ( pageScope if no scope is specified). The type of the exported variable is Boolean and its value is the value of the testCondition . <c:choose>, <c:when>, <c:otherwise> These tags imitate the Java control structure if...else...
Created by Fang on August 26, 2009 02:50:20
Last update: January 10, 2010 00:22:44
You can use the Maven archetype plugin to quickly start a new Maven project from scratch:
C:\work\maven>mvn archetype:generate
[INFO] S...
Created by Dr. Xi on January 07, 2010 20:02:00
Last update: January 07, 2010 20:07:19
If all you want is a quick way to format some numbers, a sample program speaks more words than the full documentation.
import java.text.DecimalFormat;
public clas...
Use String.format :
public class TestFormat {
public static voi...
Created by Dr. Xi on November 21, 2009 02:07:07
Last update: November 21, 2009 02:08:19
This is from Oracle 10g documentation . Data Lock Conversion Versus Lock Escalation [/size] A transaction holds exclusive row locks for all rows inserted, updated, or deleted within the transaction. Because row locks are acquired at the highest degree of restrictiveness, no lock conversion is required or performed. Oracle automatically converts a table lock of lower restrictiveness to one of higher restrictiveness as appropriate. For example, assume that a transaction uses a SELECT statement with the FOR UPDATE clause to lock rows of a table. As a result, it acquires the exclusive row locks and a row share table lock for the table. If the transaction later updates one or more of the locked rows, the row share table lock is automatically converted to a...
Created by Dr. Xi on October 30, 2008 03:39:50
Last update: October 30, 2008 03:40:51
-- define types
CREATE OR REPLACE TYPE pers...
Created by Dr. Xi on September 29, 2008 23:05:12
Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...
Created by Dr. Xi on May 30, 2007 03:29:51
Last update: May 30, 2007 03:29:51
Use the kill command to terminate a UNIX process. More precisely, the kill command sends a signal to the specified processes. There are 2 syntaxes:
kill -l
which displays the signal numbers and signal names.
kill -sigid pid ...
which sends signal sigid to the listed process ids (pid). If the sigid is omitted, SIGTERM (number 15) is sent. Process can ignore all signals except the KILL signal (number 9). Sending the KILL signal ensures a kill.