12 2014 档案

摘要:今天上线了一个API,6台机器做的集群。API的第一步是读取cookie,判断用户是否登录。例如,线上服务器分别是10.255.242.1 10.255.242.2 10.255.242.3 10.255.242.4 10.255.242.5 10.255.242.6, API地址是... 阅读全文
posted @ 2014-12-30 19:08 tai君 阅读(230) 评论(0) 推荐(0)
摘要:$item){ if(is_object($item) || is_array($item)){ $arr_xml[$key] = xmlToArray($item); } } return $arr_xml... 阅读全文
posted @ 2014-12-26 11:46 tai君 阅读(1367) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-12-15 11:43 tai君 阅读(386) 评论(0) 推荐(0)
摘要:";echo $a;echo "";methodTwo();echo "";echo $a;?> 这是当初校招的时候 迅雷的面试官问的一个问题 阅读全文
posted @ 2014-12-12 18:24 tai君 阅读(1302) 评论(0) 推荐(0)
摘要:$k){ return $this->search($arr, $k, $low, $mid-1); } if ($arr[$mid]search($arr, $k, $mid+1, $high); } return false; }}class Client{ public s... 阅读全文
posted @ 2014-12-09 11:16 tai君 阅读(637) 评论(0) 推荐(0)
摘要:php里面解决约瑟夫环还是比较方面的,但是下面的方法太费空间m = $m; $this->n = $n; } public function getKing(){ $mokeys = range(1, $this->n); $tmp = 0; while(count($mokeys)>1)... 阅读全文
posted @ 2014-12-08 19:25 tai君 阅读(389) 评论(0) 推荐(0)
摘要:还是要常常写程序啊,顺序表的归并操作,是归并排序中的基础操作mergeArray($arr_1, $arr_2); print_r($arr); }}Client::main();?> 阅读全文
posted @ 2014-12-08 17:30 tai君 阅读(432) 评论(0) 推荐(0)
摘要:此文是之前项目经验的续篇。上篇讲了开发抽奖API遇到的难点及其解决方案,这篇将讲述上线后发生的事情。抽奖项目上线之后,反响不错,领导还表扬了。但是有一天上午,有个事业部打来电话,说刚刚开始上线的活动,抽奖提示奖品已抽完,叫我们查一下。活动是百分百中奖的,只有所有奖品库存没有了,才会提示奖品已经抽完。... 阅读全文
posted @ 2014-12-07 17:40 tai君 阅读(241) 评论(0) 推荐(0)
摘要:$arr[$j+1]){ $tmp = $arr[$j]; $arr[$j] = $arr[$j+1]; $arr[$j+1] = $tmp; } } } return $arr; } }//冒泡的改进算法class BubbleSortB implements... 阅读全文
posted @ 2014-12-01 16:25 tai君 阅读(223) 评论(0) 推荐(0)