Recent Notes
Displaying keyword search results 1 - 3
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 Dr. Xi on January 08, 2011 15:06:17
Last update: January 08, 2011 15:06:17
For Python regular expression (regex) the groups method returns a tuple containing all sub-groups of the match, from group 1 to the last. The number of groups returned is determined by the regex, not the actual matching action. Optional groups are returned as None if not present in the match (unless a default value is provided to the groups method). So there's no need to count the number of groups matched (you know it when you write the regex).
In the following I try to match a phone number where the area code is optional, the number of groups matched is always 2:
>>> m = re.search('(\d\d\d)?(\d\d\d-?\d\d\d\d)', '...
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>
...