自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(242)
  • 资源 (23)
  • 收藏
  • 关注

原创 我的.vimrc文件

set nocompatibleset autoindentset smartindentset showmatchset rulerset incsearchset mouse=nset tabstop=4set shiftwidth=4set softtabstop=4set cindentsyntax enableset numberset confirmset

2014-07-28 19:41:56 833

原创 第九章 TCP和UDP同时用复用一个端口实现一个回射服务器

linux服务器编程 TCP和UDP同时用复用一个端口实现一个回射服务器

2014-07-13 17:24:54 2603

原创 第九章 select模式下的非阻塞连接

#include #include #include #include #include #include #include #include #include #include #include #include #include #define BUFFER_SIZE 1023int setnonblocking( int fd ){ int old_

2014-07-13 17:11:52 969

原创 第九章 用多线程来读取epoll模型下的客户端数据

linux服务器编程 用多线程来读取epoll模型下的客户端数据

2014-07-13 16:54:07 1428

原创 第九章 select用法初试

#include #include #include #include #include #include #include #include #include #include #include int main( int argc, char* argv[] ){ if( argc <= 2 ) { printf( "usage: %s ip_address

2014-07-13 16:46:04 723

原创 第九章 两种模式的比较

linux服务器编程

2014-07-13 16:41:23 1100 1

原创 华为上机 公共字串计算

我用这种方法,提交了好几次,#include#include#include#includeusing namespace std;int getCommonStrLength(char *pFirstStr,char *pSecondStr){ if(strlen(pFirstStr)==0||strlen(pSecondStr)==0)

2014-07-12 16:01:35 1007 6

原创 leetcode 11 Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?

2014-07-10 16:50:26 665

原创 leetcode 10 Linked List Cycle II

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?

2014-07-10 16:39:47 669

原创 leetcode 17 Candy

There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on

2014-07-10 15:42:07 645

原创 leetcode 15 Single Number II

Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without u

2014-07-10 15:02:32 744

原创 leetcode 66 Plus One

#include#include#includeusing namespace std;vector plusOne(vector &digits){ int len=digits.size(); vector res(digits); int carrybit=1,i; for(i=len-1;i>=0;i--)

2014-07-09 21:15:28 625

原创 leetcode 74 Subsets

Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For exa

2014-07-09 15:34:32 693

原创 leetcode 75 Combinations

#include#include#includeusing namespace std;void com(int depth,int n,int k,vector v,vector > &res){ if(v.size()==k) { res.push_back(v); return ;

2014-07-09 15:06:49 758

原创 leetcode 46 Permutations

#include#include#includeusing namespace std;void perm(int start,int end,vector in,vector > &res){ if(start==end) { res.push_back(in); return ;

2014-07-09 11:26:41 666

原创 leetcode 149 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2014-07-07 22:01:15 621

原创 leetcode 69 Sqrt(x)

int sqrt(int x){return std::sqrt(x);}

2014-07-07 19:54:50 824

原创 leetcode 127 Word Ladder

Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m

2014-07-07 16:20:16 1058

原创 leetcode 150 Median of Two Sorted Arrays

There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

2014-07-07 11:06:19 831

原创 leetcode 151 Two Sum

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 to the target, whe

2014-07-06 21:06:24 830 1

转载 ubuntu 安装 openssh-server

一直想不下linux技术,一直没有时间弄,最近由于工作上的需要,需要熟悉linux系统,借此机会好好学习一下首是是最其本的,安装openssh-server,方便远程访问,使用Putty可以访问ubuntu    PuTTY 是一套免费的 SSH / Telnet 程序,它可以连接上支持 SSH Telnet 联机的站台,并且可自动取得对方的系统指纹码(Fingerprint)。建

2014-07-03 13:56:25 794

转载 Ubuntu下搭建FTP服务器

服务器系统是Ubuntu 12.04 LTS,FTP软件当然是选择大名鼎鼎的vsftpd(very secure FTP daemon), 用系统自带的FTP还好Ubuntu装vsftpd还是很简单,一句命令就行:sudo apt-get install vsftpd命令执行过程中,安装程序会给本地创建一个名为“ftp”的用户组,命令执行完之后会自动启动FTP服务。可以使用

2014-07-03 13:55:45 722

原创 C++ STL学习之九:关联式容器map深入学习

MAP容器        1)概念:map 是一个容器,它用于储存数据并且能从一个数据集合中取出数据。它的数据组成包含两项,一个是它的数据值,一个是用于排序的关键字。其中关键字是惟一的,它用于将数据自动排序。而每个元素的数据值与关键字无关,可以直接改变。                     【重点】内部结构采用RB_TREE(红黑树)。查找复杂度:O(log2N)      

2014-07-02 17:26:39 708

原创 C++ STL学习之八:关联式容器set深入学习

set和map的最大不同就是set是单值,而map是键值对, 当然set也可以理解成键值对相等的特殊键值对。这样讲的话,我们大概就知道了,它们的底层实现就是一个东西。那么multiset和set有什么区别呢?主要值能不能重复的问题,如果可以保存多个相同值的话就使用multiset否则就使用set。因为插入的时候,它们分别调用的是insert和unique_insert;同理,map和multima

2014-07-02 17:02:39 745

原创 C++ STL学习之七:配接器priority_queue深入学习

priority_queue是一个带有权值观念的队列,因此取出元素的时候只能取出权值最大的元素。 priority_queue完全以底层容器为根据(缺省为vector),加上heap处理规则实现。

2014-07-02 16:15:20 689

原创 C++ STL学习之六:配接器queue深入学习

一,概述         先进先出的数据结构,底端加入元素,顶端移除元素,类似stack同样不能有遍历行为,没有迭代器。也是以既有容器为底端容器被归类为陪接器(container adapter),默认底端容器为deque。二,使用         #include           using namespace std;三,方法queue:

2014-07-02 15:38:42 643

原创 C++ STL学习之五:配接器stack深入学习

stack是一种先进先出的数据结构。只能在栈顶操作。它以底层容器完成所有的操作,因此是一个adapter(配接器)。

2014-07-02 15:28:50 594

原创 C++ STL学习之四:序列式容器list深入学习

特点:1)环状双向链表,对于任何位置的元素插入或删除是常数时间2)插入和接合不会使原有list迭代器失效list迭代器:不能以普通指针为迭代器,使用bidirectional iterator插入操作:本质是插入在…之前,新节点位于标示出插入点所指节点的前方,插入前的所有迭代器在插入后有效

2014-07-02 14:48:12 785

原创 C++ STL学习之一:STL概况

0. STL综述STL(Standard Template Library)C++模板库,该书剖析的是SGI版本的STL,是GNU C++的标准库。STL的价值:1.带给我们一套极具实用价值的零部件,一集一个整合的组织。2.STL带给我们一个高层次的,已泛型思维为基础的,系统化的,条理分明的“软件组件分类学”。STL六大组件:1.容器(vector, list, deque

2014-07-02 10:51:26 802

原创 C++ STL学习之二:序列式容器vector深入学习

vector的空间可扩充,支持随机存取访问,是一段连续线性的空间。所以它是动态空间,与之对比的array是静态的空间,不可扩充。简单来说,vector是数组的增强版。

2014-07-02 10:39:42 709

原创 C++ STL学习之三:序列式容器deque深入学习

deque是双端队列,它的空间构造并非一个vector式的长数组,而是“分段存储,整体维护”的方式;STL允许在deque中任意位置操作元素(删除添加)(这超出了deque的概念,最原始的deque将元素操作限定在队列两端),允许遍历,允许随机访问(这是假象);我们将看到,deque将是STL中stack和queue的幕后功臣,对deque做适当的修正,便可以实现stack和queue。

2014-07-02 10:12:31 781

转载 Careercup | Chapter 5

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 bit i. You can assume that the bits j through i

2014-06-30 18:04:14 650

转载 matlab中记录程序运行时间

使用Matlab运行程序的时候,我们经常需要知道或比较不同程序的具体运行时间,其程序代码如下:st=cputime;        % 程序开始运行时的cpu时间% 程序开始……% 程序结束et=cputime-st        % 计算程序运行所用的时间

2014-06-26 10:26:48 25631

原创 Linux high performance:http请求的读取和分析

#include #include #include #include #include #include #include #include #include #include #define BUFFER_SIZE 4096enum CHECK_STATE { CHECK_STATE_REQUESTLINE = 0, CHECK_STATE_HEADER, CHECK_

2014-06-25 15:33:01 662

原创 Libevent群:很值得体会的多线程编程

/* This exmple program provides a trivial server program that listens for TCP connections on port 9995. When they arrive, it writes a short message to each client connection, and closes each co

2014-06-25 11:29:20 2206

原创 Libevent群:很值得体会的bufferevent+evconnlistener

//说明,为了使我们的代码兼容win32网络API,我们使用evutil_socket_t代替int,使用evutil_make_socket_nonblocking代替fcntl/* For sockaddr_in */#include /* For socket functions */#include /* For fcntl */#include #in

2014-06-25 10:45:17 785

转载 libevent源码浅析: http库

from 转自:http://godorz.info/author/godorz/page/3/libevent自带了一个http库,用它可以很简单的实现一个http服务器,本文非常简单地分析之.evhttpevhttp库有几个主要的结构体,它们之间的联系非常龌龊:其中,结构体event, min_heap, evsignal_info, e

2014-06-22 20:34:20 1277

转载 libevent多线程使用事项

在linux平台上使用c开发网络程序的同志们一般情况下都对鼎鼎大名的libevent非常的熟悉了。但是一些新进入此领域的new new people们对此都是一头雾水。原本的迷茫再加上开源软件一贯的“帮助文件”缺失作风,让我们这些新手们显的非常的无助。幸好有一些热心的朋友们帮忙,才化险为夷啊!    前几天一直在开发一个locker server,虽然公司现有的locker server能

2014-06-22 20:27:35 1057 1

转载 libevent带负载均衡的多线程使用示例

分类: LINUX功能:主线程根据负载工作线程负载均衡算法,每隔一秒钟向特定的工作线程发送一条字符串信息,工作线程简单的把字符串信息打开出来。Makefileeventtest : eventtest.cgcc -Wall -g -levent -lpthread -o eventtest eventtest.c.PHONY : cleancle

2014-06-22 19:55:48 898

转载 用libevent多线程方式实现echo server

功能:主线程同时监听定时器事件和IO事件,工作线程简单的监听IO事件。主线程每隔一秒种向工作线程发送一条字符串信息工作线程显示该信息并回显给主线程该示例演示了主线程如何同时监听多个事件。Makefileeventtest : eventtest.cgcc -Wall -g -levent -lpthread -o eventtest ev

2014-06-22 19:36:35 836

TransporterManual.pdf

IBM CDC实时数据同步

2021-05-18

OGG+TDT(4.8)添加表字段及添加表.docx

IBM CDC实时数据同步

2021-05-18

JavaSE回顾总结(狂神说java).xmind

avaSE回顾总结,学习笔记

2021-02-09

Flink_HBase阿里巴巴电商业务中的应用

Flink_HBase阿里巴巴电商业务中的应用,这个资源共享出来,提供大家学习一下。

2019-01-04

2018最新BAT+面试题目

2018最新BAT+面试题目,共享出来,大家可以参考一下。

2019-01-04

九度求职经验系列之“实习生”篇.pdf

九度求职经验系列之“实习生”篇.pdf 讲述了九度求职经验相关内容

2014-06-02

程序员面试宝典完整版.pdf

程序员面试宝典完整版.pdf 讲述了程序员面试相关内容

2014-06-02

阿里巴巴Oracle DBA笔试题.pdf

阿里巴巴Oracle DBA笔试题.pdf讲述了阿里巴巴Oracle DBA笔试题相关内容

2014-06-02

阿里巴巴2011实习生招聘技术岗位笔试题.pdf

阿里巴巴2011实习生招聘技术岗位笔试题.pdf

2014-06-02

阿里巴巴2010校园招聘技术岗位笔试题(南京站).pdf

阿里巴巴2010校园招聘技术岗位笔试题(南京站).pdf

2014-06-02

C++ 面向对象程序设计.pdf

C++ 面向对象程序设计.pdf 讲述了C++ 面向对象程序设计相关内容

2014-06-02

Linux多线程服务端编程:使用muduo C++网络库.pdf

Linux多线程服务端编程:使用muduo C++网络库.pdf讲述了linux下多线程编程相关内容

2014-06-02

Linux多线程编程手册.pdf

Linux多线程编程手册.pdf讲述了linux下多线程编程相关内容

2014-06-02

Shell脚本学习指南.pdf

Shell编程经典教程 .pdf 讲述了linux下shell编程相关内容,内容详实 实例很多

2014-06-02

Shell编程经典教程 .pdf

Shell编程经典教程 .pdf 讲述了linux下shell编程相关内容,内容详实 实例很多

2014-06-02

Linux高性能服务器编程.pdf

详细地讲解了Linux下的服务器编程及多线程编程

2014-05-29

操作系统内核精析

详细讲述了操作系统的内核,并有全面的程序代码

2013-04-18

空空如也

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

TA关注的人

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