上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
  2013年1月8日
摘要: 转自:http://www.it165.net/os/html/201208/3143.html编写Shell 脚本时,如果变量的值是一个路径的话,我们可以轻易的解析路径path信息,就像php中的pathinfo一样,来获取当中的路径(dirname) 或档名(basename).变量结果说明${path}/usr/local/bin/emacs原本值${path#/*/}local/bin/emacs去除第一个资料夹${path##/*/}emacs只取档名(basname)${path%/*}/usr/local/bin只取路径(dirname)${path:15}emacs取第15个字 阅读全文
posted @ 2013-01-08 13:32 风在竹林 阅读(228) 评论(0) 推荐(0) 编辑
  2013年1月6日
摘要: 转自:http://www.phppan.com/2011/06/php-last-month-today/一日,遇到一个问题,求上一个月的今天。 最开始我们使用strtotime(”-1 month”) 函数求值,发现有一个问题,月长度不一样的月份的计算结果有误。 比如:2011-03-31,得到的结果是2011-03-03。我们先不追究什么问题,先看如何解决问题。 此时,想起PHP中有一个mktime函数,于是自己写了如下代码:echo date("Y-m-d H:i:s", mktime(date("G", $time), date("i 阅读全文
posted @ 2013-01-06 17:20 风在竹林 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 转自:http://hideto.iteye.com/blog/255816当前week的第一天: select date_sub(curdate(),INTERVAL WEEKDAY(curdate()) + 1 DAY)当前week的最后一天:select date_sub(curdate(),INTERVAL WEEKDAY(curdate()) - 5 DAY)前一week的第一天:select date_sub(curdate(),INTERVAL WEEKDAY(curdate()) + 8 DAY)前一week的最后一天:select date_sub(curdate(),INT 阅读全文
posted @ 2013-01-06 11:11 风在竹林 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.csdn.net/dreamboycx/article/details/8293636http://blog.csdn.net/flm_0722/article/details/4961758http://blog.csdn.net/chenhj1988918/article/details/7569221本日、本周和本月的SQL语句 $time = time()+8*3600;$nowtime = date("Y-m-d",$time);$weekfirst = strtotime('-1 week Monday');$mon 阅读全文
posted @ 2013-01-06 11:01 风在竹林 阅读(258) 评论(0) 推荐(0) 编辑
  2013年1月5日
摘要: 转自:http://blog.ihipop.info/2010/10/1719.html如果说Perl用户 一定熟悉 CPAN,那么Python用户一定熟悉setuptools默认activePython已经集成了这个工具,如果没有,可以在这里下载http://pypi.python.org/pypi/setuptools#downloads用法:cd /d E:\Python26\Scriptseasy_install 模块名软件会自动联网下载安装,linux用法一样。更多知识,参见IBM知识库http://www.ibm.com/developerworks/cn/linux/l-cppe 阅读全文
posted @ 2013-01-05 10:53 风在竹林 阅读(345) 评论(0) 推荐(0) 编辑
  2013年1月3日
摘要: 转自:http://www.regular-expressions.info/email.htmlHow to Find or Validate an Email AddressThe regular expression I receive the most feedback, not to mention "bug" reports on, is the one you'll find right on this site's home page: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b . This reg 阅读全文
posted @ 2013-01-03 16:34 风在竹林 阅读(300) 评论(0) 推荐(0) 编辑
  2012年12月31日
摘要: 转自:http://blog.csdn.net/ricky1217/article/details/6934202参考:http://www.byreach.com/m/node/1439同样的代码,发现通过 localhost/index.php 访问,和在 shell 中通过 php ./index.php 运行結果却不一样。在程序中需要通过 shell_exec 来执行一个 linux 程序,而它的输入来自 echo ,即:shell_exec('echo '.escapeshellarg($str).' | some_cmd 2>&1'); 阅读全文
posted @ 2012-12-31 23:55 风在竹林 阅读(1267) 评论(0) 推荐(0) 编辑
  2012年12月26日
摘要: 转自:横排:echo $form->radioButtonList($Model, ‘type’,$arrtype,array(‘template’ => ‘<li style=”display:inline-block;width:120px;”>{input} {label}</li>’,'separator’ => ”))主要是display:inline-block去<br>:echo $form->radioButtonList($person,’gender_code’, array(‘m’=>’Male’, 阅读全文
posted @ 2012-12-26 21:47 风在竹林 阅读(2579) 评论(0) 推荐(0) 编辑
摘要: 转自: 应用中经常遇到需要在表单form中使用两个关联的下拉列表dropdown。其中一个下拉列表中的数据依赖于另一个下拉列表的当前值。例如填写地 址,当 我们修改’国家’下拉列表的值,’城市’列表中的项目就会全部更新为该国的城市。通过Yii内建的AJAX功能可以比较容易的实现关联下拉列表的功能。下 面简要介绍实现过程。 首先,在表单的view文件中,我们需要在表单中显示国家和依赖于国家的城市两个下拉列表。echo CHtml::dropDownList('country_id','', array(1=>'USA',2=>' 阅读全文
posted @ 2012-12-26 19:40 风在竹林 阅读(597) 评论(0) 推荐(0) 编辑
  2012年12月24日
摘要: 转自:http://blog.chinaunix.net/uid-20344928-id-2985712.html32 or 64linux下查看操作CPU的运行位数:getconf LONG_BIT如结果是32,表示当前CPU工作在32位模式下(即操作系统是32位的),但并不表示CPU一定是32位的(64位的也可以当32位的来用)。要查看cpu是否支持64bit,方法如下:# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l如结果大于0, 说明支持64bit处理模式。顺便说一下,64位的CPU必须运行在64位的操作系统下 阅读全文
posted @ 2012-12-24 15:07 风在竹林 阅读(591) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页