??
1.什么是正则表达式
①文件路径通配符
"?"匹配单个字符,"*"匹配零个或多个字符。
②正则表达式
符合某种规则的表达式
③元字符与子匹配
元字符
子匹配
括号所括起来的表达式部分为一个子匹配(子表达式)
2.RegExp对象
①创建
1)显示构造器:var regExp = new RegExp(...
分类:
其他好文 时间:
2015-01-14 15:36:14
阅读次数:
173
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* ...
分类:
其他好文 时间:
2015-01-14 15:35:32
阅读次数:
178
题意:
给两个串,问有多少长度大于等于K的公共子串(位置不同也算一对)
题解:
后缀自动机DP
对第一个串建立后缀自动机,然后做一些预处理,
然后拿第二个串在后缀自动机上跑,到每个节点加一次贡献。
但是这样需要每个点往parent树上跑一遍,会TLE,所以可以加个lazy。
然后代码中有两次运用到拓扑序来从子向父推DP值。
呃,说得乱糟糟的。
Orz No_stop
不...
分类:
其他好文 时间:
2015-01-14 15:35:14
阅读次数:
209
“p” command prints the buffer (remember to use -n option with “p”)
“d” command is just opposite, its for deletion. ‘d’ will delete the pattern space buffer and immediately starts the next cycle.
...
分类:
其他好文 时间:
2015-01-14 15:34:14
阅读次数:
157
Syntax:
#sed -e 'command' -e 'command' filename
Note: -e option is optional for sed with single command. sed will execute the each set of command while processing input from the pattern buffer.
...
分类:
其他好文 时间:
2015-01-14 15:35:56
阅读次数:
164
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *nex...
分类:
其他好文 时间:
2015-01-14 15:33:27
阅读次数:
169
更新时遇到这个问题,解决方法如下: 把根目录下的.svn目录删除掉,再checkout,然后就会出现下面的加version的action。 疯吻IT...
分类:
其他好文 时间:
2015-01-14 15:35:45
阅读次数:
135
self.tabBarController = [[UITabBarController
alloc] init];
HomeViewController *homeVC = [[HomeViewController
alloc] init];
UINavigationController *nav1 = [[UINavigationController
al...
分类:
其他好文 时间:
2015-01-14 15:35:23
阅读次数:
154
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
分类:
其他好文 时间:
2015-01-14 15:33:12
阅读次数:
141
curl ifconfig.me
原理是这样的:...
分类:
其他好文 时间:
2015-01-14 15:33:24
阅读次数:
101
制定新年计划是我们最喜欢做的事情之一,我们总是会在年底的时候对新的一年有一个很好的计划,但后来就把它们都抛到脑后了,直到最后全部忘记。也许,我们的计划总是过于宏伟,很多事情都是做不到的,甚至显得遥不可及。但是,今年一定会有所不同,这篇文章就是专为程序员准备的九大新年计划,供各位程序员参考。
1. 学习一门新的不同风格的编程语言
这是很需要的一件事,因为如果你只了解一种语言,它就会局限你解决问题的能力和你的职业发展。所以在新的一年,你应该花些时间学习一门新的语言,体验不同的编程风格,并学以致用。...
分类:
其他好文 时间:
2015-01-14 15:32:34
阅读次数:
141
在调用OSQQuery时,需要这样定义:OS_Q_DATA qdata;OSQQuery(q1, &qdata);不能这样定义:OS_Q_DATA *qdata;OSQQuery(q1, qdata);会触发HardFault_Handler()中断,原因就是没有申请空间。
分类:
其他好文 时间:
2015-01-14 15:32:05
阅读次数:
289
问题:活动描述:有一个签到活动,就是用户每天只能签到一次, 签到后并发放奖励,就是因为会发放奖励所以导致活动,有好多人开挂来刷这个活动,导致有些人,一天领取多个奖励的现象,php代码逻辑:部门一个同事php代码逻辑是这样的,签到用redis来记录是否签到,签到成功就发奖励逻辑顺序是:先判断是否满足签...
分类:
其他好文 时间:
2015-01-14 15:32:23
阅读次数:
147
更新时遇到这个问题,解决方法如下: 把根目录下的.svn目录删除掉,再checkout,然后就会出现下面的加version的action。 疯吻IT
分类:
其他好文 时间:
2015-01-14 15:30:55
阅读次数:
207
生成验证码的方式有很多种,如下则是比较简单的实现,且运用了正余弦曲线来扭曲验证码字符。 unit AuthenticodeGenerate;interfaceuses SysUtils, Windows, ExtCtrls, Graphics;function GenerateAuthenti...
分类:
其他好文 时间:
2015-01-14 15:30:33
阅读次数:
998