得到2010数据库技术大会门票 (2010-03-30)

今天有幸得到了2010数据库技术大会的门票
虽然属于B类票,但是市场价1000元的门票还是很有诱惑力的!
免费得到 呵呵~~~
特别兴奋,期待已久了,那里面全是腕儿!
不知道4.2日和4.3日有没有时间呢
正好是这周五和这周六。 
估计还要请假
反正很想去听课
还很想去吃免费的自助午餐^_^

2010数据库技术大会-门票正面 2010数据库技术大会-门票反面

点击查看原文阅读(354) | 评论(2) | 分类:我的日记

嘻哈包袱铺 (2010-03-27)

昨天去了嘻哈包袱铺听相声,慕名而来的。
票价20,看三小时非常实惠,
非常逗,跟看电视是另一种感觉
相机模式没调好,照出来的照片很模糊
传几张照片上来

嘻哈包袱铺-1

嘻哈包袱铺-2

嘻哈包袱铺-3

嘻哈包袱铺-4

嘻哈包袱铺-5

嘻哈包袱铺-6

嘻哈包袱铺-7

嘻哈包袱铺-8

点击查看原文阅读(291) | 评论(0) | 分类:我的日记

作为一名coder,此刻我内牛满面 (2010-03-26)

作为一名coder,此刻我内牛满面
转自youku.com:

(十点了,不知道你的code写到了那一行)
从未想过,这些符号,会让人如此着迷
兴奋...高兴...沉默...忧郁...
写code是他的快乐,看code成了我的快乐
喜欢他的认真,却不想他总给自己找压力
(现在你是不是又在跟code较劲啊)
(如果可能我来做你下一行的code好不好)


 

点击查看原文阅读(371) | 评论(1) | 分类:懒得分类

心酸 (2010-03-21)

今天特别心酸,
本来今天才是妈的生日
周五回家算是给妈妈过了个简单的生日
只买了一些她爱吃菜回去.
今天他们也因为工作没有来
下午看着妈从菜市场买了一些菜回家
手里还提着一兜鸡蛋糕
说是比较便宜,才三块钱一斤
还拿出一个给我吃
当时就觉得心理不好受,很酸
我连一个生日蛋糕也没给妈买
根本没尽到一个做儿子的义务...
等明年的二月初六要好好给妈过一次生日!

点击查看原文阅读(292) | 评论(1) | 分类:我的日记

封装PHP验证码类 (2010-03-05)

PHP验证码是很常见的应用
下面是一段封装好的类库
方便以后使用
 

总结一下核心函数:
imagecreate 创建图像;
imagecolorallocate  为图像上色
imagerectangle 创建矩形
imagestring 画字符串
imageline 生成干扰线
imagejpeg 生成JPEG格式
imagedestroy 催婚图像

PHP验证码类
  1. <?php
  2. session_start();
  3. class checkImage {
  4.  
  5.     private $config;
  6.     private $im;
  7.     private $str;
  8.  
  9.     function __construct() {
  10.         $this->config['width']      = 50;
  11.         $this->config['height']     = 20;
  12.         $this->config['vcode']      = "vcode";
  13.         $this->config['type']       = "default";
  14.         $this->config['length']     = 4;
  15.         $this->config['interfere']  = 10;
  16.         $this->str['default']       = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  17.         $this->str['string']        = "abcdefghijklmnopqrstuvwxyz";
  18.         $this->str['int']           = "0123456789";
  19.     }
  20.  
  21.     public function init($config=array()){
  22.         if (!empty($config) && is_array($config)){
  23.             foreach($config as $key=>$value){
  24.                 $this->config[$key] =   $value;
  25.             }
  26.         }
  27.     }
  28.  
  29.     public function create(){
  30.         if (!function_exists("imagecreate")){
  31.             return false;
  32.         }
  33.         $this->createImage();
  34.     }
  35.  
  36.     private function createImage(){
  37.         $this->im   =   imagecreate($this->config['width'],$this->config['height']);
  38.         imagecolorallocate($this->im, 255, 255, 255);
  39.  
  40.         $bordercolor=   imagecolorallocate($this->im,0,0,0);
  41.         imagerectangle($this->im,0,0,$this->config['width']-1,$this->config['height']-1,$bordercolor);
  42.  
  43.         $this->createStr();
  44.         $vcode  =   $_SESSION[$this->config['vcode']];
  45.         $fontcolor  =   imagecolorallocate($this->im,46,46,46);
  46.         for($i=0;$i<$this->config['length'];$i++){
  47.             imagestring($this->im,5,$i*10+6,rand(2,5),$vcode[$i],$fontcolor);
  48.         }
  49.  
  50.         $interfere  =   $this->config['interfere'];
  51.         $interfere  =   $interfere>30?"30":$interfere;
  52.         if (!empty($interfere) && $interfere>1){
  53.             for($i=1;$i<$interfere;$i++){
  54.                 $linecolor  =   imagecolorallocate($this->im,rand(0,255),rand(0,255),rand(0,255));
  55.                 $x  =   rand(1,$this->config['width']);
  56.                 $y  =   rand(1,$this->config['height']);
  57.                 $x2 =   rand($x-10,$x+10);
  58.                 $y2 =   rand($y-10,$y+10);
  59.                 imageline($this->im,$x,$y,$x2,$y2,$linecolor);
  60.             }
  61.         }
  62.         header("Pragma:no-cachern");
  63.         header("Cache-Control:no-cachern");
  64.         header("Expires:0rn");
  65.         header("content-type:image/jpegrn");
  66.         imagejpeg($this->im);
  67.         imagedestroy($this->im);
  68.         exit;
  69.     }
  70.  
  71.     private function createStr(){
  72.         if ($this->config['type']=="int"){
  73.             for($i=1;$i<=$this->config['length'];$i++){
  74.                 $vcode  .=  rand(0,9);
  75.             }
  76.             $_SESSION[$this->config['vcode']] = $vcode;
  77.             return true;
  78.         }
  79.         $len    =   strlen($this->str[$this->config['type']]);
  80.         if (!$len){
  81.             $this->config['type'] = "default";
  82.             $this->create_str();
  83.         }
  84.         for($i=1;$i<=$this->config['length'];$i++){
  85.             $offset  =  rand(0,$len-1);
  86.             $vcode  .=  substr($this->str[$this->config['type']],$offset,1);
  87.         }
  88.         $_SESSION[$this->config['vcode']] = $vcode;
  89.         return true;
  90.     }
  91.  
  92. }
  93.  
  94. $v = new checkImage();
  95. //$config['width']  =   50;         //验证码宽
  96. //$config['height'] =   20;         //验证码高
  97. //$config['vcode']  =   "vcode";    //检查验证码时用的SESSION
  98. //$config['type']   =   "int";  //验证码展示的类型default:大写字母,string:小写字母,int:数字
  99. //$config['length'] =   2;          //验证码长度
  100. //$config['interfere']= 10;         //干扰线强度,范围为1-30,0或空为不起用干扰线
  101. //$v->init($config);    //配置
  102. $v->create();
  103.  
  104. ?>
  105.  
  106. <SCRIPT LANGUAGE="JavaScript">
  107.     <!--
  108.         function reloadcode(){
  109.          var d = new Date();
  110.          document.getElementById('safecode').src="./vcode.php?t="+d.toTimeString()
  111.         }
  112.     //-->
  113. </SCRIPT>
  114.  
  115. <img src="vcode.php" id="safecode" onclick="reloadcode()">

 

点击查看原文阅读(422) | 评论(1) | 分类:PHP
<< 1 2 3 4 5 6 7 8 9 10 >>