PHP-Parser 学习笔记

缘起 最近工作上接到一个任务,要把项目代码的控制器中所有没有判断过权限的public方法找出来。我们的控制器里有一个统一的checkAllow

Algorithms Part I week 1: Analysis of Algorithms

Why to analyze? To solve a single problem, there may be many different algorithms. Should we just randomly pick up one or use the best one? Of course, we want the best one. But how can we assert that this one is better than that one? Even though we have the best one, is it really the best one in the world? Can there be a better undiscovered algorithm? We must analyze algorithms to:

Algorithms Part I week 1: union-find

Theses days, I took a MOOC course named Algorithms instructed by Robert Sedgewick and Kevin Wayne from Princton University. To solidify my understanding of the course and for future reference, I'm going to write some notes on the subject. And from this post on, I decide to write technical articles in English, which is a good way to improve my written English skill. Basic steps There are some steps we can follow to develop a usable algorithm.

laravel route 重定向的一个小坑

今天做项目发现一个奇怪的现象,我的路由配置里有如下配置: 1 2 3 4 5 6 7 8 <?php Route::group(array('prefix'=>'admin','before'=>'adminauth'),function(){ // 管理员登录 Route::get('/',function(){ return Redirect::to('admin/login'); }); Route::get('login','UserController@adminLogin'); }; 目的是无论用户输入admin,还是adm

搭建 vpn

今天入手了linode,网站环境搭建好后,开始弄vpn。本文参考了一下这篇文章,并结合之前的经验。 1. 安装PPP,PPTP 1 2 # yum install -y ppp # rpm -ivh

fedora20 rime安装成功

实在是无法抑制心中的喜悦啊! 这段时间又突发奇想想折腾linux了。之前有朋友说fedora下rime输入法比较好装,于是前两天装了fedor

php socket 编程文章推荐

一直想做一个在线聊天的程序,不免搜集一些资料。对于实时通信,目前流传广泛并且已经成熟的技术是ajax长轮询(具体介绍请百度,不是本文主要内容

js中获取鼠标点击位置和按键值

看一下下面这段代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <html> <head> <script type="text/javascript" charset="utf-8"> function mousemove() { document.myForm.screenx.value=event.clientX; document.myForm.screeny.value=event.clientY; } </script> </head> <body> <form action="test_submit" method="get" name="myForm"> <img src="./aaa.png" onmousemove="mousemove()"/> <input type="text" name="screenx" value="change when mousemove"/> <input type="text" name="screeny" value="change when mousemove"/> </form> </body> </html> 这段代码在ie