原题地址将L中的单词看成一个整体,这道题与Minimun Window String比较类似,都是利用滑动窗口搜索。所以,依次枚举所有S的起始位置i,从i处开始搜索。当然并不需要枚举所有的i,i最多等于L中单词长度-1。比如L中的单词长度为3,那么当枚举过i=0,1,2后,不用再尝试i=3了,因为结...
分类:
其他好文 时间:
2015-01-22 20:09:58
阅读次数:
189
1 基于消息的通信机制 Intent--------boudle,extra用这种简单的形式,一般而言传递一些简单的类型是比较容易的,如int、string等详细介绍下Intent机制Intent包含两部分:1 目的【action】-------要去到哪里去2 内容【category、data】--...
分类:
其他好文 时间:
2015-01-22 20:05:47
阅读次数:
158
一、Cookie详解 1、属性: name:(必须) value:(必须)不能是中文 maxage:(可选)最长存活时间.默认是会话。单位是秒 path:(可选)路径 一个cookie的默认路径是:写cookie的那个servlet的访问路径。 写cookie的servlet的路径是:String ...
分类:
其他好文 时间:
2015-01-22 19:59:17
阅读次数:
316
/**创建一个压缩文件,from为文件夹路径,to为创建好后压缩文件路径*/ public void CreateZip(String from,String to) throws IOException { Listlist=getFiles(from); ZipOutputStream ...
分类:
其他好文 时间:
2015-01-22 19:58:00
阅读次数:
122
利用继承Thread类实现的多线程无法资源共享如下程序class MyThread extends Thread{ public MyThread(String name){ super(); this.name=name; } public void run(){ while(ticket...
分类:
编程语言 时间:
2015-01-22 19:55:16
阅读次数:
206
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2015-01-22 19:53:56
阅读次数:
168
1 /** 2 * @method 图片等比缩放 3 * @param string $srcImage 源图片路径 4 * @param string $toFile 目标图片路径 5 * @param integer $maxWidth ...
分类:
Web程序 时间:
2015-01-22 19:44:36
阅读次数:
199
实现手写图片,将图片转化为字符串以及字符串转化为图片,减小发送内容大小
/**
* bitmap转为base64
* @param bitmap
* @return
*/
public static String bitmapToBase64(Bitmap bitmap) {
String result = null;
ByteArrayOutputStream ba...
分类:
移动开发 时间:
2015-01-22 18:17:15
阅读次数:
129
题意 比较两个字典 按字典序输出所有添加 删除 修改的项 如果没有任何更新 输出 No changes
STL map的应用 对比两个字典 注意开始字符串的处理和字典可以为空
#include
using namespace std;
map d[2];
map::iterator it;
const int N = 105;
string s, a, b, t[N];
vo...
分类:
其他好文 时间:
2015-01-22 18:15:33
阅读次数:
160
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input...
分类:
其他好文 时间:
2015-01-22 18:08:59
阅读次数:
145