易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

java编码2

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生成背景透明的png图片
最近用到Java动态生成背景透明的图片功能,从gif和png中选择了png格式,个中缘由就不说了,于是动手到网上搜索有用的代码。现把搜索结果总结如下:
1. 生成png图片
int width = 400;
int height = 300;
// 创建BufferedImage对象
BufferedImage&nb ......

java zip 解压缩

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.logging.Logger; ......

java中的内存分配机制

Java把内存划分成两种:一种是栈内存,一种是堆内存。   
   在函数中定义的一些基本类型的变量和对象的引用变量都在函数的栈内存中分配。   
   当在一段代码块定义一个变量时,Java就在栈中为这个变量分配内存空间,当超过变量的作用域后,Java会自动释放掉为该变量 ......

Java中的常量


 
Java
中的常量
常量就是程序里持续不变的值,它是不能改变的数据。
Java
中的常量包含整型常量、浮点数常量、布尔常量等,下面来看一下它们是如何表示的:
整型常量
整型常量可以分为十进制
、十六进制
和八进制

十进制

0 1 2 3 4 5 6 7 8 9
注意
:以十进制表示时,第一位不能是
0
(数字 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号