星期日, 二月 21, 2010
东华博客搬家
东华博客更新一直断断续续,
为了记录生活中的点点滴滴,
记下曾经的努力,
让回首往事的时候能够有点记忆,
决定重开博客,采用独立域名与服务器,
东华搬家至:http://www.truevue.org/
东华博客新站期望您的访问与建议:)
星期一, 十一月 16, 2009
奥巴马上海复旦大学演讲
中国没有做到,我相信美国也没有,这是个理想、目标:
所有的人生来平等,
都有着基本的权利,
而政府应当反映人们的意志,
贸易应该是开放的,
信息流通应当是自由的,
而法律要保证这个公平。
星期二, 十一月 10, 2009
星期日, 十一月 08, 2009
苹果CEO乔布斯在斯坦福大学的演讲稿[中英]
今天看了李开复在交大的演讲,这是李开复是第二次去交大。
虽然我也是交大出来的,但是都没赶上这两次。正如演讲中提到的 between JOBs.
但是都很幸运,都有视频录像,让我能有机会能够听到,看到开复。
这次的演讲提到了Steve Jobs在斯坦福的演讲,找来看了一下,感触颇深。
转期讲演稿如下,以作自勉:Stay Hungry. Stay Foolish.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
苹果计算机公司CEO史蒂夫・乔布斯6.14在斯坦福大学对即将毕业的大学生们进行演讲时说,从大学里辍学是他这一生做出的最为明智的一个选择,因为它逼迫他学会了创新。
乔布斯对操场上挤的满满的毕业生、校友和家长们说:“你的时间有限,所以最好别把它浪费在模仿别人这种事上。” --同样地,如果还在学校的话,似乎不应该去模仿退学的牛人们。演讲得非常好,强烈建议大家看看!
You've got to find what you love,' Jobs says
Jobs说,你必须要找到你所爱的东西。
This is the text of the Commencement address by Steve Jobs, CEO of Apple Computer and of Pixar Animation Studios, delivered on June 12, 2005.
这是苹果公司和Pixar动画工作室的CEO Steve Jobs于2005年6月12号在斯坦福大学的毕业典礼上面的演讲稿。
I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I've ever gotten to a college graduation. Today I want to tell you three stories from my life. That's it. No big deal. Just three stories.
我今天很荣幸能和你们一起参加毕业典礼,斯坦福大学是世界上最好的大学之一。我从来没有从大学中毕业。说实话,今天也许是在我的生命中离大学毕业最近的一天了。今天我想向你们讲述我生活中的三个故事。不是什么大不了的事情,只是三个故事而已。
The first story is about connecting the dots.
第一个故事是关于如何把生命中的点点滴滴串连起来。
I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?
我在Reed大学读了六个月之后就退学了,但是在十八个月以后——我真正的作出退学决定之前,我还经常去学校。我为什么要退学呢?
It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: "We have an unexpected baby boy; do you want him?" They said: "Of course." My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.
故事从我出生的时候讲起。我的亲生母亲是一个年轻的,没有结婚的大学毕业生。她决定让别人收养我, 她十分想让我被大学毕业生收养。所以在我出生的时候,她已经做好了一切的准备工作,能使得我被一个律师和他的妻子所收养。但是她没有料到,当我出生之后,律师夫妇突然决定他们想要一个女孩。 所以我的生养父母(他们还在我亲生父母的观察名单上)突然在半夜接到了一个电话:“我们现在这儿有一个不小心生出来的男婴,你们想要他吗?”他们回答道:“当然!”但是我亲生母亲随后发现,我的养母从来没有上过大学,我的父亲甚至从没有读过高中。她拒绝签这个收养合同。只是在几个月以后,我的父母答应她一定要让我上大学,那个时候她才同意。
And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents' savings were being spent on my college tuition. After six months, I couldn't see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn't interest me, and begin dropping in on the ones that looked interesting.
在十七岁那年,我真的上了大学。但是我很愚蠢的选择了一个几乎和你们斯坦福大学一样贵的学校, 我父母还处于蓝领阶层,他们几乎把所有积蓄都花在了我的学费上面。在六个月后, 我已经看不到其中的价值所在。我不知道我想要在生命中做什么,我也不知道大学能帮助我找到怎样的答案。 但是在这里,我几乎花光了我父母这一辈子的所有积蓄。所以我决定要退学,我觉得这是个正确的决定。不能否认,我当时确实非常的害怕, 但是现在回头看看,那的确是我这一生中最棒的一个决定。在我做出退学决定的那一刻, 我终于可以不必去读那些令我提不起丝毫兴趣的课程了。然后我还可以去修那些看起来有点意思的课程。
It wasn't all romantic. I didn't have a dorm room, so I slept on the floor in friends' rooms, I returned coke bottles for the 5¢ deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:
但是这并不是那么罗曼蒂克。我失去了我的宿舍,所以我只能在朋友房间的地板上面睡觉,我去捡5美分的可乐瓶子,仅仅为了填饱肚子, 在星期天的晚上,我需要走七英里的路程,穿过这个城市到Hare Krishna寺庙(注:位于纽约Brooklyn下城),只是为了能吃上饭——这个星期唯一一顿好一点的饭。但是我喜欢这样。我跟着我的直觉和好奇心走, 遇到的很多东西,此后被证明是无价之宝。让我给你们举一个例子吧:
Reed College at that time offered perhaps the best calligraphy instruction in the country. Throughout the campus every poster, every label on every drawer, was beautifully hand calligraphed. Because I had dropped out and didn't have to take the normal classes, I decided to take a calligraphy class to learn how to do this. I learned about serif and san serif typefaces, about varying the amount of space between different letter combinations, about what makes great typography great. It was beautiful, historical, artistically subtle in a way that science can't capture, and I found it fascinating.
Reed大学在那时提供也许是全美最好的美术字课程。在这个大学里面的每个海报, 每个抽屉的标签上面全都是漂亮的美术字。因为我退学了, 没有受到正规的训练, 所以我决定去参加这个课程,去学学怎样写出漂亮的美术字。我学到了san serif 和serif字体, 我学会了怎么样在不同的字母组合之中改变空格的长度, 还有怎么样才能作出最棒的印刷式样。那是一种科学永远不能捕捉到的、美丽的、真实的艺术精妙, 我发现那实在是太美妙了。
None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, its likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.
当时看起来这些东西在我的生命中,好像都没有什么实际应用的可能。但是十年之后,当我们在设计第一台Macintosh电脑的时候,就不是那样了。我把当时我学的那些家伙全都设计进了Mac。那是第一台使用了漂亮的印刷字体的电脑。如果我当时没有退学, 就不会有机会去参加这个我感兴趣的美术字课程, Mac就不会有这么多丰富的字体,以及赏心悦目的字体间距。那么现在个人电脑就不会有现在这么美妙的字型了。当然我在大学的时候,还不可能把从前的点点滴滴串连起来,但是当我十年后回顾这一切的时候,真的豁然开朗了。
Again, you can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something - your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.
再次说明的是,你在向前展望的时候不可能将这些片断串连起来;你只能在回顾的时候将点点滴滴串连起来。所以你必须相信这些片断会在你未来的某一天串连起来。你必须要相信某些东西:你的勇气、目的、生命、因缘。这个过程从来没有令我失望(let me down),只是让我的生命更加地与众不同而已。
My second story is about love and loss.
我的第二个故事是关于爱和损失的。
I was lucky – I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation - the Macintosh - a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.
我非常幸运, 因为我在很早的时候就找到了我钟爱的东西。Woz和我在二十岁的时候就在父母的车库里面开创了苹果公司。我们工作得很努力, 十年之后, 这个公司从那两个车库中的穷光蛋发展到了超过四千名的雇员、价值超过二十亿的大公司。在公司成立的第九年,我们刚刚发布了最好的产品,那就是Macintosh。我也快要到三十岁了。在那一年, 我被炒了鱿鱼。你怎么可能被你自己创立的公司炒了鱿鱼呢? 嗯,在苹果快速成长的时候,我们雇用了一个很有天分的家伙和我一起管理这个公司, 在最初的几年,公司运转的很好。但是后来我们对未来的看法发生了分歧, 最终我们吵了起来。当争吵不可开交的时候, 董事会站在了他的那一边。所以在三十岁的时候, 我被炒了。在这么多人的眼皮下我被炒了。在而立之年,我生命的全部支柱离自己远去, 这真是毁灭性的打击。
I really didn't know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down - that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me – I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.
在最初的几个月里,我真是不知道该做些什么。我把从前的创业激情给丢了, 我觉得自己让与我一同创业的人都很沮丧。我和David Pack和Bob Boyce见面,并试图向他们道歉。我把事情弄得糟糕透顶了。但是我渐渐发现了曙光, 我仍然喜爱我从事的这些东西。苹果公司发生的这些事情丝毫的没有改变这些, 一点也没有。我被驱逐了,但是我仍然钟爱它。所以我决定从头再来。
I didn't see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.
我当时没有觉察, 但是事后证明, 从苹果公司被炒是我这辈子发生的最棒的事情。因为,作为一个成功者的极乐感觉被作为一个创业者的轻松感觉所重新代替: 对任何事情都不那么特别看重。这让我觉得如此自由, 进入了我生命中最有创造力的一个阶段。
During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I retuned to Apple, and the technology we developed at NeXT is at the heart of Apple's current renaissance. And Laurene and I have a wonderful family together.
在接下来的五年里, 我创立了一个名叫NeXT的公司, 还有一个叫Pixar的公司, 然后和一个后来成为我妻子的优雅女人相识。Pixar 制作了世界上第一个用电脑制作的动画电影——“”玩具总动员”,Pixar现在也是世界上最成功的电脑制作工作室。在后来的一系列运转中,Apple收购了NeXT, 然后我又回到了Apple公司。我们在NeXT发展的技术在Apple的复兴之中发挥了关键的作用。我还和Laurence 一起建立了一个幸福的家庭。
I'm pretty sure none of this would have happened if I hadn't been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don't lose faith. I'm convinced that the only thing that kept me going was that I loved what I did. You've got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.
我可以非常肯定,如果我不被Apple开除的话, 这其中一件事情也不会发生的。这个良药的味道实在是太苦了,但是我想病人需要这个药。有些时候, 生活会拿起一块砖头向你的脑袋上猛拍一下。不要失去信心。我很清楚唯一使我一直走下去的,就是我做的事情令我无比钟爱。你需要去找到你所爱的东西。对于工作是如此, 对于你的爱人也是如此。你的工作将会占据生活中很大的一部分。你只有相信自己所做的是伟大的工作, 你才能怡然自得。如果你现在还没有找到, 那么继续找、不要停下来、全心全意的去找, 当你找到的时候你就会知道的。就像任何真诚的关系, 随着岁月的流逝只会越来越紧密。所以继续找,直到你找到它,不要停下来!
My third story is about death.
我的第三个故事是关于死亡的。
When I was 17, I read a quote that went something like: "If you live each day as if it was your last, someday you'll most certainly be right." It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: "If today were the last day of my life, would I want to do what I am about to do today?" And whenever the answer has been "No" for too many days in a row, I know I need to change something.
当我十七岁的时候, 我读到了一句话:“如果你把每一天都当作生命中最后一天去生活的话,那么有一天你会发现你是正确的。”这句话给我留下了深刻的印象。从那时开始,过了33年,我在每天早晨都会对着镜子问自己:“如果今天是我生命中的最后一天, 你会不会完成你今天想做的事情呢?”当答案连续很多次被给予“不是”的时候, 我知道自己需要改变某些事情了。
Remembering that I'll be dead soon is the most important tool I've ever encountered to help me make the big choices in life. Because almost everything – all external expectations, all pride, all fear of embarrassment or failure - these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.
“记住你即将死去”是我一生中遇到的最重要箴言。它帮我指明了生命中重要的选择。因为几乎所有的事情, 包括所有的荣誉、所有的骄傲、所有对难堪和失败的恐惧,这些在死亡面前都会消失。我看到的是留下的真正重要的东西。你有时候会思考你将会失去某些东西,“记住你即将死去”是我知道的避免这些想法的最好办法。你已经赤身裸体了, 你没有理由不去跟随自己的心一起跳动。
About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn't even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor's code for prepare to die. It means to try to tell your kids everything you thought you'd have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.
大概一年以前, 我被诊断出癌症。我在早晨七点半做了一个检查, 检查清楚的显示在我的胰腺有一个肿瘤。我当时都不知道胰腺是什么东西。医生告诉我那很可能是一种无法治愈的癌症, 我还有三到六个月的时间活在这个世界上。我的医生叫我回家, 然后整理好我的一切, 那就是医生准备死亡的程序。那意味着你将要把未来十年对你小孩说的话在几个月里面说完.;那意味着把每件事情都搞定, 让你的家人会尽可能轻松的生活;那意味着你要说“再见了”。
I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form of pancreatic cancer that is curable with surgery. I had the surgery and I'm fine now.
我整天和那个诊断书一起生活。后来有一天早上我作了一个活切片检查,医生将一个内窥镜从我的喉咙伸进去,通过我的胃, 然后进入我的肠子, 用一根针在我的胰腺上的肿瘤上取了几个细胞。我当时很镇静,因为我被注射了镇定剂。但是我的妻子在那里, 后来告诉我,当医生在显微镜地下观察这些细胞的时候他们开始尖叫, 因为这些细胞最后竟然是一种非常罕见的可以用手术治愈的胰腺癌症。我做了这个手术, 现在我痊愈了。
This was the closest I've been to facing death, and I hope its the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:
那是我最接近死亡的时候, 我还希望这也是以后的几十年最接近的一次。从死亡线上又活了过来, 死亡对我来说,只是一个有用但是纯粹是知识上的概念的时候,我可以更肯定一点地对你们说:
No one wants to die. Even people who want to go to heaven don't want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life's change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.
没有人愿意死, 即使人们想上天堂, 人们也不会为了去那里而死。但是死亡是我们每个人共同的终点。从来没有人能够逃脱它。也应该如此。 因为死亡就是生命中最好的一个发明。它将旧的清除以便给新的让路。你们现在是新的, 但是从现在开始不久以后, 你们将会逐渐的变成旧的然后被清除。我很抱歉这很戏剧性, 但是这十分的真实。
Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of other's opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.
你们的时间很有限, 所以不要将他们浪费在重复其他人的生活上。不要被教条束缚,那意味着你和其他人思考的结果一起生活。不要被其他人喧嚣的观点掩盖你真正的内心的声音。还有最重要的是, 你要有勇气去听从你直觉和心灵的指示——它们在某种程度上知道你想要成为什么样子,所有其他的事情都是次要的。
When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in Menlo Park, and he brought it to life with his poetic touch. This was in the late 1960's, before personal computers and desktop publishing, so it was all made with typewriters, scissors, and polaroid cameras. It was sort of like Google in paperback form, 35 years before Google came along: it was idealistic, and overflowing with neat tools and great notions.
当我年轻的时候, 有一本叫做“整个地球的目录”振聋发聩的杂志,它是我们那一代人的圣经之一。它是一个叫Stewart Brand的家伙在离这里不远的Menlo Park书写的, 他象诗一般神奇地将这本书带到了这个世界。那是六十年代后期, 在个人电脑出现之前, 所以这本书全部是用打字机,、剪刀还有偏光镜制造的。有点像用软皮包装的google, 在google出现三十五年之前:这是理想主义的, 其中有许多灵巧的工具和伟大的想法。
Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: "Stay Hungry. Stay Foolish." It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.
Stewart和他的伙伴出版了几期的“整个地球的目录”,当它完成了自己使命的时候, 他们做出了最后一期的目录。那是在七十年代的中期, 你们的时代。在最后一期的封底上是清晨乡村公路的照片(如果你有冒险精神的话,你可以自己找到这条路的),在照片之下有这样一段话:“保持饥饿,保持愚蠢。”这是他们停止了发刊的告别语。“保持饥饿,保持愚蠢。”我总是希望自己能够那样,现在, 在你们即将毕业,开始新的旅程的时候, 我也希望你们能这样:
Stay Hungry. Stay Foolish.
保持饥饿,保持愚蠢。
Thank you all very much.
非常感谢你们。
星期二, 六月 16, 2009
最新火车时刻表查询系统终于完成了
我来弄个火车车次查询系统,赶了好几天,终于把系统给完成了,http://shz-shrail.net.cn/,
订票系统收集了最新火车时刻表,2009年4月1日调整的数据库。
发文庆祝一下,功能已经完成,还有页面需要美工。
这个以后慢慢弄吧。
星期一, 四月 20, 2009
The Top 300 Free Software
OfficeOpenOffice - office suite Archive managers7-Zip - compression program InternetFirefox - web browser P2P this is sharing files on your computer with someone else.?Torrent - torrent client ChatMiranda - chat client SecurityAVG Free - antivirus NetworkHamachi - VPN client ServersFileZilla - FTP client AudioFoobar2000 - audio player VideoWindows Media Player - audio/video player ImageGimp - image editor 3DBlender3D - 3D renderer DevelopersAutoIt - task automation CD/DVDDeepBurner - CD/DVD burner CodecsGSpot - codec information System UlilitiesCCleaner - system cleaner UI EnhancementsRocketDock - application launcher Hardware monitoring/BenchmarkingCPU-Z - cpu information Games123 Free Solitaire - solitaire games collection EducationSpeQ Mathematics - mathematics program MiscellaneousnLite - Build your own custom Windows disk. WallpapersMichael Swanson - 1920 x 1200; 1600 x 1200; amazing wallpapers |
星期日, 四月 05, 2009
农夫果园
开心网前一阵推出了农夫果园,挺好玩的说。
鲜花港
不过还没发现鲜花港的商机,有待发掘。
搜索量的快照:
星期一, 三月 23, 2009
picasa web的图片大小自定义
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99tjBEen6W5R9a2b8fSO8ubbjwarHIuegTa-11kUTR5mD_dp0mL7JneAoRGU0ohkv8DjFGH12JIghLNc5Nh89j4AxqAiKHlmjE5Xba62uj4hDoK-NTI3sUdx6-IhcUBOlvsp6ag/s144/dile-newegg.jpg
picasa,提供了四种图片大小供你选择:144,288,400,800。
当我们比较上面四种图片地址的时候会发现其中的规律:
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99tjBEen6W5R9a2b8fSO8ubbjwarHIuegTa-11kUTR5mD_dp0mL7JneAoRGU0ohkv8DjFGH12JIghLNc5Nh89j4AxqAiKHlmjE5Xba62uj4hDoK-NTI3sUdx6-IhcUBOlvsp6ag/s144/dile-newegg.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99tjBEen6W5R9a2b8fSO8ubbjwarHIuegTa-11kUTR5mD_dp0mL7JneAoRGU0ohkv8DjFGH12JIghLNc5Nh89j4AxqAiKHlmjE5Xba62uj4hDoK-NTI3sUdx6-IhcUBOlvsp6ag/s288/dile-newegg.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99tjBEen6W5R9a2b8fSO8ubbjwarHIuegTa-11kUTR5mD_dp0mL7JneAoRGU0ohkv8DjFGH12JIghLNc5Nh89j4AxqAiKHlmjE5Xba62uj4hDoK-NTI3sUdx6-IhcUBOlvsp6ag/s400/dile-newegg.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99tjBEen6W5R9a2b8fSO8ubbjwarHIuegTa-11kUTR5mD_dp0mL7JneAoRGU0ohkv8DjFGH12JIghLNc5Nh89j4AxqAiKHlmjE5Xba62uj4hDoK-NTI3sUdx6-IhcUBOlvsp6ag/s800/dile-newegg.jpg
现在你发现了其中的规律了吧,其实除了上面的四种大小,我们还可以用下面的一些:
s72,s144,s200,s320,s400,s512,s576,s640,s720,s800,
s912,s1024,s1152,s1280,s1440,s1600.
现在你的选择多了吧:)
星期二, 三月 17, 2009
Linux Shell I/O重定向(三): 进阶I/O
<&n 标准输入复制自文件描述符 n
<&- 关闭标准输入(键盘)
>&- 关闭标准输出
n<&- 表示将 n 号输入关闭
n>&- 表示将 n 号输出关闭
上述所有形式都可以前导一个数字,此时建立的文件描述符由这个数字指定而不是缺省的 0 或 1。
如:
... 2>file 运行一个命令并把错误输出(文件描述符 2)定向到 file。
... 2>&1 运行一个命令并把它的标准输出和输出合并。(严格的说是通过复制文件描述符 1 来建立文件描述符 2 ,但效果通常是合并了两个流。)
我们对 2>&1详细说明一下 :
2>&1 也就是 FD2=FD1 ,这里并不是说FD2 的值 等于FD1的值,因为 > 是改变送出的数据信道,也就是说把 FD2 的 "数据输出通道" 改为 FD1 的 "数据输出通道"。如果仅仅这样,这个改变好像没有什么作用,因为 FD2 的默认输出和 FD1的默认输出本来都是 monitor,一样的!
但是,当 FD1 是其他文件,甚至是其他 FD 时,这个就具有特殊的用途了。请大家务必理解这一点。
exec 0exec 1>outfilename # 打开文件outfilename作为stdout
exec 2>errfilename # 打开文件 errfilename作为 stderr
exec 0<&- # 关闭 FD0
exec 1>&- # 关闭 FD1
exec 5>&- # 关闭 FD5
问:
如果关闭了 FD0、FD1、FD2,其后果是什么?
恢复 FD0、FD1、FD2与 关闭FD0、FD1、FD2 有什么区别?代码分别是什么?
打开了FD3~FD9,我们用完之后,你觉得是将他们关闭还是恢复?
下面是提示(例子来源于CU一帖子,忘记出处,来日再补上):
exec 6>&2 2>ver
command >>dev/null &
exec 2>&6 # 恢复 FD2
Linux Shell I/O重定向(二): 基本IO
cmd >> file 把 stdout 重定向到 file 文件中(追加)
cmd 1> fiel 把 stdout 重定向到 file 文件中
cmd > file 2>&1 把 stdout 和 stderr 一起重定向到 file 文件中
cmd 2> file 把 stderr 重定向到 file 文件中
cmd 2>> file 把 stderr 重定向到 file 文件中(追加)
cmd >> file 2>&1 把 stderr 和 stderr 一起重定向到 file 文件中(追加)
cmd < file >file2 cmd 命令以 file 文件作为 stdin,以 file2 文件作为 stdout
cmd < file cmd 命令以 file 文件作为 stdin
cmd << delimiter Here document,从 stdin 中读入,直至遇到 delimiter 分界符
Linux Shell I/O重定向(一): 基本概念
b、 常用FD有3个,为0(stdin,标准输入)、1(stdout,标准输出)、2(stderr,标准错误输出),默认与keyboard、monitor、monitor有关;
c、 用 < 来改变读进的数据信道(stdin),使之从指定的档案读进; d、 用 > 来改变送出的数据信道(stdout, stderr),使之输出到指定的档案;
e、 0 是 < 的默认值,因此 < 与 0<是一样的;同理,> 与 1> 是一样的;
f、 在IO重定向 中,stdout 与 stderr 的管道会先准备好,才会从 stdin 读进资料;
g、 管道“|”(pipe line):上一个命令的 stdout 接到下一个命令的 stdin;
h、 tee 命令是在不影响原本 I/O 的情况下,将 stdout 复制一份到档案去;
i、 bash(ksh)执行命令的过程:分析命令-变量求值-命令替代(``和$( ))-重定向-通配符展开-确定路径-执行命令;
j、 ( ) 将 command group 置于 sub-shell 去执行,也称 nested sub-shell,它有一点非常重要的特性是:继承父shell的Standard input, output, and error plus any other open file descriptors。
k、 exec 命令:常用来替代当前 shell 并重新启动一个 shell,换句话说,并没有启动子 shell。使用这一命令时任何现有环境都将会被清除。exec 在对文件描述符进行操作的时候,也只有在这时,exec 不会覆盖你当前的 shell 环境。
星期五, 三月 13, 2009
Linux中LS_COLOR设置
具体LS_COLORS的文件类型和颜色值可以参考我以前的博文 http://keeppoo.blogspot.com/2007/09/lscolor.html
这边给出一个我用的设置值,你可以直接拷贝贴到你shell的rc(run common)文件中:
setenv LS_COLORS 'no=00:fi=00:di=01;34:ln=00;04;31:pi=00;37:so=01;31:bd=37:cd=37:or=01;31:ex=01;31:*.o=01:*.gz=00;35:*.tar=00;35:*.Z=00;35:*.tgz=00;35:*.mpg=36:*.mpeg=36:*.dat=35:*.mov=35:*.pm=35:*.jpg=36:*.JPG=36:*.gif=36:*.GIF=36:*.ps=01;33:*.pdf=01;35:*.fm=01;35:*.htm=01;34:*.html=01;34:*.HTM=01;34:*.HTML=01;34:*.c=00;31:*.cpp=00;31:*.pl=00;31:*.my=01;04;35:*.man=01;04;07;30:*.ppt=35:*.DOC=35:*.doc=35:*.cmd=04;35:*.tcl=04;36:*.tclscript=04;36:*.log=04;35'
星期日, 三月 08, 2009
ghs.google.com被封的解决办法
发现 blog.tortinita.org 是可以访问的,查了一下CNAME,是ghs.hloli.net,算是一个候选吧,不知道他是怎么实现的:(
目前(2009年3月10号)最新最可靠的ghs.google.com的替代解决方法就是使用 ghs.hloli.net 替代 ghs.google.com。
设置好之后,大约过一小时后可以用nslookup就行查询 ,具体查询方法可以参考上一篇博文:http://keeppoo.blogspot.com/2009/03/cname.html
CNAME查询
使用的工具就是windows自带的 nslookup。
运行 nslookup (Win+R -> nslookup)
c:\>nslookup
返回中,其中“Default Server”和“Address”是当前上网所用的DNS服务器域名和地址。
此时,在提示符下直接输入域名,可查到该域名的A记录。例如:
pythonclub.org
server:####
address:xxxxx
non-authoritative answer
name:###
address:xxxxx
其中“Non-authoritative answer”表示查询结果是从DNS的cache里返回的。
输入set querytype=mx,再输入域名,可查询MX记录。例如:
> set querytype=ns
> xianba.net
Server: ###
ress:###
...
输入set querytype=cname,再输入域名,可查询CNAME记录。
输入set querytype=ns,再输入域名,可查询NS记录。
星期五, 二月 27, 2009
PHP脚本:上传ftp文件到指定目录
$daily_script_name = "file-name-to-upload";
$ftp_host = "your-ftp-host";
$uname = "user-name";
$pass = '********';
$remote = "your-remote-file-location/$daiy_script_name";
$ftpc = ftp_connect($ftp_host);
if (ftp_login($ftpc, $uname, $pass)) {
print ("FTP logged in...<br />\n");
} else {
print ("FTP could not login.<br />\n");
}
if (ftp_put($ftpc, $remote, $daily_script_name, FTP_BINARY)) {
print ("File was uploaded.<br />\n");
} else {
print ("File was not uploaded.<br />\n");
}
ftp_close($ftpc);
星期四, 二月 26, 2009
Google Application 现在支持中国移动的手机验证了
这个号码就是google短信提醒的统一号码。
开始试用google app:)
星期二, 二月 24, 2009
星期五, 二月 20, 2009
详解4G内存与CPU,BIOS和操作系统之间牵绊
因为内存价格的持续走低,目前各大内存厂商相继推出了单条2GB的DDR2 800内存,这些内存给人最大的感觉就是价格便宜量又足。很多用户就直接买了两条2GB的内存,想组成双通道使用。可拿回家一看,原本4GB的内存容量被识别出来的只有3.2GB左右。通过检查,发现内存本身并没有问题。那又是什么吞食了你的内存呢?这就是我们本期将要给大家说清楚的一个问题。
800MB内存被吞食了?
大家或许会发现一种很奇怪的现象,在我们的Windows XP和Vista中,安装4GB内存后,显示出来的只有3.2GB左右甚至更少,有800多MB的内存"无缘无故"地消失了,这让人感觉十分费解,主板和操作系统之所以不能使用全部的4GB内存,问题的根源就在于计算机那32位X86架构。 32位X86架构是指个人电脑的地址总线是32位的,CPU、内存控制器、操作系统都是按32位地址总线设计。32位地址总线可以支持的内存地址代码是 4096MB,也就是有4GB的地址代码,可以编4GB个地址。这4GB个地址码正好可以分配给4GB内存。但是,这4GB个地址码不能全部分配给安装在主板上的物理内存。因为个人电脑还有很多设备需要地址代码,以便CPU可以根据地址码找到它们,同时CPU和这些设备交换数据需要暂时存放数据的存储器 ――寄存器,这些寄存器也需要地址代码。比如硬盘控制器、软驱控制器、管理插在PCI槽上的 PCI卡的PCI总线控制器,PCI-E总线控制器和PCI-E显卡,它们都有寄存器都需要系统分配给它们地址代码。这些地址由系统分配,电脑用户在使用中感觉不到。这样一来,当我们为电脑插上总容量为4GB的内存时,就有一部分内存分配不到地址代码而不能使用。
要深入了解4GB内存之谜,我们就得弄清楚各部件与4GB内存关系,其中涉及到的部件有CPU、内存控制器(Intel平台集成在北桥,AMD平台集成在CPU)和操作系统。
CPU、内存控制器、BIOS:能支持4GB
CPU能支持4GB内存
从386时代开始,CPU 的地址总线就是32位的,可以访问4GB的地址代码。从奔腾Ⅱ到奔腾Ⅳ,理论上已经可以访问64GB的地址编码。后来支持 64位架构的奔腾Ⅳ到现在的酷睿2,地址总线已经升级到64位,64位地址总线可以访问千亿GB的地址编码。实际上用不到这么多的地址总线,一般用42位足够了,可以编码的地址量有4TB。兼容64位架构的CPU用在32位系统时地址总线就缩小为36位。所以现在的CPU支持4GB内存是没有问题的。
内存控制器的地址总线
与主板安装的内存直接关联的是内存控制器。内存控制器一边管理内存,一边通过地址总线与CPU通信。内存控制器的地址总线决定了可以支持的内存地址编码数量,同时内存控制器的实际连接内存的地址线决定了可以支持的内存容量。Intel把内存控制器放在北桥,AMD把内存控制器放在CPU。所以要分开介绍。
1、Intel的内存控制器
由于Intel的内存控制器放在北桥内,内存控制器的改变就与北桥密切相关。从P965开始内存控制器已经是36位地址总线,可以编64GB的地址代码,除系统占用的地址码,分配给主板安装的4GB内存绰绰有余。所以,从P965开始Intel的北桥支持4GB内存是没有问题的。
2、AMD的内存控制器
AMD从支持64位架构的CPU(Athlon64)开始把内存控制器集成到CPU。内存控制器的地址总线是64位架构的,使用40位,可以支持1000GB的地址编码。所以,AMD 从Athlon64开始,内存控制器支持4GB内存也是没有问题的。
BIOS能支持4GB内存
BIOS不是主板厂家自己开发的,BIOS版权控制在AMI等几个公司。它们与Intel和AMD合作共同开发BIOS。所以当Intel和AMD提出 "映射"方式解决4GB内存问题,AMI等厂商就会开发出相应的BIOS。早期的BIOS里面会显示出"映射"选项,用户可以开启或关闭。现在已经是默认开启,不再显示这项设置。所以可以说,对于现在的BIOS来讲,在支持4GB内存方面是没问题的。
4GB内存的"原罪":X86架构
CPU和内存控制器从硬件上为使用4GB内存提供了保障。但是还没有解决4GB内存的问题。障碍来自于个人电脑的体系标准――32位X86架构。早在 8086时代,内存是焊接在主板上的,一般也就几KB的内存,IBM规定640KB的地址是最高端,这个地址分配给BIOS,接下来有一段地址分配给系统的显示设备和I/O设备。电脑的迅速发展很快突破640KB内存达到并超过1MB。但是640KB下面这一段地址分配不能改变,因为CPU、DOS操作系统都是从640KB读取BIOS通过640KB下面的显示设备寄存地址,I/O设备寄存地址与显示设备、I/O设备通信、交换数据。如果更改,以前的所有电脑都要作废。所以必须寻找一个办法,既不改变640KB地址分配,又可以使用640KB到1MB的内存。那就是这种地址分配规则不变,采用"内存地址映射"技术,把640KB到500多KB的这一段地址映射到640KB-1MB的空间里,映射工作由BIOS负责。操作系统则由两条DOS命令 HIMEM.SYS和EMM386.SYS负责,熟悉DOS的用户,都会知道这两条命令。通过映射,就可以让DOS软件使用更多的内存。内存发展到 4MB,16MB,都是通过"内存映射"技术解决。到现在,个人电脑只要兼容DOS,就必须遵守640KB这种地址内存分配规则。
奔腾Ⅱ时代,SDRAM内存容量达到128MB。那时候的地址总线是32位,最大地址空间是4GB,这时32位X86架构已经完全形成。除保留以前的内存地址分配规则外,还要把 BIOS地址映射到地址空间的顶端――4GB。一直到815时代的DDR内存,915时代的DDR2内存。真正使用的内存单条最大容量为512MB,系统使用的内存不会超过2GB。所以4GB内存问题没有显现。
945时代时1GB的DDR2内存出现后,内存控制器的设计者们开始考虑主板安装4GB的内存条。但当时很少有用户使用4GB内存,4GB内存问题依然没有凸现。
其实,Intel在915时期就提出要解决32位X86架构硬件支持4GB内存的问题。到P965正式解决时,解决方案还是"内存地址映射"。这个方案不是新想出来的,在32位X86架构的服务器系统早已经采用,只是被移植到个人电脑上来。
从64GB的地址空间顶部开始,映射PCI设备的I/O地址,然后映射系统占用的3GB到4GB的地址。把3GB到4GB的这段地址代码留给安装在主板上的物理内存,就可以使用安装的全部内存了。
为什么必须要采用"映射"的办法?因为内存的编址必须是连续的,不能断开。而系统的地址空间(也叫逻辑地址)是可以不连续的。就像我们给街道两边的房屋号码牌一样,编制方案(相当于逻辑地址)可以规划很大,可以分割。给到这一条街房屋的号码牌必须是连续的,这是真实的地址,以便于人们按地址寻找房屋。
当然这种"映射"工作还是由BIOS完成。要支持4GB内存,还必须要BIOS支持。
通过内存地址重映射把系统占用的4GB地址还给物理内存,是32位X86架构的规则。AMD也要采用这个规则,虽然它的内存控制器集成在CPU 内。也正是由于内存控制器集成在CPU内,北桥不再含有内存控制器。主板厂家开发AMD平台主板时,会依据市场定位设计主板支持的内存容量。有支持2GB 的,也有支持4GB、8GB或更多。所以AMD平台的4GB问题还要看主板。
操作系统才是"罪魁祸首" 。
操作系统管理和使用物理内存,因此在操作系统内也必须有一个逻辑(虚拟)地址系统,与主板上的所有存储地址(包括内存的、I/O设备的、BIOS的)对应,也有类似"地址总线"的结构。32位操作系统是按32位地址总线设计,32位的地址寄存器,因此只能管理4GB的地址,去掉系统占用的,也不能完全使用全部4GB内存。个人电脑的32位操作系统都不能支持4GB内存,即使是Vista 32 SP1也不能。Vista 32 SP1比XP 32 SP3进步一点的是在系统属性里面可以显示实际安装多少内。
32位的Vista SP1已经能顺利识别4GB内存、但在任务管理器可以看到系统真正使用的内存不到4GB。
* 那么哪些操作系统可以支持并使用4GB内存?第一是64位操作系统,因为64位操作系统是按64位地址总线设计的。比如Windows XP 64,Vista 64。第二是具有物理地址扩展功能,并且地址寄存器大于32位的服务器操作系统,但有些具备物理地址扩展的服务器操作系统,由于地址寄存器限于32位也不能支持4GB。
最后:
我们可以看出,现在的主板芯片组或内存控制器已经不再是吞食我们内存的主要原因。而罪魁祸首则是出在我们使用的32位操作系统上。虽然现在的Vista SP1已经能识别到完整的4GB内存,但实际使用的内存还是和以前的那3GB左右的没区别。所以现在来谈4GB内存的普及依然为时过早。另一方面,有的内存厂商为了避免出现内存浪费的情况发生,推出了三条1GB内存的组合套装,这也是相当贴心的一个设计。

