Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on August 15, 2012 08:55:15    Last update: August 15, 2012 08:55:15
From Java JSSE documentation : The generic Java dynamic debug tracing support is accessed with the system property java.security.debug , while the JSSE-specific dynamic debug tracing support is accessed with the system property javax.net.debug . The javax.net.debug property value must specify either all or ssl , optionally followed by debug specifiers. Examples : To get a list of debugging options: java -Djavax.net.debug=help MyApp To view all debugging messages: java -Djavax.net.debug=all MyApp To view the hexadecimal dumps of each handshake message (the colons are optional): java -Djavax.net.debug=ssl:handshake:data MyApp To view the hexadecimal dumps of each handshake message, and to print trust manager tracing (the commas are optional): java -Djavax.net.debug=SSL,handshake,data,trustman... A detailed debugging example: Debugging SSL/TLS Connections
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 freyo on August 22, 2011 15:32:23    Last update: August 22, 2011 15:32:56
Find ports for emulator devices: $ adb devices List of devices attached emul... Telnet to emulator console: $ telnet localhost 5554 Trying 127.0.0.1... ... Use " sms send " to send a message: sms send 1234 'A test message' OK
Created by freyo on August 01, 2011 16:06:40    Last update: August 03, 2011 08:32:01
To list all installed packages: # pm list packages To list all disabled packages: # pm list packages -d pm help: # pm usage: pm [list|path|install|uninstall] ...
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 Dr. Xi on April 18, 2011 12:10:37    Last update: April 18, 2011 12:14:24
Python defines a long list of special methods to customize class behavior. This is a short list for the Basic Customizations . Method Description object.__new__(cls[, ...]) Called to create a new instance of class cls. __new__() is a static method (special-cased so you need not declare it as such) that takes the class of which an instance was requested as its first argument. __new__() is intended mainly to allow subclasses of immutable types (like int, str, or tuple) to customize instance creation. It is also commonly overridden in custom metaclasses in order to customize class creation. object.__init__(self[,...]) Called when the instance is created. The arguments are those passed to the class constructor expression. If a base class has an __init__() method, the derived class’s __init__()...
Created by Dr. Xi on October 16, 2008 20:45:40    Last update: March 28, 2011 20:23:22
Java's built-in classes are way too complex/flexible for a simple protocol like HTTP. This is a wrapper to simplify HTTP GET and POST. import java.io.*; import java.net.*; imp... A simple test: import java.io.*; import java.util.*; ...
Created by mak on March 02, 2011 15:50:56    Last update: March 02, 2011 15:50:56
Python list comprehension with if-else condition in general: new_list =[ (F, T) [boolean test] for x in old_lis... #!/usr/local/bin/python l = [ 1, 2, 3, 4 ] ...
Created by Dr. Xi on February 09, 2011 13:27:51    Last update: February 09, 2011 13:27:51
By the perldoc , use Module LIST; is exactly equivalent to: BEGIN { require Module; Module->import( LIST); } Because of the BEGIN block, use is executed immediately. Therefore, it is not suitable for lazy loading of modules at runtime. use does not work with a runtime variable: C:\>perl $cgi = "CGI"; require $cgi; prin... require works: C:\>perl $cgi = 'CGI'; require "${cgi}.pm"; ... Also, file extension is required if require is not passed a bareword: // this works require CGI; // so does th...
Created by Dr. Xi on February 03, 2011 13:47:22    Last update: February 03, 2011 13:47:22
Read a directory and sort files by modified date (oldest to newest): $dirname = "."; opendir(DIR, $dirname) or die $... Same, but with glob (note that the output is a bit different): $dirname = "."; @files = sort { -M $b <=> -M $... Switch the places of $a and $b to order from newest to oldest.
Previous  1 2 Next