代码如下:string p = @"(http|https)://(?[^(:|/]*)";Regex reg = new Regex(p, RegexOptions.IgnoreCase);Match m = reg.Match(HostUrl);Result=m.Groups["domain"]...
在android中选择图片是一个很常见的功能,图片的来源通常情况下是从相机获取和从相册获取两种。
先来写一个简单的选择按钮和一个能显示图片的ImageView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
andr...
分类:
移动开发 时间:
2015-04-20 20:58:02
阅读次数:
188
$str = "测试中文";echo $str;echo "";//if (preg_match("/^[".chr(0xa1)."-".chr(0xff)."]+$/", $str)) { //只能在GB2312情况下使用//if (preg_match("/^[\x7f-\xff]+$/", $...
分类:
Web程序 时间:
2015-04-20 20:54:08
阅读次数:
168
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
andr...
分类:
其他好文 时间:
2015-04-20 18:35:19
阅读次数:
118
var browser = {versions: function () {var u = navigator.userAgent, app = navigator.appVersion;return { //移动终端浏览器版本信息ios: !!u.match(/\(i[^;]+;( U;)? CP...
分类:
移动开发 时间:
2015-04-20 09:21:55
阅读次数:
168
原文链接:http://inosin.iteye.com/blog/786467默认路由:# Rails3:match '/:controller(/:action(/:id))'# Rails2:map.connect ':controller/:action/:id'正则路由: # Rails3...
分类:
其他好文 时间:
2015-04-19 17:55:30
阅读次数:
122
字符串匹配(string match)是在实际工程中经常会碰到的问题,通常其输入是原字符串(String)和子串(又称模式,Pattern)组成,输出为子串在原字符串中的首次出现的位置。通常精确的字符串搜索算法包括朴素搜索算法,KMP, BM(Boyer Moore), sunday, robin-karp 以及 bitap。下面分析朴素搜索算法和KMP这两种方法并给出其实现。假设原字符T串长度N...
分类:
编程语言 时间:
2015-04-18 16:11:43
阅读次数:
246
使用style替换背景,防止Activity黑色背景闪过1.原来的布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_...
分类:
移动开发 时间:
2015-04-17 22:25:19
阅读次数:
210
在使用cocos2d-x开发Android项目时,使用Eclipse + ADT运行模拟器时出现以下错误:FATAL EXCEPTION: GLThread 56Process: com.louis, PID: 825java.lang.IllegalArgumentException: No co...
分类:
编程语言 时间:
2015-04-17 17:24:39
阅读次数:
296
优化布局层次1.避免布局镶嵌过深(如下)<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_paren...
分类:
移动开发 时间:
2015-04-17 14:04:35
阅读次数:
183