[2007-11-17]
股市暴跌,猪肉暴涨,站长顶不顺了,做了近十年程序员,唯一值点钱的也许就这个十年苦心血经营的网站了,现含泪转让本站套点现,感谢所有关心本站的朋友,有意者请联系:webmaster@delphibox.com,站长将发送相关信息给您。
2007年11月18日星期日
刚刚看到的
刚刚在2ccc上看到的
2007年10月16日星期二
Color! What Color!
Free personality analysis from ColorQuiz.com.
Generated on Mon Oct 15 18:09:39 2007.
Your Existing Situation
Having difficulty in standing up to the demands imposed on him. Finds a great effort is involved and wishes to have the situation eased.
Your Stress Sources
An existing situation or relationship is unsatisfactory, but he feels unable to change it to bring about the sense of belonging which he needs. Unwilling to expose his vulnerability, he therefore continues to resist this state of affairs, but feels dependent on the attachment. This not only depresses him, but makes him irritable and impatient, producing considerable restlessness and the urge to get away from the situation, either actually or, at least, mentally. Ability to concentrate may suffer.
Your Restrained Characteristics
Willing to become emotionally involved as he feels rater isolated and alone. Egocentric and therefore quick to take offense, though he tries to avoid open conflict.
Feels that things stand in his way, that circumstances are forcing him to compromise and forgo some pleasures for the time being.
Your Desired Objective
His need to feel more causative and to have a wider sphere of influence makes him restless and he is driven by his desires and hopes. May try to spread his activities over too wide a field.
Your Actual Problem
Anxiety and restless dissatisfaction, either with circumstances or with unfulfilled emotional requirements, have produced stress. He feels misunderstood, disoriented, and unsettled. This drives him into a search for new conditions or relationships, in the hope that these might offer greater contentment and peace of mind.
Generated on Mon Oct 15 18:09:39 2007.
Your Existing Situation
Having difficulty in standing up to the demands imposed on him. Finds a great effort is involved and wishes to have the situation eased.
Your Stress Sources
An existing situation or relationship is unsatisfactory, but he feels unable to change it to bring about the sense of belonging which he needs. Unwilling to expose his vulnerability, he therefore continues to resist this state of affairs, but feels dependent on the attachment. This not only depresses him, but makes him irritable and impatient, producing considerable restlessness and the urge to get away from the situation, either actually or, at least, mentally. Ability to concentrate may suffer.
Your Restrained Characteristics
Willing to become emotionally involved as he feels rater isolated and alone. Egocentric and therefore quick to take offense, though he tries to avoid open conflict.
Feels that things stand in his way, that circumstances are forcing him to compromise and forgo some pleasures for the time being.
Your Desired Objective
His need to feel more causative and to have a wider sphere of influence makes him restless and he is driven by his desires and hopes. May try to spread his activities over too wide a field.
Your Actual Problem
Anxiety and restless dissatisfaction, either with circumstances or with unfulfilled emotional requirements, have produced stress. He feels misunderstood, disoriented, and unsettled. This drives him into a search for new conditions or relationships, in the hope that these might offer greater contentment and peace of mind.
2007年10月6日星期六
2007年8月1日星期三
Undocumented MessageBoxTimeOut function
From: http://www.delphi3000.com/articles/article_4808.asp
There are lots of neat little things that are in many of the DLLs that Microsoft has installed in Windows. Most of them are documented in the Win32 API. However, there are a lot of them that are undocumented. This article shows how to use one of the undocumented functions available in user32.dll, MessageBoxTimeOut.
This type of functionality for a MessageBox has been requested on the Delphi newsgroups many times and there have been several solutions written. After being introduced in XP, this functionality is now available to developers using this undocumented API.
Since this function is not documented, it is not found in Windows.pas, so it has to be defined. It is identical to the MessageBox API definition except it has two more parameters, wLanguageID and dmMilliseconds.
function MessageBoxTimeOut(
hWnd: HWND; lpText: PChar; lpCaption: PChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
function MessageBoxTimeOutA(
hWnd: HWND; lpText: PChar; lpCaption: PChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
function MessageBoxTimeOutW(
hWnd: HWND; lpText: PWideChar; lpCaption: PWideChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
implementation
// this const is not defined in Windows.pas
const
MB_TIMEDOUT = 32000;
function MessageBoxTimeOut; externaluser32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutA; external user32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutW; external user32 name 'MessageBoxTimeoutW';
Now, to call the function, it is as easy as setting the flags and making the call. There may be other results returned that I am not aware of besides the standard IDxxx return values and the MB_TIMEDOUT result defined above.
var
iResult: Integer;
iFlags: Integer;
begin
// Define a MessagBox with an OK button and a timeout of 2 seconds
iFlags := MB_OK or MB_SETFOREGROUND or MB_SYSTEMMODAL or MB_ICONINFORMATION;
iResult := MessageBoxTimeout(
Application.Handle,
'Test a timeout of 2 seconds.',
'MessageBoxTimeout Test', iFlags, 0, 2000);
// iResult will = 1 (IDOK)
ShowMessage(IntToStr(iRet));
// Define a MessageBox with a Yes and No button and a timeout of 5 seconds
iFlags := MB_YESNO or MB_SETFOREGROUND or MB_SYSTEMMODAL or MB_ICONINFORMATION;
iResult := MessageBoxTimeout(
Application.Handle,
'Test a timeout of 5 seconds.',
'MessageBoxTimeout Test', iFlags, 0, 5000);
// iResult = MB_TIMEDOUT if no buttons clicked, otherwise
// iResult will return the value of the button clicked
case iResult of
IDYES: // Pressed Yes button
ShowMessage('Yes');
IDNO: // Pressed the No button
ShowMessage('No');
MB_TIMEDOUT: // MessageBox timed out
ShowMessage('TimedOut');
end;
end;
I presume Borland will not put this into Windows.pas until Microsoft documents it but developers can get a head start on them by using the code above. It is unlikely that Microsoft will depricate this function for quite some time because all of the standard MessageBox API calls actually call MessageBoxTimeOutA or MessageBoxTimeoutW and pass $FFFFFFFF as the timeout period meaning the dialog will wait a very long time, approx 49 days!
=======
This function could be useful, however, since it is not documenten, there is no guarantee whether or not this function will continue to exist. Even the fact that other APIs indirectly call it, does not quarantee this. Microsoft could easily remove the function, and write a different implementation for message boxes.
But until then, you can use it of course. :)
$FFFFFFFF could also mean -1, when the parameter is actually an integer value. In this case, it probably means 'indefinate' instead of 49 days, which makes more sense. I can hardly imagine that every MessageBox will automatically close after 49 days. :)
2007年7月19日星期四
时间如流水
再来看看昨天的时间
07:30 起床,奔赴实验室
08:30 查看邮件、新闻
09:00 看书:Writing English Language Tests
11:00 吃午饭、休息
12:00 写日志
13:00 睡午觉
14:00 处理视频
17:00 吃晚饭、休息
17:30 视频处理
18:30 看足球赛
23:00 聊天、打电话
00:00 吃夜宵
01:00 写程序、听英语
02:00 游戏
03:00 睡觉
从起床到睡觉共19.5小时,其中:
顺便把今天的也总结一下吧
07:30 起床、查看邮件
08:30 看书:设计模式
09:30 处理题库
10:00 看书:wxPython in Action
12:00 睡午觉
14:00 开会
16:30 修改程序
17:00 吃晚饭
17:30 休息、聊天
18:00 踢球、洗澡
20:30 写日志
从起床到现在共15小时,其中:
07:30 起床,奔赴实验室
08:30 查看邮件、新闻
09:00 看书:Writing English Language Tests
11:00 吃午饭、休息
12:00 写日志
13:00 睡午觉
14:00 处理视频
17:00 吃晚饭、休息
17:30 视频处理
18:30 看足球赛
23:00 聊天、打电话
00:00 吃夜宵
01:00 写程序、听英语
02:00 游戏
03:00 睡觉
从起床到睡觉共19.5小时,其中:
- 有效学习工作时间7小时
- 半有效学习工作时间1.5小时
- 生活琐事5小时
- 娱乐休闲6小时
- 电脑屏幕前12小时
- 有效工作还不错
- 娱乐时间真长啊,与其说是娱乐还不如说是郁闷。想起有人在BBS上问的一句话:谁告诉我今天有比赛的?
顺便把今天的也总结一下吧
07:30 起床、查看邮件
08:30 看书:设计模式
09:30 处理题库
10:00 看书:wxPython in Action
12:00 睡午觉
14:00 开会
16:30 修改程序
17:00 吃晚饭
17:30 休息、聊天
18:00 踢球、洗澡
20:30 写日志
从起床到现在共15小时,其中:
- 有效学习工作时间6.5小时
- 半有效学习工作时间2.5小时
- 生活琐事3.5小时
- 休闲娱乐2.5小时
- 电脑屏幕前9小时
- 有计划就好了
翻译 协作 问题
在教育中文翻译 的各位热心的“老”人们的帮助下,翻译了一篇文章。当文章出现在网站上时,才发现除了文字的翻译外,还要插入图片、文章分类等工作要做。感谢编辑们的同时,也想到如果只是草草翻译一下文字,恐怕只是给审校和编辑徒增麻烦。所以以后翻译须格外认真。通过这次翻译,也清楚了工作流程,下次就可以集中精力在内容上了。
说 到翻译,有了一点感触。一定要熟悉文章内容。翻译时,也不能只看这一篇文章。文章中的内容,如果不是很清楚,就需要阅读相关的资料;文章中的引用、链接有 时也需要找原文来看。自己阅读的时候,可能有的单词拿不准什么意思就忽略过去了,可是翻译的时候如果找不到准确的意思,恐怕翻出来的就与原意风马牛不相 及。
这次通过GD共享文档是算是第一次真正的协作吧。以前虽然在TRAC和SVN上作项目,但大家都基本上是在一起,有什么问题主要是当面讨论,靠SVN控制 源码,TRAC的作用非常小。这次就不一样了,体会出了协作的概念和力量。GD也是第一次真正使用,感觉确实比较方便,瞬间已经成了我的主要工作环境,想 不通以前为什么看了一眼就把它抛在脑后了。
关注教育中文翻译很久了,先是订阅RSS,到现在开始参与翻译,但是没有发现多少自己很感兴趣的内容。也许是我对这个领域了解的太少了,看的东西不多,而 自己其实更象是一个程序员。但我对此还是很有信心的,也相信做这样的事是很值得的,希望能找到更多自己比较熟悉的内容,来参与翻译。
除了翻译,我更希望看到原创的内容。我不是在意原创这个词的意义,只是觉得国外的情况跟我们有不少差距,我们在了解国外的同时,需要关注身边的情况。
OLDaily上每天的条目都不少,如果想了解清楚每个条目,光是看简短的评述肯定不够,一定要花时间阅读原文。可是,我对于究竟有多少人在阅读这个网站很不乐观,也不知道网站有没有什么统计数据。
突然发现网站上有统计的,平均日22IP,62PV,估计每天都是那些人在看吧。虽然比我预想的要好,但还是很少的。
说 到翻译,有了一点感触。一定要熟悉文章内容。翻译时,也不能只看这一篇文章。文章中的内容,如果不是很清楚,就需要阅读相关的资料;文章中的引用、链接有 时也需要找原文来看。自己阅读的时候,可能有的单词拿不准什么意思就忽略过去了,可是翻译的时候如果找不到准确的意思,恐怕翻出来的就与原意风马牛不相 及。
这次通过GD共享文档是算是第一次真正的协作吧。以前虽然在TRAC和SVN上作项目,但大家都基本上是在一起,有什么问题主要是当面讨论,靠SVN控制 源码,TRAC的作用非常小。这次就不一样了,体会出了协作的概念和力量。GD也是第一次真正使用,感觉确实比较方便,瞬间已经成了我的主要工作环境,想 不通以前为什么看了一眼就把它抛在脑后了。
关注教育中文翻译很久了,先是订阅RSS,到现在开始参与翻译,但是没有发现多少自己很感兴趣的内容。也许是我对这个领域了解的太少了,看的东西不多,而 自己其实更象是一个程序员。但我对此还是很有信心的,也相信做这样的事是很值得的,希望能找到更多自己比较熟悉的内容,来参与翻译。
除了翻译,我更希望看到原创的内容。我不是在意原创这个词的意义,只是觉得国外的情况跟我们有不少差距,我们在了解国外的同时,需要关注身边的情况。
OLDaily上每天的条目都不少,如果想了解清楚每个条目,光是看简短的评述肯定不够,一定要花时间阅读原文。可是,我对于究竟有多少人在阅读这个网站很不乐观,也不知道网站有没有什么统计数据。
突然发现网站上有统计的,平均日22IP,62PV,估计每天都是那些人在看吧。虽然比我预想的要好,但还是很少的。
2007年7月18日星期三
时间是如何流走的
昨天在Google Calendar上记录了一下时间,来看看时间是怎样流走。
07:30 起床了从起床到睡觉共16个小时,其中:
08:00 查看邮件,写一段记录
08:50 看书:DDG动态链接库
09:30 取信件,安装视频处理程序
10:30 继续看书:DDG动态链接库
11:00 吃午饭
11:30 继续看书:DDG动态链接库
12:00 睡午觉
14:00 翻译
15:00 测试程序
17:00 休息
17:30 吃晚饭
18:00 翻译、阅读
19:00 看书:PP3E
20:00 阅读RSS、聊天
21:30 奔赴宿舍,准备睡觉
23:30 睡觉
- 看书2.5小时
- 测试程序2小时
- 翻译1.5小时
- 网上阅读、聊天、收发邮件3小时
- 视频处理1小时
- 生活琐事3.5小时
- 休息2.5小时
- 有效学习工作时间2.5+2+1.5+1=7小时
- 半有效时间3*0.5=1.5小时
- 电脑屏幕前10小时
- 有效时间还是不错的,在有效时间内能高效工作就好。
2007年7月14日星期六
无聊
刚才写到了无聊,就又想到了另一个无聊的游戏,扫雷,无聊一把,记录一下自己目前最好的战绩:
又想到了笨重的QD,时间以数字方式显示时,时间下面的线条会随着时间变化,却始终没有看出变化的规律。那天上网搜索,没有结果,却发现另有一个网友也在问这个问题,随后有人问答说:估计也没什么意义,就象快速拔号设置时后面乱七八糟的线条一样,还让人以为是手机屏幕出问题了。他称这是NOKIA的蹩脚设计师的问题。哈哈~~
其实QD最糟糕的设计就是那个胶圈了,半年换过一个就已经又惨不忍睹了……
- 初级:3
- 中级:29
- 高级:103
又想到了笨重的QD,时间以数字方式显示时,时间下面的线条会随着时间变化,却始终没有看出变化的规律。那天上网搜索,没有结果,却发现另有一个网友也在问这个问题,随后有人问答说:估计也没什么意义,就象快速拔号设置时后面乱七八糟的线条一样,还让人以为是手机屏幕出问题了。他称这是NOKIA的蹩脚设计师的问题。哈哈~~
其实QD最糟糕的设计就是那个胶圈了,半年换过一个就已经又惨不忍睹了……
Python 猜数字 for S60
无聊小游戏一个,
等时间的时候拿出手机来玩下也不错~~
这回笨重的QD总算派上点用场,
不过写程序时没有模拟器可真是折腾呀,
存储卡取出装上,反反复复……
#猜数字 for S60
#玩法按照文曲星上的(印象中)
#4个数字,不重复,范围(1-9)
import appuifw
from random import randint
def initializeSecret():
secret = []
for i in range(4):
num = randint(1, 9)
while num in secret:
num = randint(1, 9)
secret = secret + [num]
return secret
def checkGuess(secret, guess):
bulls, cows = 0, 0
for i in range(4):
if guess[i] in secret:
if guess[i] == secret[i]:
bulls = bulls + 1
else:
cows = cows + 1
return (bulls, cows)
def processGuess(gue):
guess = []
if len(gue) != 4:
return guess
for i in range(4):
digit = gue[i]
try:
num = int(digit)
if not 1 <= num <= 9:
return guess
except:
return guess
if not num in guess:
guess = guess + [num]
return guess
goon = True
while goon:
secret = initializeSecret()
guessTime = 0
while guessTime < 8:
gue = appuifw.query(u'Please input four digits:', 'number')
guess = processGuess(str(gue))
if len(guess) != 4:
appuifw.note(u"Invalid input")
continue
print guess
guessTime = guessTime + 1
result = checkGuess(secret, guess)
if result[0] == 4:
appuifw.note(u"You guess it! Congratulations!")
guessTime = 0
break
print result
appuifw.note(u'%dA%dB'%(result[0], result[1]))
if guessTime >= 8:
appuifw.note(u"Sorry, you failed!")
goon = appuifw.query(u"Next Number?", 'query')
2007年7月1日星期日
这一天
早晨七点起来去准备组织口语考试,没想到出现了那么多的问题。
沟通是一个问题,跟教学组负责人沟通没有作任何努力就让步了。考试对我来说没有什么太多兴趣,就是一项服务工作。既然如此,就由他们安排吧,做好服务工作就是了。
没想到出现了这么多的问题,错误状态不断出现,服务器连接失败,监考程序重启,还有考场突然停电。面对这样的情况,是非常沮丧和失望的。不再按照最保守的方法处理了,既然都这样了,用以前没有用过的办法快速处理一下也未尝不可,其实处理结果好坏也无所谓了。提心掉胆怕出错,甚至都快赞同不再往下考的想法了。好不容易一个上午总算过去了,在各个考场跑来跑去,电话打来打去,遇到各种各样的问题,真的累了。考试是结束了,可是留下了一堆乱麻等着去一根根缕清楚。
中午侄儿打电话来说考取了石家庄二中,甚是高兴。
下午去KTV打牌,晚上去聚餐。
伤离别,离别就在眼前;说再见,期待再见就是明天。
晚上回来查看了考试文件与状态相关情况,够麻烦,慢慢理吧 :(
沟通是一个问题,跟教学组负责人沟通没有作任何努力就让步了。考试对我来说没有什么太多兴趣,就是一项服务工作。既然如此,就由他们安排吧,做好服务工作就是了。
没想到出现了这么多的问题,错误状态不断出现,服务器连接失败,监考程序重启,还有考场突然停电。面对这样的情况,是非常沮丧和失望的。不再按照最保守的方法处理了,既然都这样了,用以前没有用过的办法快速处理一下也未尝不可,其实处理结果好坏也无所谓了。提心掉胆怕出错,甚至都快赞同不再往下考的想法了。好不容易一个上午总算过去了,在各个考场跑来跑去,电话打来打去,遇到各种各样的问题,真的累了。考试是结束了,可是留下了一堆乱麻等着去一根根缕清楚。
中午侄儿打电话来说考取了石家庄二中,甚是高兴。
下午去KTV打牌,晚上去聚餐。
伤离别,离别就在眼前;说再见,期待再见就是明天。
晚上回来查看了考试文件与状态相关情况,够麻烦,慢慢理吧 :(
2007年6月1日星期五
新独立时代
在《中国式离婚》中,女主角的心理问题源于对自己的不自信,而对自己的不自信是由于没有了工作,失去了独立的基础。
与《中国式离婚》不同,《新结婚时代》中的女子个个都是独立的。新型婚姻中的双方在经济上是独立的;女专家的独立自不必说;漂亮的单身女性 ——与《中国式离婚》中离婚的单身母亲一样也是独立的;就连一直生活在农村的女子也可以因为女儿上学的问题而离婚,这也非得以独立为基础。
在这里,其他一切——包括男人,都是配角,女人的独立才是主角。这里是新独立时代。
与《中国式离婚》不同,《新结婚时代》中的女子个个都是独立的。新型婚姻中的双方在经济上是独立的;女专家的独立自不必说;漂亮的单身女性 ——与《中国式离婚》中离婚的单身母亲一样也是独立的;就连一直生活在农村的女子也可以因为女儿上学的问题而离婚,这也非得以独立为基础。
在这里,其他一切——包括男人,都是配角,女人的独立才是主角。这里是新独立时代。
2007年5月9日星期三
五一散记
还是记下点儿什么吧。
5.1 骑车去三河,去时四个小时,游览二十分钟,吃饭一个小时,回来五个小时。一个字:累。
5.2 终于买了件花衬衫,开心。
5.3 Lenovo笔记本电脑的PCMCIA 插槽开和关的过程不是可逆的。
5.4 参加同学婚宴,祝福。
5.5 爱丽丝成就了金贝贝的大富翁之旅。
5.6 三个人的同学聚会。
5.7 车站,学校,车站。身在曹营心在汉。
5.1 骑车去三河,去时四个小时,游览二十分钟,吃饭一个小时,回来五个小时。一个字:累。
5.2 终于买了件花衬衫,开心。
5.3 Lenovo笔记本电脑的PCMCIA 插槽开和关的过程不是可逆的。
5.4 参加同学婚宴,祝福。
5.5 爱丽丝成就了金贝贝的大富翁之旅。
5.6 三个人的同学聚会。
5.7 车站,学校,车站。身在曹营心在汉。
2007年3月27日星期二
流水帐
昨天去爬大蜀山了,确切地说应该是前天,借着版聚的机会。拍了几张照片。在户外活动就是爽啊,比整天待在电脑前舒服多了。打牌也很有意思,只是没有看见他们怎么杀人。
连续打了两个晚上的实况,手都抽筋了。看着红脸的伊布被我使得惨不忍睹,自己都不忍心哪~~
QQ的简单签名引来了众多人的疑问,没有答案。
连续打了两个晚上的实况,手都抽筋了。看着红脸的伊布被我使得惨不忍睹,自己都不忍心哪~~
QQ的简单签名引来了众多人的疑问,没有答案。
2007年1月1日星期一
2007的第一碗面
希望
我希望我什么都第一
我希望生活是温暖的,不会觉得冷
温暖也是靠创造的,只有不断的慢慢加温,才会长久,让人心安
都输完了,重新开始
打游戏把积分都输完了,从佃户变成长包身工,在新的一年就要到来的时候。
都输完了,重新开始。
第一碗面
好几天没有煮面吃了,都有点想念了。
2007的第一碗面,也为这一年的生活定下了一个基调。
订阅:
评论 (Atom)