关于prototype中$相关Function的说明

$() 替代简写document.getElementById(),可以同时返回多个id。

var zhaiduo = $(‘DivA’);

var zhaiduos = $(‘DivA’,’DivB’);

$F() 返回表单中任何元素的值,如text, button, select, texarea等。

$F(‘Form_text’)

// <input type=”text” id=”Form_text” value=”zhai duo”>

$A() 把相关的字符串列表转成数组对象。

var zhaiduo = $A(‘AA BB CC DD’);

zhaiduo.each(function(iteme){}

$H() 将对象转成Hash数组对象。

var zhaiduo = { X: 32, Y: 24, Z: 32 };

var myhash = $H(zhaiduo);

$R() 创建一个有起始和结束范围的对象。

var my_range = $R(1970, 2008, false);

my_range.each(function(value, index){}

开源的PHP简易中文分词模块

hightman向大家展示一些很有用的PHP手记,其中包括:PHP版简易中文分词在线演示及源码浏览和让MySQL4.0 FullText 全文检索支持中文,这是我最欣赏的。本着开源的精神,免费提供相关代码给PHP爱好者学习和交流,这是目前国内很多PHP同行所做不到的。随着国内的PHP开源项目越来越多,就像年初的DISCUZ向公众免费开放代码,希望国内的PHP水平更加专业,更上一层楼。

想成为百万富翁?先思考这三个问题。

在你动手开始为自己成为百万富翁而计划的时候,下面三个问题有助于帮助我们寻找出路和目标,并且包括我对这三个问题的理解。

what comes easy to me, but harder to others?
想想你最擅长什么?什么东西,你比别人更厉害?

what would you do for work for years and years and never have to get paid for it?
什么东西你愿意无偿的去做?我想这个应该是兴趣了。

how can you be of service and how can you give back?
你打算付出什么?有没有把握获得回报?

查看原文[English]

Google的中美办公室对比

新的Google中国大厦,可以用奢华来表示。(感觉环境除了新,没有别的,哪怕勉为其难的放个帐篷或是秋千)

233701000_7fd242a73f.jpg233701257_e0088ce809.jpg233701676_cf1df82c2f.jpg233704515_28e9f16381_m.jpg

看看美国Google员工的办公室,(感觉这些舒适的环境是积累下来的,并不炫耀)

90605452_7877ff848c_m.jpg151034217_f4ef44684f_m.jpg151039203_6a4e4d19bd_m.jpg151039205_edda5304a9_m.jpg
似乎它们都是以Google的文化为出发点,“舒适的办公环境,免费的餐饮和自由的装饰布置”。可是我仔细瞧瞧,总是觉得中国的办公室还缺点什么。是成就感?还是人情味?还是不做作?

作为一个局外人,确实不便说太多。只想表达自己的旁观者的看法。还是keso说得对:“仅仅有舒适的环境,并不必然带来创新”。

Apach1.3.31+PHP4.3.3安装出错:can't load of php4apache.dll

复制php.ini到系统盘windows目录下,httpdconf配置文件中增加:

LoadModule php4_module “C:/php/sapi/php4apache.dll”

#AddModule mod_php4.c // 不用填加这一行

AddType application/x-httpd-php .php
解决办法:复制php安装目录下php4ts.dll到系统盘windows目录下。

听说apach2.2.3+php4.4也有这个问题,不过好像用这种办法无法解决。

Update: PHP5.0.1安装(目录C:/php5)

1. copy php.exe, php.ini 到 windows目录
2. copy 所有DLL到system32目录
3. 编辑httpd.conf,增加:

AddType application/x-httpd-php .php
LoadModule php5_module “c:/php5/php5apache.dll”
SetEnv PHPRC C:/php5

广州暂住人员如何申请港澳游

离香港这么近,应该过去看看。

暂住人员办理往来港澳通行证受理、审批、制证工作时限为15个工作日,只比常住户口人员多了一道提交单位证明和意见的手续。暂住人员办理往来港 澳通行证具体手续如下:符合规定在广州住满半年的外地人员(IC卡暂住证未满半年的,可与纸质暂住证连续计算),向暂住地或直系亲属所在地的区(县)公安 局出入境管理部门,提交填写完整的《广州市居民往来港澳地区旅游申请表》,同时提交申请人近期正面蓝底免冠彩色照片3张。在应聘企业连续工作满半年的证 明、单位或派出所意见等相关证明资料以及旅游发票,并交验身份证、暂住证便可申办。
看来也挺复杂,不过这个规章制度也并非完美。要是自由职业的人,无法提交单位证明和意见怎么办?难道只有在广州企业打工的人才有港澳游的权利?

CSS样例:英文首字母特大写

This is a CSS style test example. Feel free to download and use this sample code from zhaiduo.com. If any questions, welcome to contact me.


代码如下:

#box{
width: 200px;
margin-left: 100px;
padding: 20px;
}
p.fl:first-line {
font-size: 20px;
color: #000;
margin: 0;
padding: 0;
}
p.fl:first-letter {
font-size: 200px !important;
color: #ccc !important;
float: left !important;
margin: 0 -50px 0 -80px !important;
padding: 0 !important;
line-height: 150px !important;
}
< div id=”box” >
< p class=”fl” >This is a CSS style test example. Feel free to download and use this sample code from zhaiduo.com. If any questions, welcome to contact me.< /p >
< /div >

微软说:任何人都可以为XBOX开发游戏

根据macworld报道,微软将会推出一种新的游戏开发平台 - Microsoft’s XNA Game Studio Express,用作为XOBX 360开发游戏。任何使用Windows XP PC的人都可以自由下载这种开发工具,设计自己的XBOX游戏,如果每年交上$99美元还可以把你的游戏交给其他设计师进行测试。

xboxhidden.jpg

Microsoft’s XNA Game Studio Express基于Visual Studio Express and .NET,开发出的游戏可以在XOBX或XP上运行。这真是一个好消息,虽然我只是一个coder,不过一直对游戏开发,特别是3D的游戏开发很感兴趣,一直烦透了“从基础学起”,希望有个快速、便捷的方式,能够让我快速领略当今世界高端游戏开发的内幕。希望这个梦想能够快些实现。

还是相信那句话:whatever you want, just do it.

来自kiko.com的互联网创业经验

Kiko难以抵挡Google在线日历的竞争,正在Ebay拍卖。不过他们的经验值得每一个梦想创业的人借鉴:

1. Stay Focused. Most entrepreneurs have lots of ideas. Often times, many of them may be really good. I don¡¯t know about you, but my favorite part about startups is talking about new products and new business ideas. If you¡¯re a creative person, it¡¯s very easy to get side-tracked on side ideas when you really should be working on your main one. This is bad. Bad, bad, bad. We did this a lot with Kiko, and it caused many delays in getting the product out the door.
2. Hire Slow, Fire Fast. Picking the right people is life and death for your company. We hired two people for Kiko. One of them (Rich White, our interface designer) was awesome; everything I could have asked for and more: self motivated, entrepreneurial, competant, hard working, and very smart. However, one of our hires turned out to be a huge mistake: he basically spun his wheels, didn¡¯t complete anything, and left for months at a time without word. Working with someone like this can easily make working on your company not very fun at all. If you have any reservations about someone at the outset, you should probably not hire them.
3. Cute hacks can cost you time. Take the time to do things right from the beginning. Seriously.
4. Make an environment where you will be productive. Working from home can be convenient, but often times will be much less productive than a separate space. Also its a good idea to have separate spaces so you¡¯ll have some work/life balance.
5. Get your investors involved. Your investors are there to help you. Get them involved from the start, and don¡¯t be afraid to ask for help. I think we made the mistake early on of trying to do (and know) everything ourselves, perhaps out of insecurity over being so new to the business world. This is a mistake.
6. Build incrementally. We tried to build the ultimate AJAX calendar all at once. It took a long time. We could have done it piece by piece. Nuff said.

Google工具栏的安全浏览功能

今天用FireFox访问某个网站,突然弹出这样一个窗口

google_alert.jpg

原来:Google 安全浏览是Google 工具栏 Firefox 版本提供的一项功能,当您访问的网页捏造借口要求您提供个人或财务信息时,此功能就会提醒您。

第一次遇见这种情况,Google真是好样的,希望它可以做得更好!

暂住证续期

yumeng.jpg
不知不觉暂住证已经又过一年,抵着万般的无奈,我还是去了外来人口管理中心交钱,谁知到了又发现暂住证缴费也涨价了,花了我138大洋。TNND什么时候,中国人在能在自己的国家自由生活。。。

关于XML的content-type问题

我们一般用content-type: text/xml来作为XML文件作为header输出,不过可能有些浏览器无法正常下载。Pete向我们建议:

if the user agent contains Mozilla.
So for IE, Firefox, and Safari 1.x my feed will be served in text/xml

other clients will get the proper application/rss+xml MIME type.
Here’s the PHP code:

if(preg_match(‘/mozilla/i’,$_SERVER[‘USER_AGENT’])){
header(‘content-type: text/xml’);
}else{
header(‘content-type: application/rss+xml’);
}
好像有问题,WP里面没办法加入带有”<和>”的代码?也不能加颜色,怎么办?更新:已解决