自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

BPC's Domain

A Geek's Perspective On Life...

  • 博客(9)
  • 资源 (4)
  • 收藏
  • 关注

转载 卡塔兰数

卡塔兰数规定C0=1而C1=1,C2=2,C3=5,C4=14,C5=42,C6=132,C7=429,C8=1430,C9=4862,C10=16796,C11=58786,C12=208012,C13=742900,C14=2674440,C15=9694845·········································卡塔兰数的一般项公式

2013-10-27 15:54:22 724

转载 一些常见的概率生成器的题目

1. 百度的一个面试题目:.已知一随机发生器,产生0的概率是p,产生1的概率是1-p,现在要你构造一个发生器, 使得它构造0和1的概率均为1/2;构造一个发生器,使得它构造1、2、3的概率均为1/3;…, 构造一个发生器,使得它构造1、2、3、…n的概率均为1/n,要求复杂度最低。初看确实有点头晕,也没什么思路。但是仔细想想为什么生成0和1的概率均为1/2,我们可以看成是生

2013-10-17 17:46:00 2888

转载 全排列生成算法

recursive generating这个算法接受一个元素均不同的数组,通过递归的调用以生成所有全排列序列。递归的原则在于,生成序列的全排列P(a1,a2,…,an)等价于生成序列…这构成了递归算法设计的deduction-case;而base-case,则是要生成全排列的序列只有一个元素。整个算法大致上可以如下实现:

2013-10-17 10:58:31 681

转载 最近共同父结点(LCA,Least Common Ancestor)

给定一棵二叉搜索树中两个节点的值,找到它们的最近共同祖先。假定两个节点都在树中,比如如图4和14的最近共同节点是8。1、通用解决方案:建立两个链表分别保存两个节点的祖先,然后逐个比较这两个链表,找到第一个不同的节点,这个节点之前的那个节点就是最近共同祖先。2、本方案:检查当前节点;如果value1和value2都小于当前节点的值,检查它的左子节点;如果value1和valu

2013-10-16 10:15:08 1392

转载 中断线屏蔽与禁用什么区别?

总结自http://bbs.chinaunix.net/thread-3628928-1-1.html基本上每个CPU在其关键控制寄存器有一位用于控制中断enable/disable中断禁用,就是把这个bit disable;如果这一bit被清掉了,整个系统中断就不可能发生中断控制器里有个寄存器叫中断屏蔽寄存器MASK;基本上每一个中断源在MASK寄存器里有一个屏蔽位;如果

2013-10-10 13:24:34 3658

转载 求两个链表的第一个节点

参考编程之美的第三章 234页。如果离链表有环的话,有环的节点肯定是共同的节点,通过标志位找环的节点或者通过链长度n以及循环的第n+1个节点肯定是第一个节点,然后用这个节点在第二个链中去遍历。 剑指offer上的193页,面试题37方法2:标记已经访问的节点 首先对每个节点添加一个标志位bVisited,表示这个节点有没有被访问过,初始为fals

2013-10-09 17:27:53 627

转载 内核中的原子上下文

内核的一个基本原则就是:在中断或者说原子上下文中,内核不能访问用户空间,而且内核是不能睡眠的。也就是说在这种情况下,内核是不能调用有可能引起睡眠的任何函数。一般来讲原子上下文指的是在中断或软中断中,以及在持有自旋锁的时候。内核提供了四个宏来判断是否处于这几种情况里:#define in_irq() (hardirq_count()) //在处理硬中断中#define in_sof

2013-10-09 09:59:56 753

转载 schedule调用相关整理

1 schedule的调用时机×××正常情况下进程上下文中的直接调用schedule(),就会尝试着进行上下文切换。比如:int down_interruptible(struct semaphore *sem)copy_from_user(to, from, n)--------只能在用户上下文中调用.×××抢占式的调用schedule()。比如:在中断里面返回时

2013-10-08 21:18:05 1126

转载 mmap详解

内存映射,简而言之就是将内核空间的一段内存区域映射到用户空间。映射成功后,用户对这段内存区域的修改可以直接反映到内核空间,相反,内核空间对这段区域的修改也直接反映用户空间。那么对于内核空间与用户空间两者之间需要大量数据传输等操作的话效率是非常高的。当然,也可以将内核空间的一段内存区域同时映射到多个进程,这样还可以实现进程间的共享内存通信。系统调用mmap()就是用来实现上面说的内存映射。最

2013-10-08 13:23:59 1349

The design of design

Making Sense of Design Effective design is at the heart of everything from software development to engineering to architecture. But what do we really know about the design process? What leads to effective, elegant designs? The Design of Design addresses these questions. These new essays by Fred Brooks contain extraordinary insights for designers in every discipline. Brooks pinpoints constants inherent in all design projects and uncovers processes and patterns likely to lead to excellence. Drawing on conversations with dozens of exceptional designers, as well as his own experiences in several design domains, Brooks observes that bold design decisions lead to better outcomes. The author tracks the evolution of the design process, treats collaborative and distributed design, and illuminates what makes a truly great designer. He examines the nuts and bolts of design processes, including budget constraints of many kinds, aesthetics, design empiricism, and tools, and grounds this discussion in his own real-world examples—case studies ranging from home construction to IBM's Operating System/360. Throughout, Brooks reveals keys to success that every designer, design project manager, and design researcher should know.

2011-08-22

NS中文手册精美版.pdf

当参考书文档不错 ns方面的中文资料太少。。

2010-04-14

Inside the C++ object model

Inside the C++ Object Model focuses on the underlying mechanisms that support object-oriented programming within C++: constructor semantics, temporary generation, support for encapsulation, inheritance, and "the virtuals"-virtual functions and virtual inheritance. This book shows how your understanding the underlying implementation models can help you code more efficiently and with greater confidence. Lippman dispells the misinformation and myths about the overhead and complexity associated with C++, while pointing out areas in which costs and trade offs, sometimes hidden, do exist. He then explains how the various implementation models arose, points out areas in which they are likely to evolve, and why they are what they are. He covers the semantic implications of the C++ object model and how that model affects your programs.

2008-09-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除