Baidu IM 最新谍报

今天是2008年2月29号,四年一遇的日子。

从雪宝宝论坛发现了百度IM的最新图片,这个软件的名字叫“百度HI”。

原帖地址:http://www.xuebaobao.com/forum-690-1-1.html

把图片都下载回来,整理了一下,咱们边看边说:

安装文件的图标:

setup file

上面清晰地写着H!,注意是感叹号!,不是I。

立刻安装:

Install 01

Install 02

Install 03

Install 04

Install 05

然后是生成的快捷方式图标:

ShortCut

登录:

Login

Login

登录成功:

Main

任务栏图标:

Conner

打开对话窗口:

Dialog

还有一些设置项:

Config

Config

Config

Config

还可以换皮肤:

Skin

得到的图片就这么多了。

看上去还很简单。

不过这说明百度已经开始正式进军IM领域了。

虽然还有待完善,但我相信一定可以越做越好!

辅助开发工具

平时经常会做一些编码和解码之类的转换,每次都要写个小文件,真麻烦,上网找过一些客户端的小工具,也都不太好用。

自己写了一个页面,随时可以使用,而且做了一系列的人性化设计,比如高亮显示之类的,感觉还不错。

大家看看吧:http://code.leakon.com/php/tools

只有一个页面,随时可以扩充新的转换。

看源码:http://leakon.googlecode.com/svn/trunk/leakon/php/tools/index.php

FreeBSD /etc 文件简介

FreeBSD中/etc下的文件可以说是纷繁复杂,对熟悉它的人来讲不算什么,但对于一个新手来说就。。。太乱了,下面是一些经常用到的配置文件的作用和配置方法,但愿能给你一点帮助。

1. aliases
2. crontab
3. csh.cshrc
4. csh.login
5. csh.logout
6. daily
7. defaultdomain
8. exports
9. fbtab
10.fstab
11.ftpusers
12.group
13.host.conf
14.hosts
15.inetd.conf
16.localtime
17.login.conf
18.make.conf
19.monthly
20.motd
21.netstart—-新版已改名为/etc/rc.network
22.passwd
23.printcap
24.profile
25.rc
26.rc.conf—-代替原来的/etc/sysconfig
27.rc.conf.local—-代替原来的/etc/rc.local
28.rc.i386
29.rc.local—-新版改名为/etc/rc.conf.local
30.rc.network—-代替原来的/etc/netstart
31.resolv.conf
32.services
33.shells
34.sysconfig—-新版已改名为/etc/rc.conf
35.syslog.conf
36.termcap
37.ttys
38.weekly

1. aliases

这个档案主要是告诉 sendmail 要将信转寄给哪些使用者, 或是交由哪个程式处理.

如. root: user1,name2,user3
usenet: “|/usr/local/bin/mail-post.pl”

如上范例, sendmail 会将原先寄给的 root 的信分送给 user1 和 name2 和 user3, 而把寄给 usenet 的信交由 mail-post.pl 处理.

在你修改完之後, 要记得执行 “newaliases” 来更新 /etc/aliases.db

关於 aliases 之详细说明, 请 man aliases 查询.

2. crontab

这是给 root 用的 crontab file, 你也可以杀掉这个档案以 “crontab -e” 来替代.
格式如下…

#分 小时 天 月 礼拜几 用谁的身份 命令
*/5 * * * * root /usr/libexec/atrun

minute: 分钟/小时, 范围自 0 至 59
hour: 小时/天, 范围自 0 至 23
mday: 天/月, 范围自 0 至 31
month: 月/年, 范围自 0 至 12
wday: 天/周, 范围自 0 至 7 (0, 7 表示星期天)
who: 表是以谁的身份执行这个 command
(这只对 /etc/crontab 有用, crontab -e 无此栏位)
command: 命令或是 shell script

*/N: 表示每 N 一算, 像小时而言, */3 指的是 0,3,6,9,12

请 man 5 crontab 去看详细说明.

3. csh.cshrc

# 系统内定给 csh shell 用的 .cshrc 档

## 确定 HOME 目录
setenv HOME $HOME
set home=$HOME
cd $HOME

## 档案权限设定
umask 022

## 就是 Aliases 嘛
alias pftp ‘/usr/local/bin/pftp’
alias free ‘pstat -s|grep -v not’
alias talk ytalk
alias ruptime ‘/usr/bin/ruptime|grep -v down’
alias ftp ncftp
alias rwho ‘/usr/bin/rwho -a|grep -v LOGIN’
alias more less
alias zmore zless
alias m less
alias pss ‘ps auxw|sort -k 2|grep $USER’
alias psm ‘ps auxw|sort -k 1,2|more’
alias psl psm
alias psv ‘ps auxw|grep -v $USER|sort -k 2|more’
alias d ‘/usr/local/bin/colorls -G -alFgk \!* | more’
alias dir ‘/usr/local/bin/colorls -G -alFgk \!*’
alias rd rmdir
alias md mkdir
alias cls clear
alias cd.. ‘cd ..’
alias del ‘/bin/rm -i’
alias xdel ‘/bin/rm -rf’
alias mv ‘mv -i’
alias dir/w ‘/bin/ls -aFgk’
alias dw ‘/bin/ls -aFgk’
#alias x ‘(startx &)>&/dev/console;sleep 300;lo’
#alias lpr ‘lpr -m’
alias cp ‘cp -i’
alias rm ‘rm -i’
alias lo ‘clear;exit’
alias bye ‘clear;exit’
#alias vi cvi
alias unlo ‘unset autologout;unsetenv autologout’
alias q joe
alias .. ‘cd ..’
alias … ‘cd ../..’
#alias ku ‘ku -W’
alias tin rtin
#alias s ‘exec screen’

## 环境设定
set path = (/sbin /usr/sbin /bin /usr/bin /usr/local/sbin /usr/local/bin)
set path = ($path /etc /usr/etc /usr/local/etc)
set path = ($path /usr/X11R6/bin /usr/games)
set path = ($path ~ ~/bin .)
set mail = (10 /var/mail/$USER)
set recexact
set autolist
set matchbeep = ambiguous
set autoexpand
set autocorrect
set ignoreeof
set noclobber
set notify
set correct = all
if ( ! $?WINDOW ) then
# set prompt = “%B%m [%/] [%?] -%n- ”
set prompt = “%B%m [%/] -%n- ”
else
set prompt = “%B%m [%/] -%n- [W$WINDOW] ”
endif
set prompt2 = “(%t %m)%~ #%% ”
set prompt3 = “%SDo you mean [%R] (y/n/e) ? ”
set history = 500
set savehist = 500
set time=100
#set watch=(1 any any)
set symlinks = ignore
set listlinks
set listjobs
set rmstar
set showdots
#set tperiod = 30
# set autologout = (60 2)
#setenv MANPATH /usr/man:/usr/local/man:/usr/man/preformat:/usr/X11/man:/usr/openwin/man
setenv EDITOR /usr/local/bin/joe
setenv VISUAL /usr/local/bin/joe
setenv EXINIT ’set ai’
setenv LESS “-EsPm-LESS-”
setenv LESSCHARDEF “8bcccbcc18b95..”
setenv PAGER “less -Em”
#setenv PAGER more
setenv LC_CTYPE lt_LN.ISO_8859-1
setenv LANG C
setenv BLOCKSIZE 1k
setenv MACHINE_ARCH i386
setenv MACHINE i386
setenv ORGANIZATION “交大资工 ADONIS”

## X 相关设定
setenv XWINHOME ‘/usr/X11R6′
setenv X11HOME ‘/usr/X11R6′
setenv OPENWINHOME ‘/usr/X11R6′
setenv XKEYSYMDB /usr/X11R6/lib/X11/XKeysymDB
setenv XNLSPATH /usr/X11R6/lib/X11/nls
#setenv LD_LIBRARY_PATH /usr/lib:/usr/X11R6/lib:/usr/local/lib
stty erase ‘^?’

if ( $?TERM ) then
if ($TERM == “xterm” || $TERM == “xterms”) then
stty erase ‘^H’
endif
endif

## 杂七杂八设定
#set term = vt100
#set TERM = vt100
#setenv term vt100
#setenv TERM vt100
#stty extb
stty 38400
stty crt
stty -tabs
stty -istrip
stty pass8
unlo
#bindkey “[HOME]” beginning-of-line
#bindkey “[ESC]” keyboard-quit
limit coredumpsize 0

# 给 FSP Client 用
setenv FSP_PORT 21
setenv FSP_HOST nctuccca.edu.tw
setenv FSP_DIR /
setenv FSP_TRACE
setenv FSP_DELAY 3000

# Aii.. 就是 fsp aliases :)
alias fcat ‘(set noglob; exec fcatcmd \!*)’
alias fcd ’setenv FSP_DIR `(set noglob; exec fcdcmd \!*)`;fpwd’
alias fdu \(set noglob\; exec fducmd \!\*\)
alias ffind \(set noglob\; exec ffindcmd \!\*\)
alias fget ‘(set noglob; exec fgetcmd \!*)’
alias fgrab ‘(set noglob; exec fgrabcmd \!*)’
alias fls ‘(set noglob; exec flscmd -F \!*)’
alias fll ‘(set noglob; exec flscmd -l \!*)’
alias fdir ‘(set noglob; exec flscmd -l \!*)’
alias fmore \(set noglob\; exec fcatcmd \!\* \| more\)
alias fpro ‘(set noglob; exec fprocmd \!*)’
alias fpwd ‘echo “$FSP_HOST ($FSP_PORT): $FSP_DIR”‘
alias frm ‘(set noglob; exec frmcmd \!*)’
alias frmdir ‘(set noglob; exec frmdircmd \!*)’
alias fhost ’setenv FSP_HOST \!*;setenv FSP_DIR /’

4. csh.login

# 系统内定的 .login 档.

#stty extb
stty 38400
#stty crt
#stty -tabs
stty -istrip
stty pass8

# Mesg y if not console
mesg y
if ( `tty | cut -c 6-` == console ) then
mesg n
endif

msgs -fp

5. csh.logout

# 系统内定的 .logout
clear
.

6. daily

cron 会依照 /etc/crontab 去做每日例行的工作. 注意一下有些 commands 对你的硬盘造成很大的负荷, 像是最後一行的 “sh /etc/security”, 他会从你的根目录开始查询. 你可以加些每天你想要执行的commands, 像是 “quotacheck -a”, “bin/rm/-f /tmp*junk*.

7. defaultdomain

这个档案记载你的 domainname, 你有跑 yp (nis) 时才有用. 当然闲闲填一填也没差啦.

8. exports

这个档案定义哪些目录可经由 NFS 给别人使用.
例如 /cdrom -ro host1,host2
/home -maproot=root host3

Notice: 若你没加 “-ro” 表示可以写入, 所以你应当小心点.

做完修正後, “kill -1 $mountd_pid”, 然後用 “showmount -e” 去看看 NFS 是否做的正确. 如果有错, 用 “tail /var/log/messages” 来看错误讯息.

你应该要将 /etc/rc.conf 中的 nfs_client_enable, nfs_server_enable 设为 YES.

详细说明请 man 5 exports.

9. fbtab

/dev/ttyv0 0600 /dev/console
/dev/ttyv1 0600 /dev/console
/dev/ttyv2 0600 /dev/console
/dev/ttyv3 0600 /dev/console
#/dev/ttyv0 0600 /dev/pcaudio:/dev/pcaudioctl

10.fstab

这个档案定义当你开机时, 你想 mount 哪些 partition.
例如.

/dev/sd0a / ufs rw 1 1
/dev/sd0e /dos msdos ro,-gmsdos,-m750 1 1
/dev/sd0g /usr/local ufs rw,userquota 1 1
/dev/sd0h /home ufs rw,userquota,groupquota 1 1
/dev/sd0b none swap sw 0 0
proc /proc procfs rw 0 0
kern /kern kernfs rw 0 0

详情请 man fstab.

如果你的 /usr 没有跟 / 放在一起,要特别注意,/usr 不可以放在使用 LKM 载入的 filesystem 後面。例如,你的 MSDOSFS 是利用 LKM 载入的(也就是说,你没有把 MSDOSFS 编译在 kernel 中),你的 /dos
一定要放在 /usr 後面,不然开机会失败,例如:

modload:exec(/usr/bin/ld):NO such file or directiory
msdos:vfsload(msdos):Operation not permitted
Filessystem mount failed,startup aborted
Enter pathname of shell or RETURN for sh

11.ftpusers

这个档注明的 users 将无法 ftp 这台机器. 只要写 username 即可. 算是禁止 ftp 进来的黑名单吧.

12.group

这个档案主要记载著 group 名称, group id 以及隶属於该 group 的使用者.

要记得在 FreeBSD 中, 只有属於 wheel group 的使用者才能 su 成 root.

在升级时特别注意 /usr/src/etc/group 中是否有新增系统 group, 如 network 这个 group 就是最近新增的 group.

其他详细请用 man group.

13.host.conf

这个档案决定 DNS-name-lookup 的先後顺序. 你最好先 “hosts”, 其次 “bind”, 最後用 “nis”.

hosts: 自 /etc/hosts 查询.
bind: 自 nameserver (参考 /etc/resolv.conf 设定) 查询.
nis: 自 nis server 查询.

14.hosts

这个档案记载了你所需要的 ip 和 hostname, 最少要包括 localhost 和你自己的 hostname, 通常是提供优先於 nameserver 的查询, 或是没有 nameserver 时的查询.

格式如下:
IP-addr full-hostname alias
如. 123.456.789.123 heaven.net.com heaven

请 man hosts 去看详细说明.

15.inetd.conf

这个档案定义由 inetd 所提供的服务, 应该要和 /etc/services 保持一致性.

当你修改这个档案的时候, 记得要 kill -1 $inetd_pid 去知会 inetd 要重新更新资料.

你可以安装 tcp-wrapper (tcpd) 以增加安全性.

16.localtime

这个档记载你所在的时区资料, 你可以从 /usr/share/zoneinfo 中选一个适合的来用.

就台湾而言, 你应该用 /usr/share/zoneinfo/Asia/Taipei, 正常来说, 在 install 时会自动将此档案 copy 到 /etc/localtime.

17.login.conf

此档案可控制系统资源与帐号各方面的限制,亦可设定内定之环境变数。

“man login.conf” for detail.

18.make.conf

当你用 make 时, 这个定义档将被参考.

如果不是以 BSD 格式撰写的 Makefiles, 你应该安装 gmake (GNU)

19.monthly

每月例行的 jobs.

20.motd

Message Of Today, 顾名思义, 就是当你 login 时所出现的画面.

假如你要有自己的 motd, 你必须把 /etc/rc.local 前面几行在开机时会更改 motd 的命令拿掉, 否则你每次开机 motd 会被乱改.

21.netstart—-新版已改名为/etc/rc.network

目前此档已由 /etc/rc.network 取代 目前此档只作为 root 在 single user mode 要手动启动网路服务
时使用。 这个档案不要做更动, 应该去修改 /etc/rc.conf

22.passwd

/etc/passwd /etc/master.passwd /etc/spwd.db /etc/pwd.db 都是 由 vipw 所产生的. 关於怎样去建一个帐号, 请参考 HOW-TO-adduser.

你可以 man passwd, vipw, chpass, chfn 查询详细说明.

23.printcap

这个档案定义印表机的设定, 在修改後, 试著用 lpr 去列印一些东西, 假如你觉得很慢, 试著用 lptcontrol -p 去改变 /dev/lpt0 到 poll 模式, 当然, 你可以将 lptcontrol -p 加到 /etc/rc.local 里 以使每次开机都有效.

man lptcontrol 查询详细说明.

24.profile

这是 /bin/sh 的 default 设定.

25.rc

当系统开机时, kernel 会先去载入 /sbin/init, 然後 /sbin/init 会去执行 /etc/rc, 所以 /etc/rc 相对於 DOS 而言就好像 AUTOEXEC.BAT. 这个档案不要去更改, 假如你不希望每次开机时 /tmp 会被清乾净, 那你可以将跟 /tmp 相关的几行给砍掉. (个人偏好)

26.rc.conf—-代替原来的/etc/sysconfig

这主要用来做系统开机时的环境设定. /etc/rc, /etc/rc.i386, /etc/rc.conf.local, /etc/rc.network, /etc/[bla bla] 都会参考这个档案. 所以这个档案可以说非常重要.

大多都有注解, 以下列举一些你该注意的地方…
1) hostname : 你的完整 hostname (FQDN: 像是 freebsd.csie.nctu.edu.tw)
2) network_interfaces : 网路卡的 device name, 像是 “ed0 lnc0″.
3) ifconfig_xxx : 定义网路卡及其 ip address.
像是 ifconfig_ed0=”inet 140.113.145.1 netmask 0xffffff00″
ifconfig_ed1=”inet 140.113.190.1 netmask 0xffffff00″
方法如下…
ifconfig_$device-name=”inet $IP netmask $netmask”,
netmask 0xffffff00 就是 255.255.255.0 表 Class C 网路.
4) defaultrouter: 内定的 router IP.(比如: 140.113.122.254)
5) routdflags : 通常 NO. 但是假如你想要跑 routed, 则用 “-s” 或 “-q”.
详细说明请 man routed.
6) rwhod : YES 执行 rwho daemon. rwho 跟 ruptime 须此 daemon.
7) sendmail_flags : 执行 sendmail daemon, 通常设为 “-db -q30m”
8) nfs_* : 执行 nfs client 或 server
9) check_quotas : enable 档案系统 quotas
10) accountint : enable command accounting, “lastcomm” 须要.
11) firewall_enable : enable firewall 的功能
firewall_type : 指定 firewall 的形态

你应该设定完後再重新开机以测试是否每个改变都合乎你的要求.

27.rc.conf.local—-代替原来的/etc/rc.local

在这个档案加入你个人的设定, 你可以将开机时想要执行的动作放在这里. 像 gopherd, lptcontrol, swap-on-file 等.

28.rc.i386

这个档案不要更动.

29.rc.local—-新版改名为/etc/rc.conf.local

新版已由/etc/rc.conf.local所取代。

30.rc.network—-代替原来的/etc/netstart

有关网路方面各项设定请由 /etc/rc.conf 设定,原则上此档不需更动

31.resolv.conf

这定义 DNS 查询 nameserver 的先後顺序.

1. domain : 将你的 domainname 放这儿.
2. nameserver : 将你的 nameservers 放这儿, 最前面的会被当成主要的nameserver.
3. search : 将 domainnames 放这儿, 当你没有输入完整的 hostname 时, 他会将 domainnames 附加上去. 例如: search csie.NCTU.edu.tw NCTU.edu.tw edu.tw tw

详情请 man resolver.

32.services

定义 service 名字以及 port. 不需要更动。

33.shells

所有的 shell 都应该放在这个档案里, 像是 /bin/sh, /bin/tcsh, /home/bbs/bin/bbsrf 等等.

假如说有某个使用者的 shell 没有列在这个档案中, 有些程式如 ftpd 会拒绝该使用者 ftp, 如 adduser 将会拒绝执行.

man shells 查询详细说明.

34.sysconfig—-新版已改名为/etc/rc.conf

参考 rc.conf。

35.syslog.conf

这个档案指出系统的 log 应该储存在哪儿.

36.termcap

这个应该 link 到 /usr/share/misc/termcap.

37.ttys

定义 tty 的形式及某些 tty 允不允许 root login. 假如某些 ttys 後面加有 “secure”, 表示 root 可以 login. 你应当多加些, 如 /dev/tty[pqrs][0-9a-v]

详情请 man ttys。

38.weekly

每周例行的工作。

百度 IM Baidu IM

百度的即时通信软件就要推出了。

以前只是听说在开发,一直没见到可用的版本,外界也是一直猜测。

公司保密工作还不错,目前除了QA,其他人都看不到IM实际的样子。

刚才百度一下,搜到好多介绍IM的文章和评论,看到这么一条:

“用QQ是一种生活的方式,他是可以赚钱的,即使通讯是一个交流工具,他是不赚钱的。”

给出原文链接,大家看看:http://net.chinabyte.com/177/3459177.shtml

前2天写了一篇文章,说“可能与不可能”。

我就不明白,为什么总是有人做这种肯定性的判断呢?

就好像某些公司的老总,在评论其他公司的产品时,总要表达出一无是处的评价,一般都这样说:像xx这样的团队,这样的产品设计,是搞不起来的,注定要失败的。

看看吧,跟刚才那个评论的语气多么相似。

听过单田芳的评书吗?里面都是讲一些武林中人,功夫高低不说,做人一定要品行端正,是一个教人向善的典范。

但跟正义的侠客剑客们唱对台戏的,都是一些卑鄙下流无恶不作的小人,以单老的话说:这个社会,缺少一种人,那就不叫个社会。

确实是这样,在等级观念越来越深入的当今社会,什么叫有层次,什么叫没层次,什么叫好人,什么叫坏人?

没有好人哪儿来的坏人?没有坏人,那怎么定义好人呢?

词语也是一样,这里有点不太适合说,您要是觉得不雅,就跳过这一行吧:牛X和傻X,没有傻X,怎么显示出您的牛X?

“ 用QQ是一种生活的方式”,呵呵,你怎么想的呀?

社会主义要是缺了您这种人,那就不叫社会主义了,直接升级成共产主义!

你以为全天下都是跟你一样,每天闲的没事上QQ找人打法时间,要不就买点Q币给你的形象买点衣服,或者找几个狐朋狗友去QQ游戏搓几圈麻将?

QQ的影响力在于他先入为主,大部分中国的青年人,用的第一个IM软件就是QQ。

我的朋友们都用QQ,为了联系他们,我不得不用QQ。并不是QQ有多么好,并不是没有他,别人就没法通过互联网进行沟通了。

你知道百度为什么成为今天的百度吗?

我有了一点体会,坚持不懈地把不可能变成可能,简单易用,速度快,稳定。

你用过淘宝的商品搜索吗?

搜个东西至少得半分钟,否则页面绝对加载不完。

你见过哪个百度的产品页面打开速度超过0.5秒?

我98年开始上网,99年知道新浪有个搜索框,可以查东西。

我搜过几次,结果不少,但基本上没有几个能打开,都是无效链接,看了一眼页面的右上角:Powered by 百度。

这是我第一次看见“百度”这两个字,我没怎么读过诗,不知道出自《青玉案》,只是觉得这个词挺怪的,但却让我印象深刻(在我看来,Google中国叫谷歌,就是为了让人印象深刻,说心里话,名字可真够难听的)。

那时,我对百度的印象很差,心里想,这叫什么玩意儿啊,搜个破东西,全都打不开。

那会儿,我试着去Yahoo搜,还算可以搜到一些东西。

99年,我高二。

后来就专心考大学,也不怎么上网了。

再次注意到百度,大概是02、03年左右,那会儿,百度已经是一个独立的搜索引擎网站了。

搜索结果相关度一般,但至少每个链接都能打开,没有死链了。

对百度的印象越来越好。

后来我用MyIE,在地址栏输入关键词,直接跳到百度搜索,这也慢慢养成了我的习惯。

当我05年6月刚开始工作的时候,那个公司,也想做搜索。当同年8月,百度在纳斯达克上市时,更激励了全公司,百度就是大家的榜样,就是公司憧憬的未来。

公司老总经常说,当年,他的公司也做搜索,跟百度是棋逢对手,甚至一度领先百度。

但后来把公司卖给Yahoo了。他现在后悔了,卖给Yahoo也就1亿美元,看到百度上市,值几十亿美元,很不平衡。

我觉得,百度之所以值那么多钱,是因为人家一直在做,有个词叫“锲而不舍”,我最喜欢这个词。

您中途退出了,所以,比赛终点那里发的奖牌,一定没有您的。

老总以前的公司,做客户端软件很出名,确实也培养了不少人才。他经常提起一个例子:他们公司被“淘汰”的程序员,到了百度,都成了开发核心。所以,他看不起百度。

我相信,那个时候,一定有人说过类似的话:

“三7二1是一种生活的方式,他是可以赚钱的,搜索引擎是一个查询工具,他是不赚钱的。”

在看到结果之前,一切的判定都是扯淡。

我看到的,是从1999年到2005年,百度坚持不懈地拼搏了6年(我看到的是6年,背后的故事,我就不知道了),才成功上市。

我是一个普通的网民,属于较低层次的那种,我一开始认为百度很差,很不喜欢百度,而现在,却把百度作为一种习惯,有啥不知道,立刻百度一下。(百度的标语啥时候能改成:你不知道 百度一下)

这证明了啥呢?

互联网是一个独特的行业,没有人敢对互联网做出全面的定义,也没有人敢说自己了解互联网。

但现象是可以被发现的:只要你的服务好用,那一定有人用,一定有越来越多的人用,一定能让不喜欢的人慢慢喜欢用!

用户多了,真的没办法不赚钱。

我又不知道自己在说啥了(考大学的时候语文不及格,同学认为我没写作文,其实我写了,但阅卷的老师可能跟我的同学持一样的观点……)。

我说啥呢?我说百度IM呢。

现在,我是百度的一员了,我比所有外部的人,更能真切感受到百度的文化。

大家不是都离不开QQ么,MSN那个破玩意儿又难用又不稳定,旺旺倒还不错,只是不习惯用。

告诉你们,百度IM来了!

我坚信,以百度的作风,QQ会感到害怕的。

百度IM就要来了,我可以预见的是,第一个版本的他,不会太好用,满意度也不会太高,这是一定的。

但是,一个顽强而坚定的后来者,已经开始起跑了!

QQ们,要是不怕死,就慢慢溜达吧……

最近的事

好久没写东西了,有点忙,也有点懒。

年前,在忙一个项目,年后终于上线了。给大伙儿推荐一下吧:

万人say Hi

其实这段时间,一直在想一些事情,可能是打字的速度实在跟不上思想的速度,一直也没写出来。

这样不好,还是想一点就说一点吧。

关于 “不可能”和“可能”的故事。

我妈在炒股票,炒了好几年,也赔了好几年。每天都要看财经评论和股市预测。我始终觉得这类评论完全是跟没说一样。细心的你,仔细听听,就会发现,在这些评论人对未来的股市做预测的时候,总是用“应该”、“基本上”、“差不多”和“我认为”等词。什么意思呢,就是我说“中国石油”这个股票明天大涨,注意,是“应该”大涨,要是涨了,那就是我NB,要是没涨,跟我没关系,因为我说过是“应该”了。

中国人爱吹牛,但不爱负责任。

总是把话说得滴水不漏,你永远挑不出他的毛病。

这里面我认为还有一个问题,就是这篇文章的核心问题:“对未来的预测”。

我们总是习惯,用过去的经验,来判断未来的可能性。

看看各大新兴的Web2.0网络公司吧,从各大成功网站挖来产品总监等人,由他们来设计产品。小网站的老总们认为,有经验的人来指导网站,就很容易成功。

我觉得事情不是这样的。

我们处在互联网这个行业,他的性质,就是没有规律可循。

所有成功的互联网企业,都是在做一件事:把不可能变成可能!

而另外一些永远成功不了的互联网公司,他们也在做一件事:复制别人成功的经验!

举个简单的例子,几百年前,中国人第一次见到外国的由钢铁打造的轮船时,认为这是不可能的,一堆大铁疙瘩,咋就不会沉到海里呢?莱特兄弟在一百多年前,试验飞机的时候,旁观者肯定用一种嘲笑的眼光看待:一堆铁疙瘩,能飞上天?

英国人把不可能变成可能,因此成为了18世纪的海上霸主。

美国人把不可能变成可能,因此成为全球航空业的领先者。

这样的例子太多了。

在互联网这个行业里,有经验的人太多了,但往往是这些人,限制了行业的发展。

前一段时间,有个成功的老总刚开始创业,就放出话来:搞互联网没有一个大的团队是做不了的。

我看未必。

如果说,在混乱的项目管理之下,开发团队在一个新手的带领下,测试团队使用落后的测试方法,运维团队采用手工的方式管理服务器,那么,再简单的项目,也要一个人员众多的团队才可以进行下去。

如果采用成熟的开发框架,把一些重复的毫无意义的劳动全部由机器完成,开发人员的数量可以大幅减少,开发人员可以把精力放在最关键的模块中;采用自动化的测试框架,设计合理的测试用例,那么每次程序有新的修改或升级时,回归测试只要一个脚本,便全部完成,输入个命令按一下回车就ok了,需要很多人吗?采用先进的服务器集群管理架构,同步文件和部署环境,完全由自动化的脚本去做,就算有一万台服务器,同样也是一条命令的事,需要很多人吗?

采取原始的、手工的操作方法,注定了效率低下。

带头这样做的人,就是因为,他们只相信原有的经验,没有勇气,没有信心,没有意识去尝试新兴的敏捷开发之道。

现在总有人去评价一个互联网公司的未来。

全都是基于个人的旧有经验去判断,这类文章我现在一眼都不看,都是废话。

在我们感叹互联网行业里一个又一个奇迹的时候,是不是也应该领悟到一些内在的原因呢?

我认为内在的原因就是创新!

以传统观念去判断未来的人,永远不会领悟创新的巨大潜力。

实在不知道怎么写,表达能力真是跟不上思想的节拍。

总结一下:把不可能变成可能,坚持不懈,努力创新!这才是你的未来!

php的xml解析类

这两天要用php解析xml,自己写闲麻烦,就到网上找到了这个xml解析类。还是很实用的。老外的程序的确写的不错,注释很详细,下边是我的xml测试文件,和程序。以下是测试的php文件。

//类文件名称为xmlClass.php。

require_once(’xmlClass.php’);

$file = “data.xml”;
$data = implode(”",file($file)) or die(”could not open XML input file”);
$obj = new xml($data,”xml”);

//以下是具体节点访问方式。
print $xml[”chapter_para_informaltable_tgroup_tbody_row”][0]->entry[0];
?>

以下是我测试xml文件的具体内容:




]>



a1b1c1
a2c2
a3b3c3

&systemEntity;


–>

/*
(c) 2000 Hans Anderson Corporation. All Rights Reserved.
You are free to use and modify this class under the same
guidelines found in the PHP License.
———–
bugs/me:
http://www.hansanderson.com/php/
me@hansanderson.com
———–
Version 1.0
- 1.0 is the first actual release of the class. It’s
finally what I was hoping it would be, though there
are likely to still be some bugs in it. This is
a much changed version, and if you have downloaded
a previous version, this WON’T work with your existing
scripts! You’ll need to make some SIMPLE changes.
- .92 fixed bug that didn’t include tag attributes
(to use attributes, add _attributes[array_index]
to the end of the tag in question:
$xml_html_head_body_img would become
$xml_html_head_body_img_attributes[0],
for example)
– Thanks to Nick Winfield
for reporting this bug.
- .91 No Longer requires PHP4!
- .91 now all elements are array. Using objects has
been discontinued.
———–
What class.xml.php is:
A very, very easy to use XML parser class. It uses PHP’s XML functions
for you, returning one array that has all the tag information. The only
hard part is figuring out the syntax of the tags!
———–
Sample use:
require(’class.xml.php’);
$file = “data.xml”;
$data = implode(””,file($file)) or die(”could not open XML input file”);
$obj = new xml($data,”xml”);
print $xml[”hans”][0]->num_results[0];
for($i=0;$i print $xml[”hans”][$i]->tag[0] . “\n\n”;
}
To print url attributes (if they exist):
print $xml[”hans”][0]->attributes[0][”size”]; # where “size” was an attr name

(that’s it! slick, huh?)
———–
Two ways to call xml class:
$xml = new xml($data);
- or -
$xml = new xml($data,”jellyfish”);
The second argument (jellyfish) is optional. Default is ‘xml’.
All the second argument does is give you a chance to name the array
that is returned something besides “xml” (in case you are already using
that name). Normal PHP variable name rules apply.
———-
Explanation of xml class:
This class takes valid XML data as an argument and
returns all the information in a complex but loopable array.
Here’s how it works:
Data:
Run the data through my class, then access the title like this:
$xml[”html_head”][0]->title[0];
Or, loop through them:
for($i=0;$i print $xml[”html_head”][$i]->title[0] . “\n”;
}
Yes, the variable names *are* long and messy, but it’s
the best way to create the tree, IMO.
Here is a complex explanation I sent to one class.xml.php user:
———
> Now I’ve run into another problem:
>
>
>

Markets
> By Aaron L. Task
Senior
> Writer
>
>
> How do I get BYLINE_AUTHOR?
print $xml[”STORY_BYLINE”][0]->BYLINE_AUTHOR[0];
> And just a little question: Is there an easy way to get TIMESTAMP?
print $xml[”STORY”][0]->attributes[0][”TIMESTAMP”];
This is confusing, I know, but it’s the only way I could really do
this. Here’s the rundown:
The $xml part is an array — an array of arrays. The first array is the
name of the tag — in the first case above, this is the tag STORY, and
below that BYLINE. You want BYLINE_AUTHOR. You want the first BA. The
first one is index [0] in the second part of the two-dimensional array.
Even if there is only *one* byline author, it’s still an array, and you
still have to use the [0]. Now, the two-dimensional array is storing
dynamic structures — objects in this case. So, we need to dereference
the object, hence the ->. The BYLINE_AUTHOR is the tag you want, and it
is an array in that object. The reason for the array is that if there are
more than one BYLINE_AUTHOR for the tags STORY, BYLINE, we would have a
[0] and [1] in the array. In your case there is just the one.
*** This is very confusing, I know, but once you understand it, the power
of this method will be more apparent. You have access to *every* bit of
information in the XML file, without having to do anything but understand
how to refer to the variables. ***
EVERY variable will look like this:
print $xml[”STORY_BYLINE”][0]->BYLINE_AUTHOR[0];
The trick is understanding how to get the variable to give you the
information. This is an array of arrays of objects holding arrays!
Any tag that has attributes will have them stored in a special object
array named “attributes” and will be called this way:
print $xml[”STORY”][0]->attributes[0][”TIMESTAMP”];
If you aren’t sure if there are attributes, you could do isset() or
is_array() for that above example. If isset(), you could for loop and
while(list($k,$v) = each($xml…)) over it to get the values.
array of
objects
|
|
$xml[”STORY_BYLINE”][0]->BYLINE_AUTHOR[0];
^ ^
array of ^
arrays ^
^
array in
object
In general, to get the value of this:









You would look for what you want, say “CITY”, then go UP one level, to
COUNTY (COUNTYNAME is on the same ‘level’), for your first array:
$xml[”STATE_COUNTY”] — ALL tags pushed together are separated with
“_”. Otherwise tags are as they were — spaces, dashes, CaSe, etc.
Now, you want the first COUNTY, though there are two, so we are do this:
$xml[”STATE_COUNTY”][0] — to get the second, we’d use [1] instead of
[0]. You could also do a for() loop through it, using sizeof() to figure
out how big it is.
So, we have the STATE,COUNTY we want — the first one. It’s an
object, and we know we want the CITY. So, we dereference the object. The
name of the array we want is, of course, CITY:
$xml[”STATE_COUNTY”][0]->CITY[0] (the first one, the second one would be
[1]).
And that’s it. Basically, find what you want, and go up a level.
You could do some complex for loops to go through them all, too:
for($i=0;$i for($j=0;$jCITY);$j++) {
print $xml[”STATE_COUNTY”][$i]->CITY[$j];
}
}
———–
Whew. I hope that helps, not hurts.
*/
/* used to store the parsed information */
class xml_container {
function store($k,$v) {
$this->{$k}[] = $v;
}
}
/* parses the information */
class xml {
// initialize some variables
var $current_tag=array();
var $xml_parser;
var $Version = 1.0;
var $tagtracker = array();
/* Here are the XML functions needed by expat */
/* when expat hits an opening tag, it fires up this function */
function startElement($parser, $name, $attrs) {
array_push($this->current_tag, $name); // add tag to the cur. tag array
$curtag = implode(”_”,$this->current_tag); // piece together tag
/* this tracks what array index we are on for this tag */
if(isset($this->tagtracker[”$curtag”])) {
$this->tagtracker[”$curtag”]++;
} else {
$this->tagtracker[”$curtag”]=0;
}
/* if there are attributes for this tag, we set them here. */
if(count($attrs)>0) {
$j = $this->tagtracker[”$curtag”];
if(!$j) $j = 0;
if(!is_object($GLOBALS[$this->identifier][”$curtag”][$j])) {
$GLOBALS[$this->identifier][”$curtag”][$j] = new xml_container;
}
$GLOBALS[$this->identifier][”$curtag”][$j]->store(”attributes”,$attrs);
}
} // end function startElement
/* when expat hits a closing tag, it fires up this function */
function endElement($parser, $name) {
$curtag = implode(”_”,$this->current_tag); // piece together tag
// before we pop it off,
// so we can get the correct
// cdata
if(!$this->tagdata[”$curtag”]) {
$popped = array_pop($this->current_tag); // or else we screw up where we are
return; // if we have no data for the tag
} else {
$TD = $this->tagdata[”$curtag”];
unset($this->tagdata[”$curtag”]);
}
$popped = array_pop($this->current_tag);
// we want the tag name for
// the tag above this, it
// allows us to group the
// tags together in a more
// intuitive way.
if(sizeof($this->current_tag) == 0) return; // if we aren’t in a tag
$curtag = implode(”_”,$this->current_tag); // piece together tag
// this time for the arrays
$j = $this->tagtracker[”$curtag”];
if(!$j) $j = 0;
if(!is_object($GLOBALS[$this->identifier][”$curtag”][$j])) {
$GLOBALS[$this->identifier][”$curtag”][$j] = new xml_container;
}
$GLOBALS[$this->identifier][”$curtag”][$j]->store($name,$TD); #$this->tagdata[”$curtag”]);
unset($TD);
return TRUE;
}
/* when expat finds some internal tag character data,
it fires up this function */
function characterData($parser, $cdata) {
$curtag = implode(”_”,$this->current_tag); // piece together tag
$this->tagdata[”$curtag”] .= $cdata;
}
/* this is the constructor: automatically called when the class is initialized */
function xml($data,$identifier=’xml’) {
$this->identifier = $identifier;
// create parser object
$this->xml_parser = xml_parser_create();
// set up some options and handlers
xml_set_object($this->xml_parser,$this);
xml_parser_set_option($this->xml_parser,XML_OPTION_CASE_FOLDING,0);
xml_set_element_handler($this->xml_parser, “startElement”, “endElement”);
xml_set_character_data_handler($this->xml_parser, “characterData”);

if (!xml_parse($this->xml_parser, $data, TRUE)) {
sprintf(”XML error: %s at line %d”,
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser));
}
// we are done with the parser, so let’s free it
xml_parser_free($this->xml_parser);
} // end constructor: function xml()
} // thus, we end our class xml
?>

diff 用法

语法:diff [选项] file1 file2

说明:该命令告诉用户,为了使两个文件 file1 和 file2 一致,需要修改它们的哪些行。如果用 “- ”表示 file1 或 file2,则表示标准输入。如果 file1 或 file2 是目录,那么 diff 将使用该目录中的同名文件进行比较,同时两个目录中的不同文件也会以 only in 目录名 : 文件名 列出。

通常输出由下述形式的行组成:

n1 a n3,n4

n1,n2 d n3

n1,n2 c n3,n4

字母(a、d和c)之前的行号(n1,n2)指file1 的n1~n2行,其后面的行号(n3,n4)指 file2 的n3~n4行。字母 a、d 和 c 分别表示附加、删除和修改操作。

在上述形式的每一行的后面跟随受到影响的若干行,以 “<” 打头的行属于第一个文件,以 “>” 打头的行属于第二个文件。

diff 能区别块和字符设备文件以及 FIFO(管道文件),不会把它们与普通文件进行比较。

如果 file1 和 file2 都是目录,则 diff 会产生很多信息。如果一个目录中只有一个文件,则产生一条信息,指出该目录路径名和其中的文件名。

该命令的各选项含义如下:
-i 忽略大小写匹配
-b 忽略行尾的空格,而字符串中的一个或多个空格符都视为相等。
-c 采用上下文输出格式(提供三行上下文)。
-C n 采用上下文输出格式(提供 n 行上下文)。
-e 产生一个合法的 ed 脚本作为输出。
-r 当 file1 和 file2 是目录时,递归作用到各文件和目录上。

PicLens 1.6 - FireFox上的华丽图像展

Piclens 原本是为 Safari Web 浏览器量身定做的一款网页图片预览工具,它允许用户在浏览网页的同时将网站上出现的一张张图片以全屏Slideshow的显示展示给用户.
而现在,包括Windows和Mac的FireFox均可以安装一个扩展来实现3D墙的功能,效果非常灿烂夺目.而且它支持众多Web2.0网站和图像搜索站点.

支持如下站点:

 

图床

社交网络

图像搜索

  Flickr
Photobucket
Picasa Web Albums
DeviantArt
Smugmug
Facebook
MySpace
Bebo
Hi5
Friendster
Google Images
Yahoo Images
Ask Images
Live Images
AOL Images

Netscape Bookmark File Format

The Microsoft Internet Explorer Favorites file format is exactly the same as the Netscape Bookmark file format. Netscape usually stores its bookmarks in an HTML file called Bookmark.htm.

File Format

The file starts with the following text:

 

<!DOCTYPE NETSCAPE-Bookmark-file-1>
    <!--This is an automatically generated file.
    It will be read and overwritten.
    Do Not Edit! -->
    <Title>Bookmarks</Title>
    <H1>Bookmarks</H1>

The rest of the file is as follows:

 

    <DL>
    {item}
    {item}
    {item}
    .
    .
    .
    </DL>

An item may be either a subfolder or a shortcut. If {item} refers to a subfolder, it is:

 

    <DT><H3 FOLDED ADD_DATE="{date}">{title}</H3>
    <DL><p>
        {item}
        {item}
        {item}
        .
        .
        .
    </DL><p>

If {item} refers to a shortcut, it is:

 

    <DT><A href="{url}" ADD_DATE="{date}" LAST_VISIT="{date}"
    LAST_MODIFIED="{date}">{title}</A>

NoteThroughout this file format definition, {date} is a decimal integer that represents the number of seconds elapsed since midnight January 1, 1970.

Exports and Imports

To export data to a Web address, send an HTTP post request. To send a post request, call HttpOpenRequest with the following parameter values:

  • verb: “POST”
  • http version: “HTTP/1.0″
  • referer: none
  • accept-types: none(implies “text/*”)

Imports from a Web address are accomplished by calling the URLDownloadToCacheFile function.

Google

Google
LAMP-Linux-redhat LAMP-Apache LAMP-MySQL LAMP-Php Leakon-Wiki Leakon-BBS XueBaoBao Xyoyou