写在前面
1.5.2版本 计12个函数
1、bind(绑定函数到对象上)
_.bind(function, object, [*arguments])
无论何时调用函数,函数里的this都指向这个对象。可选参数argument用来填充函数的参数
var func = function(greeting){ return greeting + ': ' + this.name };
fun...
分类:
其他 时间:
2014-03-27 15:16:38
收藏:
0 评论:
0 赞:
0 阅读:
464
红黑树本身是二叉树,举例:
红黑树的每个节点都带有颜色,会有一个专门的属性color在对象里记载,
红黑树有五个属性:
1,根节点是黑色的
2,节点是红色或黑色的
3,所有叶节点(也就是NIL)都是黑色的
*4,红色节点的儿子都是黑色的,也就是说红色的节点不能靠着
*5,从任一节点到每个叶节点的简单路径包含相同的黑色节点。(4,5重要)
这些属性就约束了红黑树:...
分类:
其他 时间:
2014-03-27 14:31:05
收藏:
0 评论:
0 赞:
0 阅读:
463
权限检查拦截器类的代码如下:
package org.crazyit.app.interceptor;
import com.opensymphony.xwork2.*;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import java.util.*;
//权限检查拦截器继承AbstractInterc...
分类:
其他 时间:
2014-03-27 14:45:51
收藏:
0 评论:
0 赞:
0 阅读:
452
binsearch::[Int]->Int->Bool
binsearch [x] y
| x == y = True
| otherwise = False
binsearch xs y =
if y == xs !! ( (length xs ) `div` 2 )
then True
else if y
then binsearch (take ( (length xs ...
分类:
其他 时间:
2014-03-27 15:05:24
收藏:
0 评论:
0 赞:
0 阅读:
507
ID Codes
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 5741
Accepted: 3436
Description
It is 2084 and the year of Big Brother has finally arrived, albeit a...
分类:
其他 时间:
2014-03-27 14:29:57
收藏:
0 评论:
0 赞:
0 阅读:
411
一、比赛简介:
主题:设计模式评选
创始人:面向对象先生
来宾:抽象先生、封装先生、继承女士、多态女士等
评委:单一职责先生、开放封闭先生、依赖倒转先生、里氏代换女士、合成聚合复用女士、迪米特先生
参赛选手:
第一组:创建型模式
第二组:结构型模式
第三组:行为型模式
主持人:GOF
二、比赛内容:
第一组:
创建型模式十分灵活,抽象了实例化的过程。它隐藏了这些类的实例...
分类:
其他 时间:
2014-03-27 14:22:47
收藏:
0 评论:
0 赞:
0 阅读:
507
故障描述:新装RAC实验,发现ora.rac2.LISTENER_RAC2.lsnr无法启动,检查listner.ora无异常。手动启动后,状态为UNKNOW。crs_stop -f ora.rac2.LISTENER_RAC2.lsnr 再crs_start -f ora.rac2.LISTENER_RAC2.lsnr后正常。
贴一下当时情况
[oracle@rac1 ~]$ crs_s...
分类:
其他 时间:
2014-03-27 15:08:30
收藏:
0 评论:
0 赞:
0 阅读:
975
题意:给出一张要买的东西列表,一排货架,要求在列表上从上到下,在货架上从左到右的选购东西,如果列表上第i件物品在第j个货架上买了,那么第i+1个物品,必须在第j个货架后面买.
求买完所有东西需要的最少价钱.
设dp[i][j]为前i件物品在前j个货架上买需要的最少价钱.
那么有dp[i][j] = min(dp[i - 1][j - 1] + price[j], dp[i][j - 1])....
分类:
其他 时间:
2014-03-27 14:47:21
收藏:
0 评论:
0 赞:
0 阅读:
337
若要检测全局表的赋值情况,可以通过接管全局表的赋值操作来进行判断。示例代码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
分类:
其他 时间:
2014-03-27 14:22:13
收藏:
0 评论:
0 赞:
0 阅读:
366
Description
It is 2084 and the year of Big Brother has finally arrived, albeit a century late. In order to exercise greater control over its citizens and thereby to counter a chronic breakdown in law...
分类:
其他 时间:
2014-03-27 14:27:23
收藏:
0 评论:
0 赞:
0 阅读:
474
Action代码如下:package org.crazyit.app.action;
import com.opensymphony.xwork2.Action;
import java.io.*;
public class LoginAction
implements Action
{
//封装请求参数的两个属性
private String user;
private Strin...
分类:
其他 时间:
2014-03-27 14:54:03
收藏:
0 评论:
0 赞:
0 阅读:
647
空间配置器
标准规范规定,STL空间配置器是一个名为allocator的模板类,同时也规定了它的必要接口,也就是说allocator类定义形式如下。其中接口allocator::allocate(),allocator::deallocate(),allocator::construct,allocator::destory()这四个接口及其重要。所以我们这里主要分析这四个接口。此外,rebin...
分类:
其他 时间:
2014-03-27 15:15:05
收藏:
0 评论:
0 赞:
0 阅读:
572
Mondriaan's Dream
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 10591
Accepted: 6163
Description
Squares and rectangles fascinated the famous Dutch paint...
分类:
其他 时间:
2014-03-27 14:53:35
收藏:
0 评论:
0 赞:
0 阅读:
594
此类提供 List 接口的骨干实现,以最大限度地减少实现“随机访问”数据存储(如数组)支持的该接口所需的工作。对于连续的访问数据(如链表),应优先使用AbstractSequentialList,而不是此类。与其他抽象 collection 实现不同,编程人员不必 提供迭代器实现;迭代器和列表迭代器由此类在以下“随机访问”方法上实现:get(int)、set(int, E)、add(int,
...
分类:
其他 时间:
2014-03-27 14:44:48
收藏:
0 评论:
0 赞:
0 阅读:
530
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;...
分类:
其他 时间:
2014-03-27 15:04:53
收藏:
0 评论:
0 赞:
0 阅读:
747
#include
#include
#include
#include
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution...
分类:
其他 时间:
2014-03-27 14:29:27
收藏:
0 评论:
0 赞:
0 阅读:
483
#include
#include
using namespace std;
class CFraction
{
private:
int nume; // 分子
int deno; // 分母
public:
CFraction(int nu=0,int de=1); //构造函数,初始化用
void set(int n...
分类:
其他 时间:
2014-03-27 14:57:42
收藏:
0 评论:
0 赞:
0 阅读:
470
最近看了一些关于ios runtime相关的资料,看到网上有人发的关于kvo的实现原理,刚好有时间自己研究了一遍,整理下分享给初学的朋友。
KVO的全称是Key-Value Observing,它实现了一种机制,对所关心的属性对象添加观察者,当属性值发生变化时会得到通知,我们可以对变化做相应的处理。看过设计模式的同学应该知道,这是一种典型的观察者模式。KVO的最大优点就是底层框架已经支持,开发人...
分类:
其他 时间:
2014-03-27 15:03:21
收藏:
0 评论:
0 赞:
0 阅读:
497
Map是将键映射到值的对象。一个映射不能包含重复的键;每个键最多只能映射到一个值,只允许包含一个null键值。
Set是一个不包含重复元素的 collection。更确切地讲,set 不包含满足 e1.equals(e2) 的元素对
e1 和 e2,并且最多包含一个 null 元素。正如其名称所暗示的,此接口模仿了数学上的 set 抽象。
//Map接口,K为键值,V为值对象
pu...
分类:
其他 时间:
2014-03-27 14:37:06
收藏:
0 评论:
0 赞:
0 阅读:
411
strcpy 函数的原型是: char * strcpy(char * strDest,const
char * strSrc);
功能:把从strSrc地址开始且含有NULL结束符的字符串复制到以strDest开始的地址空间,返回指向strDest的指针。说明:strSrc和strDest所指内存...
分类:
其他 时间:
2014-03-27 13:49:55
收藏:
0 评论:
0 赞:
0 阅读:
409