预览模式: 普通 | 列表

YY宣言[纯属玩笑]

一、本人简介
出生日期:1984.6.6
出生地:黑龙江齐齐哈尔,曾居嫩江南畔十载,离江边不过半里之遥
户籍:上海静安,迁居苏州河左岸十数年,距河岸二三百步
实际籍贯:浙江宁波,一说慈溪,一说余姚,户口簿上竟随母系载齐齐哈尔
身高:站在冰封的海平面上时,头顶上瑟瑟发抖的苍蝇恰好处于海平1800毫米处
体重:毛重6万公克,略显骨感
相貌:初中时代曾被少量情窦初开的少女捧为帅哥,纠缠不已,目前已年老色衰,尚可供卡西莫多欣羡
职业:给员工打工的微型软件公司私营企业主,常以文人情怀来写代码,虽无法挥洒自如,却可自娱自乐兼养家糊口
爱好:读书,文史社科为主,总体上爱好不太确定,可以随需发展
其它:无犯罪前科,无前女友,更无前妻,亦无私生子
(本简介为不完全版,完全版涉及个人隐私不便公开。)

二、本人誓言
本人已发下毒誓,其大意为:不主动追求女生,如破此戒,定糟天罚,处罚方式为每日抄写“吾爱南无阿弥陀佛”九千九百九十九遍,直至往生西方极乐世界见到阿弥陀大佛为止。故此,请各位尊贵的小姐们自行抓捕,但谢绝使用暴力制伏。
(毒誓为不完全版,完全版涉及个人隐私不便公开。)

三、本人口味
性别:女,我知道没有发展出同性或双性倾向是我的错,因此烦请男士和双性人勿要打扰
出生日期:1984.6.6凌晨3时之前
身高:在本人2/3及以上又不比本人还高的,1米2以下的恕不接待,恋童是犯罪
体重:在本人体重的1/2到4/3之间,为防止遭受家庭暴力,吨位超过0.08的恕不接待
相貌:和本人站在一起,不像在给世界名著《陪衬人》拍电影版即可
职业:除拳击教练或选手、西医及“特殊职业”从业者外
其它:不限
(本人特此保留口味部分的最终解释权,若经修改,恕不另行通知。)
分类:生活旅行 | 固定链接 | 评论: 0 | 引用: -27 | 查看次数: 3669

Macross系列的传统

简言之:
以歌声为武器,以会变形的小飞机、大飞船为装备,以外星怪人、怪物为主要对象,一面开现场演唱会,一面发展三角关系,一面作战的一组故事。

十大不可或缺的传统人设及剧情

1、喜欢天空的男主人公
(超时空要塞Macross,Macross Frontier,Macross Plus等)

2、喜欢唱歌的女主人公
(超时空要塞Macross,Macross 7及其OVA, Macross Frontier,Macross Plus等)

3、男主人公突遇急情不得不驾驶来路不明的战机,且首次驾驶时救了女主人公一命
(超时空要塞Macross,Macross Frontier)

4、男主人公与女主人公被困密室,一边YY,一边等待救援
(超时空要塞Macross,Macross 7, Macross Frontier)

5、Miss Macross评选
(超时空要塞Macross,Macross 7, Macross Frontier)

6、主人公开音乐会
(超时空要塞Macross,Macross 7, Macross Frontier)

7、一打仗就唱歌
(几乎全部)

8、女主人公在娘娘中餐馆帮忙或打工
(超时空要塞Macross,Macross Frontier)
娘娘主题歌歌词由中文、英文、Zentraedi文和日文(共计地球语三种,外星语一种)拼成,最完整的全文如下:好吃来来~美姑娘!娘娘~娘娘~你好娘! Gorgeous~Delicious~Deculture啊~~~おいしいニャー!

9、至少一名男主人公在骷髅中队担任飞行员
(超时空要塞Macross,Macross Frontier,Macross Zero)

10、由复杂的三角关系来推动剧情
1)超时空要塞Macross:林明美+一条辉vs.明美表哥(一女+二男)是为三角一组;一条辉+早濑未沙vs.明美(一男+二女)则为三角二组;最终结果(漫画or小说版):一条辉、早濑2012年在首次大规模移民船图上成婚,明美亦上此船(准备第三者插足?),明美表哥行踪不明。
2)Macross 7:米雷尼·吉那斯+热气·巴撒拉vs.贾姆林(一女+二男)三角组合,结果:至少到205X年为止结果不明。
3)Macross Frontier:早乙女アルト+雪莉露·诺姆vs兰华·李(一男+二女)三角组合,结果:尚在发展中,2060年之前看来不会有结果。
4)Macross Plus:谬芳容+勇·戴森vs.卡尔德·果阿·波曼(一女+二男)三角组合,结果:不明。
5)Macross Zero:工藤信+莎拉·诺姆vs.玛奥·诺姆(一男+二女)三角组合,结果:无果。

Yack Deculture!
分类:生活旅行 | 固定链接 | 评论: 0 | 引用: -18 | 查看次数: 4621

Is a specific app running?

How to know whether an app is running in REALbasic? The common idea is looping through all processes and testing with the name of the app which you want to know if it's opened.

Windows
On Windows, we can do it via declares, the Win32 APIs we need to use are EnumProcesses, EnumProcessModules, GetModuleFileNameEx, etc. I wrote a function a few days ago. You can find the source code of it in Window1 of the RB project attached. I didn't implemented it in a very smart way. It gets the names of all processes, then tests to see if a specific app name can be found. It because I wanted to demonstrate how to list the paths of all processes. You may make some changes on it to exit the For loop when the app is found.

Mac OS X
On Mac, calling AppleScript functions seems the best way. You can loop through all process objects provided by the System Events application in a tell block. However, since AppleScript supports using keyword each or plural of class name to access all objects in the direct parameter of tell statement (in this case, it's the System Events application), so that the script can be simply written like this:

on run {appname}
tell application "System Events"
if (name of each process) contains appname then
return true
else
return false
end if
end tell
end run

OR:

on run {appname}
tell application "System Events"
if (name of processes) contains appname then
return true
else
return false
end if
end tell
end run
 
On Leopard, AppleScript are updated to 2.0, many new features are introduced. As the result, it's able to test whether an app is running without launching it:
on run {appname}
if application appname is running then
return true
else
return false
end if
end run
The code above doesn't work on Tiger and earlier.
 
To use an AppleScript, drag and drop the scpt file to your project, and call it by its name showed in the listbox of project panel, as calling a global function. The AppleScript will be compiled and embedded to app file you built. You will observe that the return value of any AppleScript you get in RB is a String, rather than the date type you expected. So you should compare it with "true" or "false", not a Boolean constant. Refer to the rbp I attached if my description isn't clear to you.
 
Attachment: IsProcRunning.zip

原载本人英文Blog

 

Tags: REALbasic Declares AppleScript English

分类:编程开发 | 固定链接 | 评论: 0 | 引用: -18 | 查看次数: 5636

Some compression arithmetics implemented in RB.

I implemented some common compression arithmetics (LZ77, RLE and Huffman) in RB above a half year ago. I've referred to several open-source C/C++ projects/libraries. None of them has any limit of using, modification and issuance, so they can be used in any project for free.
Download them 
here.

原载本人英文Blog

Tags: REALbasic English

分类:编程开发 | 固定链接 | 评论: 0 | 引用: -18 | 查看次数: 4174

How to hide taskbar button of a window?

In REALbasic, some types of window show buttons on taskbar in default. However, you may want to hide the taskbar button in some cases. For example, you want to use a document window as a modeless dialog, or you want to use a plain box as a splash window or a customized tooptip/popup window (not like REALbasic, most Windows applications won't display buttons on taskbar for their splash windows, such as Word, Windows Live Mail or RealPlayer). Simply add the follow code to the Open event handle of the window.

#if TargetWin32 Then
  Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32, ByVal dwNewLong As Int32) As Int32
  Const GWL_EXSTYLE = -20
  Const WS_EX_TOOLWINDOW = &H80
  Call SetWindowLong(Self.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW)
#endif


原载本人英文Blog

查看更多...

Tags: REALbasic Declares English

分类:编程开发 | 固定链接 | 评论: 0 | 引用: -11 | 查看次数: 5926