2008/08/28

逐鹿蓝天

《逐鹿蓝天》 —— 美国民航业的经营管理

Web 2.0

以前一直对所谓的 Web2.0 不敢冒, 主要还是因为对 Web2.0 的概念不了解。 今天在 西西河 看到铁手老大的帖子: 对Web2.0的描述简明扼要,重点突出,很有感觉

一般而言,谈论WEB2.0时,我们的概念基本上是,1、用户贡献的内容。2、方便的交互环境。和以前的网站概念不同,WEB2.0主要是依靠用户的参 与。用户的直接参与和内容提供,这是大家都能看到的WEB2.0的核心要素。好的WEB2.0,是在于能够有比较清楚的定位,吸引特定的人群,并在技术上 方便用户的参与。比如MYSPACE更注重社交功能,三教九流,五花八门都可以找到或者建立自己的朋友圈子,内容并不重要。
从这个意义上说,digg.com del.icio.us 才有那么点儿Web2.0的意思。 :)

2008/08/25

重温 shell 编程的 变量操作

Shell编程的时候,总会觉得字符串的处理很麻烦! 其实人家也觉得麻烦,ksh/bash中自有一套办法来帮助你,只是很多时候我们都不知道或者没注意而已!
特别是有正则表达式

The character $ is used to introduce substitutable parameters.

${parameter}

The shell reads all the characters from ${ to the matching } as part of the same word even if it contains braces or metacharacters. The value, if any, of the parameter is substituted. The braces are required when parameter is followed by a letter, digit, or underscore that is not to be interpreted as part of its name, when the variable name contains a .. The braces are also required when a variable is subscripted unless it is part of an Arithmetic Expression or a Conditional Expression. If parameter is one or more digits then it is a positional parameter. A positional parameter of more than one digit must be enclosed in braces. If parameter is * or @, then all the positional parameters, starting with $1, are substituted (separated by a field separator character). If an array vname with subscript * or @ is used, then the value for each of the elements is substituted, separated by the first character of the value of IFS.


${#parameter}

If parameter is * or @, the number of positional parameters is substituted. Otherwise, the length of the value of the parameter is substituted.


${#vname[*]}
${#vname[@]}

The number of elements in the array vname is substituted.


${!vname}

Expands to the name of the variable referred to by vname. This will be vname except when vname is a name reference.


${!vname[subscript]}

Expands to name of the subscript unless subscript is * or @. When subscript is *, the list of array subscripts for vname is generated. For a variable that is not an array, the value is 0 if the variable is set. Otherwise it is null. When subscript is @, same as above, except that when used in double quotes, each array subscript yields a separate argument.


${!prefix*}

Expands to the names of the variables whose names begin with prefix.


${parameter:-word}

If parameter is set and is non-null then substitute its value; otherwise substitute word.


${parameter:=word}

If parameter is not set or is null then set it to word; the value of the parameter is then substituted. Positional parameters may not be assigned to in this way.


${parameter:?word}

If parameter is set and is non-null then substitute its value; otherwise, print word and exit from the shell (if not interactive). If word is omitted then a standard message is printed.


${parameter:+word}

If parameter is set and is non-null then substitute word; otherwise substitute nothing.

In the above, word is not evaluated unless it is to be used as the substituted string, so that, in the following example, pwd is executed only if d is not set or is null:

print ${d:-$(pwd)}

If the colon ( : ) is omitted from the above expressions, then the shell only checks whether parameter is set or not.


${parameter:offset:length}
${parameter:offset}

Expands to the portion of the value of parameter starting at the character (counting from 0) determined by expanding offset as an arithmetic expression and consisting of the number of characters determined by the arithmetic expression defined by length. In the second form, the remainder of the value is used. If A negative offset counts backwards from the end of parameter.
Note that one or more blanks is required in front of a minus sign to prevent the shell from interpreting the operator as :-. If parameter is * or @, or is an array name indexed by * or @, then offset and length refer to the array index and number of elements respectively. A negative offset is taken relative to one greater than the highest subscript for indexed arrays. The order for associate arrays is unspecified.



${parameter#pattern}
${parameter##pattern}

If the shell pattern matches the beginning of the value of parameter, then the value of this expansion is the value of the parameter with the matched portion deleted; otherwise the value of this parameter is substituted. In the first form the smallest matching pattern is deleted and in the second form the largest matching pattern is deleted. When parameter is @, *, or an array variable with subscript @ or *, the substring operation is applied to each element in turn.



${parameter%pattern}
${parameter%%pattern}

If the shell pattern matches the end of the value of parameter, then the value of this expansion is the value of the parameter with the matched part deleted; otherwise substitute the value of parameter. In the first form the smallest matching pattern is deleted and in the second form the largest matching pattern is deleted. When parameter is @, *, or an array variable with subscript @ or *, the substring operation is applied to each element in turn.



${parameter/pattern/string}
${parameter//pattern/string}
${parameter/#pattern/string}
${parameter/%pattern/string}

Expands parameter and replaces the longest match of pattern with the given string. Each occurrence of \n in string is replaced by the portion of parameter that matches the n-th sub-pattern. In the first form, only the first occurrence of pattern is replaced. In the second form, each match for pattern is replaced by the given string. The third form restricts the pat-
tern match to the beginning of the string while the fourth form restricts the pattern match to the end of the string. When string is null, the pattern will be deleted and the / in front
of string may be omitted. When parameter is @, *, or an array variable with subscript @ or *, the substitution operation is applied to each element in turn. In this case, the string portion of word will be re-evaluated for each element.

邓稼先传

缅怀一下~~~~ 做个书签!

http://www.tektalk.cn/2008/07/28/%E9%82%93%E7%A8%BC%E5%85%88%E4%BC%A0/

学海无涯

西西河看到的!
做学问难啊! 做学问还要打好基础~~~
斗争要有理有利有节!!!

【原创】化学博士后的经历(1)---隐忧
【原创】化学博士后的经历(2)---艰难
【原创】化学博士后的经历(3)---醒悟
【原创】化学博士后的经历(4)---反击前哨战
【原创】化学博士后的经历(5)---当众摊牌
【原创】化学博士后的经历(6)---舌战
【原创】化学博士后的经历(7)---终于轻松了
【原创】化学博士后的经历(8)---最后的不厚道

2008/08/24

看看什么叫做工作中的有理有利有节

看看萨老的原创:原载于 西西河

【原创】东瀛坑熊记 上
【原创】东瀛坑熊记 下
【原创】东瀛坑熊记 中

香农极限 带宽计算公式

今天在西西河看到了 有人讲香农公式 http://www.ccthere.com/article/696151
不禁要感慨这人太牛了。给我们呈现了一种物理学中简单的美~~~

具体来说
  • If S/N >> 1, then
 C \approx 0.332 \cdot B \cdot \mathrm{SNR (in \ dB)}
where
\mathrm{SNR (in \ dB)} = 10\log_{10}{S \over N}
  • Similarly, if S/N <<>
 C \approx 1.44 \cdot B \cdot {S \over N}
In this low-SNR approximation, capacity is independent of bandwidth if the noise is white, of spectral density N0 watts per hertz, in which case the total noise power is B \cdot N_0.
 C \approx 1.44  \cdot {S \over N_0}

2008/08/21

苏联笑话

火车停了
话说列宁,斯大林,赫鲁晓夫,勃列日涅夫,戈尔巴乔夫五人同坐一列社会主义号火车前进, 突然火车停了,车长过来报告,前面铁路断了,列宁:"说发动一次星期六义务劳动把它修好",斯大林一瞪眼:"一定有阶级敌人搞破坏,抓起来枪毙",赫若有 所思 "前面不通,就倒车吧",勃列日涅夫:"找几个人下车摇火车就行了,乘客感到车在动就以为在前进",只有戈尔巴桥夫最绝:"把火车拆了,每人扛一件零件前 进, 到有铁轨的地方再装起来"于是拆了火车, ...


斯大林的烟斗
斯大林喜欢夜间工作,有一次他凌晨 3点迷迷糊糊就睡着了,把最喜欢的烟斗忘在了沙发缝里。第二天早上起来发现找不到烟斗了,就让贝利亚去处理这件事。第二天贝利亚揭露出了一个“利用偷烟斗 进行暗杀活动的托洛茨基组织”,10多名罪犯全被枪决,但是还是没找到那个烟斗。最后是苏斯洛夫坐这个沙发觉得塥的慌,打开一看才找到的。


赫鲁晓夫与猪
赫 鲁晓夫喜欢以农业专家自居。一次参观某集体农庄养猪场,发现一头病歪歪的小猪。农庄主席解释说这猪从小营养不良,养僵了。赫鲁晓夫当即说,把这猪抱到我 家,保证两个月养肥还给你们。赫氏回家怎么摆弄那猪也不长。情急下决定把猪处理掉。他在傍晚时分将猪放入婴儿车,准备推到莫斯科河边抛掉。谁知半路上偏偏 遇上米高扬。 “赫鲁晓夫同志,散步哪。” “啊……出来走走……” “这是谁啊?” “哦,是我……小外孙。” “我看看。哦,多好的孩子,长得真像他外祖父!”


赫鲁哓夫视察
赫鲁哓夫有一次视察农场,在参观到猪圈时,记者拍了照。回到报社后,想以赫鲁哓夫同志和猪的标题发表在真理报上。苏斯洛夫说这样会影响领导形象。结果,第二天,苏联人民手里拿到的真理报上的标题是:赫鲁哓夫同志视察农场(左起等三位为赫鲁哓夫同志)。


当时你再干什么
赫鲁晓夫在苏共二十大揭露斯大林的暴行时,台下有人递条子上去。赫鲁晓夫当场宣读了条子的内容:“当时你在干什么?”。然後问道:“这是谁写的,请站出来!”。连问三次,台下一直没有人站出来。于是赫鲁晓夫说:“现在让我来回答你吧,当时我就坐在你的位置上。”


两面派
原 苏联共产党中央第一书记赫鲁晓夫(1891--1971年)在愤怒遣责联合国阻挠苏调停刚果战后独立危机的行为不久,又向联合国秘书长哈马金尔德发去一封 礼节性的邀请书,请他参加苏联的国宴。赫鲁晓夫非常热情地欢迎哈马金尔德的到来。有人问他,为什么对前不久遣责过的人表现得如此热忱。赫鲁晓夫反问道: “你知道我国高加索地区人民的传统习惯吗?敌人在你家里作客,与你分享面包和食盐时,你要殷勤款待;一旦敌人跨出了你的家门,你就可以豁断他的喉管。”


勃列日涅夫的糊涂母亲
勃列日涅夫偏爱住非常豪华的住房,在郊外有好几处很奢侈的别墅。有一次,他把他的老妈接到城里来,骄傲地把自己的别墅展示给她看。谁知他的老妈一点也不高兴。勃列日涅夫很奇怪,问为什么。他妈答道:孩子,你住这么好的房子,要是共产党执政,你可怎么办呀……


勃列日涅夫论苏联民主
勃 列日涅夫当政时期,美国总统尼克松访问苏联。在记者招待会上,尼克松想借机宣扬美国式的民主,于是说:“在我们美国言论自由,任何人都可以在白宫前,大 骂:‘尼 克松是王八蛋!’肯定没有警察来抓他。” 勃列日涅夫不动声色平静的说:“在苏联同样也是言论自由,任何人也都可以在克里 姆林宫前大骂:‘尼克松是王八蛋’同样也没有警察来抓他!”


马克思主义者勃烈日捏夫
斯大林逝世后的 苏联,一直由精通马列的苏斯洛夫做意识形态的最高权威。搬倒赫鲁晓夫不久,地位还不是很稳固。苏斯洛夫为勃烈日捏夫写好了一片苏共中央全会的发言稿,其中 有几段引用的马克思的经典语句,但是在勃烈日捏夫在会上读时却跳过这些段落,让苏斯洛夫一脑子问号。会后去勃烈日捏夫家做客时才有机会问,勃烈日捏夫说 “你说他们会相信我读过马克思的书吗?如果我能引用出马克思话,柯锡金、谢列平他们都会笑的”


勃列日涅夫穿鞋
勃列日涅夫上班秘书对他说:“列昂尼德·伊利奇,您的皮鞋一只是棕色的,一只是红色的” 勃列日涅夫:这有什么奇怪,我家里还有一双也是这样的。

2008/08/15

Open Souce 的版权终于得以正名

Jacobsen v. Katzer:开源运动的一个重大胜利 http://www.cnbeta.com/articles/62360.htm
Jacobsen v. Katzer 的诉讼 http://en.wikipedia.org/wiki/Jacobsen_v._Katzer

案件大致情况是:
2006年,Bob Jacobsen起诉Matt Katzer,声称后者的软件没有遵守开源协议,标明源代码的出处和作者,要求法院认定这是侵犯著作权行为。但是,当时的旧金山联邦地区法院驳回了这个请 求,认为这只是“违反契约”(a breach of the licensing agreement),而不是“侵犯著作权”(copyright infringement)。 在美国通常“违法契约”诉讼人只能申请经济上的补偿, 而“侵犯著作权”则可以申请禁止令要求侵权人停止损害。
2008年8月,美国联邦上诉法院(Court of Appeals for the Federal Circuit)判决:“‘开源协议’ 是一种著作权协议,违反协议就是侵权行为。” 法官还表示 "Open source licensing has become a widely used method of creative collaboration that serves to advance the arts and sciences in a manner and at a pace that few could have imagined just a few decades ago,"

对于实行判例法系的美国,这将是法律体系对开源版权的确认!

PC Magazine 的报道: http://www.pcmag.com/article2/0,2817,2328027,00.asp

研究的精神

兴趣是最好的老师, 世界上没有完美的系统,电子车票系统也是如此。 这个PDF里讲述了一个MIT的三位学生发现了波士顿地铁电子车票系统的漏洞的故事。 国内的这种研究的精神似乎少了一些! 我们的教育导向太死板了!

2008/08/14

低价 PC or 低功耗 PC

随着Intel Atom的诞生, 低价PC或者低功耗PC的大潮开始涌动了! 回过头来说,低功耗PC也许还不错,但是低价PC这也许又不是Intel真正想要给我们这些消费者的! 看看 ccthere.com 上的文章!
特别是下面的这段文字:
“Intel每年销售1亿多片CPU,销售额为350-400亿美元,平均每片价格为200多美元,毛利润150美元以上。假设Intel为低成本电脑推 出价格为20美元左右的CPU,毛利润为每片5美元左右,每年销售2亿片,销售额为40亿美元,毛利润为10亿美元。如果这2亿片低成本芯片的销售不影响 原来的1亿多片的芯片销售,则Intel是愿意做的;但如果由于这2亿片低成本芯片的销售使得其他处理器的销售减少了2000万片,则Intel销售额减 少40亿美元,利润减少30亿美元。”(《龙芯之火,可以燎原》,2007年12月)
市场经济,利益至上 Intel Atom 的低功耗,低廉的价格,低下的性能都是Intel所期望的! Intel从一开始就没有打算用 Atom 来作为低价PC的CPU来销售,她的目标是低功耗PC。以至于Atom在这个领域内热卖的时候,Intel不但没有增加产量,而是控制产量提高售价,因为Intel比谁都清楚Atom的毛利太低,卖的太多不赚钱,既然它热卖那就索性提价提高毛利!

AMD也有他自己的应对策略。AMD比不了Intel,她没有太多的研发实验室,没有太多的工厂,不能像Intel那样同时搞很多的不同设计,既然不能用新的对应的产品和你比,那就用已经有的老产品改头换面来跟你比,反正最终的效果是一样的。 当然了,不是在低价PC,AMD的价格已经够低了; 只能在低功耗方面做文章, 这个Mini-780G就是一个不错的模式!
“功耗吗确实是你Intel Atom低,但是我的总功耗也不高,也就是个70/80W(比Atom高30W),但是性能比你强1倍,1080p完全没问题,不像你720p都吭吭哧哧的!为了看高清又有谁会在乎多点这一个灯泡呢?”
博弈啊!!!

2008/08/07

How to Write a Good Technical Documentation

Writing good documentation always hard! But you can make it better.

DO:

  • Fully understand the situation, and know the 5 W's:
    "Who, What, Where, When, and Why".

  • KISS: Keep It Simple and Stupid
  • Write agenda before you start

  • Keep the technical integrity
  • Add reference links for all the shared knowledge

  • Use diagram to show the complex logical
  • Use table to show the structured information
  • Compare the different design alternatives
  • Use bulletin and numbered list to express the idea

  • Write a good looking document
  • Have a good template
  • Use named style to control the format
  • Always do spelling/grammar check
  • Tidy your documentation

  • Ask for comments from others
  • Track changes between the reversions

DON'T:
  • Write long sentence or paragraph
  • Be afraid to delete some pieces
  • Be afraid to reconstruct sections
  • Be afraid to spend more time

Miscellanea:
  • Ask for others' help, and help others
  • Eats your own dog food
    Read it once more when you feel it were finished

BlockChain 相关电子书

@copyright of Sam Chadwick   - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...