defall_index(l,o):deffind_index(l,o,start=0):try:index=l.index(o,start)except:index=-1returnindexindexs=[]i=0whileTrue:idx=find_index(l,o,i)ifidx==-1:...
分类:
编程语言 时间:
2014-09-25 21:59:47
阅读次数:
212
package src;
public class Main {
public static void main(String args[]){
String chinese = "中文 is english";
int clenth = 0;
try{
clenth = chinese.getBytes("gbk").length;
}catch(Exc...
分类:
编程语言 时间:
2014-09-25 18:35:57
阅读次数:
230
public byte[] base64ToByte(String strBase64){ if(strBase64==null)return null; byte[] bytes = null; try { BASE64Decoder dec = ne...
分类:
其他好文 时间:
2014-09-25 14:04:28
阅读次数:
205
连接数据库步骤: a. 用java程序与db建立一个连接(通道) b。根据连接获取一个执行sql语句的对象 c。执行sql语句 d。关闭连接public class Main { public static void main(String[] args) { try { ...
分类:
数据库 时间:
2014-09-25 12:58:29
阅读次数:
172
1 #!/usr/bin/env python2 #coding=utf-83 import traceback 4 5 try:6 1/07 except Exception, e:8 print e9 print traceback.format_exc()
分类:
编程语言 时间:
2014-09-25 12:50:28
阅读次数:
194
public String readTxtFile(String filePath) { StringBuffer appInfolistInput = new StringBuffer(); try { String encoding = "UTF8"; File file = new...
分类:
编程语言 时间:
2014-09-25 11:54:18
阅读次数:
147
package cn.sql.sqlconn;public class Util { public Util(){ try { Class.forName("com.mysql.jdbc.Driver"); } catch (C...
分类:
数据库 时间:
2014-09-24 22:15:07
阅读次数:
203
final int PAGE_SIZE = 4;int pageNo = 1;String strPageNo = request.getParameter("pageNo");if(strPageNo != null && !"".equals(strPageNo.trim())) { try ....
分类:
其他好文 时间:
2014-09-24 21:44:47
阅读次数:
193
public static void createFileToNewPath(InputStream inStream, String newPath) { try { int bytesum = 0; int byteread = 0; ...
分类:
编程语言 时间:
2014-09-24 19:30:27
阅读次数:
167
本文转载:http://www.cnblogs.com/LoveJenny/archive/2013/03/13/2956922.html看到try,finally ,有没有让你想到什么呢?,对了using 可以生成try-finallypublic class WaitCursor : IDisp...