06 2013 档案

摘要:select * from test where name='zj' and sex='2';我以前也经常用这种写法,今天爬出去看了一下某位人写的,用了一下也挺好用的下面这种写法,一一对应关系 阅读全文
posted @ 2013-06-21 10:06 尹少爷 阅读(1525) 评论(0) 推荐(1) 编辑
摘要:mysql> select * from test where id in(2,5,4,13,6) order by field(id,2,5,4,13,6) limit 0,6;+----+-------+------+| id | name | sex |+----+-------+------+| 2 | zj_2 | 2 || 5 | zj_5 | 2 || 4 | zj_4 | 2 || 13 | zj_13 | 2 || 6 | zj_6 | 2 |+----+-------+------+有利有弊,order by 和in 我们都... 阅读全文
posted @ 2013-06-20 17:19 尹少爷 阅读(2764) 评论(0) 推荐(1) 编辑
摘要:1 使用file_get_contents和fopen必须空间开启allow_url_fopen。2 方法:3 4 编辑php.ini,设置allow_url_fopen =true5 On,allow_url_fopen关闭时fopen和file_get_contents都不能打开远程文件。 阅读全文
posted @ 2013-06-18 18:08 尹少爷 阅读(326) 评论(0) 推荐(0) 编辑
摘要:test.php 1 <?php 2 $locale='zh_CN'; 3 if(isSet($_GET["locale"]))$locale = $_GET["locale"]; 4 ?> 5 <html> 6 <head> 7 <link rel="gettext" type="application/x-po" href="./locale/<?php echo $locale ?>/LC_MESSAGES/messages.po 阅读全文
posted @ 2013-06-18 15:43 尹少爷 阅读(2195) 评论(0) 推荐(0) 编辑
摘要:安装gettext:ubuntu: apt-get install php-gettext, apt-get install gettextwindow:开启扩展修改locale :$ /usr/share/i18n/locales //查看支持的语言$ vi /etc/locale.gen //开启语言$ locale-gen //是新设置的locale 生效$ locale -a 查看目前支持的语言example:test.php:';28 echo _("This is book.");29 echo '';30 echo _("He 阅读全文
posted @ 2013-06-17 15:47 尹少爷 阅读(1218) 评论(0) 推荐(0) 编辑
摘要:在where语句中,rand有时候会出现多条记录本来我还认为不会出现,后来多执行了几次,就出现了我认为他可能是多次结果的和,但是不是,后来我发现又错了,不是,求助于手册,发下下面的话。同时,我看了一下他走没走索引,发现他只走了where,没有走其他的索引,这要注意啊 阅读全文
posted @ 2013-06-17 12:08 尹少爷 阅读(359) 评论(0) 推荐(0) 编辑
摘要:安装svn1 apt-get install subversion2 安装图形界面3 sudo add-apt-repository ppa:rabbitvcs/ppa4 5 sudo apt-get update6 7 sudo apt-get install rabbitvcs-core rabbitvcs-nautilus3 rabbitvcs-thunar rabbitvcs-gedit rabbitvcs-cli重启文件管理系统,就可以了nautilus -q pgrep -f service.py | xargs kill nohup nautilus > /dev/null 阅读全文
posted @ 2013-06-13 16:18 尹少爷 阅读(130) 评论(0) 推荐(0) 编辑
摘要:---恢复内容开始---sublime text 2学习(二):创建可复用的代码片段对于工程师来讲,写一个html页面的基本结构是体力活,每次去拷贝一个也麻烦,sublime text 2 提供了一个很好的复用代码片段。在菜单上点击Tools -> New Snippet,会新建一个xml文件页签: 1 <snippet> 2 <content><![CDATA[ 3 /** 4 * PHPVersion: 5.4.x 5 * Author : ${1:zhangjun <zhangjun516@126.com> } 6 * FileName : 阅读全文
posted @ 2013-06-09 10:11 尹少爷 阅读(311) 评论(2) 推荐(0) 编辑
摘要:开始用yii framework,帮助初始化,帮助我们构建整个的平台1 php YiiRoot/framework/yiic.php webapp testdrive 1 $yii=dirname(__FILE__).'/framework/yii.php'; 2 $config=dirname(__FILE__).'/store/protected/config/main.php'; 3 4 // remove the following lines when in production mode 5 defined('YII_DEBUG') 阅读全文
posted @ 2013-06-07 11:43 尹少爷 阅读(932) 评论(0) 推荐(0) 编辑
摘要:这是今天在微博的一个人发的,有人@我了,我就做了一个,看一下吧,两次结果相差如此直大。。。。我一般都会用count(*) 因为它走主键索引,但是count(C)则不一定,我要说一下sql缓存可以看到缓存是开启的,但是大小为0,我后来修改了后来我证明这两个不会走查询缓存,因为只有sql一样的时候才会走缓存可以看到走缓存的次数并没有增加,那么是什么导致了前后两次相差那么大呢我们先看一下他们走的索引;索引走的一样,那么我们看一下profile的记录,就会发现区别。这两个时间的差距,我也只能写到这了,上班了。。请各位补充 阅读全文
posted @ 2013-06-05 12:37 尹少爷 阅读(2529) 评论(0) 推荐(0) 编辑
摘要:能力有限,只做出来了两道题,悔恨啊。。。。。1. $content=file_get_contents('~~:88/hackathon/stage1.txt'); $lines = explode("\n", $content); foreach($lines as $key => $val){ echo '<br/>'; if(md5($val)=='c4d4198fee6293e3d057f7c5540c2950'){ var_dump($key); var_dump($val); ... 阅读全文
posted @ 2013-06-03 09:24 尹少爷 阅读(216) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示