wordCamp 2008
2008/09/13 11:10 | by edwardproAdmin ]

虽然我不用wordpress但是身边好友或多或少在用,所以报名参加了这样一次小活动,也许也会有所收获...
F1 匈牙利站排位赛成绩分析
2008/08/02 22:47 | by edwardproAdmin ]
| 名次 | 车手 | 差距 | 第一节 | 第二节 | 第三节 |
| 1 | 汉密尔顿 | 1.523 | 1:19.376 | 1:19.473 | 1:20.899 |
| 2 | 科瓦莱宁 | 1.66 | 1:19.945 | 1:19.480 | 1:21.140 |
| 3 | 马萨 | 2.123 | 1:19.578 | 1:19.068 | 1:21.191 |
| 4 | 库比卡 | 1.505 | 1:20.053 | 1:19.776 | 1:21.281 |
| 5 | 格洛克 | 2.08 | 1:19.980 | 1:19.246 | 1:21.326 |
| 6 | 莱科宁 | 1.97 | 1:20.006 | 1:19.546 | 1:21.516 |
| 7 | 阿隆索 | 1.882 | 1:20.229 | 1:19.816 | 1:21.698 |
| 8 | 韦伯 | 1.686 | 1:20.073 | 1:20.046 | 1:21.732 |
| 9 | 特鲁利 | 1.885 | 1:19.942 | 1:19.486 | 1:21.767 |
| 10 | 皮奎特 | 2.24 | 1:20.583 | 1:20.131 | 1:22.371 |
| 11 | 维泰尔 | 红牛二队-法拉利 | 1:20.157 | 1:20.144 | - |
| 12 | 巴顿 | 本田 | 1:20.888 | 1:20.332 | - |
| 13 | 库特哈德 | 红牛-雷诺 | 1:20.505 | 1:20.502 | - |
| 14 | 波尔戴 | 红牛二队-法拉利 | 1:20.640 | 1:20.963 | - |
| 15 | 罗斯伯格 | 威廉姆斯-丰田 | 1:20.748 | 无成绩 | - |
| 16 | 海德菲尔德 | 宝马-索伯 | 1:21.045 | - | - |
| 17 | 中岛一贵 | 威廉姆斯-丰田 | 1:21.085 | - | - |
| 18 | 巴里切罗 | 本田 | 1:21.332 | - | - |
| 19 | 费斯切拉 | 印度力量-法拉利 | 1:21.670 | - | - |
| 20 | 苏蒂尔 | 印度力量-法拉利 | 1:22.113 | - | - |
其实麦克拉伦采用了超轻载油,当然鉴于麦克拉伦的技术优势,不能说他这是为了排位赛而排位赛的,要看具体战术,看他和法拉利之间进站差距吧.
六一 二零零八
2008/05/31 22:16 | by edwardproAdmin ]

来看看今年的六一特别照片,今天选择了红领巾,记得小时候我是六一节入团的,所以一定要带红领巾.好吧,看看我认真学习的好样子吧(道具齐全没有办法,呵呵)

带上红领巾申请果然不同了,呵呵,可惜多了作秀的感觉...

最后来一张搞笑的:

最后来点正常的照片吧:
岸边有人玩遥控船,很专业,我暗暗的说这东西比我的本本+相机都归啊,乖乖,那么就catch it.怎么样我的手动对焦有没有小白的速度了?小小地自满一下,呵呵(明显自我感觉太好,偷偷说,这其实是固定对焦拍摄的,呵呵)

出门的时候一辆车特别美拍下来吧...

总结:今年六一过得很有特色,充满创意,期待明年的!唯一的遗憾照片居然全部iso400!唉...大意了大意了...
杭州行照片一
2008/05/27 22:33 | by edwardproAdmin ]
zend select小议
2008/05/25 07:05 | by edwardproAdmin ]
首先是select对象的一些小问题.select中有很多组语句的函数,但这些函数却不会判断是否传入是空字符串,导致输出变成两个单引号,这就要求开发人员在自己的函数里判断,这点不是太灵活.
接下来select的毛病是不支持外连接,实际上这个有些让我意外,意外的原因是居然不能支持,而从目前zend的机制来看它对于这个的支持是非常良好的,因为它已经加入了lazy概念也就是在1:n中常使用的一种性能优化模式,也是外连接支持的一个必备因素,这点很有点问题.但是当你仔细看看你会发现这个东西是一个半成品.实际上要做到无限联级的首要就是,必须把数据表映射成代码中的数据对象,虽然在php中没有pojo这个概念,但实际上你可以理解一个具有数据表所有功能的对象为数据表实体(entity bean).但zend目前的db构架显然还不是太完全,它给我的感觉更多的是把db作为了一个颗粒,也就是数据库或者叫做数据连接,这个颗粒度的分层我认为是有问题的.当然你完全可以封装上去,但是这意味着我们需要抛起zend的很多东西,也许这就是zend framework本身开放性带来的弊端.我说过,zf是一个本身完全oo但是可以让开发者完全不用懂oo也能写出好的php分层结构的东西,这就注定了它会具有很多弊端.
另外我发现zend的fetchrow有性能问题,虽然他返回第一个结果集,但实际上他没有对数据库查询做优化,也就是说当你传入一个select * from user 那么在zend里用fetchall和fetcherow性能本身差别不大,而理想的做法是在前面的语句中加入limit 1这样才会对性能有本质提高,否则这个方法的存在意义就不大了.
另外在数据层它没有预留cache接口,实际上大量的实践证明要提高php低下的io能力只能用缓存技术,否则任何一种主流语言的数据库连接性能都可以秒杀php.而cache接口没有预留意味着我们又要很费劲地在外面包上一层,这也是我在我的zend ext中所干的活.
侠客行-阿里巴巴第二届网络侠客大会记
2008/05/25 06:45 | by edwardproAdmin ]
5月24日一个人独自来到了杭州目标只有一个阿里巴巴的开发者论坛活动,一早出发就不顺利,没有买到d字头车票结果坐了慢车,到了那边已经中午,活动差不多结束,正好是google研究院在介绍他们的新东西,这个东西有点意思,感觉OEM可以效仿,后面再说.首先看看照片吧.
google的新东西还是很多的,这次基本上也是google在主导他们的产品,其实我本来对google的手机平台很感兴趣,但是看着看着发现它的最大核心居然不是开源的也没有独立项目,就是它的java虚拟机别小看这东西,这东西号称可以秒杀sun的jdk,但是这东西由于核心技术原因不是开源的!而手机平台的其他部分是一个组件合成的东西,有点像sun的soloris的味道.而且目前来看它的开发ide还不够成熟,这块产品需要很长一段时间来磨练的. 但是google另外一个东西就很灵了,这是一个基于rss和atom的组件,它把各种信息资源组成widget,然后利用这些资源widget来组成你自己的主页,呵呵这东西有点意思,想想到时可以和oem系统结合结合,我们现在oem还是基于机器人思想的那么致命的问题就是远程调用其实是很麻烦的事情,虽然现在看起来我们用得很好,但是灵活性和扩展性=0,而如果利用google类似的技术那么就...而且google有一个open social server这个东西就是一个返回xml的代理机器,利用这个就可以实现我们的oem需求了,而且使用起来更简单,系统灵活性也很好. 最后马云上台了,他话不多,但是有几句话还是很在理: 我不懂技术,我是来学习的,虽然我不懂技术但是我尊重技术人员,我一直认为技术是互联网的支柱,但是我不会在公司提技术是第一生产力(这句话我倒是一直挂在嘴边).当年我怀着一颗梦想,终于把阿里巴巴做起来了,现在我要带领更多的技术去成就亚洲的互联网技术中心,这也是我们这个论坛的目标,希望有更多的开发者加入进来.马云其实上台的时候绝对是众星捧月的,公司无数人也对他极其敬仰,但是这个人看起来并不是那么有距离感.我想说的是一个伟大的领导者他需要的是号召力而不是距离感. 中午吃了知味观,哈哈,看来我每次来都会吃一次,呵呵...下午继续,由于这次会议的限制我只能选择一个分会场,我选择了开放平台,有三个部分都是google的系统,最后是阿里巴巴的saas.
第一部分是手机平台的前面说过了,后面是google的open social这个东西其实在我看来提出了一个很好的分层应用概念,这个概念实际上我在上次zend框架里已经提过,我设想把ajax服务从zend里剥离出来变成一个独立产品,开发时不再需要继承于controller基类,这样少了很多麻烦,而前端全部由js完成这样又可以rest(当然这种rest上不了wap呵呵),这个分层应用技术并不复杂也很容易用,但是它的优秀在于他的设计概念,其实我对这个应用没有太大兴趣,因为我写一个简单的就能用,而这个独立的玩具很重,现场演示时就看到了非常麻烦的一面,而且相对来说对开发者的js要求非常高,否则对于一般人没有意义.
最后放个mm照片,这个mm是我们那个会场的摄影,看着她抖花花的抱着小白就...看来大家吃饭都不容易哦...不过不和谐的一幕是某人听着睡着了,呼噜声惊了全场!连阿里的人都怒了.
最后谈谈体会,其实互联网正在革命而且这种革命几乎都是地下的,但是等你发现你已经死了,这就是未来的web-app时代的真正方向,呵呵,不过说实话阿里请的人名气响,却大多不会演讲,整个下午说得比较空洞,难怪人家睡着了,呵呵,不过我们真的要看了,不能以大老粗自居啊,不会不要惊不能不学我一直这么说的,可是现实的环境真糟糕,不过我觉得未来还是好的,既然有人喜欢去死,那么就去啦,我不会陪你的.
|
今日看病趣多多
2008/05/14 12:11 | by edwardproAdmin ]
肠道科一般都会在角落里一个阴森的大楼我走了进去,心了一寒,哪能有731部队的感觉呢,大楼有点潮湿,而且灯光昏暗,医生大概因为病人不多,都懒懒地,我叫了半天才出来一个挂号的。可是看病之后却完全不同了。
今天是一个40多的老医生,看起来有点凶,但是在我无敌搞笑地带动下突然就变了以下摘录经典对话:
医生:发烧嘛?
我:发,
医生:多少?
我:不知道。
医生:那量一下吧。
(接过体温计是老式的水银管)
医生:放腋下。
我:嘎高级。
医生:那当然,我们是肠道科。
我:我好像轻度脱水了。
医生:你拉了几次?
我:早上两次,中午晚上没吃,没事,晚上又拉了2次
医生: 3 4次怎么可能脱水,我看看
医生:嗯,发热是发的,这个脱水。。。
我:哦,可是我没力气,腿软。
医生:你有热度我看你也许感冒了,回家吃点感冒药,年轻人动不动就没力气
我:哦。。。
医生:感冒药你有的我就不开了你自己吃,其他的要我给你开。
我:哦。
我:我一天没吃了。
医生:那怎么行,你不吃东西我就要给你吊葡萄糖。
我:哦。。。那我现在饿了,马上去吃。
医生:那就对了,拉肚子,饭一定要吃的,不吃就让你在这里吊针
我:哦。。。
我做的小熊
2008/05/02 16:42 | by edwardproAdmin ]
上周买了一个自己缝的diy小熊,15块钱买的,当时挑了一个难度比较高的,这个小熊可以是有衣服的哦,衣服都缝了半天呢,呵呵。劳动节不上班也不能闲着,花了一个上午把之前已经裁剪好的布料缝合好了,先看看哈。
看看它的衣服吧,布料不是太好,所以针脚还是比较粗的,呵呵,本来衣服用缝纫机靠边的,奈何缝纫机因很久不用少零件了,所以只能全手工缝制了。。。裤子里还有橡皮筋哦^^我还特地给他做了围巾,哈哈。
光膀子的熊也是很精细的哦,绝对不是很粗糙的。
下面是小熊专辑,嘿嘿嘿嘿!!!!!
|
推荐专辑
2008/03/02 11:17 | by edwardproAdmin ]

01 毕竟
02 喜欢
03 亲爱的
04 gonna stop
05 儿歌
06 模样
07 讨人厌的字
08 欲望把眼前的地板铺满
09 OUTRO
10 并不
推荐第二首 《喜欢》简单的旋律,但是吉他配的很不错,富有变化加上钢琴的伴奏,清晰地感觉那种在一个人的酒吧,喝着酒,想着那个人,自己在默默地回忆着那些往事,默默地说着,我最喜欢你。
这是是赤裸裸的炫耀!
2008/02/25 21:32 | by edwardproAdmin ]
mac非常自动化,属于傻瓜式操作系统,其实很舒服的,上面跑了netbean 6不过速度感觉一般,都说mac是ruby利器,不过我感觉也不是很强烈,大概xp和linux用多了,不过操作基本没有问题最多是快捷按不来而已,呵呵,不过这机器确实好用,mac狂赞的,不要说什么不实用,那是在中国,老外可不这么想,呵呵^^
赤裸裸地炫耀一把。。。
早上装了一下eclipse,相当的好,速度很快,但是mac有个问题下面的doc和菜单都占地方,导致中间区域小,又是宽屏,所以用来做开发机这点就有点不爽了,还是需要更大些的屏幕。
老可爱的小东西
2008/01/12 14:54 | by edwardproAdmin ]
Flash Player文件55 6 5 1 7 55 6 5 2 1 55 5 3 1 7 6 44 3 1 2 1
2007/12/27 11:54 | by edwardproAdmin ]
rt,看得懂的人就能明白。
色戒的感情路
2007/12/22 17:57 | by edwardproAdmin ]
色戒的主线虽然是王和易但其中却有很复杂的感情路线:
A:王和那个女同学是情敌,王力宏喜欢王,而那个女同学喜欢王,从中那个女同学办下了让梁同学上了王的事情。
D:王和假扮的麦没有感情,从道义上,看到了被梁上了,他心里有些内疚而已。
E:梁不过是王道的女同学的工具而已,和王除了第一次没有再多的情感,而王非常憎恨他。
F:王力宏并不喜欢她,但那个女的却死心塌地
C:王力宏一开始喜欢上了王佳芝,但他们却很暧昧,王也被王力宏的正直和才气所吸引,于是答应了王力宏杀特务的事情,但事情的进行却发现了王力宏懦弱的那面,他开始退缩和表现出不成熟,尤其在王佳芝的第一次时候,王想说什么却以一种很人君子的态度扮演着自己,这也是两人感情的转折点。
B:王和易是主角,他们的感情从一开始的假戏真做转变成为后来的真心相爱,也是色阶的主体。
预告片:lucene 的多线程抓取
2007/12/20 06:56 | by edwardproAdmin ]
CakePHP 手册翻译(二) 配置(1)
2007/12/09 18:11 | by edwardproAdmin ]
Section 1
Database Configuration
Your app/config/database.php file is where your database configuration all takes place. A fresh install doesn't have a database.php, so you'll need to make a copy of database.php.default. Once you've made a copy and renamed it you'll see the following:
在app目录下,必须依存一个db配置文件,路径是 /app/config/database.php 这个文件安装cake之后是不存在的,你可以从database.php.default拷贝一份出来,下面来看看文件里有什么:
app/config/database.php
'connect' => 'mysql_connect',
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'project_name',
'prefix' => '');
Replace the information provided by default with the database connection information for your application.
One note about the prefix key: the string you enter there will be prepended to any SQL call that Cake makes to your database when working with tables. You define it here once so you don't have to specify it in other places. It also allows you to follow Cake's table naming conventions if you're on a host that only gives you a single database. Note: for HABTM join tables, you only add the prefix once: prefix_apples_bananas, not prefix_apples_prefix_bananas.
你的的应用的连接信息替换掉默认的信息就可以了。需要注意一点:表名前缀一旦定义它就会在全局数据库使用时生效,你不能在其他地方制定它了。它允许你在单一数据库状况下使用表名公约。注意对于join表的时候,你加了前缀,表明一定是: 前缀+表名 而不是 前缀+表名1+前缀+表名2.
CakePHP supports the following database drivers: cakephp支持如下的数据库驱动:
mysql
postgres
sqlite
pear-drivername (so you might enter pear-mysql, for example)
adodb-drivername
The 'connect' key in the $default connection allows you to specify whether or not the database connection will be treated as persistent or not. Read the comments in the database.php.default file for help on specifying connection types for your database setup.
$default 中的连接允许你指定是否采用持久化连接,请阅读 database.php.default中的帮助信息,查看你使用的数据库连接类型。
Your database tables should also follow the following conventions:
你的数据表应遵守如下的约定:
Table names used by Cake should consist of English words in plural, like "users", "authors" or "articles". Note that corresponding models have singular names.
Your tables must have a primary key named 'id'.
If you plan to relate tables, use foreign keys that look like: 'article_id'. The table name is singular, followed by an underscore, followed by 'id'.
If you include a 'created' and/or 'modified' column in your table, Cake will automatically populate the field when appropriate.
1 表名必须使用英语复数形式,比如: users authors articles 注意相应的Model名字要用单数形式
2 你的表必须含有主键"id”(这点和 rails一样,只不过rails 可以通过 set_primary_key 设定 注释)
3 如果你要使用关系表,表名是单数然后加下划线加id,类似于 article_id(这点也比较死板感觉)
4 如果你的表里字段名有叫 created或者modified的,cake会自动重名
You'll also notice that there is a $test connection setting included in the database.php file. Fill out this configuration (or add other similarly formatted configurations) and use it in your application by placing something like:
你也许注意到默认配置里有个叫test的配置项,你也可以填写一个或者使用你指定名字的配置名,例如:
Inside one of your models. You can add any number of additional connection settings in this manner.
在你的model里你可以增加任意数量的额外链接设置在你的配置里
Section 2
Global Configuration
CakePHP's global configuration can be found in app/config/core.php. While we really dislike configuration files, it just had to be done. There are a few things you can change here, and the notes on each of these settings can be found within the comments of the core.php file.
cake的全局配置可以在/app/config/core.php中找到。虽然我们都不喜欢配置文件,不过这是必须要做的:( 有几件事情,你可以修改这里,不过要注意每个设置项都要在core.php的注释里。
DEBUG: Set this to different values to help you debug your application as you build it. Specifying this setting to a non-zero value will force Cake to print out the results of pr( ) and debug( ) function calls, and stop flash messages from forwarding automatically. Setting it to 2 or higher will result in SQL statements being printed at the bottom of the page.
Also when in debug mode (where DEBUG is set to 1 or higher), Cake will render certain generated error pages, i.e. "Missing Controller," "Missing Action," etc. In production mode, however (where DEBUG is set to 0), Cake renders the "Not Found" page, which can be overridden in app/views/errors/error404.thtml.
DEBUG设成成不同的值,可以帮助你调试你的应用程序,这个选项必须设置值的。cake通过调用pr和debug函数来打印信息,自动停止刷新消息如果自动forward。设置它为2或者更高,会导致,sql语句被打印在页面底部。 同样,在调试模式里,cake会回显某个生成的错误页面如: 没有控制器 没有Action 等等。在产品模式下,你最好把DEBUG设成0 cake会回显 not found 页面 你可以覆盖掉 /app/views/errors/error404.thtml改变显示的错误页面
CAKE_SESSION_COOKIE: Change this value to the name of the cookie you'd like to use for user sessions in your Cake app.
CAKE_SESSION_COOKIE:COOKIE的session名字
CAKE_SECURITY: Change this value to indicate your preferred level of sessions checking. Cake will timeout sessions, generate new session ids, and delete old session files based on the settings you provide here. The possible values are:
session的有效期时间设定。如果超时,cake就会生成性的id并商处旧的session文件。本参数可以设定的值:
high: sessions time out after 20 minutes of inactivity, and session id's are regenerated on each request 高: session有 20分钟不活动
medium: sessions time out after 200 minutes of inactivity 中 超过200分钟
low: sessions time out after 600 minutes of inactivity 低 超过600分钟
CAKE_SESSION_SAVE: Specify how you'd like session data saved. Possible values are: 指定 session存在哪里,可以设定的值:
cake: Session data is saved in tmp/ inside your Cake installation
php: Session data saved as defined in php.ini
database: Session data saved to database connection defined by the 'default' key.
1 cake 报错在/tmp 你安装cake的地方
2 php 根据php。ini的设置
3 数据库,session会被报错在默认连接池的数据库中
Routes Configuration
"Routing" is a pared-down pure-PHP mod_rewrite-alike that can map URLs to controller/action/params and back. It was added to Cake to make pretty URLs more configurable and to divorce us from the mod_rewrite requirement. Using mod_rewrite, however, will make your address bar look much more tidy.
Routes are individual rules that map matching URLs to specific controllers and actions. Routes are configured in the app/config/routes.php file. They are set-up like this:
routing类似于精简的modrewrite模块,用于映射url成 /controller/action.params。 routing设置使得cake通过mod_rewirte生成漂亮的url,使用它使得你的url更整洁。
routes的个人设置规则可以使得符合的url被影射到指定的控制器和动作,routes被设置在app/config/routes.php中
Route Pattern
$Route->connect (
'URL',
array('controller'=>'controllername',
'action'=>'actionname', 'firstparam')
);
?>
Route Pattern
$Route->connect (
'URL',
array('controller'=>'controllername',
'action'=>'actionname', 'firstparam')
);
?>
Where:
URL is the regular expression Cake URL you wish to map,
controllername is the name of the controller you wish to invoke,
actionname is the name of the controller's action you wish to invoke,
and firstparam is the value of the first parameter of the action you've specified.
Any parameters following firstparam will also be passed as parameters to the controller action.
The following example joins all the urls in /blog to the BlogController. The default action will be BlogController::index(). Route Example
$Route->connect ('/blog/:action/*', array('controller'=>'Blog', 'action'=>'index'));
?>
Route Example
$Route->connect ('/blog/:action/*', array('controller'=>'Blog', 'action'=>'index'));
?>
Route Handling in a Controller
class BlogController extends AppController
{
function history ($year, $month=null)
{
// .. Display appropriate content
}
}
?>
The 'history' from the URL was matched by :action from the Blog's route. URL elements matched by * are passed to the active controller's handling method as parameters, hence the $year and $month. Called with URL /blog/history/05, history() would only be passed one parameter, 05.
The following example is a default CakePHP route used to set up a route for PagesController::display('home'). Home is a view which can be overridden by creating the file /app/views/pages/home.thtml.
Setting the Default Route
$Route->connect ('/', array('controller'=>'Pages', 'action'=>'display', 'home'));
?>
Setting the Default Route
$Route->connect ('/', array('controller'=>'Pages', 'action'=>'display', 'home'));
?>


















