2006-10-21

又一个低级错误

最近为了项目写了个完成端口测试代码,当代码完成时却始终无法正确执行。
无法,只好又投身代码调试查错中。
结果发现原来是我 CreateThread 时传递了参数给线程,线程使用的是 register 模式,所以在线程中取出 Parameter 无效。
结果非常简单,改为 Stdcall 调用即可 - -!
总之。。。大意了! (- -!)

2006-10-19

贴两张Google的漫画


A: My son wants to be a lawyer.
B: My son wants to be a doctor.
C: My son wants to sell his website to google.



1: Google bought YouTube for 1.65 Billion Dollars! (165000000 Dollars)
2: 1.65 Billion Dollars! (165000000 Dollars)
3: I think Mr.Google better let Mrs.Google hold the checkbook from now on!

2006-10-09

SDK:当前时间 [Bitx.cn]

SDK用.
注:Delphi的wsprintf无法直接使用,使用我修改后的wsprintf直接格式化以提升效率.

function NowTime: String;
var
SystemTime: TSystemTime;
TimrFmt: array[0..5] of Integer;
p: PChar;
begin
GetLocalTime(SystemTime);
with SystemTime do
begin
TimrFmt[0] := wYear;
TimrFmt[1] := wMonth;
TimrFmt[2] := wDay;
TimrFmt[3] := wHour;
TimrFmt[4] := wMinute;
TimrFmt[5] := wSecond;
end;
GetMem(p, 19);
try
wvsprintf(p, '%d-%02d-%02d %02d:%02d:%02d', @TimrFmt);
Result := String(p);
finally
FreeMem(p);
end;
end;

2006-10-08

让图片飞舞起来的JavaScript代码

打开某个带图片的网站后,复制下面的代码直接在"地址栏"里运行:

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);

提示:重复运行可提高速度.

效果:

2006-10-01

生日快乐:欢庆祖国成立57周年!

10月1号了,今天是中华人民共和国成立57周年的日子。
挨个打开了国内的几个大的门户网站,看看都有没有换上国庆LOGO,其中:

已经替换了LOGO的

http://www.sina.com - 新浪


http://www.baidu.com - 百度


没有替换LOGO但醒目位置有国庆新闻的

http://www.cctv.com - 中央电视台

http://www.china.com - 中华网

没有替换LOGO,醒目位置也无法找到国庆新闻的

http://www.qq.com - 腾讯

http://www.163.com - 网易

http://www.sohu.com - 搜狐

http://cn.msn.com - MSN 中国

http://www.google.cn - Google 中国

http://www.chinaren.com - 中国人

http://www.21cn.com - 21CN


现在才刚刚凌晨,也许大多数网站都在“休息”吧,不知道明天白天会怎样?