<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[lhbeggar的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/lhbeggar</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; lhbeggar]]></copyright><item><title><![CDATA[PHP垃圾回收机制之性能方面的考虑]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/49427177</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/49427177</guid><author>lhbeggar</author><pubDate>Mon, 26 Oct 2015 17:22:08 +0800</pubDate><description><![CDATA[性能方面考虑的因素 ¶
在上一节我们已经简单的提到：回收可能根有细微的性能上影响，但这是把PHP 5.2与PHP 5.3比较时才有的。尽管在PHP 5.2中，记录可能根相对于完全不记录可能根要慢些，而PHP 5.3中对 PHP run-time 的其他修改减少了这个性能损失。
这里主要有两个领域对性能有影响。第一个是内存占用空间的节省，另一个是垃圾回收机制执行内存清理时的执行时间增加(run-]]></description><category></category></item><item><title><![CDATA[PHP垃圾回收机制之回收周期]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/49425355</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/49425355</guid><author>lhbeggar</author><pubDate>Mon, 26 Oct 2015 16:06:50 +0800</pubDate><description><![CDATA[回收周期(Collecting Cycles) ¶
传统上，像以前的 php 用到的引用计数内存机制，无法处理循环的引用内存泄漏。然而 5.3.0 PHP 使用文章» 引用计数系统中的同步周期回收(Concurrent
 Cycle Collection in Reference Counted Systems)中的同步算法，来处理这个内存泄漏问题。
对算法的完全说明有点超出这部分内容的范围]]></description><category></category></item><item><title><![CDATA[PHP垃圾回收机制之引用计数]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/49424221</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/49424221</guid><author>lhbeggar</author><pubDate>Mon, 26 Oct 2015 15:05:47 +0800</pubDate><description><![CDATA[引用计数基本知识 ¶
每个php变量存在一个叫"zval"的变量容器中。一个zval变量容器，除了包含变量的类型和值，还包括两个字节的额外信息。第一个是"is_ref"，是个bool值，用来标识这个变量是否是属于引用集合(reference set)。通过这个字节，php引擎才能把普通变量和引用变量区分开来，由于php允许用户通过使用&来使用自定义引用，zval变量容器中还有一个内部引用计数机制]]></description><category></category></item><item><title><![CDATA[PHP socket类]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46412537</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46412537</guid><author>lhbeggar</author><pubDate>Mon, 08 Jun 2015 14:48:23 +0800</pubDate><description><![CDATA[没事的时候自己封装了一个socket类
功能很简单和curl功能是一样的
class socketClass{
    private $host;
    private $url;
    private $error_no = 0;
    public $error_str = '';
    private $port = 80;
    private $timeout = 5;]]></description><category></category></item><item><title><![CDATA[PHP做APP接口时，如何保证接口的安全性]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46377653</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46377653</guid><author>lhbeggar</author><pubDate>Fri, 05 Jun 2015 15:51:05 +0800</pubDate><description><![CDATA[PHP做APP接口时，如何保证接口的安全性？
1、当用户登录APP时，使用https协议调用后台相关接口，服务器端根据用户名和密码时生成一个access_key，并将access_key保存在session中，将生成的access_key和session_id返回给APP端。
2、APP端将接收到的access_key和session_id保存起来
3、当APP端调用接口传输数据时，将所传数]]></description><category></category></item><item><title><![CDATA[MYSQL性能优化]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46360655</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46360655</guid><author>lhbeggar</author><pubDate>Thu, 04 Jun 2015 14:18:42 +0800</pubDate><description><![CDATA[转载地址：http://blog.youkuaiyun.com/iquicksandi/article/details/7970706

网上有很多的文章教怎么配置MySQL服务器，但考虑到服务器硬件配置的不同，具体应用的差别，那些文章的做法只能作为初步设置参考，我们需要根据自己的情况进行配置优化，好的做法是MySQL服务器稳定运行了一段时间后运行，根据服务器的”状态”进行优化。
　　mysql> sh]]></description><category></category></item><item><title><![CDATA[深入理解Redis主键失效原理及实现机制]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46355979</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46355979</guid><author>lhbeggar</author><pubDate>Thu, 04 Jun 2015 09:20:52 +0800</pubDate><description><![CDATA[转载地址：http://blog.jobbole.com/71095/


对于缓存失效，不同的缓存有不同的处理机制，可以说是大同中有小异，作者通过对Redis 文档与相关源码的仔细研读，为大家详细剖析了 Redis 的缓存过期/失效机制相关的技术原理与实现细节。
下面是作者原文：
作为一种定期清理无效数据的重要机制，主键失效存在于大多数缓存系统中，Redis 也不例外。在 Redis ]]></description><category></category></item><item><title><![CDATA[linux命令学习（每天都会更新）]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46341509</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46341509</guid><author>lhbeggar</author><pubDate>Wed, 03 Jun 2015 10:11:09 +0800</pubDate><description><![CDATA[1、crontab命令

基本格式 : 
*　　*　　*　　*　　*　　command 

分　时　  日　  月　 周　    命令 
第1列表示分钟1～59 每分钟用*或者 */1表示 
第2列表示小时1～23（0表示0点） 
第3列表示日期1～31 
第4列表示月份1～12 
第5列标识号星期0～6（0表示星期天） 
第6列要运行的命令 
crontab文件的一些例子]]></description><category></category></item><item><title><![CDATA[PHP中include和require的区别]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46313047</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46313047</guid><author>lhbeggar</author><pubDate>Mon, 01 Jun 2015 16:42:37 +0800</pubDate><description><![CDATA[1、include用到时加载
2、require程序一开始就会加载
3、include_once和require_once保证同一个文件只会被引入一次
4、include在引入文件时发生错误，则会继续执行
5、require在引入文件时发生错误，则会结束运行
6、include是有条件加载，require是无条件加载]]></description><category></category></item><item><title><![CDATA[PHP求给定数组的组合]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46312183</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46312183</guid><author>lhbeggar</author><pubDate>Mon, 01 Jun 2015 16:00:25 +0800</pubDate><description><![CDATA[1、求给定数组的组合
如array('a', 'b', 'c')
结果为
a
b
c
a b
a c
b c
function combination($arr){
    if(empty($arr)){
        return false;
    }
    $count = count($arr);
    for($i=1; $i<$count; $i++){
 ]]></description><category></category></item><item><title><![CDATA[进程与线程之间的关系]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46236515</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46236515</guid><author>lhbeggar</author><pubDate>Fri, 29 May 2015 15:11:13 +0800</pubDate><description><![CDATA[看到一种说法是“一个程序至少有一个进程，一个进程至少有一个线程”，这种把程序与进程，进程与线程的关系混淆的说法是错误的。

程序(program)只能有一个进程，一个进程就是一个程序。有人说，我打开一个程序，比如chrome，有十多个进程呢，这是咋回事。那就是十多个程序，操作系统给他们分配了彼此独立的内存，相互执行不受彼此约束，分配同样时间的CPU。对于用户而言，他们是一个整体，我们通常称之为]]></description><category></category></item><item><title><![CDATA[PHP静态成员变量和非静态成员变量]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46124775</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46124775</guid><author>lhbeggar</author><pubDate>Thu, 28 May 2015 16:18:29 +0800</pubDate><description><![CDATA[PHP静态成员变量和非静态成员变量
突然在网上找到了一遍对PHP静态变量和非静态变量讲解比较深入的一遍文章，特转来分享下。
转载地址：http://blog.chinaunix.net/uid-20722281-id-160034.html

数据成员可以分静态变量、非静态变量两种. 
静态成员：静态类中的成员加入static修饰符,即是静态成员.可以直接使用类名+静态成员名访问此静态成]]></description><category></category></item><item><title><![CDATA[memcached缓存的执行过程]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46120951</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46120951</guid><author>lhbeggar</author><pubDate>Thu, 28 May 2015 13:58:15 +0800</pubDate><description><![CDATA[memcached缓存为什么可以支持高并发读写？
1、多路复用I/O模型
      传统I/O中，系统可能会因为某个用户的I/O连接没有做好准备而一直等待，直到这个连接做好准备，这个当有其他用户连接服务器时，由于系统的阻塞而得不到响应。
      多路复用I/O模型是一种消息通知模式，用户做好I/O连接准备后，系统会通知我们这个连接已经做好I/O准备，这样就不会阻塞某个用户的连接，正因为]]></description><category></category></item><item><title><![CDATA[PHP 类的静态成员变量和普通成员变量对比]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/46119705</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/46119705</guid><author>lhbeggar</author><pubDate>Thu, 28 May 2015 11:04:24 +0800</pubDate><description><![CDATA[有很多人可能弄不清楚，在PHP中类的静态成员变量和普通成员变量有什么区别？
1、类的静态方法只能访问静态成员变量，而不能访问非静态成员变量
2、静态成员变量不需要实例化就能访问，且访问速度快一些
3、类的静态成员变量只属于这个类，但类的所有实例共享这个静态成员变量


一个由 c/c++编译过的程序占用的内存分为一下几个部分
（1）、栈区 stack ：
             ]]></description><category></category></item><item><title><![CDATA[C语言 最大堆排序]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/45896891</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/45896891</guid><author>lhbeggar</author><pubDate>Thu, 21 May 2015 21:17:05 +0800</pubDate><description><![CDATA[#include
using namespace std;

int left(int i){
	return 2*i;
}
int right(int i){
	return 2*i+1;
}
int parent(int i){
	return i/2;
}
void maxHeapify(int *arr, int length, int i){
	if(arr == 0 || i < 0)]]></description><category></category></item><item><title><![CDATA[C语言 判断给定数组是否为二叉查找树后序遍历结果]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/45870039</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/45870039</guid><author>lhbeggar</author><pubDate>Wed, 20 May 2015 13:59:33 +0800</pubDate><description><![CDATA[题目：输入一个整数数组，判断该数组是不是某二元查找树的后序遍历的结果。如果是返回true，否则返回false。
例如输入5、7、6、9、11、10、8，由于这一整数序列是如下树的后序遍历结果：
         8
       /  \
      6    10
    / \    / \
   5   7   9  11
因此返回true
#include
using na]]></description><category></category></item><item><title><![CDATA[C语言 二叉查找树镜像]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/45868281</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/45868281</guid><author>lhbeggar</author><pubDate>Wed, 20 May 2015 11:11:16 +0800</pubDate><description><![CDATA[题目：输入一颗二元查找树，将该树转换为它的镜像，即在转换后的二元查找树中，左子树的结点都大于右子树的结点。用递归和循环两种方法完成树的镜像转换。
例如输入：
     8
    /  \
  6      10
 /\       /\
5  7    9   11
输出：
      8
    /  \
  10    6
 /\      /\
11  9  7  ]]></description><category></category></item><item><title><![CDATA[约瑟夫环的两种解法]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/45867513</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/45867513</guid><author>lhbeggar</author><pubDate>Wed, 20 May 2015 10:22:03 +0800</pubDate><description><![CDATA[题目：n个数字（0,1,…,n-1）形成一个圆圈，从数字0开始，每次从这个圆圈中删除第m个数字（第一个为当前数字本身，第二个为当前数字的下一个数字）。当一个数字删除后，从被删除数字的下一个继续删除第m个数字。求出在这个圆圈中剩下的最后一个数字。
#include
#include;
using namespace std;

int lastRemaining(int num, int m){
]]></description><category></category></item><item><title><![CDATA[栈的push、pop序列[数据结构]]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/45846017</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/45846017</guid><author>lhbeggar</author><pubDate>Tue, 19 May 2015 16:09:59 +0800</pubDate><description><![CDATA[题目：输入两个整数序列。其中一个序列表示栈的push顺序，判断另一个序列有没有可能是对应的pop顺序。为了简单起见，我们假设push序列的任意两个整数都是不相等的。
比如输入的push序列是1、2、3、4、5，那么4、5、3、2、1就有可能是一个pop系列。因为可以有如下的push和pop序列：push
 1，push 2，push 3，push 4，pop，push
 5，pop，pop，]]></description><category></category></item><item><title><![CDATA[C语言 数组中只出现一次的值]]></title><link>https://blog.youkuaiyun.com/lhbeggar/article/details/45842125</link><guid>https://blog.youkuaiyun.com/lhbeggar/article/details/45842125</guid><author>lhbeggar</author><pubDate>Tue, 19 May 2015 10:56:10 +0800</pubDate><description><![CDATA[题目：一个整型数组里除了两个数字之外，其他的数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n)，空间复杂度是O(1)。
#include
using namespace std;

int findFirstBit1(int num){
	int indexBit1 = 0;
	while((num & 1) == 0 && indexBit1 < 32){
		nu]]></description><category></category></item></channel></rss>