var DSQ = setInterval(function(){ console.log('zzq');},1000);setTimeout(function(){ clearInterval(DSQ);//清除定时器,想要再次使用需重新创建},5000);setTimeout(fun...
分类:
其他好文 时间:
2015-03-18 09:00:51
阅读次数:
114
Description萧芸斓是Z国的公主,平时的一大爱好是采花。今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花。花园足够大,容纳了n朵花,花有c种颜色(用整数1-c表示),且花是排成一排的,以便于公主采花。公主每次采花后会统计采到的花的颜色数,颜色数越多她会越高兴!同时,她有一癖好,她不...
分类:
其他好文 时间:
2015-03-18 09:01:02
阅读次数:
218
DecimalFormat 是 NumberFormat 的一个具体子类,用于格式化十进制数字。DecimalFormat 包含一个模式 和一组符号符号含义:0 一个数字# 一个数字,不包括 0. 小数的分隔符的占位符, 分组分隔符的占位符; 分隔格式。- 缺省负数前缀。% 乘以 100 和作为百分...
分类:
其他好文 时间:
2015-03-18 08:58:02
阅读次数:
115
Still 3 methods:Same with inorder, but post order is a little different. We need to treat it as reverse result of preorder.So we go to right branch fi...
分类:
其他好文 时间:
2015-03-18 08:57:58
阅读次数:
132
Basic question. Use a queue to store Node, use two numbers to record current level node numbers and next level node numbers. 1 /** 2 * Definition for....
分类:
其他好文 时间:
2015-03-18 08:58:27
阅读次数:
105
Same with inorder.1. recursive: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeN...
分类:
其他好文 时间:
2015-03-18 08:58:05
阅读次数:
131
Use lMax get the maximum value of a sub SINGLE branch (left branch or right branch or just current node).Use gMax get the maximum value of the whole s...
分类:
其他好文 时间:
2015-03-18 08:56:01
阅读次数:
190
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2594分析:判断是否在两串中存在子串,能作为s1的前缀 && s2的后缀。可以考虑将两串合并,然后直接利用next数组。合并后可能会出现的状况是,所求子串大于s1 || s2的长度,所以还要进行一次判断。...
分类:
其他好文 时间:
2015-03-18 08:56:12
阅读次数:
149
This question is almost same as the previous one.I just use a stack (another vector) of vector to store the level result. Then reverse it. 1 /** 2 * ....
分类:
其他好文 时间:
2015-03-18 08:56:41
阅读次数:
155
writing_first_django_app_part4Write a simple form点击每个Question进去detail界面,看到的vote我们希望以选择的形式给用户进行选择,然后将结果以表格的形式POST到服务器.# polls/templates/polls/detail.ht...
分类:
其他好文 时间:
2015-03-18 08:55:58
阅读次数:
187
Hive是为了简化编写MapReduce程序而生的,使用MapReduce做过数据分析的人都知道,很多分析程序除业务逻辑不同外,程序流程基本一样。在这种情况下,就需要Hive这样的用戶编程接口。Hive本身不存储和计算数据,它完...
分类:
其他好文 时间:
2015-03-18 07:54:00
阅读次数:
401
1.多表连接查询: class?A(models.Model):
????name?=?models.CharField(u‘姓名‘)
class?B(models.Model):
????aa?=?models.ForeignKey(A)
B.objects.filter(aa__name__contains=‘searchtitle‘) 2...
分类:
其他好文 时间:
2015-03-18 07:54:57
阅读次数:
575
在centos7中运行NodeJs的容器,发现挂载的本地目录在容器中没有执行权限,经过各种验证和Google搜索,找到了问题的原因,这里做一下记录。原因是centos7中的安全模块selinux把权限禁掉了,至少有以下三种方式解决...
分类:
其他好文 时间:
2015-03-18 07:52:56
阅读次数:
244
16.5?? BOOTP穿越路由器 我们在 5.4节中提到 RARP的一个缺点就是它使用链路层广播,这种广播通常不会由路由 器转发。这就需要在每个物理网络内设置一个 RARP 服务器。如果路由器支持 BOOTP协议, 那么BOOTP能够...
分类:
其他好文 时间:
2015-03-18 07:51:50
阅读次数:
138
GP2Y1010AU0F传感器接线方式如下: 使用PA0接收模拟信号,PB1发送脉冲信号。 代码如下: GP2Y.c #include?"GP2Y.h"
#include?"system.h"
u16?AD_PM;
void?GP2Yinit(void)
{?
//定义变量
????ADC_InitT...
分类:
其他好文 时间:
2015-03-18 07:52:20
阅读次数:
919
1.在scroView上拖一个imageView 设置其大小,然后设置contentSize的大小,只能用代码设置。在设置contentOffSet属性(contentOffSet的属性特点,是一个point设置成正值向上移动)。contentInSet = UIEdgeInSetMake(...
分类:
其他好文 时间:
2015-03-18 07:51:39
阅读次数:
417