java log add function
#dd_traces.pl (C) Marko Kivij?rvi 2006
# Dummy checks
die "Specify an input file!\n" if $ARGV[0] eq "";
die "File not found!\n" unless -e $ARGV[0];
die "Incorrect file extension for a C/C++ file!\n"
if ( $ARGV[0] !~ /(.*)\.(java)$/ );
# Constants
my $IMPORT_LOG_PACKAG = "\nimport android.util.Log;";
my $TAG;
if( $ARGV[0] !~ /BaseAdapter\.java/ && $ARGV[0] !~ /View\.java/) {
$TAG="SWIFTTAG";
}
else {
$TAG="SWIFTBASETAG";
}
# Parse output filename from the input filename
my $file = $ARGV[0];
my $origFile = $1."-orig.".$2;
#system( "cp $file $origFile" );
# Reset the input record separator (newline) so the entire file is read at once
undef $/;
# Read the input file
$_ = <>; # All there
# Adds a tracer macro after each function definition
s/
package #package
\s+
[^{;\/(\s]*\.[^{;\/(\s]* # package name
;
/
AddLogImport(tiny_mce_markeramp;) # Print the match and add the macro
/gxe; # g = repeat, x = split regex to multiple lines, e = evaluate substitution
s/
(public|private|protected)? #api property type
(\s+)?
(abstract)?
(\s+)?
class # Possible function return type
\s+ # One or more empty spaces
(\b\w+?) &n
Ïà¹ØÎĵµ£º
String str = "ÖÐ";
String str1 = new String(str.getBytes("gbk"), "ISO8859-1");
String str2 = new String(str1.getBytes("ISO8859-1"), "gbk");
System.out.println(str2); //Êä³ö"ÖÐ" ......
¿ÉÄÜÓкܶàѧϰJavaµÄÅóÓÑ»¹²»ÖªµÀJavaµÄÔËÐÐÔÀí¡¢JavaÐéÄâ»úÊÇÔõô¹¤×÷µÄ£¬±¾ÎĽ«ÎªÄãÏêϸ½²½â(JVM)Java ÐéÄâ»ú¡£
¡¡¡¡ÔÚJavaÖÐÒýÈëÁËÐéÄâ»úµÄ¸ÅÄ¼´ÔÚ»úÆ÷ºÍ±àÒë³ÌÐòÖ®¼ä¼ÓÈëÁËÒ»²ã³éÏóµÄÐéÄâµÄ»úÆ÷¡£Õą̂ÐéÄâµÄ»úÆ÷ÔÚÈÎºÎÆ½Ì¨É϶¼Ìṩ¸ø±àÒë³ÌÐòÒ»¸öµÄ¹²Í¬µÄ½Ó¿Ú¡£±àÒë³ ......
ÔÚĿǰµÄ¹ØÓÚjava×ÔѧµÄÌÖÂÛÖУ¬×î¾³£¿´µ½µÄ¾ÍÊÇ×êÑС¶Thinking in java¡·(TIJ)µÄ¾Ñ飬µ«ÊÇ£¬¾¡¹ÜʹÓÃTIJ×÷Ϊ½Ìѧ²ÄÁϵĽÌѧÐÐΪҲºÜ¶à£¬ÎÒÈ´ÉÐδ·¢ÏÖÓдӽÌʦ¹ØÓÚÈçºÎ½«TIJÓÃÓÚ½ÌѧµÄÂÛÊö¡£Îª´Ë£¬ÎÒȨ×÷Å×שÒýÓñ¡£
Ê×ÏÈ£¬ÎªÊ²Ã´ÒªÑ§Ï°java£¿°´ÕÕEckelµÄ»°Ëµ£¬ ......
keytool -genkey -dname "CN=demo, OU=softDept, O=company,
L=puddong,S=shanghai, C=cn" -alias demo -keyalg RSA -keysize 1024
-keystore demoKeystore -validity 3650 -storepass storePwd -keypass
demoPwd
Éú³É±£´æ¹«Ô¿ºÍ˽ԿµÄÃÜÔ¿²Ö¿â£¬±£´æÔÚdemoKeystoreÎļþÖС£ÕâÀïstorepass ......