字符串匹配
精确:
indexOf(String str); -- strstr(), O(mn)。
lastIndexOf(String str); -- continue 的别样用法。
matches(String regex); -- Regex.compile()/match()。
模糊:
java package?
Spell Checker -- 两个字符串的相似程度...
分类:
编程语言 时间:
2014-06-20 11:00:18
阅读次数:
287
拼音输入法输出的候选分成两个部分,系统词以及短句(智能组词),智能组词是通过model以及解码弄出来的,后续再说。
系统词就是那些常用的词(词组)收录到词典中,用户的输入和词典中的词match时,直接吐出来,而不需要解码获得。
系统词以及对应的rank(score)对输入法的体验很大,毕竟大多数用户还是继续短词输入。
系统词包含几个部分:
1.基础词
2.高频短串
3....
分类:
其他好文 时间:
2014-06-10 19:17:09
阅读次数:
231
ListView 的高度 必须要设置成一个明确的值 或者match_parent
不然就会调用多次getView方法
分类:
移动开发 时间:
2014-06-09 18:51:50
阅读次数:
253
画板案例:
步骤:
步骤一:声明一些全局上使用的变量:
//
接收布局文件上的图片显示控件
private ImageView
iv;
//
声明一个可以用来编辑的bitmap
private Bitmap
baseBitmap;
//
画布的声明
private Canvas
canvas;
//
画笔的声明...
分类:
移动开发 时间:
2014-06-08 18:23:51
阅读次数:
244
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
android:layout_width="wrap...
分类:
其他好文 时间:
2014-06-08 17:58:54
阅读次数:
633
代码清单:
<?php
/**
* 判断字符串是否为utf8编码,英文和半角字符返回ture
* @author ruxing.li
* @param $string
* @return bool
*/
function is_utf8($string) {
return preg_match('%^(?:
[\x09\x0A\x0D\x...
分类:
其他好文 时间:
2014-06-08 10:47:58
阅读次数:
267
JS方法: $(function(){ is_weixn(); }) function
is_weixn(){ var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMesse...
分类:
微信 时间:
2014-06-04 18:04:49
阅读次数:
413
界面效果
应用的权限
布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
andr...
分类:
移动开发 时间:
2014-06-03 00:45:02
阅读次数:
303
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="...
分类:
移动开发 时间:
2014-06-01 04:04:04
阅读次数:
490
不断找增广路,直到没有增广路,每找到一条增广路匹配数就加1 //hungary const
int X=100,Y=100;int match[Y];// initial to -1bool vis[Y];int g[X][Y];bool
dfs(int x){ for(int y=1;y<=Y;y...
分类:
其他好文 时间:
2014-05-31 20:49:41
阅读次数:
247