function saveImage($path) { if(!preg_match('/\/([^\/]+\.[a-z]{3,4})$/i',$path,$matches)) die('Use image please'); $image_name = strToLower($matches[1]... ...
分类:
Web程序 时间:
2017-08-09 10:11:40
阅读次数:
254
[POJ1155]TELE 试题描述 A TV-network plans to broadcast an important football match. Their network of transmitters and users can be represented as a tree. ...
分类:
其他好文 时间:
2017-08-08 22:58:36
阅读次数:
283
1. Cookie Web使用HTTP协议传输数据,而HTTP协议是无状态协议。(DNS则是有状态协议) 协议的状态是指下一次传输可以“记住”这次传输信息的能力, 为了保证服务器的内存,HTTP不会为了下一次连接而维护这次连接所传输的信息。这就是HTTP无状态协议。 Cookie的作用就是弥补这种无 ...
分类:
其他好文 时间:
2017-08-08 17:57:18
阅读次数:
220
test:测试string是否包含有匹配结果,包含返回true,不包含返回false。 match:根据pattern进行正则匹配,如果匹配到,返回匹配结果,如匹配不到返回null search :根据pattern进行正则匹配,如果匹配到一个结果,则返回它的索引数;否则返回-1 replace:根 ...
分类:
编程语言 时间:
2017-08-08 17:56:58
阅读次数:
162
string regexSearch = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars()); Regex reg = new Regex(string.Format("[{0}]", ...
分类:
Web程序 时间:
2017-08-08 15:33:42
阅读次数:
191
在电商项目中,最核心的功能之一就是搜索功能,搜索做的好,整个电商平台就是个优秀的平台。一般搜索功能都使用搜索引擎如Lucene、solr、elasticsearch等,虽然这功能比较强大,但是对于一些小公司或者小的电商平台项目有点大材小用了,对于小项目我们可以采用折中的方法,使用ik+MySQL的搜 ...
分类:
数据库 时间:
2017-08-08 12:27:30
阅读次数:
250
总结一下正则的方法 str.match(regex) match() 方法可在字符串内检索指定的值,或找到一个或多个正则表达式的匹配。 null : 没有匹配到 存放匹配结果的数组: 匹配到了 regex.test(str) test() 方法用于检测一个字符串是否匹配某个模式. true : 匹配 ...
分类:
Web程序 时间:
2017-08-07 17:40:13
阅读次数:
245
hashlib 使用 hashlib.md5() m.update(“sdaf”) hmac hmac.new(“asdf”,”asdfiasd天王盖地虎f”.encode(encoding=”utf-8”));re 模块match() 从头开始search() 查询所有 只匹配一次findall(... ...
分类:
编程语言 时间:
2017-08-06 23:10:58
阅读次数:
181
function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = ...
分类:
移动开发 时间:
2017-08-06 19:41:52
阅读次数:
238
#include <iostream>#include <cstring>#include <algorithm>#define MAX 1<<28;using namespace std;#define MAX 1<<28;int lx[50], ly[50];int map[50][50];in ...
分类:
其他好文 时间:
2017-08-06 16:02:19
阅读次数:
174