JavaScript模块化规范主要遵循CommonJS和AMD规范。CommonJS规范-服务器端JavaScript规范Node.js是一个服务器端JavaScript项目,采用了CommonJS标准实现其模块系统。CommonJS中采用一个全局require方法来加载模块,主要由原生模块modu...
分类:
编程语言 时间:
2014-05-19 17:56:40
阅读次数:
293
为了解释本节的目的,首先想象一下,我们有包含了三个node的cluster,这个cluster有一个名称是blogs的index,这个index有两个primary
shard。每个primary shard有两个replica。相对应的shard的数据备份不会在相同的node,因此,这个clust...
分类:
其他好文 时间:
2014-05-19 16:44:31
阅读次数:
287
About Self-Signed Certificates
自签证书。一个SSL证书,是加密网站的信息,并创建更安全的链接的一种方式。附加地,证书可以给网站浏览者显示VPS的的身份证明信息。如果一个SSC没有第三方证实,那么证书作者可以发行SSL证书,用以验证虚拟服务器的细节。
Step One-...
分类:
其他好文 时间:
2014-05-19 15:53:09
阅读次数:
262
A linked list is given such that each node
contains an additional random pointer which could point to any node in the list
or null.Return a deep copy ...
分类:
其他好文 时间:
2014-05-19 15:50:28
阅读次数:
447
一个文档可以从primary shard和任意一个相对应的replica
shard中检索:就像上面图形中表示的,下面列出从primary shard或这replica
shard检索document的步骤:1:客户端发送请求到node12:这个node使用document的_id判定documen...
分类:
其他好文 时间:
2014-05-19 15:30:30
阅读次数:
251
【题目】
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.
Note:
Given n will ...
分类:
其他好文 时间:
2014-05-18 18:48:03
阅读次数:
269
【题目】
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
For example, given array S = {...
分类:
其他好文 时间:
2014-05-18 10:37:57
阅读次数:
269
【题目】
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
【题意】
合并K个有序链表
【思路】
归并
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For ...
分类:
其他好文 时间:
2014-05-18 09:05:40
阅读次数:
255
3SumClosest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution....
分类:
其他好文 时间:
2014-05-18 05:57:48
阅读次数:
244
链表是数据结构的基础内容之一,下面就链表操作中的创建链表、打印链表、求取链表长度、判断链表是否为空、查找结点、插入结点、删除结点、逆转链表、连接链表、链表结点排序等进行总结。
1.创建表示结点的类,因为链表操作中需要比较结点,因此结点需要实现comparable接口。
public class Node implements Comparable {
private Object data;...
分类:
其他好文 时间:
2014-05-18 03:04:38
阅读次数:
316