06 2014 档案

摘要:linux多进程1. fork()创建进程,创建一份父进程的拷贝;在父进程中返回的是子进程id,在子进程中返回的是0;失败时返回-1;2. fork()经常和exec()结合,exec() 覆盖了原进程的空间,转而执行其他程序;3. 杀掉父进程,不会同时杀掉子进程;孤儿进程:一个父进程退出,而它的一... 阅读全文
posted @ 2014-06-24 00:25 linyx 阅读(377) 评论(0) 推荐(0)
摘要:6.2There is an 8x8 chess board in which two diagonally opposite corners have been cut off. You are given 31 dominos, and a single domino can cover exa... 阅读全文
posted @ 2014-06-20 20:39 linyx 阅读(162) 评论(0) 推荐(0)
摘要:5.1 You are given two 32-bit numbers, N andM, and two bit positions, i and j. Write a method to insert M into Nsuch that M starts at bit j and ends at... 阅读全文
posted @ 2014-06-18 13:04 linyx 阅读(501) 评论(0) 推荐(0)
摘要:A monolithic kernel is a kernel where all services (file system, VFS, device drivers, etc) as well as core functionality (scheduling, memory allocatio... 阅读全文
posted @ 2014-06-17 00:12 linyx 阅读(835) 评论(0) 推荐(0)
摘要:冯·诺伊曼结构(von Neumann architecture),也称普林斯顿结构,是一种将程序指令存储器和数据存储器合并在一起的计算机设计概念结构。本词描述的是一种实现通用图灵机的计算设备,以及一种相对于并行计算的串行式结构参考模型(referential model)。此结构隐约指导了将存储设... 阅读全文
posted @ 2014-06-12 21:52 linyx 阅读(865) 评论(0) 推荐(0)
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.递归,二分法。 1 /** 2 * Definition for binary tree 3 * st... 阅读全文
posted @ 2014-06-12 16:38 linyx 阅读(181) 评论(0) 推荐(0)
摘要:二叉查换树,左孩子小于等于根,右孩子大于根。完全二叉树,除最后一层外,每一层上的节点数均达到最大值;在最后一层上只缺少右边的若干结点。 complete binary tree满二叉树,完美二叉树是全部结点数达到最大的二叉树。perfect binary tree, full binary tree... 阅读全文
posted @ 2014-06-11 19:28 linyx 阅读(247) 评论(0) 推荐(0)
摘要:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2014-06-11 19:27 linyx 阅读(160) 评论(0) 推荐(0)
摘要:公开密钥加密public-key cryptography,也称为非对称(密钥)加密。非对称密钥,是指一对加密密钥与解密密钥,这两个密钥是数学相关,用某用户密钥加密后所得的信息,只能用该用户的解密密钥才能解密。如果知道了其中一个,并不能计算出另外一个。因此如果公开了一对密钥中的一个,并不会危害到另外... 阅读全文
posted @ 2014-06-10 23:57 linyx 阅读(767) 评论(0) 推荐(0)
摘要:3.1Describe how you could use a single array to implement three stacks.Flexible Divisions的方案,当某个栈满了之后,需要把相邻的栈调整好,这是一个递归的过程。每个stack有一些属性,所以不妨将每个stack封闭... 阅读全文
posted @ 2014-06-10 12:22 linyx 阅读(301) 评论(0) 推荐(0)
摘要:路由器A router is a device that forwards data packets between computer networks. This creates an overlay internetwork, as a router is connected to two or... 阅读全文
posted @ 2014-06-10 00:31 linyx 阅读(460) 评论(0) 推荐(0)
摘要:奇偶校验位是一个表示给定位数的二进制数中1的个数是奇数还是偶数的二进制数。奇偶校验位是最简单的错误检测码。A parity bit, or check bit is a bit added to the end of a string of binary code that indicates wh... 阅读全文
posted @ 2014-06-09 23:40 linyx 阅读(397) 评论(0) 推荐(0)
摘要:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2014-06-09 15:11 linyx 阅读(190) 评论(0) 推荐(0)
摘要:链表的题里面,快慢指针、双指针用得很多。2.1 Write code to remove duplicates from an unsorted linked list.FOLLOW UPHow would you solve this problem if a temporary buffer i... 阅读全文
posted @ 2014-06-09 14:26 linyx 阅读(236) 评论(3) 推荐(0)
摘要:在计算机网络中,网络地址转换(Network Address Translation或简称NAT),也叫做网络掩蔽或者IP掩蔽(IP masquerading),是一种在IP封包通过路由器或防火墙时重写源IP地址或目的IP地址的技术。这种技术被普遍使用在有多台主机但只通过一个公有IP地址访问因特网的... 阅读全文
posted @ 2014-06-08 23:57 linyx 阅读(319) 评论(0) 推荐(0)
摘要:动态主机设置协议(Dynamic Host Configuration Protocol, DHCP)是一个局域网的网络协议,使用UDP协议工作,主要有两个用途:给内部网络或网络服务供应商自动分配IP地址给用户给内部网络管理员作为对所有计算机作中央管理的手段DHCP使用了租约的概念,或称为计算机IP... 阅读全文
posted @ 2014-06-08 22:43 linyx 阅读(442) 评论(0) 推荐(0)
摘要:无类别(现在)无类别域间路由(Classless Inter-Domain Routing、CIDR)是一个用于给用户分配IP地址以及在互联网上有效地路由IP数据包的对IP地址进行归类的方法。CIDR用可变长子网掩码 (VLSM,Variable Length Subnet Masking),根据各... 阅读全文
posted @ 2014-06-08 22:09 linyx 阅读(1662) 评论(0) 推荐(0)
摘要:Internet Control Message Protocol,ICMP是网路协议族的核心协议之一。它用于TCP/IP网络中发送控制消息,提供可能发生在通信环境中的各种问题反馈,通过这些信息,令管理者可以对所发生的问题作出诊断,然后采取适当的措施解决。ICMP通常用于返回的错误信息或是分析路由。... 阅读全文
posted @ 2014-06-08 21:23 linyx 阅读(195) 评论(0) 推荐(0)
摘要:作为大吃货,需要掌握一些吃货基础知识。在中国影响较大的有四大菜系,代表了各地色、香、味、形俱佳的传统特色烹饪技艺,指:鲁菜(山东)、川菜(四川)、粤菜(广东、广西东部)、淮扬菜(江苏)。八大菜系指:鲁菜、川菜、粤菜、淮扬菜、闽菜、浙菜、湘菜、徽菜。京菜和鄂菜(湖北),即为十大菜系。我大粤菜稳稳居于四... 阅读全文
posted @ 2014-06-08 13:18 linyx 阅读(243) 评论(0) 推荐(0)
摘要:看到微博上转载的知乎上的一篇文章,顺便学习了一些。http://zhuanlan.zhihu.com/wille/19763358贴两个图:相位差则是时间差在一个周期中所占的比例。我们将时间差除周期再乘2Pi,就得到了相位差。欧拉公式:\(e^{ix}=cos(x)+isin(x)\)\(x=\pi... 阅读全文
posted @ 2014-06-08 13:03 linyx 阅读(246) 评论(0) 推荐(0)
摘要:Transmission Control Protocol, TCP是一种面向连接的、可靠的、基于字节流的传输层通信协议.应用层向TCP层发送用于网间传输的、用8位字节表示的数据流,然后TCP把数据流分区成适当长度的报文段(通常受该计算机连接的网络的数据链路层的最大传输单元(MTU:Maximum ... 阅读全文
posted @ 2014-06-07 23:40 linyx 阅读(352) 评论(0) 推荐(0)
摘要:在计算机硬件中,数字都以无符号的二进制形式表示,因此需要一种编码负号的方法。当前有四种方法,用于扩展二进制数字系统,来表示有符号数:原码(sign-and-magnitude),反码(ones' complement),补码(two's complement)。原码、反码、补码都有符号位,符号位为1... 阅读全文
posted @ 2014-06-07 22:00 linyx 阅读(748) 评论(0) 推荐(0)
摘要:整个金融行业大致分为buy side和sell side两大类。Sell side做的主要是把各种asset变成各种金融产品,提供给市场。Sell side主要指的是通常意义上的投行。投行内部结构也很复杂,按照产品分大致分为fixed income和equity两大类。按照业务分大致分为IBD, s... 阅读全文
posted @ 2014-06-07 17:27 linyx 阅读(661) 评论(0) 推荐(0)
摘要:因为平常用的话只是vector的一些非常简单的功能,基本上把它当数组来用,现在也只是把这一部分写了一些。 1 template 2 class XVector { 3 public: 4 XVector(int cacheSize):cacheSize(cacheSize), count(0... 阅读全文
posted @ 2014-06-07 13:25 linyx 阅读(182) 评论(0) 推荐(0)
摘要:A basic requirement is that the function should provide a uniform distribution of hash values. A non-uniform distribution increases the number of coll... 阅读全文
posted @ 2014-06-07 01:14 linyx 阅读(255) 评论(0) 推荐(0)
摘要:等比数列的通项公式:\(a_n=a_1q^{n-1}\)求和公式: \(S_n=\frac{a_1(1-q^n)}{1-q} (q \neq 1) \)等差数列的通项公式: \(a_n=a_1+(n-1)d\)求和公式:\(S_n=na_1+\frac{n(n-1)}{2}d\)特征值和特征向量:设... 阅读全文
posted @ 2014-06-07 00:37 linyx 阅读(377) 评论(0) 推荐(0)
摘要:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?实现题。从最外圈顺时针交换,最... 阅读全文
posted @ 2014-06-06 22:24 linyx 阅读(224) 评论(0) 推荐(0)
摘要:1.1Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?字符串问题,需要先确定是不是只有ASCII码... 阅读全文
posted @ 2014-06-06 14:45 linyx 阅读(303) 评论(0) 推荐(0)
摘要:IEEE 802.1X是IEEE制定关于用户接入网络的认证标准(注意:此处X是大写),全称是“基于端口的网络接入控制”,属于IEEE 802.1网络协议组的一部分。于2001年标准化,之后为了配合无线网络的接入进行修订改版,于2004年完成。它为想要连接到LAN或WLAN的设备提供了一种认证机制。I... 阅读全文
posted @ 2014-06-06 00:11 linyx 阅读(558) 评论(0) 推荐(0)
摘要:Manholes, which interconnect underground sewerage pipes, and serve as a point of entry for cleaning the pipes, are located at every major sewer pipe j... 阅读全文
posted @ 2014-06-05 22:18 linyx 阅读(447) 评论(0) 推荐(0)
摘要:来HK之后,锻炼的时间就少了许多。以后还是要抓紧啊。 计划,两天一次。 1.热身3~5min。2.无氧运动30~60min。(200俯卧撑、300仰卧起坐)3.有氧运动30~60min。(跑步、游泳、羽毛球) 现在一些观点表明仰卧起坐的训练效果不大,而且有可能损伤脊柱,因此很多训练计划都改为使用卷腹 阅读全文
posted @ 2014-06-05 21:47 linyx 阅读(359) 评论(0) 推荐(0)
摘要:You are given a function rand(a, b) which generates equiprobable random numbers between [a, b] inclusive. Generate 3 numbers x, y, z with probability ... 阅读全文
posted @ 2014-06-05 19:50 linyx 阅读(163) 评论(0) 推荐(0)
摘要:随机生成[0,n)中不重复的m个数。 1 class Random { 2 public: 3 Random(int n, int m):n(n), m(m) {} 4 void generate() { 5 srand(time(NULL)); 6 ... 阅读全文
posted @ 2014-06-05 15:43 linyx 阅读(441) 评论(0) 推荐(0)
摘要:花了半天把二分查找的几种都写了一遍。验证了一下。二分查找的正确编写的关键就是,确保循环的初始、循环不变式能够保证一致。 可以先从循环里面确定循环不变式,然后再推导初始条件,最后根据循环不变式的内容推导出结果。 1. 普通的二分查找 第一版本: 循环内部有三次比较,一般来说,相等的操作只需要判断一次, 阅读全文
posted @ 2014-06-05 13:58 linyx 阅读(228) 评论(0) 推荐(0)
摘要:Bubble sortBubble sort, sometimes incorrectly referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the... 阅读全文
posted @ 2014-06-05 12:35 linyx 阅读(658) 评论(0) 推荐(0)
摘要:ARMARM架构,过去称作高级精简指令集机器(Advanced RISC Machine,更早称作:Acorn RISC Machine),是一个32位精简指令集reduced instruction set computing(RISC)处理器架构,其广泛地使用在许多嵌入式系统设计。由于节能的特点... 阅读全文
posted @ 2014-06-04 23:57 linyx 阅读(4148) 评论(0) 推荐(0)
摘要:筛选时间原页面的发车时间太宽了,如果只想要16:30-19:20的票就没法选。我一般是这个时间段回去。chrome里面,右键->审查元素(发车时间那个下拉列表)->修改value->重新选一下下拉列表那个改动过的项。刷新时间F12->Console->输入autoSearchTime=500->回车... 阅读全文
posted @ 2014-06-04 22:54 linyx 阅读(243) 评论(0) 推荐(0)
摘要:有一些网站不允许文本选择,对于我这种伸手党实在是很不友好。当然像这类的功能,应该是用JS来控制。chrome的话,JS禁用可以在地址栏旁边的一个下拉列表那里选。 阅读全文
posted @ 2014-06-04 22:45 linyx 阅读(863) 评论(0) 推荐(0)
摘要:英文履历(Resume)和中文履历表的格式上有什么不同呢?中文的履历表是一个表格,把该填的资料填进去就是了,在国外找工作用的英文履历,则是在一张白纸上,用你喜欢的表达方式、文字、格式,把你的优点和与众不同之处写上去,所以你之后能不能拿到面试机会,甚至于能不能得到这份工作,就取决于这小小的一张履历。那... 阅读全文
posted @ 2014-06-04 22:40 linyx 阅读(1914) 评论(0) 推荐(0)
摘要:1. Take default loss function for grantedMany practitioners train and pick the best model using the default loss function (e.g., squared error). In pr... 阅读全文
posted @ 2014-06-04 13:41 linyx 阅读(202) 评论(0) 推荐(0)