Suppose you want to create and run virtual machines (VMs) on VirtualBox. However, a host machine does not support X11 environment, or you only have ac...
分类:
其他好文 时间:
2014-08-19 14:11:24
阅读次数:
311
public?class?PatternMatching?{
?/*
??*?该方法用来判断子串是否存在于父串中?若存在返回true,否则返回false?searchMe表示父串,substring表示子串
??*/
?public?boolean?match(String?searchM...
分类:
编程语言 时间:
2014-08-18 18:56:33
阅读次数:
201
用JS来判断了,经过查找资料终于实现了效果,function is_weixn(){ var ua = navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i)=="micromessenger") { return t...
分类:
微信 时间:
2014-08-18 18:29:12
阅读次数:
332
function urlParse(url) { try { var hostexp = /http\:\/\/([^\/]+)/; var hoststr = url.match(hostexp)[0]; var ...
分类:
Web程序 时间:
2014-08-18 15:59:12
阅读次数:
168
functionhasClass(obj,cls){returnobj.className.match(newRegExp('(\\s|^)'+cls+'(\\s|$)'));}functionaddClass(obj,cls){if(!this.hasClass(obj,cls))obj.clas...
分类:
Web程序 时间:
2014-08-17 22:37:52
阅读次数:
253
题目大意:
给出一组合法的括号。
括号要么不涂颜色,要么就涂上红色或者绿色。
匹配的括号只能有一个有颜色。
两个相邻的括号不能有相同的颜色。
思路分析:
因为是一个合法的括号序列。
所以每个括号与之匹配的位置是一定的。
那么就可以将这个序列分成两个区间。 (L - match[L] ) (match[L]+1, R)
用递归先处理小区间,再转移大区间。
...
分类:
其他好文 时间:
2014-08-17 17:04:42
阅读次数:
206
PowerShell 中的 replace
PowerShell 中的 replace,既是是字符串函数,还是运算符,类似于 like、match 之类。
比如,有一个字符串:
$a = "aaa.bbb?ccc=ddd"
要去掉问号后面的字符,可以用 repace 函数:
$a.replace("?ccc=ddd", "")
但是,replace 函数好像并不支持正则表达式,...
分类:
其他好文 时间:
2014-08-17 15:37:32
阅读次数:
279
Alice and Bob
Accepted : 98
Submit : 324
Time Limit : 1000 MS
Memory Limit : 65536 KB
Problem Description
Alice and Bob always love to play games, so does thi...
分类:
其他好文 时间:
2014-08-17 15:37:12
阅读次数:
299
if (!String.prototype.format) { String.prototype.format = function() { var args = arguments; return this.replace(/{(\d+)}/g, function(match, nu...
分类:
编程语言 时间:
2014-08-16 20:59:01
阅读次数:
235