1. Error: Dangling meta character '*' near index 0对字符串使用split()方法截取 * ? + / | 等字符的时候会报以下异常 Dangling meta character '?' near index 0 ?+、*、|、\等符号在正则表达示中...
分类:
编程语言 时间:
2014-07-03 07:13:36
阅读次数:
222
在使用的是 Template(open(file)) 引入的 html, 在处理静态文件的时候,怎么处理图片?可以这样:def imgFile(environ, start_response): ext = environ['PATH_INFO'].split('.') for n in...
分类:
编程语言 时间:
2014-07-03 06:39:21
阅读次数:
220
如将字符串‘张三,李四,王五,赵六,'转换成
1. 张三
2.李四
3.王五
4.赵六
REGEXP_SUBSTR
查询语句:
WITH TEST AS (SELECT ‘张三,李四,王五,赵六,' AS STR FROM DUAL)
SELECT DISTINCT REGEXP_SUBSTR(STR, '[^,]+', 1, LEVEL)
FROM TEST
...
分类:
数据库 时间:
2014-07-02 07:13:36
阅读次数:
208
substr 方法返回一个从指定位置开始的指定长度的子字符串。stringvar.substr(start [, length ])参数stringvar必选项。要提取子字符串的字符串文字或 String 对象。start必选项。所需的子字符串的起始位置。字符串中的第一个字符的索引为 0。lengt...
分类:
Web程序 时间:
2014-07-01 16:20:58
阅读次数:
253
#includevoid main(){const int count = 5;//定义数量struct student{char name[80];float math,eng;float aver;}stu[count],temp;//输入for (int i = 0; i stu[sub].a...
分类:
编程语言 时间:
2014-07-01 13:32:56
阅读次数:
257
1.写一个shell脚本test.sh,重新启动tomcat[java]view plaincopy#!/bin/sh./etc/profilepid=`psaux|greptomcat|grep-vgrep|grep-vretomcat|awk'{print$2}'`echo$pidif[-n"$...
分类:
系统相关 时间:
2014-07-01 12:08:38
阅读次数:
304
字符串的Split()和Join()方法提供了拆分字符串的功能。
Split()方法可以获得从字符串拆分到数组的值,
Join()方法可以从数组创建一个带分隔符的字符串。同时支持自定义格式和其他程序进行信息交换
Replace() 替换功能。
具体参数参考实际方法。
此文仅为记录...
分类:
其他好文 时间:
2014-07-01 07:46:09
阅读次数:
145
select regexp_substr('A,B,C,D,E', '[^,]+', 1, level, 'i') as str
from dual
connect by level
length('A,B,C,D,E') - length(regexp_replace('A,B,C,D,E', ',', '')) + 1;...
分类:
其他好文 时间:
2014-07-01 07:38:06
阅读次数:
217
Ø 读取文件的时间
#!/bin/bash
for file in `ls /root`
do
stat $file>1.txt
sed -n "7p" 1.txt>2.txt
usetime= awk -F ":" '{print $2}' 2.txt
echo "time="$file $usetime
done
Ø 读取文件的每行while...
分类:
其他好文 时间:
2014-07-01 06:49:51
阅读次数:
204
自动化格式分区方法----非交互---可用于脚本要先给用户一个提示,让他选择一个分区来格式化foriin`mount|grep“/dev/sdb”|awk’{print$1}’`dofuser–km$i;umount$idoneddif=/dev/zeroof=$PartDiskbs=512count=1sync;sleep3echo‘np1+20Mnp2+512Mnp3+128Mt382w’|fdisk/dev/s..
分类:
系统相关 时间:
2014-07-01 06:00:36
阅读次数:
359