问题描述:
Given a string s and a dictionary of words
dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict =...
分类:
其他好文 时间:
2015-01-06 23:14:33
阅读次数:
229
在项目中遇到一处bug,调试的结果竟然是StringUtils.isNumeric(String str) 在捣鬼(采用的是org.apache.commons.lang.StringUtils),下面的代码是判断一个参数非空,且为整数:if(StringUtils.isNumeric(str) &...
分类:
其他好文 时间:
2015-01-06 22:56:54
阅读次数:
207
url代码:过程:1、创建url对象 2、打开一个url连接 3、设置get请求 4、设置连接超时时间 5、服务器返回码 6、取服务器返回的数据,以流的形式把数据返回 7、需要把inputStream 转换成string 这个操作是一个非常常用的操作 我把它抽成一个...
分类:
其他好文 时间:
2015-01-06 22:51:49
阅读次数:
315
procedure Add(var Result: string; P: PChar; Count: Integer); var ? Len: Integer; begin ? Len := Length(Result); ? SetLength(Result, Len + Count); ? Move(P^, Result[Len], Count); end;...
分类:
其他好文 时间:
2015-01-06 21:43:48
阅读次数:
156
在interface里面的变量默认都是public static final 的。所以可以直接省略修饰符:String param="ssm";//变量需要初始化为什么接口要规定成员变量必须是public static final的呢?答:首先接口是一种高度抽象的"模版",,而接口中的属性也就是’模...
分类:
其他好文 时间:
2015-01-06 21:20:56
阅读次数:
134
package Equals;public class IntegerEquals { public static void main(String[] args) { printLine(128); Integer a=128; Integer b=...
分类:
其他好文 时间:
2015-01-06 21:20:42
阅读次数:
215
很多资料只提到升迁到xe,而我们调用底版本c++开发的程序,是只能按Ansi操作的,所以需要反向转换。var s:PansiChar;s:=PansiChar(AnsiString('我我我我我'));这样就能转换过来了,如果没有AnsiString转换一下,那就只能取到第一个字符参考:http:/...
/** * 解压缩一个文件 * * @param zipFile * 压缩文件 * @param folderPath * 解压缩的目标目录 * @throws IOException * 当解压缩过程出错时抛出 */ public static void unZipFile(File zipFile, String folderPath) throws ZipException, IOExcep...
分类:
编程语言 时间:
2015-01-06 20:10:32
阅读次数:
200
最近编译larbin_daemon爬虫服务器端管理程序时,总是会报如下的错误:
g++ -c -o editConf.o editConf.cpp
editConf.cpp:49:8: error: redefinition of ‘std::string projectG’
editConf.h:34:8: error: ‘std::string projectG’ previously...
分类:
编程语言 时间:
2015-01-06 20:06:52
阅读次数:
243
判断客户端是否为IEpublic static boolean isIE(HttpServletRequest request) { String userAgent = request.getHeader("User-Agent").toLowerCase(); ret...
分类:
Web程序 时间:
2015-01-06 20:01:23
阅读次数:
156