昨天遇到一个问题,代码如下:private String getSessionId(HttpResponse response) { // TODO Auto-generated method stub Header[] allHeaders = response.get...
分类:
移动开发 时间:
2015-03-29 12:07:24
阅读次数:
131
守护线程/*
* Daemon线程,即守护线程
* 一般都在后台运行,为其他线程提供服务,不能单独存在
*/
public class Test08 {
public static void main(String[] args) {
MyThread8 t1 = new MyThread8("守护线程");
System.out.println("是守...
分类:
编程语言 时间:
2015-03-29 10:53:45
阅读次数:
148
想搞清楚这个问题的原因就是我无法把一个文本里的单词全部给找出来,因为接触C++的时候记得好像regex可以有好多个字符组成,这样就可以通过,。!和空格等标点来分割文本了,但是split的方法所接受的参数只有String类型的regex和int类型的limit,limit用来表示最多可以将字符串分成多少部分。后来通过在网上查找资料才知道原来String类型的regex可以由多部分组成,每个部分分别由 | 隔开,对于可能要出现的* + .等符号,可能需要 \\ 的转义,具体注意事项有以下几个部分:
1.首先 ....
分类:
编程语言 时间:
2015-03-29 10:53:16
阅读次数:
168
/**
* 第一个字母转大写
*/
import java.util.*;
public class acm2026 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext()) {
String str = in.next...
分类:
其他好文 时间:
2015-03-29 10:52:33
阅读次数:
105
题意:找出最长公共自序列,有一样长的取字典序小的。如果lcs长度为0,输出哭脸。
做法:在最长公共子序列基础上,每次dp的时候 判断下两个string的字典序大小。最长公共子序列的复杂度是100*100,字符串最长是100,O(10^6)。...
分类:
其他好文 时间:
2015-03-29 10:50:16
阅读次数:
160
read from excel matlabhttp://stackoverflow.com/questions/10781700/how-can-i-import-string-from-excel-into-matlab将读取的信息从string 转换为numbermatlab读取矩阵的某一行:...
分类:
其他好文 时间:
2015-03-29 10:47:22
阅读次数:
112
我们在上次学习到了 String.Join函数(http://blog.csdn.net/zhvsby/archive/2008/11/28/3404704.aspx),当中用到了String.SPlit函数,所以能够上网查了该函数的用法 例如以下:#中使用string.Split方法来切割字符串的...
分类:
其他好文 时间:
2015-03-29 10:45:04
阅读次数:
137
/*十六进制的转换要求: 1.从键盘输入数据(有输入提示) 2.用自定义方法增加: 对输入的数,进行8进制和2进制的转换。*/importjava.util.Scanner;publicclassArrayTest{ publicstaticvoidmain(String[]args){ System.out.print("请输入要转换为16进制的数字:"); Scannersc..
分类:
编程语言 时间:
2015-03-29 07:10:01
阅读次数:
203
一、method参数actionpackage com.pb.web.action;public class HourseAction { public String add(){ System.out.println("执行添加操作!"); return ...
分类:
其他好文 时间:
2015-03-29 01:49:47
阅读次数:
154
题目:Word Break
要求找到所有能够有字典中的词重组成目标串的结果
public class Solution {
public static List wordBreak(String s, Set dict) {
List dp[] = new ArrayList[s.length()+1];
dp[0] = new ArrayLi...
分类:
其他好文 时间:
2015-03-29 00:42:27
阅读次数:
150