| Yong 的个人资料Lyrids' Sub-Space for Wi...日志列表网络 | 帮助 |
Lyrids' Sub-Space for WindowsSimplicity Is Beauty 8月16日 MJHEROI've beening working with the following
online Mahjong game site for 16 months. Drop in and enjoy it, it's totally free and full of fun, excitement and prizes.
12月21日 Cleverness is the enemy of maintenanceGuess what the following line of code means:
$optimal_result = [$result1=>$result2]->[$result2<=$result1];
(Answer: $optimal_result is assigned to the smaller value of $result1 and $result2.)
[$result1=>$result2] creates a reference to a list containing ( $result1, $result2),
and the -> de-reference the reference above, which leads to the list
$result2<=$result1 will be 0 if $result2 is bigger than $result1, and 1 otherwise, and thus
[$result2<=$result1] is either [0] or [1], So the whole expression is wither
($result1,$result2) [0] , when $result2 > $result1
or
($result1,$result2) [1], when $result2 <= $result1
!!!
Perl is a powerful language to write such cryptic code in such an elegant way. :) Cool Perl modules (2)Config::Std
Config::Tiny
Config::General
They're over than enough to handle INI and most other common configuration files. Good Perl ModulesRegexp::Common - with the largest set of tests , 175000 !!!
IO:Prompt - does ont work on Windows
List::Utils - the first() function
Module::Starter - create module skeleton Perl - the GetOpt::Clade package - so cool !Getopt::Long is probably more than adequate for most developers' command-line processing needs. And while its feature set is still limited, those very limitations may actually be an advantage, as they tend to discourage the creation of "adventurous" interfaces. However, if your applications do have more advanced requirementssuch as mutually exclusive options (verbose vs taciturn), or options that can be used only with other options (-bak being valid only if insitu is in effect), or options that imply other options (garrulous implying verbose)then there are dozens of other Getopt:: modules on the CPAN to choose from[*]. [*] Literally. At last count there were at least 30 distinct Getopt:: modules on CPAN. Perl's secret shame!
One of the most powerful and adaptable of these is Getopt::Clade. With it, the command-line processing implemented in the previous examples could be implemented as in Example 14-4. Example 14-4. Command-line parsing via Getopt::Clade # Handle command lines of the form: # # > orchestrate -in source.txt -o=dest.orc --verbose # Specify and parse valid command-line arguments... use Getopt::Clade q{ -i[n] [=] Specify input file [default: '-'] -o[ut] [=] Specify output file [default: '-'] -l[en] [=] Display length [default: 24 ] -w[id] [=] Display width [default: 78 ] -v Print all warnings --verbose [ditto] }; # Report intended behaviour... if ($ARGV{-v}) { print "Loading first $ARGV{'-l'} chunks of file: $ARGV{'-i'}\n" } # etc. To create an interface using Getopt::Clade, you simply load the module and pass it the usage message you'd like to see. It then extracts the various options you've specified, builds a parser for them, parses the command line, and then does any appropriate type-checking on what it finds. For example, the -i flag's slot is specified with the suffix :in, indicating that it's supposed to be an input file. So Getopt::Clade checks whether any string in that slot is the name of a readable file. Likewise, the :+int marker in -l causes the module to accept only a positive integer in that slot. Once the command line has been parsed and verified, the module fills in any missing defaults, and puts results in the standard %ARGV hash[*]. [*] Yes, that's a non-lexical variable. However, like its more famous siblings @ARGV and $ARGV, it has special status in a Perl program. Like the %ENV hash, it represents part of the external environment of the program, so the use of this global variable is acceptable under these guidelines. It doesn't even create problems under use strict. Notice that there are no specifications for help, usage, version, or man flags; they're always generated automatically. Likewise, there's no need for explicit error-handling code: if command-line parsing fails, Getopt::Clade generates the appropriate error message automatically, piecing together a full usage line from the options you specified. The module has many other features, and is definitely worth considering when implementing complex command-line interfaces. 4月25日 DV-Sub tools - finally I got YOU!!!Long I've been planning converting all the 20plus DV tapes into high resolution DivX files. But until 3 days ago, when I found the great tool - DVSubMaker, I did not start seriously, for concerning about the loss of precious timecode/date information during the DV capturing. It's really a shame that Adobe Premiere , and MS MovieMaker does not explicitly support extracting the timecode track information, though aparently they support timecode. DVSubMaker is a freeware written by Mike Laba (aka Krong) in 2002. If you need it, google it. 3月28日 3COM DABS无盘启动GHOST3COM DABS无盘启动GHOST--解放你的网管(附视频下载) 为了这个,让我找了不少时间,今晚终于搞定它了,兴奋之余,写出来和朋友们共同分享。 About embedded Linux (in Chinese)http://csdn.net/subject/LinuxEmbed/ 嵌入式linux项目介绍 MiniGUI 这个项目是自由软件领域鼎鼎大名的魏永明先生创建的,后来他创建了飞漫软件公司做MiniGUI的商业化工作。MiniGUI 是 100% 按照 GPL 条款发布的自由软件,能 100% 遵守 GPL 许可证条款的开发者无需支付任何授权费用。 intimate 一个很有意思的项目,发起者的目的就是要把linux安装到Compaq iPAQ这样的Pocket PC上,有点像那些hack微软XBOX的人们做的事情。 uClibc 嵌入式Linux的C语言开发库项目,它比GNU C Library小很多。支持的处理器有:alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC, SH, SPARC, v850。 ThinLinux 这个项目的目的是做一些最小化的 Linux 分发版,用于专用的相机服务器、X-10 控制器、MP3 播放器以及其它一些类似的嵌入式应用。 英文资源 handhelds.org致力于把Linux/Unix移植到移动设备上一个组织的站点。 中文资源 微码科技 这个网站的论坛里有比较丰富的嵌入式linux资源。 嵌入式Linux论文 这里给出的是一篇研究生毕业论文,作者是杨立峰。论文主要介绍嵌入式实时Linux方面的内容,包括数据结构、中断调度、进程间通信和与之相关的应用程序设计。对入门的开发者有很好的参考意义。 Linux嵌入式实时操作系统开发与设计(一) 3月21日 The Mobile Phone I'm looking for or waiting forAfter comparison between mobile phones from Nokia, Motorola & Ericsson, I sketch out a Wish-To-Have feature for my next mobile phone as follows,
Current in the scope of my radar:
Strategy:
3月18日 VW FAQA personal website which contains some very interesting and first-hand informaiton about VW Jetta IV (aka Bora in China & Europe) Source: 单眼皮 (http://www.bora-vw.com/bbs) The birth of my home-made KWP Protocol SnifferGreat tools make a master. I always have my faith in it. I've spent a couple of months developing a software talking KWP1281 protocol with my VW Bora 1.8T (YM2003) car to make some magic with it:
I was very lucky to find the famous VAGINFO page and got the very base of proprietary KWP1281 protocol. After that I quickly sketched out a piece of program and it talked with my engine ECU ! It was an amazing moment... my Bora turns out to be my big big toy :) Going further I found I won't go any further without a tool... a tool by which I can analyse other powerful tools like Revo Lemmiwinks and, of course, the famous VAG-COM. An idea came across to my mind about a month ago when discussing with my Dad about sniffing the VAG diagnose cable for the purpose of protocol analysis... (hacking) and we quickly worked out 1 experimental devices. (to be continued) Software for calculation of the power and matching of parts in a carThis company markets Virtual Engine, a set of software toosl for car parts matching. The pciture -> http://www.virtualengine2000.com/images/DynoSt6.jpg URL --> http://www.virtualengine2000.com/DynoStandardOverview.htm The Virtual Engine Calculator is free for downloading. Worth a try.
Magic BoulevardI got this song from Liuman-All mailing list (by yeung). It's quite moving. Will upload it to somewhere to share with the folks.
|
||||||
|
|