This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_login_addr(email): | |
main_addr = email.split('@')[-1] | |
if 'mail' in main_addr: return main_addr | |
else: return 'mail.' + main_addr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backspace %08 | |
tab %09 | |
linefeed %0A | |
creturn %0D | |
space %20 | |
! %21 | |
" %22 | |
# %23 | |
$ %24 | |
% %25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import string | |
RCV_LOG = r"/path/to/xxx.log" | |
def get_last_n_lines(logfile, n): | |
n = string.atoi(n) | |
blk_size_max = 4096 | |
n_lines = [] | |
with open(logfile, 'rb') as fp: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestFile { | |
public static void main(String[] args) { | |
System.out.println("yes,alex!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<s:set name="var" value="XXX" /> | |
<s:property value="{#var}" /> | |
<s:if test="%{#var == YYY}"> | |
</s:if> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<s:if test="%{keyword == ''}"> | |
<title><s:property value="keyword"/></title> | |
</s:if> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
OlderNewer