Recent Notes

Displaying keyword search results 1 - 10
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 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 Fang on November 10, 2011 09:26:12    Last update: November 10, 2011 09:26:12
Syntax highlighted XML schema for JSF 2.0 Application Configuration Resource File ( faces-config.xml ). Almost 3000 lines! <?xml version="1.0" encoding="UTF-8"?> <xsd:sch...
Created by Dr. Xi on September 24, 2011 20:59:16    Last update: September 24, 2011 21:00:20
To import source from my-project into the svn repository: $ svn import my-project/ file:///home/drxi/work/sv... List the contents of the repository: $ svn ls file:///home/drxi/work/svn-repository/ ... List the contents of the newly imported project: $ svn ls file:///home/drxi/work/svn-repository/my-...
Created by freyo on September 09, 2011 11:43:36    Last update: September 09, 2011 11:45:45
When you run automated Android tests with Eclipse or from the command line, you get text output, which isn't good for reporting purposes. If you run a large set of test cases with automated build, the text report isn't very helpful. Fortunately, Android CTS generates test reports in XML with accompanying XSL to make it look nice in a browser. To run your own tests with Android CTS: Download Android CTS Make a new directory MyRepository under android-cts , alongside the existing repository directory. Copy host_config.xml from repository to MyRepository Create directory plans under MyRepository , add a test plan ( MyTests.xml ): <?xml version="1.0" encoding="UTF-8"?> <TestPla... Create directory testcases under MyRepository . Copy TestDeviceSetup.apk from repository/testcases to MyRepository/testcases Under MyRepository/testcases , create a test...
Created by freyo on August 31, 2011 15:49:54    Last update: August 31, 2011 15:49:54
Got this error while trying to build Android app: [apkbuilder] Creating AppInfo-debug-unaligned.ap... Solution: Delete the Android debug keystore: $ rm ~/.android/debug.keystore Build again: $ ant debug The new key is valid for 30 years (keystore password is 'android'): $ keytool -list -v -keystore ~/.android/debug.keys...
Created by alfa on July 01, 2011 12:48:36    Last update: July 01, 2011 12:48:36
The javadoc can generate JavaDoc either from a list of source files or a list of packages (or a combination of both). But the -sourcepath switch only works for package names. It does not work for source files! This works: javadoc /path/to/source/mypackage/*.java So does this (using package name): javadoc -sourcepath /path/to/source mypackage This does not work! javadoc -sourcepath /path/to/source mypackage/*.ja...
Created by freyo on April 01, 2011 14:29:25    Last update: June 29, 2011 13:58:27
Start the emulator ( create an AVD if none exists) $ tools/emulator -avd Simple8 Create new project $ tools/android create project \ > --package co... where " --target 2 " identifies the target platform as displayed by " tools/android list targets ", which is stored in the properties file default.properties in the project root folder. cd HelloWorld and install debug package onto the running emulator: $ ant install Buildfile: build.xml [set... Launch the Hello World application on the emulator. You'll see something like this: Edit res/values/string.xml , change the contents to: <?xml version="1.0" encoding="utf-8"?> <resourc... Edit res/layout/main.xml , change the contents to: <?xml version="1.0" encoding="utf-8"?> <LinearL... The contents of the text area now refer to a string defined in the resource file strings.xml , instead...
Created by Dr. Xi on June 21, 2011 15:54:00    Last update: June 22, 2011 11:33:09
Demo code for CSV parsing with SuperCSV parser . Java code: import java.io.*; import java.util.List; imp... Test with a simple CSV file: psmith01,CLASS2B,Peter Smith 1,YEAR2,1,N,ADVANCED,... The parser worked correctly: Line 1 has 11 values: |psmith01| |CLASS2B|... Test with a more complicated CSV file: "psmith01 abc", "CLASS2B " , " Peter... The parser messed up on all three lines: Line 1 has 5 values: |psmith01 abc| |CLASS... Using two lines input: "psmith01 abc", "CLASS2B " , " Peter... It generates an exception: Line 1 has 5 values: |psmith01 abc| |CLASS... Add a new line in item two: "One", "Two ", "Three" Result: Line 2 has 3 values: |One| |Two | |...
Created by freyo on May 16, 2011 13:05:57    Last update: May 16, 2011 13:07:18
The root URL is: http://android.git.kernel.org/ Built-in applications are projects named platform/packages/apps/<app_name>.git , for example, phone app is: platform/packages/apps/Phone.git , contacts app is: platform/packages/apps/Contacts.git . Android framework classes such as android.app.Activity , android.content.ContentProvider etc., are under the platform/frameworks/base.git project. By default, browsing displays the HEAD branch, to see a different branch, add hb parameter. Compare: http://android.git.kernel.org/?p=platform/build.git;a=tree;f=tools to: http://android.git.kernel.org/?p=platform/build.git;a=tree;f=tools;hb=refs/tags/android-2.2.1_r1 , you'll notice that dexpreopt is missing in the former. Use the tags action to display a list of tags for the current project. For example: http://android.git.kernel.org/?p=platform/build.git;a=tags . An incomplete parameter list (parameters are separated by a semicolon): p : project, for example, platform/build.git . a : action, for example, tree , summary , log etc. f : file name. hb : branch or tag name, for example:...
Previous  1 2 Next