上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要: 之前在看黑客与画家的时候看过,今天重温,完全不一样的感觉!原文地址:http://www.ruanyifeng.com/blog/2010/10/why_lisp_is_superior.html--------------------------------------------------------------------------------------------------------------------------作者:阮一峰日期:2010年10月14日上周,《黑客与画家》总算翻译完成,已经交给出版社了。翻译完这本书,累得像生了一场大病。把书稿交出去的时候,心里空荡荡的, 阅读全文
posted @ 2013-08-24 19:53 KingsLanding 阅读(572) 评论(0) 推荐(0) 编辑
摘要: Packet, Raw, Netlink, and Routing Sockets :Netlink, routing, packet, and raw are all types ofspecialized sockets.Netlink provides a socket-based interface for communication of messages and settings between the user and the internal protocolsRtnetlinkis forapplication-level managementof theneighbor t 阅读全文
posted @ 2012-12-31 19:50 KingsLanding 阅读(1712) 评论(0) 推荐(0) 编辑
摘要: Chapter 5: Linux SocketsSockets provide a standardprotocol-independent interfacebetween the application-level programs and the TCP/IP stack.From the viewpoint of TCP/IP,everything above the transport layer is part ofthe application.The socket API is the best known networking interface for Unix appli 阅读全文
posted @ 2012-12-31 18:35 KingsLanding 阅读(1840) 评论(0) 推荐(0) 编辑
摘要: /***netif_rx-post buffer to the network code*@skb: buffer to post**This function receives a packet from a device driver and queues it for*the upper (protocol) levels to process. It always succeeds. The buffer*may be dropped during processing for congestion control or by the*protocol layers.**return 阅读全文
posted @ 2012-12-25 22:47 KingsLanding 阅读(5758) 评论(0) 推荐(1) 编辑
摘要: 原文地址:http://software.intel.com/en-us/articles/avoiding-and-identifying-false-sharing-among-threadsAvoiding and Identifying False Sharing Among ThreadsAbstractIn symmetric multiprocessor (SMP) systems, each processor has a local cache. The memory system must guarantee cache coherence.False sharing oc 阅读全文
posted @ 2012-12-23 20:25 KingsLanding 阅读(1552) 评论(0) 推荐(1) 编辑
摘要: Chap-3:TCP/IP in Embedded SystemsTwo guiding principlesallow protocol stacks to be implemented as shown in the OSI model:information hidingandencapsulation.Thephysical layer(PHY) isresponsible forthemodulationandelectrical details of data transmission.One of theresponsibilitiesof thedata link layeri 阅读全文
posted @ 2012-12-20 21:43 KingsLanding 阅读(2336) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>intmain(){chara=1;charb=2;intc[10];inti;for(i=0;i<=10;i++)c[i] =i* (i<<8);printf("%d %d\n",a,b);return0;}运行结果是多少?答案是:0 0要知道为什么,首先要能够划出栈的布局,然后确切的理解小端机是什么意思,知道数组的增长方式,看下图:虽然自己对栈布局和大小端机都有了解,无奈在一对一纸上笔试的时候还是没有做对。回来在Centos下试了一下,在windows下是 阅读全文
posted @ 2012-10-15 09:34 KingsLanding 阅读(1254) 评论(3) 推荐(0) 编辑
摘要: 设计模式分为三种类型,共23类。 创建型模式:单件模式、抽象工厂模式、建造者模式、工厂方法、原型模式。 结构型模式:适配器模式、桥接模式、装饰模式、组合模式、外观模式、享元模式、代理模式。 行为型模式:模版方法模式、命令模式、迭代器模式、观察者模式、中介者模式、备忘录模式、解释器模式、状态模式、策略模式、职责链模式、访问者模式。 Abstract Factory(抽象工厂模式):提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类。Adapter(适配器模式):将一个类的接口转换成客户希望的另外一个接口。A d a p t e r模式使得原本由于接口不兼容而不能... 阅读全文
posted @ 2012-09-30 20:37 KingsLanding 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 为什么要提倡"Design Pattern"呢?根本原因是为了代码复用,增加可维护性。那么怎么才能实现代码复用呢?面向对象有几个原则:开闭原则(Open Closed Principal,OCP)、里氏代换原则(LSP)、依赖倒转原则(DIP)、接口隔离原则(ISP)以及抽象类(Abstract Class)、接口(Interface)。开闭原则具有理想主义的色彩,它是面向对象设计的终极目标。其他几条,则可以看做是开闭原则的实现方法 设计模式就是实现了这些原则,从而达到了代码复用、增加可维护性的目的。开放封闭原则 此原则是由"Bertrand Meyer" 阅读全文
posted @ 2012-09-30 20:35 KingsLanding 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 早上起来看微博,看到大神们又在关于C++的各种讨论,找相关知识来看看,搜到了这篇文章。Google有很多自己实现的使C++代码更加健壮的技巧、功能,以及有异于别处的C++的使用方式。1. 智能指针(Smart Pointers)如果确实需要使用智能指针的话,scoped_ptr完全可以胜任。在非常特殊的情况下,例如对STL容器中对象,你应该只使用std::tr1::shared_ptr,任何情况下都不要使用auto_ptr。“智能”指针看上去是指针,其实是附加了语义的对象。以scoped_ptr为例,scoped_ptr被销毁时,删除了它所指向的对象。shared_ptr也是如此,而且,s.. 阅读全文
posted @ 2012-09-01 07:46 KingsLanding 阅读(1644) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页