I don't make software, i make it better!

UT江湖

March 10th, 2010 ricky.zhu 1 comment

看着熟悉的office,熟悉的面孔,热情的场面
这个我曾经工作了4年多的地方,依然那么亲切

UT的江湖

2009年,UT斯达康可谓流年不利,杭州总部大楼的出售映衬了多年积弊。

2009年全年,UT斯达财报均报亏损,裁员重组。12月,UT斯达康把位于杭州滨江的大楼以9.5亿元的价格出售给中南建设集团。

今年年初,UT斯达康引进风险投资,已开始全面改革,“左拉广电,右牵亦庄”,只聚焦IPTV和宽带两大业务和中国、印度、日本三大市场,其余业务和人员重组。UT斯达康将把公司总部迁至北京,公司计划保留其在杭州和深圳的全部业务。

UT斯达康曾经是很多IT人员最向往的公司之一。视频展示了UT斯达康深圳研发中心2010年嘉年华,欢乐仍在。

UT斯达康员工、视频作者utshine表示:“怀念UT,UT是家好公司,国内少有的对员工的好公司,任何一个公司都有起有落,UT也一样。像任正非说的,只要保证灰度向前,就好了;简单一句话:对得住员工的公司就是好公司。”

2010年,新的开始。更多欢乐,还是更多痛苦……有些纤弱的花瓣,在缺少阳光的写字楼里,依然绽放出,羞涩的美丽。——UT斯达康员工对于当前的境况,自省与希望并存。

UT斯达康能否再现小灵通的神话?如同视频配乐所唱:“路途遥远,让我们在一起吧。”

via

Categories: 业界 Tags:

Handy one-liners for awk

March 9th, 2010 ricky.zhu No comments

HANDY ONE-LINERS FOR AWK 22 July 2003
compiled by Eric Pement version 0.22
Latest version of this file is usually at:

http://www.student.northpark.edu/pemente/awk/awk1line.txt

USAGE:

Unix: awk ‘/pattern/ {print “$1″}’ # standard Unix shells
DOS/Win: awk ‘/pattern/ {print “$1″}’ # okay for DJGPP compiled
awk “/pattern/ {print \”$1\”}” # required for Mingw32

Most of my experience comes from version of GNU awk (gawk) compiled for
Win32. Note in particular that DJGPP compilations permit the awk script
to follow Unix quoting syntax ‘/like/ {“this”}’. However, the user must
know that single quotes under DOS/Windows do not protect the redirection
arrows (< , >) nor do they protect pipes (|). Both are special symbols
for the DOS/CMD command shell and their special meaning is ignored only
if they are placed within “double quotes.” Likewise, DOS/Win users must
remember that the percent sign (%) is used to mark DOS/Win environment
variables, so it must be doubled (%%) to yield a single percent sign
visible to awk.

If I am sure that a script will NOT need to be quoted in Unix, DOS, or
CMD, then I normally omit the quote marks. If an example is peculiar to
GNU awk, the command ‘gawk’ will be used. Please notify me if you find
errors or new commands to add to this list (total length under 65
characters). I usually try to put the shortest script first.

FILE SPACING:

 # double space a file
 awk ‘1;{print ""}’
 awk ‘BEGIN{ORS="\n\n"};1′

 # double space a file which already has blank lines in it. Output file
 # should contain no more than one blank line between lines of text.
 # NOTE: On Unix systems, DOS lines which have only CRLF (\r\n) are
 # often treated as non-blank, and thus ‘NF’ alone will return TRUE.
 awk ‘NF{print $0 "\n"}’

 # triple space a file
 awk ‘1;{print "\n"}’

NUMBERING AND CALCULATIONS:

 # precede each line by its line number FOR THAT FILE (left alignment).
 # Using a tab (\t) instead of space will preserve margins.
 awk ‘{print FNR "\t" $0}’ files*

 # precede each line by its line number FOR ALL FILES TOGETHER, with tab.
 awk ‘{print NR "\t" $0}’ files*

 # number each line of a file (number on left, right-aligned)
 # Double the percent signs if typing from the DOS command prompt.
 awk ‘{printf("%5d : %s\n", NR,$0)}’

 # number each line of file, but only print numbers if line is not blank
 # Remember caveats about Unix treatment of \r (mentioned above)
 awk ‘NF{$0=++a " :" $0};{print}’
 awk ‘{print (NF? ++a " :" :"") $0}’

 # count lines (emulates "wc -l")
 awk ‘END{print NR}’

 # print the sums of the fields of every line
 awk ‘{s=0; for (i=1; i< =NF; i++) s=s+$i; print s}’

 # add all fields in all lines and print the sum
 awk ‘{for (i=1; i<=NF; i++) s=s+$i}; END{print s}’

 # print every line after replacing each field with its absolute value
 awk ‘{for (i=1; i<=NF; i++) if ($i < 0) $i = -$i; print }’
 awk ‘{for (i=1; i<=NF; i++) $i = ($i < 0) ? -$i : $i; print }’

 # print the total number of fields ("words") in all lines
 awk ‘{ total = total + NF }; END {print total}’ file

 # print the total number of lines that contain "Beth"
 awk ‘/Beth/{n++}; END {print n+0}’ file

 # print the largest first field and the line that contains it
 # Intended for finding the longest string in field #1
 awk ‘$1 > max {max=$1; maxline=$0}; END{ print max, maxline}’

 # print the number of fields in each line, followed by the line
 awk ‘{ print NF ":" $0 } ‘

 # print the last field of each line
 awk ‘{ print $NF }’

 # print the last field of the last line
 awk ‘{ field = $NF }; END{ print field }’

 # print every line with more than 4 fields
 awk ‘NF > 4′

 # print every line where the value of the last field is > 4
 awk ‘$NF > 4′

TEXT CONVERSION AND SUBSTITUTION:

 # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
 awk ‘{sub(/\r$/,"");print}’   # assumes EACH line ends with Ctrl-M

 # IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
 awk ‘{sub(/$/,"\r");print}

 # IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format
 awk 1

 # IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format
 # Cannot be done with DOS versions of awk, other than gawk:
 gawk -v BINMODE="w" ‘1‘ infile >outfile

 # Use "tr" instead.
 tr -d \r <infile>outfile            # GNU tr version 1.22 or higher

 # delete leading whitespace (spaces, tabs) from front of each line
 # aligns all text flush left
 awk ‘{sub(/^[ \t]+/, ""); print}

 # delete trailing whitespace (spaces, tabs) from end of each line
 awk ‘{sub(/[ \t]+$/, "");print}

 # delete BOTH leading and trailing whitespace from each line
 awk ‘{gsub(/^[ \t]+|[ \t]+$/,"");print}
 awk ‘
{$1=$1;print}‘           # also removes extra space between fields

 # insert 5 blank spaces at beginning of each line (make page offset)
 awk ‘{sub(/^/, "     ");print}

 # align all text flush right on a 79-column width
 awk ‘{printf "%79s\n", $0}‘ file*

 # center all text on a 79-character width
 awk ‘{l=length();s=int((79-l)/2); printf "%"(s+l)"s\n",$0}‘ file*

 # substitute (find and replace) "foo" with "bar" on each line
 awk ‘{sub(/foo/,"bar");print}‘           # replaces only 1st instance
 gawk ‘
{$0=gensub(/foo/,"bar",4);print}‘  # replaces only 4th instance
 awk ‘
{gsub(/foo/,"bar");print}‘          # replaces ALL instances in a line

 # substitute "foo" with "bar" ONLY for lines which contain "baz"
 awk ‘/baz/{gsub(/foo/, "bar")};{print}

 # substitute "foo" with "bar" EXCEPT for lines which contain "baz"
 awk ‘!/baz/{gsub(/foo/, "bar")};{print}

 # change "scarlet" or "ruby" or "puce" to "red"
 awk ‘{gsub(/scarlet|ruby|puce/, "red"); print}

 # reverse order of lines (emulates "tac")
 awk ‘{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j–] }‘ file*

 # if a line ends with a backslash, append the next line to it
 # (fails if there are multiple lines ending with backslash…)
 awk ‘/\\$/ {sub(/\\$/,""); getline t; print $0 t; next}; 1‘ file*

 # print and sort the login names of all users
 awk -F ":" ‘{ print $1 | "sort" }‘ /etc/passwd

 # print the first 2 fields, in opposite order, of every line
 awk ‘{print $2, $1}‘ file

 # switch the first 2 fields of every line
 awk ‘{temp = $1; $1 = $2; $2 = temp}‘ file

 # print every line, deleting the second field of that line
 awk ‘{ $2 = ""; print }

 # print in reverse order the fields of every line
 awk ‘{for (i=NF; i>0; i–) printf("%s ",i);printf ("\n")}‘ file

 # remove duplicate, consecutive lines (emulates "uniq")
 awk ‘a !~ $0; {a=$0}

 # remove duplicate, nonconsecutive lines
 awk ‘! a[$0]++‘                     # most concise script
 awk ‘
!($0 in a) {a[$0];print}‘      # most efficient script

 # concatenate every 5 lines of input, using a comma separator
 # between fields
 awk ‘ORS=%NR%5?",":"\n"‘ file

SELECTIVE PRINTING OF CERTAIN LINES:

 # print first 10 lines of file (emulates behavior of "head")
 awk ‘NR < 11

 # print first line of file (emulates "head -1")
 awk ‘NR>1{exit};1

  # print the last 2 lines of a file (emulates "tail -2")
 awk ‘{y=x "\n" $0; x=$0};END{print y}

 # print the last line of a file (emulates "tail -1")
 awk ‘END{print}

 # print only lines which match regular expression (emulates "grep")
 awk ‘/regex/

 # print only lines which do NOT match regex (emulates "grep -v")
 awk ‘!/regex/

 # print the line immediately before a regex, but not the line
 # containing the regex
 awk ‘/regex/{print x};{x=$0}
 awk ‘
/regex/{print (x=="" ? "match on line 1" : x)};{x=$0}

 # print the line immediately after a regex, but not the line
 # containing the regex
 awk ‘/regex/{getline;print}

 # grep for AAA and BBB and CCC (in any order)
 awk ‘/AAA/; /BBB/; /CCC/

 # grep for AAA and BBB and CCC (in that order)
 awk ‘/AAA.*BBB.*CCC/

 # print only lines of 65 characters or longer
 awk ‘length > 64

 # print only lines of less than 65 characters
 awk ‘length < 64

 # print section of file from regular expression to end of file
 awk ‘/regex/,0
 awk ‘
/regex/,EOF

 # print section of file based on line numbers (lines 8-12, inclusive)
 awk ‘NR==8,NR==12

 # print line number 52
 awk ‘NR==52
 awk ‘
NR==52 {print;exit}‘          # more efficient on large files

 # print section of file between two regular expressions (inclusive)
 awk ‘/Iowa/,/Montana/‘             # case sensitive

SELECTIVE DELETION OF CERTAIN LINES:

 # delete ALL blank lines from a file (same as "grep ‘.‘ ")
 awk NF
 awk ‘
/./

CREDITS AND THANKS:

Special thanks to Peter S. Tillier for helping me with the first release
of this FAQ file.

For additional syntax instructions, including the way to apply editing
commands from a disk file instead of the command line, consult:

“sed & awk, 2nd Edition,” by Dale Dougherty and Arnold Robbins
O’Reilly, 1997
“UNIX Text Processing,” by Dale Dougherty and Tim O’Reilly
Hayden Books, 1987
“Effective awk Programming, 3rd Edition.” by Arnold Robbins
O’Reilly, 2001

To fully exploit the power of awk, one must understand “regular
expressions.” For detailed discussion of regular expressions, see
“Mastering Regular Expressions, 2d edition” by Jeffrey Friedl
(O’Reilly, 2002).

The manual (“man”) pages on Unix systems may be helpful (try “man awk”,
“man nawk”, “man regexp”, or the section on regular expressions in “man
ed”), but man pages are notoriously difficult. They are not written to
teach awk use or regexps to first-time users, but as a reference text
for those already acquainted with these tools.

USE OF ‘\t’ IN awk SCRIPTS: For clarity in documentation, we have used
the expression ‘\t’ to indicate a tab character (0×09) in the scripts.
All versions of awk, even the UNIX System 7 version should recognize
the ‘\t’ abbreviation.

#—end of file—

Categories: 脚本语言 Tags:

GNU/Linux Advanced Administration

February 4th, 2010 ricky.zhu 2 comments

非常不错的一本电子书,从GNU/Linux的来历,发行版,内核,一直讲到GNU/Linux的管理(包括工具,网络管理,数据管理,服务器管理,安全管理,配置管理和优化以至于集群技术)非常的全面和细致,共享一下。

PDF下载

Categories: 脚本语言 Tags:

Oracle+Sun Product Line

February 2nd, 2010 ricky.zhu 3 comments

With SUN, oracle’s product line is complete now.

and comparison

Just record it for reference.

Categories: 业界 Tags:

入口腾龙17-50

January 30th, 2010 ricky.zhu 6 comments

纠结了N久了,今天终于3550元搞定了腾龙17-50,也就是传说中的B005。(A16的升级版本)这款比A16增加了防抖功能,并把口径从67mm增加到了72mm,其实最值得期待的还是他的2.8的恒定大光圈。
在副厂镜头中,这绝对是一款佼佼者,性价比较高。要知道,Canon原厂的17-40 4L的报价一直都在5000元以上,这款恒定2.8行货价格才3000多,而且蜂鸟上的评测和口碑也一直都不错。
刚刚上腾龙网站发现这款镜头获得2010年日本数码相机大奖的金奖

B005

具体指标:

型号 B005
焦距 17-50mm
光圈 F/2.8
视角 78° 45’~31° 11’
镜片构成 14组19片
最近摄距 0.29m
最大摄影倍率 1:4.8
工作距离 72mm
总长 94.5mm*
最大直径 79.6mm
重量 570g*
光圈叶片数 7片
最小光圈 F/32
标准附件 花瓣型遮光罩

[更新]
效果图一
B005-1
效果图二
B005-2

更多效果图 (请酌情翻墙)

update
出手手里的这款佳能450D 套机头 18-55mm is

Categories: 生活点滴 Tags:

用户界面测试的颠覆性技术-Sikuli

January 27th, 2010 ricky.zhu 8 comments

Sikuli绝对是一种颠覆性的技术,至少对于GUI的测试技术来说,是质的突破,比如它彻底解决了在这之前GUI自动化测试工具上的关键点-对象识别。

技术来自于从麻省理工学院计算机和艺术智能实验室的一个用户界面设计小组的研究项目,Sikuli脚本和Sikuli开发平台基于MIT License发布,是开源的。

什么是Sikuli
========
Sikuli是一种利用图片(快照)去搜索和自动化GUI的视觉技术,Sikuli的第一个release包含Sikuli脚本,也就是为Jython编写的一种视觉脚本API,同时包含了Sikuli IDE,一个可以非常容易的用快照书写视觉脚本的集成开发环境。Sikuli脚本可以自动化你在屏幕上看到的一切,而这不需要内部API的支持。你可以编程控制一个页面,一个运行在Windows/Linux/Mac OS X上的桌面应用程序,甚至于一个运行在模拟终端的iphone的应用程序。

Sikuli的必杀技
========
自动化所有你看到的一切
利用快照进行自动化
工作在Java平台(意味着可移植)

Sikuli安装和使用
===========
下载安装了一下,在Windows上需要JDK1.6以上环境,这里有一个简单的视频介绍(看不到youtube的同学翻墙吧)。

不会翻墙的地同学请从如下视频观看:

继续阅读论文
=========
GUI Testing Using Computer Vision

Sikuli: Using GUI Screenshots for Search and Automation

MIT news介绍图像驱动计算

一个例子快照
=========
sikuli

拭目以待!

Categories: 测试工具 Tags:

欧盟批准Oracle收购SUN

January 22nd, 2010 ricky.zhu 1 comment

经过长达半年的谈判,欧盟终于批准了这笔74亿美金的交易,Oracle成功收购SUN,对于Oracle这将是一个标准性的事件。

EU Clears Oracle to Buy Sun Microsystems

毫无疑问,这是一家伟大的公司,是一个英雄辈出的公司,不过看到这个长长的列表,我还是有点震撼

【在Sun公司工作的杰出科学家和工程师】

Bill Joy(BSDvi之父)
Ivan Sutherland(图灵奖得主)
Bryan Cantrill(DTrace之父)
Steve Bourne(Bourne shell之父)
Jeff Bonwick(ZFS之父)
Joshua Bloch(Java教父)
Guy L. Steele, Jr.(Scheme之父)
James Duncan Davidson(Tomcat之父)
Whitfield Diffie(公钥算法之父)
Craig McClanahan(Struts之父)
Ian Murdock(Debian之父)
Jakob Nielsen(可用性权威)
Radia Perlman(Internet之母)
Marc Tremblay(UltraSPARC处理器)
Marc Fleury(JBoss之父)
Tim Bray(XML
Peter Norvig(Google研发总监)
John Ousterhout(Tcl之父)

【在Sun公司工作过的杰出企业家】

Eric Schmidt(Google,lex)
Andy Bechtolsheim(Sun创始人,Google的第一个投资者)
庄思浩(BEA) =>没想到BEA,SUN最后都被Oracle收购了…
Chris Malachowsky(NVIDIA)

Categories: 业界 Tags:

Linux System and Performance Monitoring

January 15th, 2010 ricky.zhu 1 comment

新年第一篇

转载sanotes的这篇非常实用的Linux System and Performance Monitoring 翻译文档,包括CPU篇,内存篇,IO篇,网络篇,总结篇等五个部分,整理成了pdf方便下载。

Linux system and performance monitoring PDF下载
原文

Categories: 主机 Tags: