- 博客(9)
- 收藏
- 关注
原创 PHP的异常捕捉
一直异或php的try catch 怎么使用 看文档是说 需要new一个exception出来,才能catch到。 那如果需要捕捉到数组下限没找到 、或者方法传的参数不对 之类的 怎么办? 还好PHP提供了set_error_handler 这个函数,可以用户自己捕捉这些异常,比如:<?php set_error...
2013-12-13 19:10:59
158
原创 PHP生成带头像的二维码
<?phprequire_once 'phpqrcode.php';QRcode::png('http://www.baidu.com', 'filename.png',QR_ECLEVEL_L,100); // creates file $QR = imagecreatefrompng("filename.png"); $logo = imagecreat...
2013-12-13 19:05:44
678
原创 multi_mechanize开源python压力测试框架
因为工作需要,需要自己做压力测试,然后就寻找免费的测试框架,然后说python不错,然后就找到了这个基于python的测试框架multi_mechanize。 然后在网上搜了下关于这个multi_mechanize的东西,发现资料比较少,然后就找到这玩意的官网,搜集点资料,在自己机器上也试安装了下。发现还是蛮酷的。 下面介绍下安装过程,当然这是基...
2013-03-19 10:36:02
367
原创 在cygwin下部署PHP环境,mssql+PHP +nginx+freetds
因为公司的环境是在linux下,所以想在自己的机器上搭建个模仿linux的环境 环境为linux +mssql+PHP +nginx+freetds 于是就想到了cygwin 去http://www.cygwin.com 下载setup.exe 然后安装,安装方法网上一大堆,主要是要安装好GCC...
2013-02-19 14:18:04
902
原创 javap生成的字节码的意思
用javap -c Test命令查看JVM生成的字节码:public boolean isOk(boolean); Code: 0: iload_1 1: ifeq 13 4: iconst_1 5: istore_2 6: goto 13 9: astore_3 10: goto 13 13: iconst_0...
2012-08-20 16:37:33
176
原创 在eclipse上安装反编译工具jd-eclipse
在eclipse上点一些类名的时候会弹出:source not found:The source attachment does not contain the source for the file String.class You can change the source attachment by clicking Change Attached Source below:...
2012-08-07 15:03:21
285
原创 dom4j解析XML,生产XML,大文件XML
dom4j跟Jdom、sax、dom之间的区别网上很多,一搜一大堆,但是处理大文件的比较少。所以总结下生成和读取大的XML文件生成大文件 public void writeToFile(String filePath,String fileName){ Document doc = DocumentHelper.c...
2012-08-06 17:43:25
336
打印螺旋数组
前些天去面试,有个题目:根据输入值,比如输入5,打印如下数字:1 2 3 4 5 16 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9 一开始的初步实现 public class ArrayPrint { int[][] aa ; int start=...
2012-08-01 11:10:52
123
原创 String类substring方法的源码问题
看String的源码看到 public String substring(int beginIndex, int endIndex) { if (beginIndex < 0) { throw new StringIndexOutOfBoundsException(beginIndex); } if (endIndex > count) { ...
2012-07-04 10:56:14
98
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人