最近在看nginx源码,看到定时器的时候,发现一个结构体利用偏移量求值问题,结构体相信做c开发的都遇到过,那么不知你对结构体中成员变量偏移这块是如何理解的;首先我们先看一下nginx中的那个让我迷惑的地方ev = (event_t*)((char*)node - offsetof(event_t,....
分类:
编程语言 时间:
2014-07-03 10:46:15
阅读次数:
234
extjs4 tree check 级联选择实现效果:关键代码:function changeAllNode(node, isCheck) { allChild(node, isCheck); allParent(node, isCheck); function allChild(...
分类:
Web程序 时间:
2014-07-01 16:11:24
阅读次数:
200
题目大意:
问[s,e]之间有多少个 斐波那契数。
思路分析:
直接模拟高精度字符串的加法和大小的比较。
注意wa点再 s 可以从 0 开始
那么要在判断输入结束的时候注意一下。
#include
#include
#include
#include
using namespace std;
struct node
{
char str[111];
...
分类:
其他好文 时间:
2014-07-01 16:08:10
阅读次数:
243
nodejsStudy
阅读《nodejs开发指南》来学习node.js的一个github仓库。
仓库里面放了这本书的电子版以及书籍的源代码
还放了node.js的最新win32的版本 node-v0.10.29 x86.msi
最后就是studyCase文件夹,存放着自己阅读书籍然后敲下来的学习案例...
分类:
Web程序 时间:
2014-07-01 15:52:36
阅读次数:
206
题目链接:点击打开链接
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define inf 10000000
#define ll __int64
#define N 200005
ll n, m, v;
struct node{...
分类:
移动开发 时间:
2014-07-01 15:52:00
阅读次数:
298
题目
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
方法
public ListNode de...
分类:
其他好文 时间:
2014-07-01 11:30:58
阅读次数:
200
告诉大家编写node.js的良好代码规范,让node.js的编写更稳健...
分类:
Web程序 时间:
2014-07-01 08:53:00
阅读次数:
501
本教程适用于centos
安装之前
检查nodejs
如果没安装nodejs按照以下步骤安装
$ su -
$ yum install openssl-devel
$ cd /usr/local/src
$ wget http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz
$ tar zxvf node-v0.10.29.tar.gz...
分类:
其他好文 时间:
2014-07-01 08:36:47
阅读次数:
530
仿写 networkx 的功能
# -*- coding: cp936 -*-
'''
简单图 Graph:
要求:
关于节点:
功能1.add_node:
通过 add_node 一次性加一个节点
字符串,数字,任何可以被哈希的 python 对象都可以当做节点
...
分类:
其他好文 时间:
2014-07-01 08:15:24
阅读次数:
281
题目
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 of the list.
方法
publi...
分类:
其他好文 时间:
2014-07-01 07:49:33
阅读次数:
186