2010年4月28日

程序员们纷纷表示“内牛满面”-VS2010视频共5季

程序员们纷纷表示“内牛满面”-VS2010视频共5季

更新:本系列广告一共5季

 

 

  最新的Visual Studio 2010 的电视广告中,一个程序员的女友作为了第一人称主角。当你陷入编码的喜怒哀乐的时候,有个小女生在你身边做偎人小鸟,没有唧唧喳喳,只有柔情无尽……来看一下Visual Studio 2010的最新电视广告连续剧,一共5季,分别为:《想做你的Code》、《让爱延长》、《幸福也要敏捷》、《为爱Debug》、《让爱编译通过》,温情+甜蜜+煽情三重渗透,程序员们必然不敌缴械...

 

第一季:《想做你的Code》

 

弹出

  十点了,不知道你的Code写到了哪一行,从未想过,这些符号能让一个人如此着迷。

  兴奋、高兴、沉默、忧虑。

  写Code是他的快乐;看他写Code成了我的快乐。喜欢他的认真,却不想他总给自己找压力。

  现在,你是不是又在跟Code较劲啊?如果可能,我来做你的下一行Code 好不好?

  程序员如果是个工作狂,能找到这样贴的女朋友,那真的是N辈子修来的福气啊~~ 如果变成了老婆,那就N^N辈子修来的福气~= =群众纷纷表示很真很实,并且这也是程序员,尤其是中国程序员普遍存在的问题。

 

第二季:《让爱延长》

 

弹出

  幸福能run多久?有时候一分钟就够!

  今天跟你通了3个电话,一共是1分21秒,每个电话平均27秒。

  女人在乎尺码,你在乎你的代码。聊我们的未来,三句话你就可以聊到技术的未来。

  我们的短信,还能再短些吗?一分钟的幸福,似乎离我越来越远。

  如果我们的谈话不象C++那们简短,我想我的幸福会更长。

  =。=程序员总是会有一些异于常人的习惯。且不说是陋习,至少很无奈。另见过程序员有这么漂亮的女朋友的请举手,举脚也行。= =算了。

 

第三季:《幸福也要敏捷》

 

弹出

  约好的幸福,为什么总要一等再等?

  今天你说,要带我去北海看银色的沙子。诶,我可记好了哦。

  想吃啊?有时间我带你去啊。

  看起来不错诶。等不忙的时候带你去看。——真的?太好了。

  好美啊,等把这个项目做完咱俩一块去。

  喂,今天是什么日子啊?——等等,让我想一想啊。

  我要的幸福,你能快点响应吗?

  更多敏捷特性,更多响应爱的需要。

  当这份爱出现了缝隙,他该怎么办。

 

 第四季:《为爱Debug》

 

弹出

 

 

 第五季:《让爱编译通过》

 

 

  这份爱能否编译通过?

  妈妈说:你什么都好,就不该是个程序员...你说我该怎么办呢?

  妈妈说:你太颓废。 我说:颓废给我安全感。

  妈妈说:你就知道工作。 我说:总比工作不努力好啊。

  妈妈说:你是经济适用男。 我说:经济只是暂时的,适用总有一天变受用。

  她问我真的想好的了吗。 我说:不是每个爱都能编译通过的,我想我就是那个幸运儿。

如果,你也是个程序员,你可能会无限的遐想……

如果,你是个程序员的女友或者老婆,算了,放弃这个可能性吧,咱如狼似虎啊。噢是吗?可能吧。想象无限美好,现实一样糟糕。

http://anforen.5d6d.com/

posted @ 2010-04-28 14:17 Free Programmer 阅读(1779) 评论(3) 编辑

powerdesigner的一些技巧

powerdesigner的一些技巧

http://anforen.5d6d.com/

先说下自己的发现: 

刚用powerdesigner有许多基本使用上的问题, 比如表和字段长度不能稍微长点, 导出时候报warning说表没有index或没有被引用。 后来发现这些都是check model在起作用, 调整一下check model对各种对象的check 规则就能解决以上问题, 比如关闭长度的检查,去掉对表index和引用的warn级别检查(warn只会提示一下, error的就会判定为check失败)。 

关闭check model又是过于极端的做法, 不太合适, 自己检查还是不如机器检查来的快和全面。 



sql语句中表名与字段名前的引号去除: 


打开cdm的情况下,进入Tools-Model Options-Naming Convention,把Name和Code的标签的Charcter case选项设置成Uppercase或者Lowercase,只要不是Mixed Case就行! 

或者选择Database->Edit current database->Script->Sql->Format,有一项CaseSensitivityUsingQuote,它的 comment为“Determines if the case sensitivity for identifiers is managed using double quotes”,表示是否适用双引号来规定标识符的大小写,可以看到右边的values默认值为“YES”,改为“No”即可! 

或者在打开pdm的情况下,进入Tools-Model Options-Naming Convention,把Name和Code的标签的Charcter case选项设置成Uppercase就可以! 


在修改name的时候,code的值将跟着变动,很不方便 


修改方法:PowerDesign中的选项菜单里修改,在[Tool]-->[General Options]->[Dialog]->[Operating modes]->[Name to Code mirroring],这里默认是让名称和代码同步,将前面的复选框去掉就行了。 




由pdm生成建表脚本时,字段超过15字符就发生错误(oracle) 


  原因未知,解决办法是打开PDM后,会出现Database的菜单栏,进入Database - Edit Current DBMS -script-objects-column-maxlen,把value值调大(原为30),比如改成60。出现表或者其它对象的长度也有这种错误的话都可以选择对应的objects照此种方法更改! 

或者使用下面的这种方法: 

     生成建表脚本时会弹出Database generation提示框:把options - check model的小勾给去掉,就是不进行检查(不推荐)! 

    或者可以修改C:\Program Files\Sybase\PowerDesigner Trial 11\Resource Files\DBMS\oracl9i2.xdb文件 

     修改好后,再cdm转为pdm时,选择“Copy the DBMS definition in model”把把这个资源文件拷贝到模型中。 




由CDM生成PDM时,自动生成的外键的重命名 


PDM Generation Options->Detail->FK index names默认是%REFR%_FK,改为FK_%REFRCODE%,其中%REFRCODE%指的就是CDM中Relationship的code!另外自动生成的父字段的规则是PDM Generation Options->Detail->FK column name template中设置的,默认是%.3:PARENT%_%COLUMN%,可以改为Par%COLUMN%表示是父字段! 




建立一个表后,为何检测出现Existence of index的警告 

    A table should contain at least one column, one index, one key, and one reference. 

可以不检查 Existence of index 这项,也就没有这个警告错误了! 

意思是说没有给表建立索引,而一个表一般至少要有一个索引,这是一个警告,不用管也没有关系! 




如何防止一对一的关系生成两个引用(外键) 

要定义关系的支配方向,占支配地位的实体(有D标志)变为父表。 

在cdm中双击一对一关系->Detail->Dominant role选择支配关系 




修改报表模板中一些术语的定义 

即文件:C:\Program Files\Sybase\PowerDesigner Trial 11\Resource Files\Report Languages\Chinese.xrl 

Tools-Resources-Report Languages-选择Chinese-单击Properties或双击目标 

修改某些对象的名称:Object Attributes\Physical Data Model\Column\ 

        ForeignKey:外键 

        Mandatory:为空 

        Primary:主键 

        Table:表 

用查找替换,把“表格”替换成“表” 

修改显示的内容为别的:Values Mapping\Lists\Standard,添加TRUE的转化列为是,FALSE的转化列为空 

另外Report-Title Page里可以设置标题信息 




PowerDesigner11中批量根据对象的name生成comment的脚本 


'****************************************************************************** 

'* File:     name2comment.vbs 

'* Purpose:  Database generation cannot use object names anymore 

'            in version 7 and above. 

'            It always uses the object codes. 

'            In case the object codes are not aligned with your 

'            object names in your model, this script will copy 

'            the object Name onto the object comment for 

'            the Tables and Columns. 

'* Title:    把对象name拷入comment属性中 

'* Version:  1.0 

'* Author: 

'* 执行方法:PD11 -- Open PDM -- Tools --  Execute Commands -- Run Script 

'****************************************************************************** 


Option Explicit 

ValidationMode = True 

InteractiveMode = im_Batch 


Dim mdl ' the current model 


' get the current active model 

Set mdl = ActiveModel 

If (mdl Is Nothing) Then 

   MsgBox "There is no current Model" 

ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then 

   MsgBox "The current model is not an Physical Data model." 

Else 

   ProcessFolder mdl 

End If 


' This routine copy name into code for each table, each column and each view 

' of the current folder 

Private sub ProcessFolder(folder) 

   Dim Tab 'running  table 

   for each Tab in folder.tables 

      if not tab.isShortcut then 

         tab.comment = tab.name 

         Dim col ' running column 

         for each col in tab.columns 

            col.comment= col.name 

         next 

      end if 

   next 


   Dim view 'running view 

   for each view in folder.Views 

      if not view.isShortcut then 

         view.comment = view.name 

      end if 

   next 


   ' go into the sub-packages 

   Dim f ' running folder 

   For Each f In folder.Packages 

      if not f.IsShortcut then 

         ProcessFolder f 

      end if 

   Next 

end sub 




PowerDesigner 生成SQL的Existence of refernce错误问题 

现象:用PowerDesigner生成SQL语句时,提示Existence of refernce错误。 

原因:该表没有与其他表的关联(如外键等),而PowerDesigner需要存在一个refernce才能生成SQL. 

解决方法: 

    在工具栏空白处右键打开Palette面板,选中Link/Extended Dependency 按钮,然后在提示出错的表上添加到自己的Dependency。 

    重新生成SQL,你将发现刚才提示的错误没有了,问题解决。 

 

利用PowerDesigner批量生成测试数据 

主要解决方法: 

A:在PowerDesigner 建表 

B:然后给每一个表的字段建立相应的摘要文件 

步骤如下: 

Model->Test Data Profiles配置每一个字段摘要文件General:输入Name、Code、 

选择Class(数字、字符、时间)类型 

选择Generation Source: Automatic、List、ODBC、File Detail:配置字段相关信息 

所有字段摘要文件配置完成后双击该表->选择字段->Detail->选择Test Data Parameters 摘要文件如果字段值与其它字段有关系在: Computed Expression 中输入计算列--生成测试数据: 

DataBase->Generation Test Data-> 

选择:Genration 类型(Sript、ODBC) 

     Selection(选择要生成的表) 

     Test Data Genration(Default number of rows 生成记录行数)

http://anforen.5d6d.com/

posted @ 2010-04-28 11:12 Free Programmer 阅读(175) 评论(0) 编辑

美国总统奥巴马悼念死亡矿工的讲话

美国总统奥巴马悼念死亡矿工的讲话

   We’re here to memorialize 29 Americans:  Carl Acord.  Jason Atkins.  Christopher Bell.  Gregory Steven Brock.  Kenneth Allan Chapman.  Robert Clark.  Charles Timothy Davis.  Cory Davis.  Michael Lee Elswick.  William I. Griffith.  Steven Harrah.  Edward Dean Jones.  Richard K. Lane.   William Roosevelt Lynch.  Nicholas Darrell McCroskey.  Joe Marcum.  Ronald Lee Maynor.   James E. Mooney.  Adam Keith Morgan.  Rex L. Mullins.  Joshua S. Napper.  Howard D. Payne.  Dillard Earl Persinger.  Joel R. Price.  Deward Scott.  Gary Quarles.  Grover Dale Skeens.  Benny Willingham.  And Ricky Workman.

“我们在这里,怀念29位美国人:卡尔·阿克德、杰森·阿金斯、克里斯多佛·贝尔、格利高里·史蒂夫·布洛克、肯尼斯·艾伦·查普曼、罗伯特·克拉克、查尔斯·蒂莫西·戴维斯、克里·戴维斯、迈克尔·李·埃尔斯维克、威廉·I.格里菲斯、史蒂芬·哈拉、爱德华·迪恩·琼斯、理查德·K.雷恩、威廉姆·罗斯威尔特·林奇、尼古拉斯·达利尔·麦考斯基、乔·马克姆、罗纳德·李·梅尔、詹姆斯·E.姆尼、亚当·基斯·摩根、雷克斯·L.姆林斯、乔什·S.纳皮尔、霍华德·D.佩恩、迪拉德·厄尔·波辛格、乔尔·R.普莱斯、迪华德·斯科特、加里·考拉斯、格罗佛·戴尔·斯金斯、本尼·威灵汉姆以及里奇·沃克曼。”

Nothing I, or the Vice President, or the Governor, none of the speakers here today, nothing we say can fill the hole they leave in your hearts, or the absence that they leave in your lives.  If any comfort can be found, it can, perhaps, be found by seeking the face of God -- (applause) -- who quiets our troubled minds, a God who mends our broken hearts, a God who eases our mourning souls.

无论我、副总统、州长,或是今天致悼词的任何一个人,都不能说出任何话语,可以填补你们因痛失亲人心中的创伤。如果有任何可以找得到的安慰,也许只能从上帝那里寻找得到,上帝安慰我们痛苦的头脑,修复破碎的心灵,减轻我们哀痛的内心。

Even as we mourn 29 lives lost, we also remember 29 lives lived.  Up at 4:30 a.m., 5:00 in the morning at the latest, they began their day, as they worked, in darkness.  In coveralls and hard-toe boots, a hardhat over their heads, they would sit quietly for their hour-long journey, five miles into a mountain, the only light the lamp on their caps, or the glow from the mantrip they rode in.

Day after day, they would burrow into the coal, the fruits of their labor, what so often we take for granted:  the electricity that lights up a convention center; that lights up our church or our home, our school, our office; the energy that powers our country; the energy that powers the world.  (Applause.)

尽管我们在哀悼这29条逝去的生命,我们同样也要纪念这29条曾活在世间的生命。凌晨4点半起床,最迟5点,他们就开始一天的生活,他们在黑暗中工作。穿着工作服和硬头靴,头戴安全帽,静坐着开始一小时的征程,去到五英里远的矿井,唯一的灯光是从他们头戴的安全帽上发出的,或是进入时矿山沿途的光线。

日复一日,他们挖掘煤炭,这也是他们劳动的果实,我们对此却不以为然:这照亮一个会议中心的电能;点亮我们教堂或家园、学校、办公室的灯光;让我们国家运转的能源;让世界维持的能源。

And most days they’d emerge from the dark mine, squinting at the light.  Most days, they’d emerge, sweaty and dirty and dusted from coal.  Most days, they’d come home.  But not that day.

These men -– these husbands, fathers, grandfathers, brothers sons, uncles, nephews -– they did not take on their job unaware of the perils.  Some of them had already been injured; some of them had seen a friend get hurt.  So they understood there were risks.  And their families did, too.  They knew their kids would say a prayer at night before they left.  They knew their wives would wait for a call when their shift ended saying everything was okay.  They knew their parents felt a pang of fear every time a breaking news alert came on, or the radio cut in.

But they left for the mines anyway -– some, having waited all their lives to be miners; having longed to follow in the footsteps of their fathers and their grandfathers.  And yet, none of them did it for themselves alone.

大多时候,他们从黑暗的矿里探出头,眯眼盯着光亮。大多时候,他们从矿里探出身,满是汗水和尘垢。大多时候,他们能够回家。但不是那天。

这些人,这些丈夫、父亲、祖父、弟兄、儿子、叔父、侄子,他们从事这份工作时,并没有忽视其中的风险。他们中的一些已经负伤,一些人眼见朋友受伤。所以,他们知道有风险。他们的家人也知道。他们知道,在自己去矿上之前,孩子会在夜晚祈祷。他们知道妻子在焦急等待自己的电话,通报今天的任务完成,一切安好。他们知道,每有紧急新闻播出,或是广播被突然切断,他们的父母会感到莫大的恐惧。

但他们还是离开家园,来到矿里。一些人毕生期盼成为矿工;他们期待步入父辈走过的道路。然而,他们并不是为自己做出的选择。

All that hard work, all that hardship, all the time spent underground, it was all for the families.  It was all for you.  For a car in the driveway, a roof overhead.  For a chance to give their kids opportunities that they would never know, and enjoy retirement with their spouses.  It was all in the hopes of something better.  And so these miners lived -– as they died -– in pursuit of the American Dream.

这艰险的工作,其中巨大的艰辛,在地下度过的时光,都为了家人。都是为了你们;也为了在路上行进中的汽车,为了头顶上天花板的灯光;为了能给孩子的未来一个机会,日后享受与伴侣的退休生活。这都是期冀能有更好的生活。所以,这些矿工的生活就是追寻美国梦,他们也因此丧命。

There, in the mines, for their families, they became a family themselves -– sharing birthdays, relaxing together, watching Mountaineers football or basketball together, spending days off together, hunting or fishing.  They may not have always loved what they did, said a sister, but they loved doing it together.  They loved doing it as a family.  They loved doing it as a community.

That’s a spirit that’s reflected in a song that almost every American knows.  But it’s a song most people, I think, would be surprised was actually written by a coal miner’s son about this town, Beckley, about the people of West Virginia.  It’s the song, Lean on Me -– an anthem of friendship, but also an anthem of community, of coming together.

在矿里,为了他们的家人,他们自己组成了家庭:庆祝彼此的生日,一同休憩,一同看橄榄球或篮球,一同消磨时间,打猎或是钓鱼。他们可能不总是喜欢这些事情,但他们喜欢一起去完成。他们喜欢像一个家庭那样去做这些事。他们喜欢像一个社区一样去做这些事。

这也是美国人熟知的一首歌里表达的精神。我想,让大多数人惊讶的是这首歌实际是一名矿工的儿子所写,关于贝克利这个小镇的,关于西弗吉尼亚人民的。这首歌曲,“靠着我”(Lean on Me)是关于友谊的赞歌,但也是关于社区关于一同相聚的赞歌。

That community was revealed for all to see in the minutes, and hours, and days after the tragedy.  Rescuers, risking their own safety, scouring narrow tunnels saturated with methane and carbon monoxide, hoping against hope they might find a survivor. Friends keeping porch lights on in a nightly vigil; hanging up homemade signs that read, “Pray for our miners, and their families.”  Neighbors consoling each other, and supporting each other and leaning on one another.

I’ve seen it, the strength of that community.  In the days that followed the disaster, emails and letters poured into the White House.  Postmarked from different places across the country, they often began the same way:  “I am proud to be from a family of miners.”  “I am the son of a coal miner.”  “I am proud to be a coal miner’s daughter.”  (Applause.)  They were always proud, and they asked me to keep our miners in my thoughts, in my prayers.  Never forget, they say, miners keep America’s lights on.  (Applause.)  And then in these letters, they make a simple plea:  Don’t let this happen again.  (Applause.)  Don't let this happen again.

How can we fail them?  How can a nation that relies on its miners not do everything in its power to protect them?  How can we let anyone in this country put their lives at risk by simply showing up to work; by simply pursuing the American Dream?

We cannot bring back the 29 men we lost.  They are with the Lord now.  Our task, here on Earth, is to save lives from being lost in another such tragedy; to do what must do, individually and collectively, to assure safe conditions underground -- (applause) -- to treat our miners like they treat each other -- like a family.  (Applause.)  Because we are all family and we are all Americans.  (Applause.)  And we have to lean on one another, and look out for one another, and love one another, and pray for one another.

There’s a psalm that comes to mind today -– a psalm that comes to mind, a psalm we often turn to in times of heartache.

“Even though I walk through the valley of the shadow of death, I will fear no evil, for You are with me; your rod and your staff, they comfort me.”

God bless our miners.  (Applause.)  God bless their families.  God bless West Virginia.  (Applause.)  And God bless the United States of America.  (Applause.)

灾难发生的几分钟,几小时,几日之后,这个社区终被外界关注。搜救者,冒着风险在充满沼气和一氧化碳的狭窄地道里搜寻,抱着一线希望去发现一位幸存者。朋友们打开门廊的灯守夜;悬挂自制的标语上写着,“为我们的矿工和他们的家人祈祷。”邻居们彼此安慰,相扶相依。

我看到了,这就是社区的力量。在灾难随后的几天,电子邮件和信件涌入白宫。邮戳来自全国各地,人们通常都是同一开头:“我很骄傲来自一个矿工的家庭。”“我是一名矿工的儿子。”“我很自豪能成为一名矿工的女人。”……他们都感到自豪,他们让我关护我们的矿工,为他们祈祷。他们说,不要忘了,矿工维持着美国的光亮。在这些信件里,他们提出一个很小的要求:不要让这样的事再发生。不要让这事情再发生。

我们怎忍让他们失望?一个依赖矿工的国家怎能不尽全力履行职责保护他们?我们的国家怎能容忍人们仅因工作就付出生命;难道仅仅是因为他们追求美国梦吗?

我们不能让29条逝去的生命回来。他们此刻与主同在。我们在这里的任务,就是防止有生命再在这样的悲剧中逝去。去做我们必须做的,无论个人或是集体,去确保矿下的安全,向他们对待彼此那样对待我们的矿工,如同一家人。因为我们是一家人,我们都是美国人。我们必须要彼此依靠,守望彼此,爱护彼此,为彼此祈福祈祷。

今天,我想起一首圣歌,在我们心痛时会想起这首歌。“我虽行过死荫的幽谷,但心无所惧,因你与我同在。你的杖,你的竿,都在安慰我。”
上帝保佑我们的矿工!上帝保佑他们的家人!上帝保佑西弗吉尼亚!上帝保佑美国!

 

 

posted @ 2010-04-28 10:32 Free Programmer 阅读(28) 评论(0) 编辑