Skip to content

Instantly share code, notes, and snippets.

@alexzhan
alexzhan / bash delete file with size 0
Created October 30, 2010 02:05
bash delete file with size 0
%to just find them and printout:
find . -maxdepth 1 -name '[!.]*' -size 0 -printf 'Name: %16f Size: %6s\n'
%delete them, may be modified to use
find . -maxdepth 1 -name '[!.]*' -size 0 -printf 'Name: %16f Size: %6s\n' | xargs rm
http://content.hccfl.edu/pollock/unix/findcmd.htm
@alexzhan
alexzhan / gist:653403
Created October 29, 2010 12:00
one small bash
for i in *.jpg ;do chmod 777 $i; done
http://bbs2.chinaunix.net/archiver/tid-1526292.html
2 不能用来修饰interface的有()
A private B public C protected D static
3 下列正确的有()
A call by value 不会改变实际参数的数值 B call by reference 能改变实际参数的引用地址
C call by reference不能呢个改变实际参数的引用地址 D call by reference不会改变实际参数的内容
7 怎样让jvm自动开始垃圾回收过程?
A 不能
C 调用System.gc();
8 如下代码运行结果是:
public class Main implements Runnable {
<s:if test="%{keyword == ''}">
<title><s:property value="keyword"/></title>
</s:if>
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Date;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date;
public class YangInitial {
//setter and getter of pagination and currentPage is ignored
private List<Integer> pagination = new ArrayList<Integer>();
int up = (currentPage / 20 + 1) * 20 + currentPage % 20 + 1 -10;
int down = (currentPage / 20) * 20 + currentPage % 20 - 10;
for( int i = down; i < up; i ++){
if(i >= 1)
pagination.add(i);
}
<s:set name="var" value="XXX" />
<s:property value="{#var}" />
<s:if test="%{#var == YYY}">
</s:if>
public class TestFile {
public static void main(String[] args) {
System.out.println("yes,alex!");
}
}