Recent Notes
Displaying keyword search results 21 - 30
Created by Fang on March 06, 2012 12:25:33
Last update: March 06, 2012 12:25:33
In the bean validation API javadoc, for every constraint annotation, there's a corresponding .List annotation. For example, for @NotNull , there's @NotNull.List , for which JavaDoc says: Defines several @NotNull annotations on the same element What would you accomplish with multiple @NotNull annotations that you cannot accomplish with one @NotNull ? This is a test to reveal some of the facts. Change the Person class to:
package com.example; public class Person { ... Add another JUnit test ( src/test/com/example/TestPersonWithList.java ): package com.example; import java.util.Itera... As the test shows, a Person bean can never be valid because we are requiring that name must begin with Mr and Ms . One might think that the same can be accomplished by simply repeating the @Pattern annotation multiple times,...
Created by Dr. Xi on March 01, 2012 10:17:51
Last update: March 01, 2012 10:17:51
svn does not automatically substitute keywords like $Id$ . To enable keyword substitution, you have to enable it with propset :
$ svn propset svn:keywords "Id" README.txt
To enable keyword substitution for all files:
$ svn propset -R svn:keywords "Id" .
The above examples enabled substitution for $Id$ only. Each keyword must be explicitly listed to be substituted. The keywords recognized by svn are:
svn:keywords - Keywords to be expanded. Val...
To list properties on a file:
$ svn proplist README.txt
Properties on 'README...
To see the svn:keywords for a file:
$ svn propget svn:keywords README.txt
Id
Created by Dr. Xi on May 02, 2011 15:59:37
Last update: February 25, 2012 09:16:37
This code snippet gets the default keystore used by the Java keytool and displays the list of aliases along with the key type (certificate or private key).
import java.io.File;
import java.io.FileInputSt...
The default keystore used by the above code is: $HOME/.keystore .
Created by voodoo on February 18, 2012 13:20:50
Last update: February 18, 2012 13:20:50
A detailed tutorial on iptables: Linux Packet Filtering and iptables
" This document was simply written to give everyone a good and simple primer at how to get started with iptables, but at the same time it was created to be as complete as possible. It does not contain any targets or matches that are in patch-o-matic for the simple reason that it would require too much effort to keep such a list updated. If you need information about the patch-o-matic updates, you should read the info that comes with it in patch-o-matic as well as the other documentations available on the Netfilter main page. "
Created by voodoo on February 16, 2012 14:57:35
Last update: February 16, 2012 14:57:35
You can use either declare or typeset to list function definitions :
To list all function names:
declare -F
To display a function definition:
$ declare -f quote
quote ()
{
echo ...
If you see a lot of functions with names starting with the underscore ( _ ) and wonder where they come from, they are created by the scripts in /etc/bash_completion.d/ .
Created by zhidao on January 25, 2012 19:27:53
Last update: January 25, 2012 19:28:47
The spring MVC annotation-driven declaration:
<?xml version="1.0" encoding="UTF-8"?> <beans x... does the following magic : Among others, registers: RequestMappingHandlerMapping RequestMappingHandlerAdapter ExceptionHandlerExceptionResolver in support of processing requests with annotated controller methods using annotations such as @RequestMapping , @ExceptionHandler , etc. Enables Spring 3 style type conversion through a ConversionService instance in addition to the JavaBeans PropertyEditors used for Data Binding. Enables support for formatting Number fields using the @NumberFormat annotation through the ConversionService . Enables support for formatting Date, Calendar, Long, and Joda Time fields using the @DateTimeFormat annotation, if Joda Time 1.3 or higher is present on the classpath. Enables support for validating @Controller inputs with @Valid , if a JSR-303 Provider is present on the classpath. Enables HttpMessageConverter support for @RequestBody method parameters and...
Created by zhidao on January 02, 2012 15:17:43
Last update: January 03, 2012 07:18:15
SCIM is needed to input Chinese in Ubuntu.
Install the needed packages:
$ sudo apt-get install scim-qtimm im-switch scim-p...
Goto "System Settings": click the "gear" icon at top right corner and select "System Settings..."
Click "Language Support"
Select scim for "Keyboard input method system"
Log out and log back in.
Switch between input methods with CTRL+Space
A list of available input methods is available from: http://www.scim-im.org/projects/imengines
Created by nogeek on December 30, 2011 13:25:28
Last update: December 30, 2011 13:57:37
By default, tomcat uses an enhanced java.util.logging implementation called JULI, which can be configured at two different levels: Globally, with the ${catalina.base}/conf/logging.properties file. Per web application, with WEB-INF/classes/logging.properties . The configuration file is a normal Java properties file: Logging handlers are specified with the handlers property.
handlers = 1catalina.org.apache.juli.FileHandler, ... The root logger can define its set of handlers using the .handlers property. .handlers = 1catalina.org.apache.juli.FileHandler,... A prefix may be added to handler names. The prefix starts with a digit and ends with a dot ( . ), for example: # 1catalina. is a prefix 1catalina.org.apache.j... System property replacement is performed for property values which contain ${systemPropertyName} . Each handler can have its own specific properties: 3manager.org.apache.juli.FileHandler.level = FINE ... Loggers can define their own...
Created by woolf on December 29, 2011 11:18:11
Last update: December 29, 2011 11:18:11
Use the expand command to extract files from a .cab file:
expand [-r] source [destination] [-d source.cab ... Option Description [-r] Renames expanded files. [destination] Specifies where files are to be expanded. If source is multiple files and -r is not specified, destination must be a directory. destination can consist of a drive letter and colon, a directory name, a file name, or a combination of any of these. [-d source.cab] Displays a list of files in the source location. Does not expand or extract the files. [-f:files] Specifies the files in a cabinet (.cab) file that you intend to expand. You can use wildcards (* and ?). source.cab Specifies the files to expand. source can consist of a drive letter and colon, a directory...
Created by Dr. Xi on December 07, 2011 13:51:13
Last update: December 07, 2011 13:51:13
To list all changed files under the current directory:
$ svn st
To list all changed files since revision 732:
$ svn diff -r 732:HEAD --summarize
To list all changed files since Dec 07, 2011:
$ svn diff -r {'2011-12-07'}:HEAD --summarize
To list all files changed after Dec 07, 2011 4:00pm:
$ svn diff -r {'2011-12-07 16:00:00'}:HEAD --summa...
To list all files changed since Dec 07, 2011 under the directory src :
$ svn diff src -r {'2011-12-07'}:HEAD --summarize