abc_begin

导航

2017年10月3日 #

219. Contains Duplicate II【easy】

摘要: 219. Contains Duplicate II【easy】 Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array suc 阅读全文

posted @ 2017-10-03 11:34 LastBattle 阅读(139) 评论(0) 推荐(0) 编辑

217. Contains Duplicate【easy】

摘要: 217. Contains Duplicate【easy】 Given an array of integers, find if the array contains any duplicates. Your function should return true if any value app 阅读全文

posted @ 2017-10-03 11:15 LastBattle 阅读(190) 评论(0) 推荐(0) 编辑

2017年10月1日 #

awk按列求和

摘要: awk 'BEGIN{total=0}{total+=$1}END{print total}' 阅读全文

posted @ 2017-10-01 15:13 LastBattle 阅读(443) 评论(0) 推荐(0) 编辑

2017年9月30日 #

nginx源码学习_源码结构

摘要: nginx的优秀除了体现在程序结构以及代码风格上,nginx的源码组织也同样简洁明了,目录结构层次结构清晰,值得a56爆大奖在线娱乐们去学习。nginx的源码目录与nginx的模块化以及功能的划分是紧密结合,这也使得a56爆大奖在线娱乐们可以很方便地找到相关功能的代码。 下面是nginx源码的目录结构: 对于上面src文件夹,输出结果 阅读全文

posted @ 2017-09-30 14:16 LastBattle 阅读(1075) 评论(0) 推荐(0) 编辑

nginx 模块简介

摘要: nginx模块一般分为5类:核心模块、标准http模块、可选http模块、邮件服务模块、第三方模块。 其中核心模块和标准http模块在快速编译之后就包含在了nginx中。 主要看一下核心模块、标准http模块和可选http模块,这些模块都可以在ngx_modules.c中找到: 1、核心模块 上面的 阅读全文

posted @ 2017-09-30 11:26 LastBattle 阅读(448) 评论(0) 推荐(0) 编辑

2017年9月29日 #

nginx configure参数

摘要: 下面是nginx源码程序的configure参数: --prefix= 指向安装目录。默认为:/usr/local/nginx --sbin-path= 指定执行程序文件存放位置。默认为:prefix/sbin/nginx --modules-path= 指定第三方模块的存放路径。 --conf-p 阅读全文

posted @ 2017-09-29 16:39 LastBattle 阅读(295) 评论(0) 推荐(0) 编辑

2017年9月27日 #

libevent源码学习_event_test

摘要: 对应的sample文件中提供了event_test.c,里面就是关于事件的简单示例,具体如下: 从这个例子中,a56爆大奖在线娱乐们可以看到使用libevent的基本步骤: event_init --> event_set --> event_add --> event_dispatch 下面分步来解析这些函数。 1 阅读全文

posted @ 2017-09-27 17:57 LastBattle 阅读(434) 评论(0) 推荐(0) 编辑

libevent源码学习_event结构体

摘要: 在libevent中最重要的结构体莫过于event和event_base了,下面对于这2个结构体进行分析。 1、结构体event,位于:event.h 2、结构体event_base,位于:event_internal.h 3、结构体eventop,位于:event_internal.h 实际真正使 阅读全文

posted @ 2017-09-27 16:24 LastBattle 阅读(618) 评论(0) 推荐(0) 编辑

do{...}while(0)的意义和用法

摘要: linux内核和其他一些开源的代码中,经常会遇到这样的代码: 这样的代码一看就不是一个循环,do..while表面上在这里一点意义都没有,那么为什么要这么用呢? 实际上,do{...}while(0)的作用远大于美化你的代码。查了些资料,总结起来这样写主要有以下几点好处: 1、辅助定义复杂的宏,避免 阅读全文

posted @ 2017-09-27 11:30 LastBattle 阅读(278) 评论(0) 推荐(0) 编辑

2017年9月23日 #

345. Reverse Vowels of a String【easy】

摘要: 345. Reverse Vowels of a String【easy】 Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hell 阅读全文

posted @ 2017-09-23 23:29 LastBattle 阅读(145) 评论(0) 推荐(0) 编辑