关于作者

姓名:

性别:其他

出生日期:--

地区:上海 - 浙江兰溪

联系电话:

QQ:--

婚否:保密
用户名:busbby
笔名:busbby
地区: 上海 - 浙江兰溪
行业:其他

日历  

快速登录

+ 用户名:
+ 密 码:

在线留言



访问统计:
文章个数:34
评论个数:15
留言条数:0




Powered by BlogDriver 2.1

带我去月球

 

文章

防守对手罚球

北京时间12月13日在火箭的前15次罚球中,他们仅仅命中率了1球,全场火箭罚球22罚6中,但是他们还是以80比77击败了活塞。

赛后活塞主帅菲利普-桑德斯赛后自嘲的说:“我们只有一点做的很好,我们在防守对手罚球上面做的很出色。”

- 作者: busbby 2007年12月13日, 星期四 14:19  回复(0) |  引用(0) 加入博采

Error when executing msi or exe file on 2003

当在Windows 2003 server上安装从其它机器复制得到的MSI, exe文件的时候,系统报错误:Windows cannot access the specified device, path or file

解决方法:改变该文件属性。 点击unblock。
In Windows 2003 when you copy an executable (*.exe) file, the file now has a blocked property.  This is a security feature that can easily be resolved by reviewing the file properties and clicking the 'Unblock' button to disable the security feature.  In the first image below the 'Unblock' button is present with the text of - 'This file came from another computer and might be blocked to help protect this computer'.  Once you click the 'Unblock' button you can now access and run the executable (*.exe) file.

- 作者: busbby 2007年12月5日, 星期三 15:02  回复(0) |  引用(0) 加入博采

多线程 C#解决方案

与多线程相关的两个常见的需要解决的问题是:临界资源保护和线程间的同步依赖,每一种语言都提供了自己的一套设施(有的语言可能需要借助OS的API)来解决这两个问题,C#提供了更方便灵活的解决方案,首先C#可以允许我们在不同的级别上加锁,也就是说我们可以控制加锁的粒度。其次,C#提供了一套内置的线程安全的容器,方便我们的使用。

一.不同级别(Level)上的同步:
1.object level 同步
对应的class必须从ContextBoundObject继承(同步上下文context,使所有的方法调用能被截获),并且在
class上运用SynchronizationAttribute 。

2.Method level 同步
System.Runtime.CompilerService空间包含的一些属性将影响CLR在运行期间的行为。特性MethodImplAttribute可以用于需要进行同步控制的方法上。

3.code segment level 同步
(1)Monitor类(主要是静态方法)
Monitor.Enter(obj)//获得加在对象obj上的锁
...
Monitor.Exit(obj)//释放锁
//上面两句之间的代码相当于lock(obj){...}

Monitor.TryEnter(obj)//该方法立即返回,如果返回值为false,则接下来不需要Monitor.Exit(obj)。

//以下几个方法用于线程间的交互 ==》 解决同步依赖
Monitor.Wait(obj)//等待脉冲消息。释放对象上的锁并阻塞当前线程,以后只有其它线程调用Pulse或PulseAll时才会给它再次获得锁的机会
Monitor.Pulse(obj)//发射脉冲消息( 只有得到锁后才能发射,而且发射不会自动释放锁)
Monitor.PulseAll(obj)

注意:
(1)Monitor 锁定对象,只能在Enter()和Exit()之间的代码块中调用Wait和Pulse

(2)不能在一个线程中获得锁,而在另一个线程中释放锁。这样会产生锁丢失。 获得锁和释放锁应该在同一个线程中完成。

(3)lock语句
lock(obj)
{
    需要进行同步的代码
}

(4)ReaderWriterLock类
    实现单写多读程序的锁。
AcquireReaderLock()//当没有写程序线程占用锁时,就可获得锁
AcquireWriterLock()//当没有任何读写程序线程占用锁时,才可获得锁
ReleaseReaderLock()
ReleaseWriterLock()

(5)ManualResetEvent
Set()方法将状态设置为有信号
Reset()将其设置为无信号
WaitOne()将阻塞到其有信号为止,若调用WaitOne的时刻就是有信号的,将不会阻塞

(6)AutoResetEvent
与ManualResetEvent的区别是,AutoResetEvent.WaitOne()会自动改变事件对象的状态,即AutoResetEvent.WaitOne()每执行一次,事件的状态就改变一次。有信号-->无信号;无信号-->有信号

说明:
(1)无论是Monitor还是lock、ReaderWriterLock都只对引用类型的对象有效,因为引用类型的对象有一个隐藏的sync#字段,该字段的作用就是作为加锁的标记。
(2)上述的各种设施中,只有Monitor 和ManualResetEvent/AutoResetEvent 能解决线程间的同步依赖问题,而其它的设施主要用于解决临界资源共享。

4.member level同步
(1)Interlocked类(主要是静态方法)
    同步一个由许多线程共享的变量。
Decrement(ref int);//使变量减1
Increment(ref int);//使变量加1
//以上两个方法仅针对类int变量
Exchange(ref object, object);

(2)ThreadStaticAttribute
    该特性用于修饰静态变量,被该特性修饰的静态变量在每个线程中都有自己的副本。

二.创建线程安全的对象
Hashtable h = Hashtable.Synchronized(new Hashtable()) ;
ArrayList等容器也提供类似操作。

- 作者: busbby 2007年11月21日, 星期三 15:42  回复(0) |  引用(0) 加入博采

魔鬼夜访钱钟书先生说

你的识见竟平庸得可以做社论

自传就是别传

财主有布袋似的大肚子表示囊中充实;思想家垂头弯背,形状像标点里的问号,表示对一切发生疑问。

- 作者: busbby 2007年09月23日, 星期日 23:16  回复(0) |  引用(0) 加入博采

关于理财
每年收益一次的是高管,每月都有收益的是员工,每天都有收益的是卖菜的,干活就有收益的是零工。

- 作者: busbby 2007年09月8日, 星期六 09:52  回复(0) |  引用(0) 加入博采

满足会带来平庸
在阿伦和加内特与皮尔斯携手后,凯尔特人队终于看到了自“大鸟”伯德退役以来的翻身机会,“我对自己现在身处的地方非常满足。”阿伦说:“不过有时满足会带来平庸,所以你必须要在体育界中小心这一点,时不时的还要振作一下。”

- 作者: busbby 2007年08月6日, 星期一 12:22  回复(0) |  引用(0) 加入博采

一句话箴言
不要和傻子争论, 否则你的智商会变得跟他们一样低下, 并被他们的经验所击败!

- 作者: busbby 2007年06月26日, 星期二 11:35  回复(0) |  引用(0) 加入博采

Many Moons
American Story: Many Moons

Written by James Thurber


Our story today is called "Many Moons", it was written by James Thurber. Here is Shep O'Neal with the story. Princess Lenore loved cakes. She once ate so many that she became sick. And the king's doctor could do nothing to help her. The king promised his little daughter anything she wanted if she would just get well. Lenore said she wanted the moon. She would get well if she had the moon.

The king called for his important official the Lord High Chamberlain. He was a big, fat man who wore thick eyeglasses. The king asked him to get the moon for the young princess. The king's official took a long list from his pocket and said, "your majesty, I've gotten you many things. Here is a list of them: ivory, monkeys, peacocks, jewels, pink elephants, little blue dogs, gold insects, and the feathers of angels and I have brought you giants and a little man, and women who lived in the sea, and singers and dancers, a kilo of butter, a bag of sugar and 24 eggs. Oh, I'm sorry, my wife wrote that." The king said he did not remember any little blue dogs and did not want to talk about little blue dogs. He wanted the moon for his daughter, and he wanted it quickly. The Lord High Chamberlain said, " I have gotten things from far-off places like Africa and Asia, but I cannot get the moon. The moon is 60,000 kilometers from the earth. It is bigger even than the Princess Lenore's room and it is made of hot copper, nobody can touch it. Little blue dogs, yes. But the moon, no."

The king ordered the Lord High Chamberlain out of the room and sent for his mathematician, a little man with no hair on his head. He carried pencils behind his ear. The king said to him:" don't tell me all the problems you have settled for me in the last 40 years. I am not interested in them. I want the moon for Princess Lenore now. Get it." The mathematician said, "Thank you, thank you for asking me. On this paper I have written all the problems I have answered for you in the last 40 years. I have told you how far up is, and how far down is. I showed you the distance between the letters 'A' and 'Z', between day and night." The king got hot with anger. He said he didn't want to talk, he wanted the moon for his daughter. But the mathematician said he could not get the moon. The moon is 500,000 kilometers away. It is almost as big as the king's country and it is made of asbestos. And it is nailed to the sky, nobody can get it.

The king pushed the mathematician out of the room. He called for his jester, the only man who made him laugh. The jester came running into the room. He wore his funny clothes covered with bells. The king said, "My daughter will stay sick until she gets the moon. All my officials say that they cannot get it." The jester thought for a minute and said, "Well, they are all wise men, but have different ideas about the moon. Why don't we ask Princess Lenore what ideas she has about the moon?" The king agreed. And the jester went to Lenore's room. The little girl spoke with difficulty. She asked the jester if he brought the moon. He said he would get it, but first he wanted to know how big she thought the moon was. Lenore answered, "It is as big as the nail on my finger. I know this is so, because when I put my small finger in front of the moon, my fingernail covers it." The jester then asked her how far away she thought the moon was. She said that it was not as high as the tree near the window. She knew this because sometimes the moon got caught in the top of the tree. The jester had one more question, "What do you think the moon is made of?" The princess laughed and said, "Of course, it is made of gold."

The jester left Lenore and went to see the king's jeweler. The jeweler made a round moon of gold, a little smaller than the fingernail of the Princess. Then he put the moon on a gold chain so that Lenore could wear it on her neck. The jester took the gold chain to Princess Lenore. She was so happy that she quickly got well. The next day she got out of bed and played in the garden. The king was happy, but then he began to worry. He knew the moon that night would be bright in the sky. If his daughter saw it, she would know that the moon on her neck was not really the moon.

Again he asked his officials to see him. The Lord High Chamberlain was first. The king asked what could be done so that Princess Lenore would not see the moon that night. The Lord Chamberlain thought for a long time. Then he said if the Princess wore black glasses she would not be able to see anything. The king said that if his daughter could not see anything she would walk into the furniture and hurt herself, and be back in bed.

He called for his mathematician. The mathematician walked around in a circle. He said he had the answer: Fireworks, every night in the gardens. So many bright lights shooting into the sky from the gardens would keep Princess Lenore from seeing the moon. The king told the mathematician that he was stupid. So much light in the sky would not let his daughter sleep.

The king looked out of his window. He saw the moon begin to rise. He quickly called for his jester and told him that his little daughter would see the moon. This would make her sick again. None of his officials knew what to do about it. The jester said, "If these wise men do not know how to hide the moon, then the moon cannot be hidden." Again, the king looked out of his window and saw that the moon was shining into Lenore's room. The jester spoke to him,"Who knew what the moon was made of and how far away it was. I think that Princess Lenore is wiser than your officials and knows more about the moon than they do. I will ask her to explain how the moon can be on her neck and in the sky."

The king could not stop him. The jester went to Lenore's room. She was in bed but not sleeping. She was looking out of the window at the moon in the sky. She held the little moon that the jester had brought her. The jester asked her, "How can the moon shine in the sky when it is hanging around your neck?" She looked at him and laughed. She said, "That's a foolish question. When I loose a tooth, a new one grows in its place, doesn't it?" The jester answered, "Of course! And when a deer loses its horns, new horns grow." She said, "That's right. And when we cut the flowers in the garden other flowers grow in their places." The jester said, "That's right. And after the night takes the place of the day, the day takes the place of the night." Princess Lenore said, "It is the same with the moon. And I think it is the same with everything." Her voice got lower and lower. And the jester looked at her closely and saw that she was asleep. He covered her gently with the blankets and walked quietly out of her room on his toes.

You have just heard the American story "Many Moons". It was written by James Thurber. Your narrator was Shep O' Neal. The producer was Lawan Davis. Listen again next week for another American story in Special English on the Voice of America. I'm Faith Lapidus.

- 作者: busbby 2007年06月26日, 星期二 11:19  回复(0) |  引用(0) 加入博采

最爱NBA之妙语连珠(7)

北京时间11月8日,热火以90比87击败西雅图超音速

超音速的维尔金斯则没有能够投篮,他被哈斯勒姆的防守逼得慌了手脚,最后裁判吹了跳球。赛后维尔金斯表示:“我只是滑了一下,我不知道为什么。我也不能说是场地的原因,但是我滑了一下。”

- 作者: busbby 2006年11月10日, 星期五 20:32  回复(0) |  引用(0) 加入博采

最爱NBA之妙语连珠(6)

火箭和灰熊06-07赛季常规赛11月7日客场86:80

“能够在对垒同分区对手时取得两场胜利,这是我们迈出的关键一步,”麦蒂赛后说,“不过我有些妒忌巴蒂尔,他能在重回老东家主场时得到球迷们的起立鼓掌,而我重返奥兰多和多伦多时,那里的球迷们都想杀了我。”

“看到巴蒂尔重返孟菲斯并带着胜利离开,我不太高兴,”琼斯说,“但不管怎样,他得到球迷们如此热烈的欢迎,这是我所不能抱怨的,这都是因为过去几年里他对灰熊队的贡献。至于他的为人,这更没有什么好说的。”

- 作者: busbby 2006年11月8日, 星期三 17:20  回复(0) |  引用(0) 加入博采

最爱NBA之妙语连珠(5)

火箭和爵士06-07赛季常规赛首场 97:107

“这个结果就像脸上被狠狠地揍了一下,”斯内德说,“我们能够做的就是感激。我们在第四节的感激让人印象深刻,如果我们能够从头到尾都这么打,那么一定没有问题。不幸的是我们并没有能够从一开始就这么打。对手拼抢的太凶悍了。”

- 作者: busbby 2006年11月2日, 星期四 16:49  回复(0) |  引用(0) 加入博采

最爱NBA之妙语连珠(4)

太阳和湖人首轮季候赛首场107:102

除了得分外,托马斯在对科比的防守上也有贡献。终场前科比曾试图在托马斯面前运球上篮,结果被后者击中面部,而且裁判也没有判托马斯犯规。科比赛后对那次漏判颇有微词,他说:“对裁判的执法我不便评论,不过你们只要看看我头上的包,就知道发生了什么。”

- 作者: busbby 2006年04月25日, 星期二 11:14  回复(0) |  引用(0) 加入博采

就业与学位的笑话一则
为缓解今年就业矛盾,有关部门出台新学位制度,博士学位毕业后可继续攻读壮士,四年壮士毕业可攻读圣斗士学位,毕业后如还找不到工作,请攻读烈士学位。

- 作者: busbby 2006年04月12日, 星期三 15:20  回复(0) |  引用(0) 加入博采

到上海火车站的公交线路有哪些?
到上海火车站的公交线路有哪些?(转载)
到上海火车站的公交线路有:
上海火车站(终点线路)
路线名     起终点站       首末班车时间    
584路   上海火车站~博山东路 6:20~22:50
隧道三线  上海火车站~乳山新村  5:25~23:20
隧道夜宵线 上海火车站~潍坊新村 23:00~5:00
927路    上海火车站~田林新村 6:50~21:10
930路    上海火车站~十六铺   6:00~24:00
95路    上海火车站~上钢一厂  4:00~23:55
302路    上海火车站~宝交公司  24:00~3:45
322路    上海火车站~宝山镇   24:00~3:40
308路    上海火车站~松花江路  24:10~4:00
104路    上海火车站~龙华镇   4:30~23:35
329路    上海火车站~工农新村 24:30~4:15
801路    上海火车站~南浦大桥  6:00~19:00
802路    上海火车站~南浦大桥  6:00~19:00
845路    上海火车站~平顺路   6:00~20:00
109路    上海火车站~南浦大桥 4:30~23:30
315路    上海火车站~上海体育馆23:55~3:50
506路    上海火车站~桂菁路   6:00~23:00
113路    上海火车站~西区汽车站4:40~23:30
申川线   上海火车站~川沙     4:00~24:00
941路    上海火车站~虹桥机场  6:00~20:25
64路    上海火车站~杨家渡   4:30~23:45
324路    上海火车站~杨家渡  0:10~4:05
328路    上海火车站~上海动物园23:35~4:00
835路    上海火车站~凌兆新村  5:40~22:40
申方线   上海火车站~松鹤公墓 9:00~
南新线   上海火车站~惠家镇   5:30~19:05
114路    上海火车站~呼兰路   5:30~23:30
502路    恒丰路~高境庙     6:00~20:00
723路    上海火车站~香山新村  5:20~22:30
768路    共和路~莲花公寓    6:00~20:00
沪唐线   上海火车站~唐行    6:00~18:00
机场五线  上海火车站~浦东机场
516路    上海火车站~真光新村  6:35~19:05
117路    上海火车站~桃浦新村  4:50~23:00
823路    上海火车站~丰镇新村  7:00~22:10
942路      上海火车站~殷行路    7:00~20:00
928路      上海火车站~双阳路    6:00~19:20
115路      上海火车站~南浦大桥  4:00~23:50

上海火车站(途径线路)
路线名   走 向        本站途径时间
213路   至敦煌   5:05~8:20、15:50~18:35
58路    至陈太路     4:37~23:05
767B线   至五汽冠忠    6:20~23:05
844路   至新疆路     6:04~19:04
510路   至大华新村   6:21~20:51
741路   至共康新村    5:48~23:33
ZX332路  至五汽公司沪太场 23:47~4:27
13路    至曹家渡     4:20~24:17
319路   至上海西站    0:19~3:59
922路   至长宁火车站   6:46~20:11
563路   至轻纺市场     6:48~19:18
106路   至上海西站    4:55~23:45
768路   至莲花公寓    6:20~23:05
223路   至杏山路     6:12~18:12
63路    至普陀医院    4:24~24:04
837路   至长风公园    6:39~23:03

- 作者: busbby 2006年04月6日, 星期四 18:24  回复(0) |  引用(0) 加入博采

corpse bride(僵尸新娘)
with this hand, i will lift your sorrows
your cup will never be empty, for i will be your wine
with this candle, i will light your way in darkness
with this ring, i ask you to be my wife
用这支手,我将带你走出忧愁困苦
你的杯永不干涸,因为我将是你生命源泉之酒
用这蜡烛,我在黑暗中照亮你的生命
用这戒指,你愿做我的妻子吗?

can one heart break when it stop beating?
如果一个人的心脏不再跳动,那她还会心碎吗?

- 作者: busbby 2006年02月17日, 星期五 19:47  回复(2) |  引用(0) 加入博采