Navigation | Paul Gu|blog

July 13, 2009

Run Windows batch script minimized

The code below that will force a Windows batch script to run in a minimized window. Insert it at the beginning of the script:

if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized
rem Anything after here will run in a minimized window

It works by having the script re-launch itself in a new minimized window. There are a few juicy batch scripting tricks in here that I recently picked up, like the %~dpnx0 syntax and the special :EOF label. And the overall flag/callback syntax is generally useful for creating self-contained batch scripts.

(Source: zoombody.com)

Filed by Paul Gu at July 13th, 2009 under Windows
No comments on this post yet

July 4, 2009

GuMaxDD 1.1 is released

Just released the latest drop down menu skin, it contains many fixes and new layout. It has been updated according to new mediawiki 1.15.0.

Here is the release notes:

Filed by Paul Gu at July 4th, 2009 under MediaWiki, MediaWiki Skin
No comments on this post yet

July 4, 2009

GuMax 3.4.5 is released

A very clean MediaWiki skin, this is the major updated version according to latest changes in MediaWiki 1.15.0.

Here is list of release notes:

It has been tested on Firefox 3.0 and up version, Internet Explorer 6.0, Internet Explorer 7.0, and Safari 3.0.2.

Filed by Paul Gu at July 4th, 2009 under MediaWiki, MediaWiki Skin
No comments on this post yet

June 18, 2009

日本鬼子的由来

四百年前即明清以来,日本海盗经常烧杀抢掠,侵扰、骚乱中国沿海各地。当时人们称日本海盗为“倭寇”,那是因为他们长得矮小丑陋,行为实比盗匪有棕而无不及,故予此名之。可到了近代,人们却称日本侵略者为“鬼子”,何也?

话说中日甲午海战前夕,清廷委派一位大臣出使日本。当时的日本不但要在世人面前炫耀武力,还妄想在文化上下玷辱中国。当记者汇聚集齐之时,日方突然提了一个风马牛不相及的问题:“我们日本有一个上联却对不出下联,只好求于汉字发源地的人了。” 说完以后,日本人亮出上联:骑奇马,张长弓,琴瑟琵琶,八大王,并肩居头上,单戈独战!

这是一个拆字联,难度较大。而且其好战侵略气焰十分骄狂嚣张。意思是,大日本兵强马壮,驾驭的是奇马,张的是强弓,文的也不简单,无论琴棋书画,诗词歌赋,光“大王”就有八个,盖世无双,言外之意,日本“单戈独战”即可踏平中国。

清廷大使臣也不示弱。当即大笔一挥立就写出下联:倭委人,袭龙衣,魑魅魍魉,四小鬼,屈膝跪身旁,合手擒拿!

此下联也用的是拆字联,对仗十分工整,且与上联针锋相对,其意思是,你们日本骑奇马张长弓,其实就是一伙来偷抢我大清龙衣的倭寇,琴瑟琵琶八大王,就是魑魅魍魉四个小鬼子,并肩居头上,其实已经屈膝跪在身旁,你如胆敢单戈独战,我就合手擒拿。

从此,大家便称日本“鬼子”。抗战时期,日本侵略者对中国人民犯下了滔天罪行,更激起了国人的愤怒与仇恨,于是“日本鬼子”、“小日本鬼子”、“鬼子”、“小鬼子”等称呼也就传遍了中华大地。

Filed by Paul Gu at June 18th, 2009 under Culture
No comments on this post yet

June 17, 2009

WinXP SP2/VISTA limits max. number of TCP connections/second

Windows XP Service Pack 2 will limit the maximum number of TCP connections your computer can have at one time. I can see what they are thinking, but I wont mind unless some of my applications (like my multi-threaded port scanner) wont work correctly with this new setting.

Here is a registry edit you can do to increase the max:

TcpNumConnections

Key: Tcpip\Parameters
Value Type: REG_DWORD – Number
Valid Range: 0 – 0xfffffe
Default: 0xfffffe
Description: This parameter limits the maximum number of connections that TCP can have open at the same time.

TcpWindowSize

Key: Tcpip\Parameters
Value Type: REG_DWORD – Number of bytes
Valid Range: 0 – 0xFFFF
Default: The smaller of 0xFFFF
OR
(The larger of four times the maximum TCP data size on the network
OR
8192 rounded up to an even multiple of the network TCP data size.)
The default is 8760 for Ethernet.
Description: This parameter determines the maximum TCP receive window size of the computer. The receive window specifies the number of bytes a sender can transmit without receiving an acknowledgment. Generally, larger receive windows improve performance over high (delay * bandwidth) networks. For highest efficiency, the receive window must be an even multiple of the TCP Maximum Segment Size (MSS).

Filed by Paul Gu at June 17th, 2009 under Windows
No comments on this post yet

June 17, 2009

Seven ways to keep employees peppy and productive

A happy, motivated employee is a productive employee – and also someone likely to stay with your firm for a long, long time.  Research shows the best places to work share a common feature: they strive to maintain an upbeat work environment and sustain employee morale.  Here are seven effective ways you can do the same:

1. Don’t sugarcoat the truth

2. Listen to your staff

3. Assign work strategically

4. Protect staff from overload

5. Reward employees and show appreciation

6. Talk about higher purpose

7. Focus on the future

Filed by Paul Gu at June 17th, 2009 under Management
No comments on this post yet

June 14, 2009

清蒸整鸡

主料:鸡1500克
辅料:口蘑28克,火腿28克,墨鱼70克,油菜心100克
调料:胡椒粉1克,味精2克,盐8克

清蒸整鸡的特色:

此菜色淡黄,缀以红、绿、黄三色配料,色彩协调,肉嫩鲜香。

清蒸整鸡的做法:

1. 将鸡取出内脏,去掉嗉囊、气管和食道,冲洗干净,放入锅内煮3分钟;
2. 捞出,用冷水洗净,剁去嘴尖和脚爪,切掉下颌,割除尾臊,用刀背砸断大腿骨,将整鸡放入釉瓦钵内,加精盐(5克),入笼先干蒸约1小时,然后,再加入清水(1000克)蒸至软烂为止;
3. 火腿切薄片;
4. 口蘑、墨鱼用斜刀切成薄片;
5. 油菜心用清水烧开氽一下,捞出待用;
6. 炒锅置中火上,下肉清、精盐烧开,再放入口蘑、墨鱼、菜心焯熟后捞出,沥去水;
7. 用手勺将整鸡翻个身后,将菜心放在整鸡的周围,口蘑、墨鱼放在上面,再盖上熟火腿片,放入味精,撒上胡椒粉即成。

Filed by Paul Gu at June 14th, 2009 under Cooking
No comments on this post yet