19
Feb

在.bat中sleep和kill

在Unix环境下,命令行或者shell中sleep和kill是常见的动作,在Windows的.bat文件中处理类似的任务就不那么直接了,备忘如下:

[sleep]
ping 127.0.0.1 -n 需要的秒数+1 -w 1000 > nul

[kill]
taskkill /f /im “进程名(如notepad.exe)”
taskkill /f /fi “WINDOWTITLE eq notepad*”

其中/f表示强制,/im表示image镜像名(可执行文件名),/fi表示filter,后面跟表达式,比如这里的”窗体标题等于notepad*”,支持wildcast通配符。

via Read Sean

另外一个不错的站点:
http://www.cn-dos.net/forum/forumdisplay.php?fid=23

25
Nov

[转] 痛苦的选择:不再只专注于技术

无意间在cnblog上看到一篇文章,作者也是搞技术出身的人。而立之年,对今后的道路发展提出了他的见解。

摘录下来,作为自己将来需要抉择时的辅助参考。

有兴趣的,可以点此前往:痛苦的选择:不再只专注于技术

评论同样精彩。

—————————–

以下为全文引用(防止将来某天源地址不能访问):

我很长一段时间都在煎熬中度过,已经快到而立之年,对自己的发展方向、前途却还很迷茫。这么多年来,我一直受兴趣指引,走了很长的路,或曲或直,但我从来没有后悔过。可决定未来的方向却让我痛苦不已。

1987年,我开始在CONMAX(记得不是很清楚了)机器上学习BASIC,从此和程序语言结下了不解之缘。当时学校仅有两台苹果II型电脑,我们连碰的机会都没有。CONMAX机器开机就是BASIC,没有操作系统,没有磁盘(使用录音机记录程序),在这样的机器上,我和我的同学们用SHAPE 命令编程序在屏幕上写自己的名字,写赛车游戏、碰碰球游戏。编程给我带来了无穷的乐趣。

93年考入大学,因为当时外贸非常热门,我放弃了感兴趣的自动化专业、机械专业,开始学习工业外贸。由于是工业外贸,所以在课程设置上包含了机械、电子、经济、英语、外贸等方向的多门课程。凭着自己的兴趣,在机械相关的课程上,我的平均成绩不在97分之下(画法几何还考了100分)。这也奠定了后来学习Auto CAD、3DS MAX的基础。电子类课程成绩也不错,基本上都是班中第一。我对外语和外贸并不是很感兴趣,但在周围同学的强大压力下,还是以73.5分的成绩通过了六级考试,并在全院第一个拿到了BEC2的证书,更没想到的是5年后我竟然成为了BEC的口语考官。

大学的生活非常紧张,除了在学生会任职之外,我还把学校中所有的计算机培训班课程学了一个遍,在这期间我接触了PASCAL、C语言、 FoxBASE、FoxPro,也为我参加数学建模竞赛奠定了计算机基础。1995年,学校组队参加全国大学生数学建模竞赛,我没有被选中。在强烈要求下,我作为旁听生参加了近一年半的数学建模的培训。虽经过艰苦的准备,但最终由于一个小失误导致我们组在全国大学生数学建模竞赛上只拿到了河北省二等奖。为了挽回失去的荣誉,我放弃了考研,毅然决定与队友参加美国大学生数学建模竞赛,并最终取得了一等奖的好成绩。可笑的是,在参赛获奖的两组六个人中,竟然有三个人是当时的“旁听生”。

虽然外贸专业课没有学好,但大学的学习为我的英语、数学、计算机打下了很好的基础,这也是我的兴趣带我到这一步的。毕业后留校,并转行管理信息系统。比起管理信息系统专业的学生来,我欠缺了太多的知识。我把“计算机技术”作为我的专攻方向,不断追赶。VFP、VB、DELPHI、.NET、SQL Server……甚至成为了MCT,在计算机技术上走了很远。

现在,我忽然发现“累”了。我发现我对编程、对计算机技术不象以前那么专注了。我更加感兴趣技术后面的东西:设计模式、分析模式、财务管理、营销策略、企业信息化……想起当时我的老师说管理信息系统是“数学”、“管理”、“计算机”的交叉地带,我现在花了7年的时间才明白“技术”不能代表一切。

很多象我一样对计算机技术“狂热”的人,其中一个原因恐怕是“编程”容易上手,花上个把月的时间就可以学到一些“高深”东西,并且可以编程炫耀一番了。另外,编程是创造的过程,看着自己的想法付诸实现,总会有成就之感,即使程序编写的很糟糕。编程也能处处体现征服困难的喜悦,每当一个问题被解决,心里面总有一种成就感,即使这个问题早就有人解决过了。这也是为什么有人花上大量时间,用尽各种技巧用JavaScript编写一个Web控件,而根本不去琢磨是否有一种智能客户端的技术,可以使用功能丰富的Windows控件。

编程中的这种体会引导着我的兴趣,让我走了很远,也失去了很多。“专注于计算机技术”让很多人放弃了外语、放弃了数学、放弃了管理。很多人说这种放弃是心甘情愿的,你可能花了两年的时间学习英语,然而收获很少,为什么不去学计算机呢,至少能够“速成”,而且喜悦伴随着整个的学习过程。可是,这错了。编程创造的价值是什么呢?当你开发一套系统的时候,这套系统的管理内涵决定了应用信息系统的价值,而不是编程技巧的高低。编程技巧的高低可以决定开发效率,但不能决定企业应用信息系统究竟能带来多大的收益。编程是一种机械性的工作,它里面的创新并不能象优化管理流程一样对企业带来的巨大的利润。Web Service技术也不是凭空出现的,而是应企业应用集成的需求而出现的。

现在的编程技术也降低了编程的门槛(很多人的虚荣心可以更容易的实现了),寒枫天伤有一次推荐自动代码生成的一系列网站,我看了一些,其中 “Constructor”软件让程序编写.net系统变的如此容易。应用MDA后恐怕更容易。也许有一天人们不用再写那么多的代码。程序开发员的价值是否也意味着会不断贬值呢?

“开发”阵营的人往往感慨为什么中国程序员没有超过30的,为什么中国没有人能够创造出一门语言来。不再专注于技术不意味着放弃技术。过分专注技术,就会陷入一种“技术成功”做成的陷阱中,最终变成一个“快乐的井底之蛙”。另外,只有知道技术的发展方向,才能更好的专注于技术,而技术的发展方向往往不取决于技术本身。设想有一天,一个跨国公司经营的几千万种商品一小时内完成清点,配货,及时针对竞争对手作出决策,所有这一切都是技术本身的功劳吗?我想不全是,其中一大部分取决于管理。用过ERP产品的程序员都说,其实每个界面都很简单,但ERP的价值不在于编程是否简单,其最重要的价值就是理顺的管理流程,推动了企业的运转。

我跟着兴趣走得太远了,而且这个“兴趣”实际上是“过分关注编程技术”带来的小恩小惠积累起来的,它让我走了条弯路(但我不后悔)。现在这个问题困扰了我太久了,我实在是很难割舍这些“小恩小惠”,可我还要割舍掉。我曾经放弃过自动化、机械选择了工业外贸,也曾经放弃了考研选择了参加美国大学生数学建模竞赛,还曾经放弃了我的大学专业工业外贸转行管理信息系统,现在我也要放弃“专注于技术”,将更多的精力专注在管理、财务、企业信息化上面。我不放弃技术,也会继续在博客园发表技术文章,只是不想再专注于技术这一方面了。

完。

07
Aug

Apathetic, Ignorant, or Just Stupid?

当全民皆运的时候,总有一些清醒的声音,如醍醐灌顶般,让我们拨开这粉饰太平和喧嚣,见到一些清澈的东西。

免大部分人翻墙之苦,征得作者同意后,全文引用如下:

Apathetic, Ignorant, or Just Stupid?

The comments on the NYT article “Before Guests Arrive, Beijing Hides Some Messes” really shock me. Most of them make me kinda sick and sad.

The NYT article is a good one uncovering a corner of the true situation in Beijing before the Olympics opening, though many deemed the story is “China bashing”, and “not newsworthy”, the city beautifying is right or at least understandable, because they thought that kind of things happened a lot, and everyone knew that.

Guys, you were totally misunderstanding the point. Beautification of the city was not the problem. The problem was how the city treat its people.

Yes, beautifying before a big event coming is not news at all, but systematically abusing its citizens by the government is. I believe every case of human abusing and human suffering would make news. It’s a forever theme of journalism.

And people in that city (and yes, in all over China) was suffering from the authorities for the sake of image. That’s the all what the NYT story want to tell you.

Those believed the story “not new” presented some examples, like things happened in Chicago in 1968, Montreal in 1976, Los Angles in 1984, without any concrete and appealing evidences.

All those events held in overseas a few decades ago seam so far away that I can’t have a clue and make comment. I don’t know if there existed any human rights issue in those events. If something bad to their people really happened, I feel sorry and sympathetic to those as I feel the same to my compatriots today. But those were all old days and I believe in western civilized world, as one commenter put it: “In today’s world is quite hard to imagine one day waking up with a wall covering the front of people’s homes, or a veil covering their businesses just because they do not comply with the standards of beauty.”

Others took the happening for granted because they thought they treat their stuffs like laundry the same way when they invited guests to their houses. These statements were totally wrong, because human beings is absolutely not stuffs. Even as unfortunate as those poor Chinese people, they own human rights and civil rights and human dignity as well as westerners. They are not doomed to be victimized, even for the sake of public good! Nobody should be treated in that way. Everybody is not like the “stuffs” you can casually throw, hide or destroy at will.

Should they been sacrificed for the beauty of the city, for the incoming glorious event, for the pleasant sightseeing of foreign athletes, leaders and tourists? No. If someone must pay for the beauty of the city, it must be those who most benefit from the beautification of the city.

China is not just another exotic tourist resort. Chinese people have suffered from ruthless and corrupt despots and bureaucrats for thousands of years. We don’t deserve more suffering because of foreigners. Chinese are open and warmhearted to all kindly friends come from abroad, but those apathetic tourists regarding Chinese pains like the way they treat monkeys in zoos would not deserve it.

If those indifferent comments not came from apathetic heart, it probably came from ignorant mind. Beautification of cities in China are not as the same way most western countries run. There is always an “Chinese characteristic” way done by the authorities to average Chinese. When a governmental campaign comes, citizens are brutally dealt with, houses are arbitrarily teared down, hundreds of thousands of low-income immigrants are mercilessly driven out, dissidents are illegally tracked and harassed, protesters are beaten, tortured and even arrested. It’s out of luck for you when your property or livelihood was in the way. No equitable negotiation. No modest compromising. No fair compensation.

I believe most westerners have no idea what befall average Chinese everyday by the authorities. Most of you seem so friendly to China while critical to your own countries. Unfortunately these kind of friendliness are actually Chinese-government-friendly, not Chinese-people-friendly. These kind of comments sound so familiar to Chinese people just like the tones of the CCP Propaganda Dept hyping everyday. More and more Chinese people know what crap they are today.

“One World, One Dream” is the theme of Beijing Olympics. It’s true that Chinese share the same planet with people in the rest of the world, so as we share the same dream of prosperity, democracy, freedom and happiness with people in the rest of the world. We deserve respect and a better life. Don’t make stupid comments until you really understand what’s happening in China. Help us if you really like China. Keeping concern for the truth and pressure on human rights issues will do the trick.

Thanks to Wozy, via Link