今天主要看下re.sub函数和Handler类的sub函数
先看下re.sub函数
re.sub共有5个参数,不过一般写前三个就好了,即pattern,repl和string
pattern表示正则中的模式字符串,repl可以是字符串,也可以是函数。string为要进行替换的字符串
先看一段代码:
import re
def Num2A(match):
return 'A'
a...
分类:
编程语言 时间:
2015-01-27 16:28:12
阅读次数:
219
当然是以文件形式写到手机内存,不过在模拟器上面运行会很慢
布局文件
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent...
分类:
移动开发 时间:
2015-01-27 11:13:20
阅读次数:
211
main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_heigh...
分类:
移动开发 时间:
2015-01-26 21:07:58
阅读次数:
256
有时间再写个日期时间合在一起的自定义时间选择对话框
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
and...
分类:
移动开发 时间:
2015-01-26 21:06:09
阅读次数:
276
/etc/named.conf视图启动acl tel{ 172.16.0.0/16;};acl li{192.168.0.0 /24;}view 名称{ match-client{ tel; } zone "xu.com" IN { type master; file "tel.xu.com.zo....
分类:
其他好文 时间:
2015-01-26 20:44:22
阅读次数:
281
实现PHP 转 ASCII
<?php
class ascii
{
function decode($str)
{
preg_match_all( "/(d{2,5})/", $str,$a);
$a = $a[0];
foreach ($a as $dec)
{
if ($dec < 128)
{
...
分类:
Web程序 时间:
2015-01-26 17:22:24
阅读次数:
180
常用的几个函数:
charAt() 返回指定位置的字符。
concat() 连接字符串,跟+差不多。
indexOf() 返回指定字符串的索引位置。注意是字符串。
match() 找到一个或多个正则表达式的匹配。正则还不会用。。。。
substr() 从起始索引号提取字符串中指定数目的字符。例如:str1.substr(0,1) 从索引0开始的1个字符,即第一个字...
分类:
Web程序 时间:
2015-01-26 15:13:02
阅读次数:
155
一、效果图及功能描述效果图点击ShowImg后点击match,然后点击showmatch,可以不断点击showmatch。主要功能描述:显示在SD卡上已经存在的图片test.jpg,根据图片在cameraframe对于每一帧计算和test.ipg的匹配并显示。二、界面设计 一个JavaCameraV...
分类:
移动开发 时间:
2015-01-25 18:04:59
阅读次数:
504
function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg)...
分类:
编程语言 时间:
2015-01-25 18:04:09
阅读次数:
185
开发自动化运维管理平台开发环境:
操作系统:Cenots6.6
Web框架:tornado-4.0.2
数据库:mysql-5.1.73
相关软件包:
tornado相关依赖包
backports.ssl_match_hostname-3.4.0.2.tar.gz
setuptools-5.7.tar.gz
certifi-1.0.1.tar.gz
tornado-4.0.2.tar.gz
torndb数据库环境需要..
分类:
其他好文 时间:
2015-01-25 11:14:56
阅读次数:
224