Recent Notes
Displaying keyword search results 1 - 9
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 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 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 Dr. Xi on June 27, 2011 15:49:00
Last update: June 28, 2011 11:13:35
You should drop the generics notation when looking up a method by signature:
import java.util.*;
import java.lang.reflect.Me...
In fact, Class.forName("java.util.List<java.lang.String>") fails with ClassNotFoundException !
However, all information about parameterized types are not lost at runtime. The Java reflection API does provide these methods to get information about parameterized types at runtime:
Method.getGenericExceptionTypes
Method.getGenericParameterTypes
Method.getGenericReturnType
for which the non-generic counterparts are:
Method.getExceptionTypes
Method.getParameterTypes
Method.getReturnType
Created by alfa on June 02, 2011 15:49:26
Last update: June 02, 2011 15:51:08
Facts:
Dynamic proxy classes are generated by the Java runtime, from a list of interfaces given by the user.
The generated proxy class implements all interfaces given by the user.
The dynamic proxy class is not synthetic .
The dynamic proxy class is useless without a user supplied InvocationHandler class, since there's only one constructor for the proxy class and it takes a InvocationHandler as parameter.
Example code:
import java.lang.reflect.Constructor;
import ja...
Output:
Class: $Proxy0
isSynthetic: false
Constructo...
Created by Dr. Xi on April 20, 2011 21:44:15
Last update: May 02, 2011 20:56:58
The String.format() method provides versatile formatting capabilities. This tutorial tries to present these capabilities in a accessible manner. The format string A format string can contain zero, one, or more format specifiers . The general form of a format specifier is:
%[argument_index$] [flags] [width] [.precision]co... where things in square brackets are optional, and conversion is a character indicating the conversion to be applied to the corresponding variable value. The only required characters in the format specifier is the percent sign % and the conversion character. A simple example: public static void simpleFormat() { System.out... The Argument index The argument index is specified by a number, terminated by the dollar sign $ . The same argument may be repeated multiple times in a format string. Unindexed...
Created by magnum on August 19, 2010 22:42:26
Last update: August 19, 2010 22:43:59
Lyx wasn't able to open DVI files with the error message MIME type application/x-dvi not supported. I looked at Lyx preferences and it's using xdg-open to open the file. The following query shows that the default application for the DVI mime type is Evince. So I updated that to xdvi , which I do have.
$ xdg-mime query default application/x-dvi
...
But it didn't work! I checked that the file ~/.local/share/applications/defaults.list did get updated. I even logged out and logged back in!
I had to update the system wide configuration file /usr/share/applications/defaults.list to make it work:
#application/x-dvi=evince.desktop
applicati...
Created by Dr. Xi on June 20, 2010 14:35:17
Last update: June 20, 2010 14:35:17
This XML signature validator comes from the Apache XML Security project. It validates the signature according to the core validation processing rules .
It does not verify that the key used to generate the signature is a trusted key. You can override the KeySelector class to make sure that the signing key is from a trusted store.
import javax.xml.crypto.*;
import javax.xml.cry...
Created by Dr. Xi on August 15, 2009 18:38:49
Last update: August 15, 2009 18:38:49
This comes from the Oracle Database Security Guide. View Description DBA_COL_PRIVS ALL_COL_PRIVS USER_COL_PRIVS DBA view describes all column object grants in the database. ALL view describes all column object grants for which the current user or PUBLIC is the object owner, grantor, or grantee. USER view describes column object grants for which the current user is the object owner, grantor, or grantee. ALL_COL_PRIVS_MADE USER_COL_PRIVS_MADE ALL view lists column object grants for which the current user is object owner or grantor. USER view describes column object grants for which the current user is the grantor. ALL_COL_PRIVS_RECD USER_COL_PRIVS_RECD ALL view describes column object grants for which the current user or PUBLIC is the grantee. USER view describes column object grants for which the current user is the...