Given a sorted array, remove the duplicates in
place such that each element appear onlyonceand return the new length.Do not
allocate extra space for a...
分类:
其他好文 时间:
2014-05-21 20:00:51
阅读次数:
296
【题目】
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
【题意】
给定一个数组,找出第一个缺失的正数。时间复杂度O(n)
...
分类:
其他好文 时间:
2014-05-21 17:13:07
阅读次数:
219
传统的消息模型有两种模型,队列模型和发布-订阅模式。
1. 队列形式中,一群消费者可能从server那边读消息,而每条消息会流向他们中的一个。
2. 发布-订阅模式中,消息会广播到所有它的消费者们那。
Kafka是使用consumer group这个概念(下面把它翻译为"消费组"),把两者结合了。。
消费者给自己标志了一个消费组名,每条新发布到topic的消息会被传递给订阅它的消费组里的消费者实例,这些消费者实例可以是不同的进程,存在在不同的机器上。
如果所有的消费者在同一个消费组里,那么这相当于是...
分类:
其他好文 时间:
2014-05-21 16:12:44
阅读次数:
279
本文参考《Android系统源代码情景分析》,作者罗升阳
一、测试代码:
~/Android/external/binder/server
----FregServer.cpp
~/Android/external/binder/common
----IFregService.cpp
...
分类:
移动开发 时间:
2014-05-21 15:48:09
阅读次数:
507
1 LVS简介
Linux VirtualServer是一个高扩展和高可用性服务器,在一个真正服务器的集群中构建而成,包含Linux操作系统中的负载均衡。 服务器的架构对于终端用户而言是完全透明的,在与用户交互过程中,用户感觉它好像是一台高性能的服务器。它的拓扑机构如下所示。
真正的服务器和负载均衡可能是通过要么高速LAN网或者通过分散的WAN网进行...
分类:
系统相关 时间:
2014-05-21 09:52:44
阅读次数:
394
之前用过uip作为udp使用,但将它作为server还没有涉及到,最近有个小项目中需要使用。以下针对它作为tcp_server流程测试和探索。
struct timer periodic_timer, arp_timer;
//struct uip_udp_conn myUdp_Con;
//struct uip_udp_conn *pMyUpd_Con;
//...
分类:
其他好文 时间:
2014-05-21 08:51:30
阅读次数:
490
本文参考《Android系统源代码情景分析》,作者罗升阳
一、测试代码:
~/Android/external/binder/server
----FregServer.cpp
~/Android/external/binder/common
----IFregService.cpp
...
分类:
移动开发 时间:
2014-05-21 08:36:38
阅读次数:
536
IHTMLDocument2 *pDoc;
IHTMLElementCollection *objAllElement;
HRESULT hr;
CoInitialize(NULL);
hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IHTMLDocument2, (void**)&pDoc);...
分类:
Web程序 时间:
2014-05-21 07:47:48
阅读次数:
382
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up t...
分类:
其他好文 时间:
2014-05-21 07:42:18
阅读次数:
230