mingyi's profile大头的空间PhotosBlogListsMore Tools Help

Blog


    July 19

    年轻人需知的71个做饭技巧

    转:年轻人要知道的71个做饭技巧
    1、煮水饺时,在水里放一颗大葱或在水开后加点盐,再放饺子,饺子味道鲜美不粘连;在和面时,每500克面粉加拌一个鸡蛋,饺子皮挺刮不粘连
    2、 炖肉时,在锅里加上几块桔皮,可除异味和油腻并增加汤的鲜味
    3、煮骨头汤时加一小匙醋,可使骨头中的磷、钙溶解于汤中,并可保存汤中的维生素。
    4、炖鸡:洗净切块,倒入热油锅内翻炒,待水分炒干时,倒入适量香醋,再迅速翻炒,至鸡块发出劈劈啪啪的爆响声时,立即加热水(没过鸡块),再用旺火烧十分钟,即可放入调料,移小火上再炖20分钟,淋上香油即可出锅;应在汤炖好后,温度降至80~90摄氏度时或食用前加盐。因为鸡肉中含水分较高,炖鸡先加盐,鸡肉在盐水中浸泡,组织细胞内水分向外渗透,蛋白质产生凝固作用,使鸡肉明显收缩变紧,影响营养向汤内溶解,且煮熟后的鸡肉趋向硬、老,口感粗糙。
    5、煮肉汤或排骨汤时,放入几块新鲜桔皮,不仅味道鲜美,还可减少油腻感。  
    6、烧豆腐时,加少许豆腐乳或汁,味道芳香
    7、将绿豆在铁锅中炒10分钟再煮能很快煮烂,但注意不要炒焦
    8、煮蛋时水里加点醋可防蛋壳裂开,事先加点盐也可  
    9、煮海带时加几滴醋易烂;放几棵波菜也行  
    10、煮火腿之前,将火腿皮上涂些白糖,容易煮烂,味道更鲜美
    11、羊肉去膻味:将萝卜块和羊肉一起下锅,半小时后取出萝卜块;放几块桔子皮更佳;每公斤羊肉放绿豆5克,煮沸10分钟后,将水和绿豆一起倒出;放半包山楂片;将带壳的核桃两三个洗净打孔放入;1公斤羊肉加咖喱粉10克;1公斤羊肉加剖开的甘蔗200克;1公斤水烧开,加羊肉1公斤、醋50克,煮沸后捞出,再重新加水加调料。
    12、煮水饺时,在锅中加少许食盐,锅开时水也不外溢  
    13、面条时加一小汤匙食油,面条不会沾连,并可防止面汤起泡沫、溢出锅外
    14、煮面条时,在锅中加少许食盐,煮出的面条不易烂糊  
    15、熬粥或煮豆时不要放碱,否则会破坏米、豆中的营养物质   
    16、用开水煮新笋容易熟,且松脆可口;要使笋煮后不缩小,可加几片薄荷叶或盐
    17、猪肚煮熟后,切成长块,放在碗内加一些鲜汤再蒸一会儿,猪肚便会加厚一倍
    18、煮猪肚时,千万不能先放盐,等煮熟后吃时再放盐,否则猪肚会缩得象牛筋一样硬
    19、煮牛肉:为了使牛肉炖得快,炖得烂,加一小撮茶叶(约为泡一壶茶的量,用纱布包好)同煮,肉很快就烂且味道鲜美。  
    20、煮牛肉和其他韧、硬肉类以及野味禽类时,加点醋可使其软化。
    21、炖老鸡:在锅内加二三十颗黄豆同炖,熟得快且味道鲜;或在杀老鸡之前,先灌给鸡一汤匙食醋,然后再杀,用文火煮炖,就会煮得烂熟;或放3~4枚山楂,鸡肉易烂
    22、老鸡鸭用猛火煮,肉硬不好吃;如果先用凉水和少许食醋泡上2小时,再用微火炖,肉就会变得香嫩可口   
    23、炖老鸭:在锅里放几个田螺容易烂熟   
    24、烧鸭子时,把鸭子尾端两侧的臊豆去掉,味道更美  
    25、煮咸肉:用十几个钻有许多小孔的核桃同煮,可消除臭味
    26、红烧牛肉时,加少许雪里红,肉味鲜美  
    27、做红烧肉前,先用少许硼砂把肉腌一下,烧出来的肉肥而不腻,甘香可口  
    28、油炸食物时,锅里放少许食盐,油不会外溅  
    29、在春卷的拌馅中适量加些面粉,能避免炸制过程中馅内菜汁流出糊锅底的现象
    30、炸土豆之前,先把切好的土豆片放在水里煮一会儿,使土豆皮的表面形成一层薄薄的胶质层,然后再用油炸   
    31、炸猪排时,在有筋的地方割2~3个切口,炸出来的猪排就不会收缩  
    32、将鸡肉先腌一会儿,封上护膜放入冰箱,待炸时再取出,炸出的鸡肉酥脆可口
    33、煎荷包蛋时,在蛋黄即将凝固之际浇一点冷开水,会使蛋又黄又嫩
    34、煎鸡蛋时,在平底锅放足油,油微热时蛋下锅,鸡蛋慢慢变熟,外观美,不粘锅
    35、煎鸡蛋时,在热油中撒点面粉,蛋会煎得黄亮好看,油也不易溅出锅外
    36、用羊油炒鸡蛋,味香无异味   
    37、炒鸡蛋时加入少量的砂糖,会使蛋白质变性的凝固温度上升,从而延缓了加热时间,加上砂糖具有保水性,因而可使蛋制品变得膨松柔软  
    38、炒鸡蛋时加入几滴醋,炒出的蛋松软味香  
    39、炒茄子时,在锅里放点醋,炒出的茄子颜色不会变黑  
    40、炒土豆时加醋,可避免烧焦,又可分解土豆中的毒素,并使色、味相宜
    41、炒豆芽时,先加点黄油,然后再放盐,能去掉豆腥味  
    42、炒波菜时不宜加盖  
    43、炒肉片:肉切成薄片加酱油、黄油、淀粉,打入一个鸡蛋,拌匀,炒散;等肉片变色后,再加佐料稍炒几下,肉片味美、鲜嫩
    44、炒牛**:切好,用盐、糖、酒、生粉(或鸡蛋)拌一下,加上生油泡腌,30分钟后再炒,鲜嫩可口  
    45、炒肉菜时放盐过早熟得慢,宜在将熟时加盐,在出锅前再加上几滴醋,鲜嫩可口
    46、**切好后放在小苏打溶液里浸一下再炒,特别疏松可口不论做什么糖醋菜肴,只要按2份糖1份醋的比例调配,便可做到甜酸适度  
    47、炒糖醋鱼、糖醋菜帮等,应先放糖,后放盐,否则食盐的“脱水”作用会促进菜肴中蛋白质凝固而“吃”不进糖分,造成外甜里淡  
    48、做肉饼和肉丸子时,一公斤肉馅放2小匙盐  
    49、做丸子按50克肉10克淀粉的比例调制,成菜软嫩  
    50、做滑炒肉片或辣子肉丁,按50克肉5克淀粉的比例上浆,成菜鲜嫩味美
    51、做馒头时,如果在发面里揉进一小块猪油,蒸出来的馒头不仅洁白、松软,而且味香
    52、蒸馒头时掺入少许桔皮丝,可使馒头增加清香  
    53、蒸馒头碱放多了起黄,如在原蒸锅水里加醋2~3汤匙,再蒸10~15分钟可变白
    54、将少量明矾和食盐放入清水中,把切开的生红薯浸入十几分钟,洗净后蒸煮,可防止或减轻腹胀
    55、牛奶煮糊了,放点盐,冷却后味道更好
    56、放有辣椒的菜太辣时或炒辣椒时加点醋,辣味大减
    57、烹调时,放酱油若错倒了食醋,可撒放少许小苏打,醋味即可消除
    58、菜太酸,将一只松花蛋捣烂放入
    59、菜太辣,放一只鸡蛋同炒
    60、菜太辣,放些醋可减低辣味
    61、菜太苦,滴入少许白醋
    62、汤太咸又不宜兑水时,可放几块豆腐或土豆或几片蕃茄到汤中;也可将一把米或面粉用布包起来放入汤中
    63、汤太腻,将少量紫菜在火上烤一下,然后撒入汤中
    64、花生米用油炸熟,盛入盘中,趁热撒上少许白酒,稍凉后再撒上少许食盐,放置几天几夜都稣脆如初
    65、菜籽油有一股异味,可把油烧热后投入适量生姜、蒜、葱、丁香、陈皮同炸片刻,油即可变香
    66、用菜油炸一次花生米就没有怪味了,炒出的菜肴香味可口,并可做凉拌菜
    67、炸完食物后的油留下一些残渣并变得混浊,可将白萝卜切成厚圆片,用筷子把萝卜戳几个洞,放入剩油中炸,残渣会附着在萝卜片上,取出清除残渣,再反复放入锅中炸,混浊的油可变清澈
    68、炒菜时应先把锅烧热,再倒入食油,然后再放菜
    69、当锅内温度达到最高时加入料酒,易使酒蒸发而去除食物中的腥味
    70、熬猪油:在电饭褒内放一点水或植物油,然后放入猪板油或肥肉,接通电源后,能自动将油炼好,不溅油,不糊油渣,油质清纯
    71、泡菜坛中放十几粒花椒或少许麦芽糖,可防止产生白花

    大佛法语

    手把青秧插满田,
    低头便见水中天,
    心地清静方为道,
    退步原来是向前
    July 01

    治世之能臣,乱世之奸雄

    Cáo Cāo (曹操; 155 – March 15, 220[1]) was a warlord and the penultimate Chancellor of the Eastern Han Dynasty who rose to great power during its final years in ancient China. As one of the central figures of the Three Kingdoms period, he laid the foundations for what was to become Cao Wei and was posthumously titled Emperor Wu of Wei (魏武帝). Although often portrayed as a cruel and merciless tyrant, Cao Cao has also been praised as a brilliant ruler and military genius who treated his officers like his family. He was also skilled in poetry and the martial arts, and wrote many war journals。

     

    Cao Cao was born in the county of Qiao (譙, present day Bozhou, Anhui) in 155. His father Cao Song was a foster son of Cao Teng, who in turn was one of the favorite eunuchs of Emperor Huan. Some historical records, including Biography of Cao Man, claim that Cao Song was originally surnamed Xiahou (thus making Cao Cao a cousin of Xiahou Dun and Xiahou Yuan, two of his most prominent generals). In the fictionalized Romance of the Three Kingdoms, Cao Cao's father was originally a Xiahou and was adopted into the Cao family.

    Cao Cao was known for his craftiness as a young man. According to the Biography of Cao Man, Cao Cao's uncle often complained to Cao Song regarding Cao Cao's childhood indulgence in hunting and music with Yuan Shao. To counter this, Cao Cao one day feigned a fit before his uncle, who hurriedly informed Cao Song. Cao Song rushed out to see his son, who then acted normally. When asked, Cao Cao replied, "I have never had such illness, but I lost the love of my uncle, and therefore he had deceived you." Henceforth, Cao Song ceased to believe the words of his brother regarding Cao Cao, and thus Cao Cao became even more blatant in his wayward pursuits.

    At that time, there was a man living in Runan named Xu Shao who was famed for his ability to evaluate one's potentials and talents. Cao Cao paid him a visit in hopes of receiving the evaluation that will earn him some reputation politically. Originally Xu Shao pondered and refused to make a statement; however, under persistent questioning, he finally said, "You would be a capable minister in peaceful times and an unscrupulous hero in chaotic times." Cao Cao took this as a compliment and was very pleased as it was recorded that he "laughs and leaves" after receiving said comment. It is worth noting that there are two other versions of the comment in other unofficial historical records: "capable minister in peaceful times, righteous hero in chaotic times"[citation needed] and "sinister foe in peaceful times, great hero in chaotic times."[citation needed]

    At twenty, Cao Cao was recommended to be a district captain of Luoyang. Upon taking up the post, Cao Cao placed rows of multicolored staffs outside his office and ordered his deputies to flog those who violated the law, regardless of their status. An uncle of Jian Shuo, one of the most powerful and influential eunuchs under Emperor Ling, was once caught walking in the city beyond the evening curfew hour by Cao Cao and given his fair share of flogging. This prompted Jian Shuo and other higher authorities to "promote" Cao Cao to another position outside the imperial capital (governor of Dunqiu County) to remove his management.

    When the Yellow Turban Rebellion broke out in 184 Cao Cao was recalled to Luoyang and promoted to a captain of the cavalry (騎都尉) and sent to Yingchuan to put down the rebels there. He was successful in his military exploits and was further promoted to Governor of Dong Commandery (東郡).

    Battle of Guandu

    In the spring of 200, Yuan Shao, the most powerful warlord of the north, amassed more than 100,000 troops and marched from Ye on Xuchang. To defend against the invasion, Cao Cao placed 20,000 men at Guandu (官渡), a strategic landing point on the shore of the Yellow River which Yuan Shao's troops had to secure en route Xuchang.

    With a few diversionary tactics, Cao Cao managed to disorient Yuan Shao's troops as well as kill two of Yuan Shao's most capable generals, Yan Liang and Wen Chou. The morale of Yuan Shao's troops suffered a further blow when Cao Cao launched a stealth attack on the former's food store, Wuchao. Many more of Yuan Shao's men surrendered or deserted than were killed during the ensuing battle. When Yuan Shao eventually retreated back to Ye in the winter of 201, he did so with little more than 800 light cavalry.

    The Battle of Guandu shifted the balance of power in northern China. Yuan Shao died shortly after his retreat and his two sons were soon defeated by Cao Cao further in the northern regions of Liaodong. Since then, Cao Cao's dominance in the entirety of northern China was never seriously challenged. The battle has also been studied by military strategists ever since as a classic example of winning against an enemy with far superior numbers.

    Battle of Red Cliffs

    Traditional site of the Red Cliffs, north of Wulin

    The Battle of Chibi (literally, "Red Cliffs") was another classic battle where the vastly outnumbered emerged as victor through strategy. In this battle, however, Cao Cao was on the losing end.

    In the winter of 208, Liu Bei and Sun Quan – two warlords who later founded Shu and Wu respectively – formed their first coalition against the southward expansion of Cao Cao. The two sides confronted at the Red Cliffs (northwest of present day Chibi City, Hubei). Cao Cao boasted 830,000 men (historians believe the realistic number was around 220,000), while the Liu-Sun coalition at best had 50,000 troops.

    However, Cao Cao's men, mostly from the north, were ill-suited to the southern climate and naval warfare, and thus entered the battle with a disadvantage. Furthermore, a plague that broke out undermined the strength of Cao Cao's army. The decision by Zhou Yu, military advisor to Sun Quan, to use fire also worked effectively against Cao Cao's vessels, which were chained together and thus allowed the fires to quickly spread. (Though in the novel Romance of the Three Kingdoms the chaining of the ships is attributed to Pang Tong, it is most likely that it was done to make stable the ships as his men were suffering from seasickness). A majority of Cao Cao's troops were either burnt to death or drowned. Those who tried to retreat to the near bank were ambushed and annihilated by enemy skirmishers. Cao Cao himself barely escaped the encounter.

    Agriculture and education

    While waging military campaigns against his enemies, Cao Cao did not forget the basis of society – agriculture and education.

    In 194, a locust plague caused a major famine across China. According to the Records of the Three Kingdoms, the people ate each other out of desperation. Without food, many armies were defeated even without fighting. From this experience, Cao Cao saw the importance of an ample food supply in building a strong military. He began a series of agricultural programs in cities such as Xuchang and Chenliu. Refugees were recruited and given wastelands to cultivate. Later, encampments not faced with imminent danger of war were also made to farm. This system was continued and spread to all regions under Cao Cao as his realm expanded. Although Cao Cao's primary intention was to build a powerful army, the agricultural program also improved the living standards of the people, especially war refugees.

    By 203, Cao Cao had eliminated most of Yuan Shao's force. This afforded him more attention on construction within his realm. In autumn of that year, Cao Cao passed an order decreeing the promotion of education throughout the counties and cities within his jurisdiction. An official in charge of education matters was assigned to each county with at least 500 households. Youngsters with potential and talents were selected to undergo schooling. This prevented a lapse in the output of intellectuals in those warring years and, in Cao Cao's words, would benefit the people.

     
    June 15

    关于BPEL

    关于BPEL

     

    在企业应用集成中,可以使用工作流程和BPM结合的方式来协调各个应用,但是WEBSERVICES 中必须要有一种标准来让无论是计算机人员和业务人员都能懂的东西。这种东西既结合计算的程序又综合了工作流程的概念,BPEL就是其中最流行的标准。

     

    通过BPEL可以将很多的WEBSERVICE集成起来,通过工作流的形式来自动执行。在集成的过程中,单个的SERVICE的实现部分保持非透明化,也就是说,在BPEL里面用到得只是每个SERVICE的接口(WSDL)而不用管,每个SERVICE在自己的地盘是怎么实现的。BPEL只要知道每个SERVICE 的功能,物理地址,和需要的参数就可以了。这样即使单个SERVICE改变或者变化也对BPEL流程没有太大的影响。这也就是composition of web services的原理:应该调用什么服务,什么时候调用,如何处理异常等等。

     

    BPLE具体的结构和细节是如何的?

    BPEL实际上也是一个基于XML的文件。

    BPEL中的一个显著特点是定义了不同的 partnerlink, partnerlink定于了这个流程中各个服务所处的地位(role), 比如说bpel中有一个查询票价的服务接口,那么对于这个查询票价的服务就处于一个SERVICE的地位,那么BPEL过程本身就是一个requestor 的地位。

    BPEL总定义好了partnerlink后也要在相应的服务接口文件中定义partnerlinktype,这个type实际指向的就是服务接口文件(WSDL)中的porttype.

     

    像一般的流程图一样,BPEL有自己的活动标签。

    Receive: 接受信息

    Reply:  对之前接受到得信息的相应,同时它还可以返回一个异常。

    Invoke: 调用一个相应的服务

    Sequence: 按顺序执行一定的活动

    Flow: 一些活动可以同时进行。

    Switch: 按照情况选择需要执行的活动

    Pick: 等待某些活动的完成

    Wait: 等待一定得时间

    While: 循环

    Assign: 复制的操作

     

    FLOW中可以定义一些links元素,用来作为导向的功能

    Link 使用连接两个活动的。

    活动中可以定义source 元素 或者target元素, source 元素内可以指明满足的条件,当满足条件时,就走到相应的target.

     

    Link 中的JoinFault的处理: 当所有导向摸个活动的links都为FALSE的时候,这个活动就应该被跳过,而且从这个活动导出的LINKS也应该被置为FALSE。这个处理可以通过BPELsuppressJoinFault=”yes” 和在相应的活动中加入 joinconditon来判断。

     

    FaultHandling:

    BPEL中的异常处理可以是全局的也可以是局部的,可以讲faulthanding加入到整个过程中或者加入到一个局部的scope中,一般的处理FAULT是当异常发生时,中止活动,并转向相应的FAULTHANDLER,这点于compensation handler不同,compensation handler是指当异常发生时,不仅活动会终止而且,之前所有的完成的工作都会被重置为最近的那个没活动发生的状态。

    关于工作流程

    关于workflow(工作流程)

     

    什么是工作流程?

    工作流就是一系列相互衔接、自动进行的业务活动或任务。 注意这里的业务活动都是自动的非人力的,在计算机领域也就是传说中的自动化过程。

    工作流的出现动力是因为,企业应用集成的发展需要将一系列的商业活动以自动化的,流线型的方式来执行,传统的点对点形式不能满足日益增加的商业过程中的应用和新技术的发展。所以工作流在应用集成方面是一个很好的工具。

     

    在当前,企业的应用集成一般是通过一个central bus来连接每个单个的应用,这里需要每个单个的应用有自己的接口,这个接口和WSDL有相似的含义。

    BUS上有很多不同的ADAPTOR,这些ADAPTORS 和每个单独应用的接口相连接,通过这个ADAPTOR可以把每个应用的数据映射为一个共同的模式,在BUS上还会有一个MESSAGE BROKER,这个东西是用来协调ADAPTOR之间的互动的。通过这样的方式,企业各系统之间的异种性就被隐藏了。

    所以设计一个EAI的平台关键的步骤就是设计ADAPTORMESSAGE BROKER

     

    综上所述,MESSAGE BROKER 隐藏了系统的异种性,而且工作流程则起到了应用集成和增加应用互动性的功能。所以这两个可以结合起来。也就是将工作流程和EAI平台两者相结合,这样既隐藏了系统的异种性,有起到了增加各应用之间互动的作用。工作流程也可以通过一个工作流程ADAPTOREAI平台相连接。这样工作流程管理系统就能和企业的其他应用相互互动。

     

    那么工作流程管理系统到底能干什么了?

    工作流程管理系统是一个软件平台,用来设计,发展,分析,和管理工作流程。

    工作流程管理系统就决定了自动化执行一个商业过程,这个商业过程什么时候执行,由谁来执行都能够由工作流程管理系统来自动决定。

     

    那么什么是商业过程?

    商业过程就是为了达到一个商业目标所需要执行的一系列商业活动的集合,比如发表一篇论坛就必须经过查询资料,开始写,教授审查,发表等等活动,每个活动的执行者和使用到的资源都不一样。

     

    工作流程是一个导向图,一般包括起始,结束,工作,和导向节点,每个节点的功能都不相同。

     

    工作流程的工作原理是,首先从工作流定义库中搜索工作节点,通过分析,将它们放到对应的资源队列中去(资源可以是人或者计算机)。

     

    BPM和工作流程相结合起来,就出现了一下几点部件

    1.       Task: 不能再细分的工作单位

    2.       Sequence 某些工作需要按一定顺序执行

    3.       Selection 基于默写情况来处理一定得工作

    4.       Parallel:   某些工作可能可以平行处理

    5.       Synchronization; 某些工作需要等待其他工作的完成才能进行

    6.       Iterator: 某些工作需要重复循环的处理

    BMP和工作流程的结合中:

    长方形代表单个的task, 圆圈代表一定join split操作, join and join or join,同样split and split or split.

     

    基于Petri Net 的工作流管理系统

    有两个重要部件,一个是places 存储了一系列的token,对象,比如说一个发送请求,一个客户的投诉等等。

    还有一个部件叫tansition,这个决定了之前token的走向,这种构造方式将一个商业过程模式化为了许多个不同的状态,比如说初始化的places 有三个客户投诉,流程图的构造是两个places 中间一个transition, 那么这个商业过程的初始状态就是(3,0),transition 将第一个places里面的一个投诉转移到第二个places里面后,状态就变为(2,1)了。

     

    判断一个transition是否激活的标准时在places里面至少有一个token.

    Token可以属于多个transition, work item 是属于transition 的,当时间到达,信息到达或者发生了一个事件,那么这个transition里面的workitem就被分配给某个资源来执行,这个时候称为fireing of transition, 当它处于fireing 的阶段时候,就被称为活动了。

     

    Petri Net中有几种split, or- split, or split 可以分为可以决定的和不可决定的两种,可以决定的是当满足某种情况的时候就进行工作,输出可以个多个,不可以决定的or split包括了可决定的情况,当preconditions重叠的时候就不可决定,反之和决定形的效果一样。

     

     

    关于REST

    关于Rest

    Rest 到底是个什么东西?

     

    Rest 就是一种联网系统的架构风格。比如说SOAP的网络服务的架构风格是服务定义特定的接口,客户通过接口可以了解服务能够干什么和怎么与服务进行互动。但是Rest 的服务与基于SOAP的服务不同,它没有像基于SOAP的那些服务那样有一个接口说明(也就是著名的WSDL)。

     

    对于REST而言,整个WEB世界是由许多资源所构成了,你要和一个网络服务互动,只能通过4个特定的服务接口模式:put, post, update and delete.这四个操作是基于REST架构的网络服务的标准活动。这些活动和servletdoget, dopost相似。

     

    如上所述。REST是将WEB上的东西定义为资源(resourse,那么所有与网络服务相关的就是对资源的获取操作等等了。每个基于REST 架构的服务都要给每个资源指定特定的URI,这个URI是非常重要的而且是极其方便简洁的。客户通过一个设计好的URI可以直接获取需要的资源。

     

    那么设计REST 架构的目的是什么? 很明显,使用REST架构就是为了很好的获取网络的资源。。。。

     

    资源到底是什么?

     

    资源就是一系列的操作和数据集合。

    REST 架构中,资源是通过一系列数据格式来代表的比如说:XML,JSON,TXT等等。

    比如客户要获取自己的账户信息,那么客户根据这个账户信息特定的URI,可以得到自己的资源。服务器端通过XML格式,或者JSON格式返回这个资源给客户。

     

     

    REST架构的服务的特点:

    1.       首先REST架构有两个方面:客户端和服务器端

    2.       统一的接口:put, post, update, delete

    3.       资源都是很好命名好的,而且是通过一个设计良好的URI来获取,资源之间也是通过URI来联系互动的。

     

    既然REST架构的服务的资源都是通过URI来引用的,那么必然导致一些复杂查询语句的产生。

    Rest架构的服务的数据代表格式有两个重要: XML JSON

    JSON其实也是基于XML的。

     

    那么设计一个REST架构的服务需要什么原则

    1.       主要的是对每一个资源定义一个有效的,命名规范的URI,不能使用动词,一定要用名词。

    2.       把资源分类,只能读的资源分为一类,不仅能读而且能写的资源分为另外一类。

    3.       所有的资源通过服务器返回的只是服务器资源的一个代表,读取资源不能对服务器的资源产生任何的影响。

    4.       通过URI来连接资源,同样资源之间的连接也是通过URI来联系的(超连接)

    5.       通过一个说明文件向客户阐述这个基于REST架构的服务是怎么操作的。这个说明文件是必须的但是这个说明文件和基于SOAP的服务的WSDL是不同的。

     

    既然你设计原则确定了,那么到底应该怎么建立一个REST 服务了?

    首先,编程语言是无关紧要的。其次,需要一个支持HTTP协议的服务器,因为REST架构的服务基本是基于HTTP的。第三,定义好REST架构服务的接口,也就是这个服务支持的一些方法: 比如说doget(), doPost(), doUpdate(), doDelete().这跟基于SOAP的服务不同,基于SOAP的服务将方法接口定义到WSDL里面,而REST 将方法接口说明放到一个说明文件里面。

    第四,在每个方法里面都要定义好特定的URI等等。最后,定义返回的资源以一种什么样的数据格式来返回给客户,比如是返回XML格式还是JSON格式,还是纯文本格式了。

     

     

    基于REST 架构的服务和XML-RPC服务,SOAP服务的不同:

    XML-RPC服务: 客户端发送一个请求,这里牵涉到一个xmlrpcclient对象和xmlrpcserver对象, xmlrpcclient可以远程对象xmlrpcserver. 在服务器端,xmlRpcServer接受客户请求并执行相应的操作。

    客户发送的请求是以XML格式传说过去的,服务器端返回的数据也是以XML格式传说过来的。这种服务凭借的协议是HTTP-POST,发送一个HTTP-Post 然后得到一个reply.

     

    基于SOAP的服务,是XML-RPC服务的进化版本,将数据封装到一个SOAP里面。。。。

    Rest SOAP

    REST:将WEB看成是一个有资源所组成的世界,仅仅基于HTTP协议。

    SOAP: WEB看成是一个互动的,每个应用通过信息传输所构成的世界。不仅仅是HTTP协议,可能还有其他协议。

     

    RESTSOAP服务在设计的不同:

    对于SOAP 需要定义一个接口说明(WSDL),数据类型,合适的传输协议,注册发布服务。

    对于REST 定义各种资源,使用很好的URI来指向这些资源,区分只读和读写的资源,定义资源之间的超连接,发布服务。

    REST SOAP各有个的好处。SOAP比较适合于B2Bbusiness to business)而REST比较适合于B2C。所以将两种构架结合起来是未来网络架构形式的一个趋向。

    关于UDDI

    UDDI: 存储了一些服务的接口说明文件,简单来讲就是存储了一些WSDL

    一个web service 要公布于世,就必须让自己在UDDI上注册,这样才能让客户来寻找和查询它的功能。

    一般的, 注册机包含了两个部分:

    1.       document-based: 存储WSDL的说明文件

    2.       meta-based: 只提取说明文件的精髓内容

     

    service provider, service registry, service requestor 之间的关系式:

    首要进行service discovery:

    Service discovery 分为静态和动态两个部分

    静态: design time, 由设计人员检测

    动态:   run time, 提供preferences, 选择合适的服务。

     

    一个最基本的流程是:

    N个服务提供者发布服务在UDDI 然后一个服务请求者发送一个查询请求(SOAP),然后这个请求者会得到很多满足要求的服务列表,然后选择一个好的服务,再发送一个请求,然后UDDI可以把这个最好的服务的WSDL发给请求者,接下来,这个请求者就可以通过这个WSDL建立PROXY来利用所选择的服务。

     

    UDDI的具体结构是如何的?

    UDDI的结构和通常的电话本很相似:

    包括:

    1.       white page: 服务提供者的联系信息

    2.       Green page: 也就是服务的porttypes

    3.       Yellow page: 关于上面的说明信息。

     

    在技术上称为:

    1.       Business Entity: 记录了服务提供者的信息

    2.       Business Service: 包含了一些列的binding template

    3.       Binding template: 指向一系列的tMODE

    4.       Tmode: 指向WSDL的实际网络地址(port) porttype

     

    UDDI能够有效的进行服务的生命周期管理: 一个服务换了地方或者换了其他什么东西

    UDDI 充当了一个中间者对于服务的改变,而且保持了服务的更新

    比如如果之前的服务出了错误,可以再次访问UDDI,更新新的服务WSDL

     

    关于SOAP

    什么是SOAP?

    SOAP就是网络上传说数据的一个协议(简单来讲)。

    SOAP定义了服务传输的数据格式,一个显著的特点是SOAP是基于XML语言的。

    它包括了四个元素:

    1.        Envelope element: 指出了这个信息是SOAP格式的。

    2.        Header element: 定义了一些格外的关于这个SOAP信息的应用信息

    3.        Body element: 这里就是数据坐落的地方,也就是客户的请求信息和服务的返回信息

    4.        Fault element: 指出了服务操作过程中产生的一些错误信息,和程序中的异常相似。

    对于header element, 它有三个属性:

    1.       Role: none(SOAP处理器不会处理这个header), next(下一个), ultimaterReceiver(最终的节点)

    2.       Mustunderstand: 中间的处理器必须正确的处理这个信息,否则就返回错误信息。

    3.       encodeingStyle: 表示这个header 的内容是怎么编码的,这个可以告诉处理器如何解码内容。

    Fault 元素是在处于body 元素之内的,它有许多属性:code, reason, Node, detail

    Code: 值叫value, 表明出错的位置

    Reason: 表明出错的原因

    Detail: 如果错误是出现在最后的节点,那么可以使用这个属性。

    SOAP ENCODEING 指示了特定的元素是怎么编码的。比如说XML的格式是多样化得,对于计算程序,不同的XML格式可能产生不同的结果。所以encodingStyle就定义了特定元素的XML 格式。

     

    关于SOAP有两个重要的区分对于SOAP-RPC SOAP-DOCUMENT

    SOAP-RPC body元素里面,方法和参数的个数是严格定义的,首先是方法名字,接下来是方法的参数。这样的方式可以让XML里面的东西直接映射为一个对象。

    SOAP-DOCUMENT body 元素里面,所有的方法和参数都直接是body的字节点。就是把所有需要的数据封装起来发送给服务。在encodingStyle里面指明特定的语义机构这样服务就可以理解和懂得这个SOAP结构。这种模式可能需要花费一点时间来让服务端理解和懂得结构。

     

    所以常用的组合式SOAP-RPC-encoded SOAP-DOCUMENT-literal

     

    在数据传说的协议定义之后,那么接下来就是服务的接口定义

    服务的接口定义描述: WSDL

    描述了一个服务可以实现的功能和需要的参数,但是它并没有指明服务的功能函数执行的顺序。

    客户可以根据特定WSDL产生一个proxy, 利用这个可以连接远程的服务。

    WSDL 分为两个部分: 服务接口定义部分(定义这个服务可以提供的功能,参数和抽象数据类型)和服务实现部分(将服务的接口绑定一个特定的物理网络地址,实际的数据等等)

     

    服务接口定义部分(service-interface definition:

    Types: 定义数据类型

    Messages: 定义功能需要用到的参数

    Operation: 定义了功能

    Porttype: 包含了operaton message, 同时message 可能用到types里面定义的数据类型。

     

    服务实现部分:

    Binding: 将接口绑定到一个实际的功能,详细阐述功能和功能参数的细节。也就是implements了接口部分定义的porttype. 同时它还定义了信息的编码格式和协议细节,比如这个信息是以SOAP协议来传输的等等。

    Service: 提供服务一个实际的物理地址,可以让客户来获取。

     

    如前面所述,构成webservice 需要三个标准: SOAP, WSDL, UDDI

    关于webservice的小部分总结

    关于WebService 的总结:

    首先 WebService 是企业应用集成的一个体现, 那么什么是企业应用集成了

    对于传统的企业,在内部多半应用点对点的交流方式, 这种点对点交流方式最大的缺点是随着服务和应用的增加, 交流连也随之增加, 对于N各应用,就需要N(N-1)/2 个交流链。

    为了适应服务和应用,以及和客户之间联系的促进, 现代的企业应用集成正满足了这个需要。

    那么到底什么企业应用集成:

    企业应用集成就是把企业的硬件,软件,业务流程等等联合起来,实现企业间的无缝连接, 使得它们像一个整体一样分享业务信息和业务流程。用来满足那些传统的点对点模式所不能满足的逐渐增加的服务需要。

    一个应用集成包括: 内容获取, 集成的应用之间的数据内容需采用一定得语句或者语义比如XML。信息流: 集成应用之间的信息传输,传输方式等等。内部和外部商业过程的集成。还有安全性的问题。

     

    应用集成包括了哪几个层:

    首先是商业处理层(business process layer:这个层主要定义了企业必须懂得企业之间商业过程的流程。企业之间必须对他们之间的商业活动达成一定得共识。比如说企业A和企业B必须对他们之间的购买商品的顺序 商品的发货方式达成一定得共识。而且对于完成这个商品交易的过程都必须对AB 是透明的。双方必须都懂得。

    这也就是服务的接口描述,每个服务都必须有一个明确清晰的接口描述(WSDL

     

    其次是内容层(content layer):企业必须懂得和理解需要购买的产品,订单的创造就是在这个层产生的。

     

    最后是数据交流层(communication layer): 在集成应用中,必须有一个统一的方法来传输各个应用之间的信息和数据。比如说WEBSERIVCE是用SOAP来实现信息和数据的传输的。

     

    那么企业的应用集成到底包括了那些了:

    1.       用户界面集成: 提供一个集成的企业门户,比如说企业的浏览器

    2.       数据集成: 集成应用将异种的和不同应用的数据集成一个整体的数据模式。

               代表性的实现方法是:EII(企业信息集成)

    3.       应用集成: EAIworkflow, SOA

    Composite application: 将当个的应用集成在一起(mash-up)不仅集成了商业逻辑层,而且将presentation layer 也集成在一起

     

    既然WebService 是企业应用集成和SOA构架的一个实现,那么

    什么是WebService?

     

    定义1 WebService 就是一个能够由特定的URI所表示的软件应用,这个软件应用有一个明确的接口说明,在说明里面描述这个Webserivce 所具有的功能和参数。 这个软件应用通过基于XML的传输协议来传输数据。

     

    定义2 WebService 是一个软件系统,用来支持网络上的相互的机器对机器的互动。 它具有一个机器能处理的接口说明,定义了功能和参数, 并且以XML 来传输数据。这样基于不同编程语言或者平台的应用程序都可以调用这个软件系统。

     

     

    在面向对象的角度, WebService就是一个远程的对象,那么要调用这个服务就必须有一种调用远程对象的机制。传统的RPC就是一个调用远程对象的机制,它能让本地来调用远程的方法, 但是RPC 是基于过程语言的仅仅支持同步的交流而且不是面向对象和没有接口的概念。微软的COM,DCOM实现了对象的调用,但是它们有一定规则需要遵守。

     

    目前比较流行的是JAVA RMI,基于JAVA 语言的远程对象调用机制。

     

    综上所述,尽管有很多这样的远程对象调用机制,但是这些调用机制都必须满足下面的三个条件:

    1.  Directory Services: 也就是定位远程对象。

    2.  Interface Definition: 远程对象的接口定义, 使得客户的应用程序知道怎么调用它

    3.  Communicaton: 必须定义个数据交流的格式而且这个数据交流应该是对于客户不可见的,隐藏的。

     

    Webservice 有三个标准: UDDI(服务查询) WSDL(服务接口说明),SOAP(服务数据传输协议)

     

    同样webService 有三个roles:

    1.       Service provider: 这里必须有一个服务的提供者

    2.       Service registry: 必须有一个像电话本一样的机制来存储各种服务的接口说明

    3.       Service requestor: 这里必须有个服务的请求者,也就是客户。

     

    WebService 中充当数据传输任务的是一个叫SOAP的传输协议,是由微软发明的

    December 06

    休息了整整3个星期

    整整休息了3个星期
    October 07

    Install Mplayer and win32codecs

    You need to add the following lines to /etc/apt/sources.list file or you need to make sure you have enabled Universe and multiverse repositories in /etc/apt/sources.list file

    sudo gedit /etc/apt/sources.list

    Make sure you have the following two lines save and exit your file

    deb http://archive.ubuntu.com/ubuntu hardy universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu hardy universe multiverse

    Now you need to run the following command to update the source list

    sudo apt-get update

    Install mplayer using the following command

    sudo apt-get install mplayer

    if you want to open mplayer just type

    gmplayer

    or

    You can Open from Applications—>Sound&Video—> Mplayer Movie Player

    Install libdvdcss2 and w32 video codecs in Ubuntu 8.04 (Hardy Heron)

    Support for WMV, RealMedia and other formats has been bundled into the w32codecs package. This package is not available from the Ubuntu repositories due to licensing and legal restrictions.

    For Ubuntu 8.04 (Hardy Heron) Users run the following command

    sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list

    Then, add the GPG Key using the following commands

    sudo apt-get update

    sudo apt-get install medibuntu-keyring

    sudo apt-get update

    For i386 Users install Codecs using the following command

    sudo apt-get install w32codecs libdvdcss2

    For amd64 Users install Codecs using the following command

    sudo apt-get install w64codecs libdvdcss2

    Using above download locations you can install most of the mutimedia codecs for ubuntu.

    Mplayer Plugin for Firefox

    If you want to install Mplayer with plug-in for Mozilla Firefox run the following command

    sudo apt-get install mozilla-mplayer

    September 26

    to my dear brother

    zhuangBDear brother already leaved one day, watched the old photoes, all the memory with him comes back.

    2006meet2006, when we meet in sydney, we just become good friends without no reasons.

    IMG_0932When we live together, we had hot pot every week. the live is good with you. all people are happy..haha

    IMG_0779Dear brother, still remember the olympic..?

    IMG_0690IMG_0774look what we did for our county...

    IMG_0621看看你在直升机上的样子。。。

    IMG_0942一个优秀的律师同时也是一个优秀的吉他手

    The highest buding in aus当我们站在南半球最高的大楼上。。。你不敢往下望。。。。。

    IMG_0854IMG_0858IMG_0876IMG_0881IMG_0891IMG_09302008, 你毕业了

    IMG_0589兄弟,你离开了,我永远怀念你。。

     

    September 17

    因为思念,所以寂寞

    吸进的是烟,吐出的确是寂寞,又是一个不眠之夜。
    September 11

    一颗不平常的心

    总是有一颗不平常的心,总是希望做些不平常的事,
    一个男人要走多远的路才会被称为一个男人,
    我想,这个答案,将随风飘荡。
    September 09

    Blowin in the Wind

    How many roads must a man walk down

    Before you call him a man?
    How many seas must a white dove sail

    Before she sleeps in the sand?

    How many times must the cannon balls fly

    Before they\'re forever banned?
    The answer, my friend, is blowin\' in the wind,
    The answer is blowin\' in the wind.
    How many years can a mountain exist
    Before it\'s washed to the sea?

    How many years can some people exist

    Before they\'re allowed to be free?

    And how many times can a man turn his head,

    And pretending he just doesn\'t see?

    The answer, my friend, is blowin\' in the wind,
    The answer is blowin\' in the wind.

    How many times must a man look up

    Before he can see the sky?

    How many ears must one person have

    Before he can hear people cry?

    And how many deaths will it take till he knows

    That too many people have died?

    The answer, my friend, is blowin\' in the wind,
    The answer is blowin\' in the wind.

    OH,the answer, my friend, is blowin\' in the wind,

    The answer is blowin\' in the wind.

    September 08

    考试结束

    今天考完了一门。。。。没啥感觉,整个人昏昏沉沉的。。。题目一个不会做

    Project management

    The  Project management has been widly used in every companies. Learning project management must be step by step. from the beginning to
    the end. The following categories are the simple conclusion according to each categries :
    Introduction
    why project mangement is needed?
    there are three main reasons regarding this quesition.
    first of all, the growing demand for complex, customized goods and services.
    secondly, the exponential expansion of human knowledge
    thirdly, the global production consumption environment and the competitive market
    What are the main objectives of project managment?
    the main objective of project management is to achieve the company's goal and climent's goal.
    three general objectives are : performance , time and cost;
    The life cycle of project managment usually start slow and then reach the peak then termaination.
    project management is unique and is different from routine work.
    During the life cycle, the performanc and schedule is more important than the cost.
    there is another kind of objective: the expectation of customers.
     
    How to choosing project?
    most likely, in most companies, there are lots of projects available, however , selecting the best project to implement is not simple.
    the project selected must help achieve the organizaiton's goals and strategy.
    First of all, the goals of comanpy must be identified. And based on the goals, the criterias can be set, the project select models based on
    the criterias can be built.
    Project selection models can be divided into numeri and non-numeric models
    non-numeric modle: the scared cow: all depened on the boss
                                  the operating necesity: must do
                                  the cometitive necesity
                                  the comparative necesity: good, fair, poor, similar to the binary search in computer algorithm
    numeric modle:       NPV = Ao + sumof each(Ft / Math.pow((1+r+c),t)
     
                                  weighted factor scoring model: Si = sum of Sij * Wo
     
    The eight-step project portfolio process is an effective way to select and manage projects that are tied to the organization's goals.
    step one: Establishing a project council : all person involved in project and can be helpful for this projects
    step two: Indentifing project categories and criteria : achieve the goal of company
    step three:Collecting project Data : many kinds of data collecting methods
    step four: Assessing Resource availablity : limited resourses
    step five: Reducing the project and criteria set :
    step six: Prioritizing the projects within categories
    step seven: Selecting the projects to be funded and held in reserve
    step eight : Implementing the process
    ////   NOV 11 , 08 
    when the project has been selected , the following thing need to do is to select the project manager.
    project manager is different from functional manager who is the header of one specific department.
    PM is a generalist rather than a specialist, a synthesizer rather than an analyst, and a facilitator rather than
    a supervisor.
    what is the requirements of project team memebers?
     High-quality technical skills.
     Political sensitivity.
     Strong problem orientation
     High self-esteem.
     
    Organizational structure
    functionl project organization, pure project organization and matrix organization
    selecting an appropriate organization form:
    1.Indentifying the specific outcomes desired.
    2.Determine the key tasks to attain these outcomes and identify the units within the parent organization where these tasks would
       normally be assigned
    3.Sequence the key tasks the group them into logical work steps
    4.Determine which project subsystems will be assigned which steps and which subsystems must closely cooperate
    5. Identifying any special firm or project characteristers, constrains, or problems that may affect how the project should be organized
    6. consider all the above relative to the pros and cons of each organizational form as a final decision is made.
     
    project engineer and project controller should report directly to project manager.
     
    August 31

    set chinese input method

    To install Chinese input fcitx

    Type apt-get update and press Enter key

    Type apt-get install fcitx and press Enter key (it may take a while to finish, be patient)

    After finished, type cd /etc/X11/Xsession.d and press Enter key to get into this directory

     Create a new file called 95xinput, add the following contents into file:(sudo kate 95xinput)

    export XMODIFIERS=@im=fcitx ;

    export GTK_IM_MODULE=fcitx ;

    fcitx

     Save the file and exit the edit mode.

    Type chmod 755 95xinput and press Enter key

    Type reboot and press Enter key to restart the pc Login into X window and open a text editor or openoffice , press ctrl-space to active Chinese input.

    You can start to input in Chinese now.

    The method can be used in english locale;

    August 02

    枭雄-顶级教父-杜月笙先生

    枭雄-顶级教父-杜月笙先生
    杜月生
    Du Yuesheng, commonly known as "Big-Eared Du", (1887-1951) was a gangster who spent most of his life in Shanghai, China. He involved his gang in the conflict between the Communists and Nationalists, eventually going into exile in Hong Kong prior to his death in 1951.
    He joined the Green Gang, the most powerful secret society in Shanghai, and eventually make his way to the top as the ringleader of the gang. He orchestrated his rise to power after the arrest of his predecessor, Huang Jinrong, by the Shanghai Garrison command.
    He soon became known as the "Jung Shi" or "Boss of the Underworld."
    Under Du's leadership, the gang controlled gambling dens, prostitution, and protection rackets. They also were a leading opium trading group (opium dealing had been a profitable business since the British introduced it to the China in the 1830s).
    Chiang Kai-shek allied with Du and the Green Gang against the communists and pro-communist unions in Shanghai. The resulting massacre, known as the 1927 Shanghai Purge, ended the First United Front. As a reward for his service, Chiang appointed him to the Board of Opium Suppression Bureau.
    Du also supported the Nationalist government with funding. In return, he was allowed to run labor unions and continue with his drug-dealing business. Due to the division in China during the Warlord era, the government of Chiang Kai-shek only nominally controlled most of China, and Chiang had to rely on the local gangs such as that of Du to have any actual and effective control. When the Nationalists declared war on Japan in 1937, Du, smuggled supplies from occupied Chinese territory.
    The relationship between Chiang and Du soured after World War II. The corruption and crimes committed by Du's associates (including his own relatives) were causing great problems for the Kuomintang. When Chiang Kai-shek's son, Chiang Ching-kuo, launched his anti-corruption campaign in Shanghai in the late 1940s, Du's relatives among the first to be jailed. Although Du had successfully managed their release by threatening to expose Chiang's own relatives' crimes which were much more serious, the jailing of Du's relatives effectively end the honeymoon between Chiang and Du.
    When Chiang's Nationalist government fled to Taiwan in 1949, Du refused to follow the nationalists and escaped to Hong Kong because he still doubted the communists would forgive him for what he did in 1927. After liberation, Du was convinced that it was safe to return to China. However, before he undertook his return trip, Du died in 1951 due to illness.
    The movie "Shang-Hai huang di-zhi" was very loosely based on his life.
     
    July 29

    今天又一个语言学校的朋友回国了,晚上一起坐在我们小小的房间畅谈了很久,
    理想,人生,女人,带着一点伤感,一个一个的朋友都远离而去,天下到底有没有永远都不会散的筵席了?
    今天我们说到了桥,朋友说人生就是在建一座一座的桥,你有了新朋友,你就有了一座桥,哪怕是你现在不会从桥
    上经过,但是重要的是,桥建好了你必须去维护它,乃至5年,10年,20年的维护,因为在你的一生中,说不定哪天
    你就要从这座桥上经过了。不去维护的桥随着岁月的流失,总有崩裂的一天,就像朋友,许久不联系的朋友也会疏远,乃至最后
    也就是一声轻轻的你好而过。
    我们每个人都应该好好珍惜身边的每一个朋友。。。。。