Recent Notes

Displaying keyword search results 1 - 10
Created by Fang on March 30, 2012 12:15:49    Last update: March 30, 2012 12:15:49
1. mvc:default-servlet-handler Configures a handler for serving static resources by forwarding to the Servlet container's default Servlet. Use of this handler allows using a "/" mapping with the DispatcherServlet while still utilizing the Servlet container to serve static resources. HandlerMapping: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Handler: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Attribute Description default-servlet-name The name of the default Servlet to forward to for static resource requests. The handler will try to auto-detect the container's default Servlet at startup time using a list of known names. If the default Servlet cannot be detected because of using an unknown container or because it has been manually configured, the servlet name must be set explicitly. 2. mvc:view-controller Defines a simple Controller that selects a view to render the response. HandlerMapping: org.springframework.web.servlet.handler.SimpleUrlHandlerMapping Handler: org.springframework.web.servlet.mvc.ParameterizableViewController Attribute Description...
Created by Fang on January 31, 2012 16:27:39    Last update: January 31, 2012 16:27:39
Because Maven dependencies are transitive, the same artifact may be brought in with different version numbers by multiple other dependencies. For example, the current project may depend on artifact A, which in turn depends on artifact C version 1. It may also have immediate dependency on artifact B, which in turn depends on artifact C version 2. Maven resolves these version conflicts in the following ways: Dependency Mediation : If a specific version is not declared in your project POM, Maven resolves the version number by nearest definition , which means it will use the closest dependency in the tree of dependencies for the current project. When dependency depth is the same, it will pick the one that appeared in the POM first. Dependency Management...
Created by Fang on January 04, 2012 09:54:05    Last update: January 04, 2012 09:54:05
There are two ways to validate a form with JSF: jsf validation on the page with <f:validate...> tags (for example: <f:validateLength> , <f:validateRegex> , etc.), or JSR303 bean validation. This note is about how to customize messages for JSR303 bean validation. The validation message is specified in the message attribute for each validation annotation type. The mesage attribute is not a literal string, but a string that is interpolated in various ways. For example, the default validation message for AssertFalse is {javax.validation.constraints.AssertFalse.message} , which is replaced with the corresponding string in ValidationMessages.properties (or ValidationMessages_tr.properties , ValidationMessages_es.properties , depending on the locale). This is the contents of ValidationMessages.properties in the hibernate validator reference implementation: javax.validation.constraints.AssertFalse.message =... To customize the messages, just provide the new value in...
Created by freyo on September 15, 2011 20:29:22    Last update: September 21, 2011 13:16:36
Usually network connectivity can be tested with ping and telnet . Android adb shell has ping but no telnet . But it has nc , which can be used in place of telnet . # nc -z -v www.google.com 80 DNS fwd/rev mismat...
Created by magnum on September 11, 2011 19:46:09    Last update: September 11, 2011 19:46:09
A pair of C functions convert between an Internet address and a string (ASCII): #include <arpa/inet.h> /* * Returns a poin... However , these functions do not support IPv6. The new pair is: #include <arpa/inet.h> /* Convert a Internet ad... Examples: #include <sys/socket.h> #include <netinet/in.h>...
Created by freyo on August 25, 2011 09:07:40    Last update: August 25, 2011 20:45:43
This is a list of built-in Android permission values: Permission Description Since API Level android.permission.ACCESS_CHECKIN_PROPERTIES Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded. 1 android.permission.ACCESS_COARSE_LOCATION Allows an application to access coarse (e.g., Cell-ID, WiFi) location 1 android.permission.ACCESS_FINE_LOCATION Allows an application to access fine (e.g., GPS) location 1 android.permission.ACCESS_LOCATION_EXTRA_COMMANDS Allows an application to access extra location provider commands 1 android.permission.ACCESS_MOCK_LOCATION Allows an application to create mock location providers for testing 1 android.permission.ACCESS_NETWORK_STATE Allows applications to access information about networks 1 android.permission.ACCESS_SURFACE_FLINGER Allows an application to use SurfaceFlinger's low level features 1 android.permission.ACCESS_WIFI_STATE Allows applications to access information about Wi-Fi networks 1 android.permission.ACCOUNT_MANAGER Allows applications to call into AccountAuthenticators. Only the system can get this permission. 5 android.permission.AUTHENTICATE_ACCOUNTS...
Created by freyo on October 28, 2010 23:00:48    Last update: August 23, 2011 08:51:42
Running " adb shell procrank ": root@android:/ # procrank ... Column Name Meaning VSS Virtual Set Size: how much virtual memory associated with process RSS Resident Set Size: how much physical pages allocated for the process. Pages shared between processes are counted multiple times PSS Proportional Set Size. Take the RSS number but evenly distribute shared pages among the sharing processes. For example, if three processes are sharing 3MB, each process gets 1MB in PSS. USS Also known as Private Dirty, which is basically the amount of RAM inside the process that can not be paged to disk (it is not backed by the same data on disk), and is not shared with any other processes. Reference: How to discover memory usage of my application...
Created by woolf on July 05, 2011 15:38:52    Last update: July 05, 2011 15:39:55
By default VirtualBox enables one network adapter ("Adapter 1") with NAT. Connection from the guest OS to the outside world works natually when the guest network adapter is assigned an IP address by the VirtualBox DHCP server. Use VBoxManage to see a list of DHCP servers: $ VBoxManage list dhcpservers NetworkName: H... The guest IP address is not visible from the outside world. If you need to access a server on the guest OS, you need to set up port forwarding in VirtualBox settings: Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding . Beware that on Linux/Unix, port forwarding may not work if you bind to a privileged port (port number < 1024) but you are not root. Bridged networking can be...
Created by magnum on June 23, 2011 20:15:49    Last update: June 23, 2011 20:29:45
Linux services startup order in general: kernel runs /sbin/init /sbin/init reads /etc/inittab and runs script defined by this line: si::sysinit:/etc/init.d/rcS switches to runlevel defined by id:3:initdefault: which causes /etc/init.d/rc to be called with the current run level. /etc/init.d/rc calls the scripts under the /etc/rc <current_run_level> .d directory (symbolic links to actual scripts under /etc/init.d/ ) in this order: The KILL scripts first (scripts with name starting with K, i.e., rc?.d/Knn name ): "script_name stop" then, the START scripts (scripts with name starting with S, i.e., rc?.d/Snn name ): "script_name start" Within each group (KILL or START), run scripts from lower priority number (i.e., the nn in the symlink name) to higher priority number. The Upstart init daemon does not use /etc/inittab . Instead, it...
Created by jinx on May 16, 2011 20:55:53    Last update: May 16, 2011 20:55:53
The PHP break statement takes an optional level parameter, which indicates how many levels of loop structure to break out. Example code: <?php for ($i = 0; $i < 5; $i++) { for (... It's a fatal error if the level parameter exceeds the maximum number of enclosing loop structures. For example, " break 3; " in above code.
Previous  1 2 3 4 Next