字符串匹配
精确:
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
问题:
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_width="match_parent"
androi...
分类:
其他好文 时间:
2014-06-19 09:36:53
阅读次数:
199
一、 验证 /** * 判断用户名是否规范 */ function
is_username($username) { if
(preg_match("/^[a-zA-Z]{1}([0-9a-zA-Z]|[._]){3,19}$/",$username)...
分类:
Web程序 时间:
2014-06-12 22:53:22
阅读次数:
221
1 // Xml 转 数组, 包括根键,忽略空元素和属性,尚有重大错误 2 function
xml_to_array( $xml ) 3 { 4 $reg = "/]*?>([\\x00-\\xFF]*?)/"; 5
if(preg_match_all($reg, $xml, $...
分类:
Web程序 时间:
2014-06-12 13:16:05
阅读次数:
260
拼音输入法输出的候选分成两个部分,系统词以及短句(智能组词),智能组词是通过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
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