`
tankmarshal
  • 浏览: 35658 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表

PHP的异常捕捉

    博客分类:
  • php
      一直异或php的try catch 怎么使用        看文档是说 需要new一个exception出来,才能catch到。         那如果需要捕捉到数组下限没找到 、或者方法传的参数不对 之类的 怎么办?         还好PHP提供了set_error_handler 这个函数,可以用户自己捕捉这些异常,比如: <?php set_error_handler("exception_error_handler"); try{ strpos(); }catch(Exception $e){ echo $e ...
  <?php require_once 'phpqrcode.php'; QRcode::png('http://www.baidu.com', 'filename.png',QR_ECLEVEL_L,100); // creates file $QR = imagecreatefrompng("filename.png"); $logo = imagecreatefrompng("logo.png"); var_dump($QR); var_dump($logo); $QR_width = ima ...
       因为工作需要,需要自己做压力测试,然后就寻找免费的测试框架,然后说python不错,然后就找到了这个基于python的测试框架multi_mechanize。        然后在网上搜了下关于这个multi_mechanize的东西,发现资料比较少,然后就找到这玩意的官网,搜集点资料,在自己机器上也试安装了下。发现还是蛮酷的。         下面介绍下安装过程,当然这是基于linux的,我是用cygwin安装的                    先安装python,这个这里省略,搜下应该是一大堆资料             安装 setup模块      ...
      因为公司的环境是在linux下,所以想在自己的机器上搭建个模仿linux的环境         环境为linux +mssql+PHP +nginx+freetds           于是就想到了cygwin           去http://www.cygwin.com  下载setup.exe         然后安装,安装方法网上一大堆,主要是要安装好GCC相关的东西,我是把 devel目录下的东西都安装上         默认是default 点击下default 可以变成install           下载nginx         htt ...
     用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 14: ireturn Exception table: from to target type 4 ...
在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:   当然 你可以点击那个“Change Attached Source”的按钮,来指定你所需要的class的源文件路径   也可以用我现在要说的jd-eclipse工具   你可以在:http ...
dom4j跟Jdom、sax、dom之间的区别网上很多,一搜一大堆,但是处理大文件的比较少。 所以总结下生成和读取大的XML文件 生成大文件 public void writeToFile(String filePath,String fileName){ Document doc = DocumentHelper.cr ...
前些天去面试,有个题目: 根据输入值,比如输入5,打印如下数字: 1   2    3    4    5  16 17  18  19  6 15 24  25  20  7 14 23  22  21  8 13 12  11  10  9   一开始的初步实现   public class ArrayPrint { int[][] aa ; int start=1; /*递归调用*/ public void makeArray(int num,int index){ //index 从0开始,把数组圈分成4部分 int length ...
看String的源码 看到 public String substring(int beginIndex, int endIndex) { if (beginIndex < 0) { throw new StringIndexOutOfBoundsException(beginIndex); } if (endIndex > count) { throw new StringIndexOutOfBoundsException(endIndex); } if (beginIndex > endIndex) { t ...
Global site tag (gtag.js) - Google Analytics