wang's profileNirvanaPhotosBlogLists Tools Help

Blog


    February 19

    Bob Seger › Like A Rock

    ///In the famous movie "The Weather man",  Dave's lead sentence on his father's live funeral.///
    ///The song really touched me                                                                                    ///
     
     
    Stood there boldly
    Sweatin in the sun
    Felt like a million
    Felt like number one
    The height of summer
    Id never felt that strong
    Like a rock

    I was eighteen
    Didnt have a care
    Working for peanuts
    Not a dime to spare
    But I was lean and
    Solid everywhere
    Like a rock

    My hands were steady
    My eyes were clear and bright
    My walk had purpose
    My steps were quick and light
    And I held firmly
    To what I felt was right
    Like a rock

    Like a rock, I was strong as I could be
    Like a rock, nothin ever got to me
    Like a rock, I was something to see
    Like a rock

    And I stood arrow straight
    Unencumbered by the weight
    Of all these hustlers and their schemes
    I stood proud, I stood tall
    High above it all
    I still believed in my dreams

    Twenty years now
    Whered they go?
    Twenty years
    I dont know
    Sit and I wonder sometimes
    Where theyve gone

    And sometimes late at night
    When Im bathed in the firelight
    The moon comes callin a ghostly white
    And I recall
    Recall

    Like a rock. standin arrow straight
    Like a rock, chargin from the gate
    Like a rock, carryin the weight
    Like a rock

    Lihe a rock, the sun upon my skin
    Like a rock, hard against the wind
    Like a rock, I see myself again
    Like a rock
    August 03

    这几天有点烦

     突然发现手头有很多事情 而且没有一件事情是轻松搞定的,而且事情都是纠缠不清 彼此有关。
    所以有点烦躁
    1
    身边的朋友 从前的旧友,都不同程度上发生这样那样的危机。我觉得人性扭曲了!
    2
    Research 出乎我的意料的需要越过一个几乎不可逾越的大山, 此research未完成, 彼research又来。
    从前总抱怨做的research垃圾,可是现在发现不垃圾的research都比较难,太难了,挑战我的眼睛和智商
    3
    Project 本来凑合出一个版本,问题多多,第一个要解决的本质问题就是存储结构,碰到了BerkeleyDB,以为救星来了
    谁知道,不crack code根本就没法直接用,而且做测试的时候 发现mem的问题才是最严重的,即使改了repository也没有
    改好mem的问题。 就仿佛要解开一些缠在一起的鱼线 找不出头绪,又看到老越们都不停的上鱼  心里着急呀
    4
    业务转型已经是必须的了,实施起来又是无从下手。
     
     
    以前总自信的以为 自己最适合的职业是 策划和咨询,从一团乱麻中寻找机会。现在极度失望。
     
    今天晚上想找3,4年前那帮朋友 像当年一样找个酒吧 烂醉如泥一把,抽点迷幻的东西,让大脑在迷幻的音乐中慢慢睡去。
     
    可是今年我27岁了 不能那么幼稚的解决问题了。
     
    还有不到两周要回去了,之前必须理出一个头绪。
     
    打击一下自以为是的人,别觉得自己够牛,那是你没到时候,等你低头发现你阵脚乱的那天,你就知道自己不过就是一团肉。
     
     
    鼓励一下自己, 要是我能活着看到明日的朝阳,我就一定能解决这一切。
     
     
     
     Aug 06, 2007, 解决了一个mem的问题,实际上是某疯狂的递归函数大概递归了2000层以上,c下面单独跑居然能过(怀疑运行时优化,编译时刻我没有
                          作优化设置),jni下面出现JVM Crash, debug JNI后找到出错地方 改为非递归后,问题解决。感谢joujou教给我JNI的牛逼assert
                          (NULL)Debug JNI
     
    July 31

    被点名了

    coffee 点了我的名,我就来剖析一下自己 

    [转贴]游戏规则:

    1.被点到名字的要把所有的问题像我一样回答出来发一篇日志在自己的页面上,所有的 问题都要答。最后去掉一个(任意一个)问题,再提一个自己的问题,凑够30个。再点出另外八个人继 续回答,并列出这八个人的名字。还要到这八个人的页面留言通知对方——你被点名了。 被点名者不得拒绝回答问题。

    2.这八个人要在自己的日志里注明是从哪里接到的,并且再想一个问题传给其他八个人 ,让游戏继续下去,不得回传。被点到名字的人将会得到大家的祝福,并且所有美好的愿 望都会在不久的将来实现

    1.你愿意毁了生活,还是愿意让生活毁了你?

       有种就来毁我,看谁彪悍

    2.你会先结婚后恋爱?当然是和同一个人,理由?

       跟喜欢的人? 可以try

    3 .相信真正的爱情只有3个月的理论吗?

       不会那么短的

    .什么样的人才值得你爱? 

       有思想 知道自己在干什么 尊重别人 

    5.与朋友产生误会,你会怎么办?

       一个职业电话销售人员不会让人误会自己,我也一样

    .你小时侯的梦想是什么?

       地质学家,让我表妹作助手

    7 .你最理想的生活状态是什么?

        毁掉所多玛和蛾摩拉,如果上帝没有能力的话

    .如果你只能实现自己的一个愿望,你会许什么

       拥有制作绝世美食的能力

    .最喜欢的食物是什么?

        羊杂碎

    10.喜欢直发还是卷发?

        光头

    11.你最讨厌什么动物?

        猪,我不愿意有其他动物模仿我

    1.结了婚还可以偷偷喜欢其他人吗?

        不道德,不过YY也可以了

    1.最喜欢什么饮料?

        肉汤

    14.你喜欢太阳吗?

         喜欢 

    15.如果明天就是世界末日,那你今天会做什么?

         跑步和推杠铃,让我的肌肉兴奋,死也要死的像个英雄,不能像平时一样猥琐

    16.如果两个好朋友背着你在一起了,你还会继续跟她/他做朋友吗?

         这种事情我持反对态度,不过不影响友谊

    17 .如果旧爱回来你会重新开始吗?

         没兴趣

    18.冲动怎么克制自己?

         把想做的做了

    19.如果你爱的人骗了你,当他/她再次让你给他/她一次机会时,你怎么办啊?

       能骗了我,那就给我当老师吧

    20、人活着到底爲什麽?

         了解别人的胃口,并作出对人家胃口的菜

    21.走自己的路,可以不在乎别人说什么吗?

         我在乎别人的评价

    22、朋友不在身邊,會感到寂寞嗎?

         常常

    23.发现自己喜欢上一个人要多久?

        很漫长 

    24、最想為妳的那位做的一件事是什麽?

         让她有个好胃口

    25、妳相信緣分嗎?

       相信

    26.对我最大的期望是什么?

        可以搞定Statistical Learning

    27.人要是没有了睡觉的功能,你觉得好还是不好?

     

       好

     

    28. 最让你怀念的学生时代是什么时候(幼儿园小学初中高中大学)?为什么?

     

          大学

     

    29  你最近发生的一件糗事是什么?

     

          被西藏禁书吓到 

     

    30 我的问题:最让你怀念的一件事 

     

         10年前 不知多少个冬季早晨, 在寒风中 我在自由路上的 羊杂碎早点铺子吃得不亦乐乎...

     

    点名: Don Cutting, Duke, Billy, Jimmy, Vapnik, Thomas Cormen, Stawlt, Eric

    July 18

    霸者无双,智者无华,勇者无惧,仁者无敌

    霸者无双,智者无华,勇者无惧,仁者无敌 
    July 04

    苏联祭[zz]

    今年是公元2007年。一个既普通又不普通的年份。电视里正在热火朝天的宣传香港胜利回归十周年,奥运倒计时一周年,还有什么恢复高考三十周年。人们热烈而兴奋的谈论着这些周年纪念。可是在这繁华嚣嚷的背后,又还有多少人记得另一个重大的纪念——2007,伟大的十月社会主义革命胜利90周年。
      
      说来惭愧,即使我,也已经几乎要淡忘这个日子了,只是买了王蒙的《苏联祭》一书才想起来。可怜啊,曾经那么红红火火的纪念活动,如今还有谁提起?
      
      肯定有人又要跳出来大叫这是为苏联的专制独裁唱赞歌。对此,我已经懒于辩驳。当您这样攻击我时,这种语调、口气,又与文革中四人帮的态度有多大区别呢?我怎么能够据此认为您就代表了民主?民主不是有信仰自由么?我们可以信仰基督教、佛教、伊斯兰教;信仰资本主义、无go-vern-ment主义;为什么就不允许信仰Communist主义?
      
      苏联,一个辉煌的70年大梦。有过太多的兴奋、太多的激动、太多的悲伤。很难想像,在人类历史的长河中,有这么一个地方,在短短七十年里汇集了这么多永载史册的人和事。今天的我们,超然世外的对它作出种种貌似公正的评价,却完全忽略了它的本质——这是关于人类永恒理想的伟大实践,是一个绚丽的梦。
      
      如果你还是与我一样,相信这个世界应该公平,应该公正,信仰劳动光荣、剥削可耻的信条,追求正义,追求理想,那么你就应该和我一样对这些不朽的声音从心底深怀敬意:
      
      1.在我们的社会中, 劳动不仅是经济的范畴, 而且是道德的范畴。
                                 ——马卡连柯(苏联教育家)
      
      2.“一个人的生命应当这样度过:当他回首往事的时候不会因虚度年华而悔恨,也不会因碌碌无为而羞愧!”
       --保尔·柯察金
      
      3.“要使别人的生活由于你的生存而更美好!”
      
       --马特洛索夫(苏联英雄)
      
      4.“我爱祖国,直到心疼”
      
       --卓娅(苏联英雄)
      
      5.在我们劳动人民的国家内,需要千百万身体健壮、意志坚强、勇敢无畏、朝气蓬勃、坚韧不拔的人。
      
       --列宁
      
      ……
      
      还有那美妙的《喀秋莎》、《莫斯科郊外的晚上》、《苏丽河》、《神圣的战争》、《共青团员之歌》的旋律,有《这里的黎明静悄悄》、《青年近卫军》,还有《莫斯科不相信眼泪》……
      
      太多太沉的回忆,太久太忧伤的思考。我如同对初恋的恋人一样深沉的迷恋于这一切,我顽固的拒绝相信Communist主义已经失败。是的,苏联政治体制腐败黑暗,但是这与Communist主义信仰有何关系?苏联开创了历史,但是并不会书写历史。我们今天是义愤填膺的谴责苏联的极权专制,但是又有谁看到了这一切:苏联曾经是全球第一个戒掉赌场、妓院的国家;苏联的经济规模在二战前就已经是世界第2;苏联的科学家、文学家的人数和水平都曾长期远远高出西欧世界;当然,还有第一个宇航员以及众多的世界第一。当你们辛辣的讽刺苏联对文艺界的高压控制时,又偏偏是苏联贡献出了一个又一个伟大的作家、艺术家、导演、演员;一部又一部经典的小说、戏剧、电影;当你们拿一个个苏联的叛逃者说事时,又为什么不提起投奔苏联的那众多的科学家以及有志青年?他们是为了钱么?
      
      苏联的历史太沉重、太沉重。我无意为那个逝去的go-vern-ment辩护,但是却不能不为信仰呐喊。如同王蒙先生所说:“(面对苏联),就像面对青春,面对自己的灵魂,面对自己的经历,面对自己的美与丑,善与恶,褒与罚,年轻与衰老一样。”红场、克里姆林宫、列宁墓、阿芙乐尔巡洋舰、庞大的集体农场、庄严的莫斯科大学、辉煌的五一大阅兵……所有这一切,都不是能够让人所轻易忘记的。90年前,当那群衣衫褴褛的俄罗斯人愤怒的冲进冬宫时,他们所追求的、所渴望得到的难道是有人所诬蔑的赤色KB吗?请尊重历史,尊重信仰,任何对那场惊天动地的壮举的动机和目的作出诬蔑的言行都是我所不能接受的。这是对死者的亵渎!对崇高的灵魂的亵渎!
      
      “苏联解体了。世界上第一个社会主义大国的立、破、兴、衰,人类的相当一部分在这块广袤的大地上所进行的实验的英勇、荒唐、KB、富有魅力与终未成功;个中的经验教训、爱爱仇仇,则会长久的留在人们的记忆中,留在史册上,警戒着并且丰富着人类文明,使人类变得更加聪明与成熟。”
      
       ——王蒙《苏联祭》
      
      
      
      谨以此文纪念伟大的十月社会主义革命胜利90周年!


    转至:http://logger.blog.sohu.com/
    June 17

    有没有人想去San Bernardino Hiking的

    San Bernardino Peak

    Highlights:

    San Gorgonio Wilderness, city views, steep demanding hike, Washington Monument
    Near: Forest Falls, CA
    Scenery:
    Distance: 16 miles round trip
    Elevation Gain: 5100 ft
    Hike Time: 9 hours
    Difficulty: Strenuous
    Trail Condition: Well maintained trail
    HikeType: Out and Back


    Summary: This trail is a no-nonsense elevation gainer. however, it maintains a steady grade for a large portion of the trip. You begin in a mixed oak/pine forest and briskly head up the side of the ridge. Two miles into the trail you enter the San Gorgonio Wilderness, which is marked by a sign. The trail evens off a bit here, but not too much. You will be climbing and climbing some more. In two more miles you will reach a relatively flat area covered with Manzanita and chaparral. This flat area is your halfway reprieve, and it continues until you reach the trail junction for Columbine Springs and John's Meadow.

    From here it is 3.6 miles up and up to the top, I can't say much for the view, because I went during very wintry weather, and I couldn't see a thing. I imagine that on a clear day though, you can see all of Southern California.

    One neat thing is that you pass Colonel Washington's baseline monument which was the 1852 survey point for all land in SoCal.

    Trailhead: Take the 10 Freeway to Redlands, exit Ford, head North and follow Ford (it will turn into Judson) to Lugonia. There are no signs in Redlands that this is the 38, but it is. Turn right, heading East towards the mountains. Two and a half miles down the road, you will see Mill Creek Ranger Station. You need to stop here and get your permit. If you go during the week, getting the free permit should not be a problem, weekends maybe (most people want to go to San Gorgonio, so you might be okay anyway.)

    Continue on the 38, until you see the sign for Angelus Oaks. The trail is not marked from this direction, so as soon as you enter Angelus Oaks, turn right onto a road with some houses, follow it until you see the signs for the trail and trail parking. Park away from the roadway and begin your hike. (Lat:34.12222 Lon:-116.92255)

    Trail Guides for San Bernardino Peak:
    San Bernardino Mountain Trails - 100 Hikes in Southern California
    by John W. Robinson  (Wilderness Press)

    Day Hikers Guide to Southern California
    by John McKinney (Olympus Press)

    Best Seasons: Fall, Spring, Summer,
    User Groups: Hikers, Dogs,
    Ranger Contact: San Bernardino National Forest (909) 794-1123 - Mill Creek Ranger Station
    Localhikes Reporter: This hike was submitted by Allen Riedel, who has posted  123 other hikes on this site. To visit this reporters web site, click here.
    Trail Reviews  Page 1 of 2   Submit your own review
    Reviewed by DHZ on 6/11/2007
    Strenuous hike but the trail is well maintained. Didn't make it to the peak, started too late. There is water at Vivian Creek Camp. To get water from Halfway Camp you need to hike about 100 yards up the dry creek bed. There is water again at High Creek. Lots of smog - shame.

    Reviewed by Laura on 7/5/2006
    Only 9 people on the trail besides me on a holiday? Unreal!! Thankful for an early start as things really heated up through the day, and the manzanita on the descent was hot! But what a gorgeous trail, and views for miles in all directions. Still wildflowers blooming and water in Limber Pine Creek. Big thunderstorms brewed around 1:00 to the east but stayed there, despite growling at me and dumping rain on that side of the range. Came down too fast (worries about rain!), so would like to revisit and ease my way down for more enjoyment. Can't wait to explore more of the peaks along the ridge!

    Reviewed by Marvin on 5/28/2006
    I love this trail. Cloudy, cool (50s), and breezy today. I was hoping to see more spring flowers, but the ones that were there--beautiful four-pedaled yellow flowers and manzanita in bloom--made the hike worthwhile. Only went as far as the Manzanita Flats area today, but it was gorgeous--misty clouds blowing ghost-like across the tops of trees and the steady sound of wind in treetops. Love the rock outcroppings, variations in foliage, trees, and valley views to the north (west was cloud-obscured). See it while you can--bark beetles are ravaging the mountain, evidenced by the many dead trees, standing and fallen.

    Reviewed by Bruno on 2/22/2006
    Hiked on Sat 02/19. Made it to Limber Pine Creek at about 9500 feet. Due to time constraints we turned around. Fresh powder and snow drifts made us move slowly. Everthing was iced up and had snow; it was beautiful! Chilly day; around 20F most of the time.

    Reviewed by eric t on 9/19/2005
    Did this as an over night trip and stayed at Limber Pine. Extremly windy at the site! I'm not sure if this is the case year round but it appears to be since there were small windbreaks built at various camp sites. Dawn views were incredible. Pack your trail runners and make a quick ascent of Washington's Monument and San Bernardino peak. Lots of water at the Limber Pine spring.

    Reviewed by Girl Jo on 8/15/2005
    Hiked on 8-13-05. Good elevation gainer. The manzanita meadow area was such a beautiful & different area. The vistas from the Limber Pines Bench to San G and across was breathtaking. On the way down I also was surpised to be able to see Big Bear Lake across another ridge. The trail is well maintained and there is water at the stream above the Limber Campground. I'm a slow hiker and it was a 9 hr hike. This was a good prep hike for Whitney and less crowded than Vivian Ck to San G.

    Reviewed by jay on 8/5/2005
    Climbed on 7/3/05 by myself. Nice hike. I was turned back at the 2 mile mark by a Ranger. Had to go get a wilderness pass and then returned to start the hike around 3 pm. Reached Limber Pine camp (and away from the crowds)just before sunset. It was just me and two other hikers camping up there. The next morning I set out for the peak. Saw a couple of deer. Pretty sweet views @ the bench just before the monument.

    Reviewed by JR on 7/18/2005
    Four of us hiked this yesterday. It was in excellent condition. There is still some snow near the summit , but you don't need any special gear. The bugs, however, were pure torture. I have hiked this peak before in July and never experienced the gnat, mosquito and fly attacks like I did yesterday. It must be all the moisture from our exceptinally wet winter. Be warned!


    Notice: Traveling in the backcountry can be hazardous. You are responsible for informing yourself about these hazards and taking necessary precautions. Information on this web site comes from volunteer reporters and may contain errors or omissions. A current guidebook and proper equipment are essential for safe enjoyment of the hikes posted on this site.
    Keys: California Hiking, California Trails, California Hikes, San Bernardino County Hiking, San Bernardino County Trails, San Bernardino County Hikes

    腿脚懒了两天 又胖了

    明显发现胸 肚子,增加了脂肪。
     
    脸上还是肉。
     
    眼神还是那么空洞。
     
    操!
     
    我一定要节制肉类和淀粉的摄入!!!
     
    June 07

    《浪客剑心》--壬生狼 [zz]

    转一篇 别人写的纪录“齐藤一”的文章

     

     

    《浪客剑心》--壬生狼

     
     
     
     
    “对拔刀齐来说,你没战死,真是最大的不幸”——此话指的就是人称“壬生狼”的前新撰组第三分队组长齐藤一。他是剑心从幕末知道明治时代仍未分出胜负的敌手。以手中一把利刀,在这个私欲横流的新社会中,坚守“恶·即·斩”的信念——齐藤一就是这样一个不得不由衷钦佩的人。

    一、狼始终是狼

      齐藤一取材与真实的历史形象。幕末的的京都因倒幕运动一片混乱,为了对抗维新志士,幕府挑选了一批优秀的剑客组成新撰组,别称“壬生狼”。齐藤一就是其中出类拔萃的一个,据说铁面无情,常对犯错的组员实行“人斩”。
      
      《浪客剑心》上说道齐藤在明治时化名为“藤田五郎”,做了维新政府的密探。这似乎让人无法理解,但听到他在对政府要员涉海实行“人斩”时说的一段话就会明白——“你们此等维新义士或许以为明治时代是自己开创的吧,不过我们幕府的人却背负着‘失败者’的称号,为明治时代的开创赌上了自己的人生。所以我肯服从政府担任密探一职,就是为了履行生存在明治时代的新撰组的职责,去解决那些蚕食明治时代的流氓……因此大久保也好,什么人也好,只为一己之欲而给国家人民带来灾难的人,我便以‘恶·即·斩’的精神解决他!”
    这段话是齐藤一的一生。
      
      尤其是后面那句“养狗用饲料,养人用金钱,要想养壬生狼,那便谁也办不到!”经典至极。

    二、冷酷无情的男人

      就齐藤的造型来说,很像那种典型的恶人,刚开始让人难以接受,记得第一次在《浪客剑心》的TV上看到他时,就觉得很讨厌,还骂过“蜘蛛头”只类的话,甚至为了打击他而给志志雄和苍紫加油……汗!现在却是我最欣赏的人物之一,所以说第一印象通常不可靠。

      对齐藤造型的欣赏是从动笔画他开始的,这时真正的被他的脸部线条所吸引,越画越觉得有种剑心他们所不具备的男性魅力。剑心强硬的一面在于他的剑眉和十字刀疤,左之助则是头巾和直竖的头发,除了这些,剩下的都是优美。而齐藤却具有完全的男性特征。

      当年被我骂做“蜘蛛头”的那几缕额前的长发却是最能表现齐藤气质的核心。融阴险与正气于一体,似敌似友,亦正亦邪,正如他拥有“前新撰组第三队组长”和“现明治政府密探”两个互相对立的身份一样。奇怪的矛盾集合起来形成了这个气质独特的男人。

      身量高拔,双肩宽阔,即不是肌肉发达,也不像少女漫画的男主角一般纤细修长。

      现代化的警服配上一把传统的日本刀;总是敞着最上面的两颗纽扣;腰间跨着枪托,却从不带手枪;无论何时都戴着一双白手套——用“酷”来形容未免流于肤浅;“深沉”也不恰当;“阴沉”是用来形容苍紫的……宇水死前曾说,齐藤至始至终都是个“冷酷无情的家伙“……
    但无论用何种词语来描述,关键在于:他是一个很彻底的男人。

      这样的人只能将他与刀刃、鲜血、政治、战争……联想在一起,甚至应该看不的到有女性在他周围一百米以内出没。所以,当他说有妻子时,我是真是从板凳上掉了下来。难怪剑心他们那么吃惊,我都已经很久没被这样吓过。记得上一次是在看《龙珠》时知道贝吉塔和布尔玛好了的时候……
     
      不过正因此事,令齐藤给人的感觉多了那么一点点一点点温情。
     
    三、烟

      从第八集开始,就见齐藤在不断的重复着这样的动作:取烟、点烟、抽烟……具观察,齐藤好象从未将一根烟抽完,总是抽了一两口就扔掉了。这是习惯呢,还是太忙以至于没有抽完一整根烟的闲暇,亦或是警察的薪水很丰厚?

      在与志志雄恶战之后,齐藤用最后的(?)力量打破铁门,让剑心他们逃出去,自己却困在了即将崩溃的基地中……左之助大叫道:“齐藤!——”而他却取出香烟,划着火柴,点烟,缓缓的吸一口,然后转身走入熊熊火海中…………这情景怎能叫我忘怀!

    四、牙突

      新撰组的剑法别具一格。据说是近藤总队长根据日本剑法攻击招数中的“刺突”改进成新撰组的奇招。(“刺突”是在短距离内攻击对手胸脯要害的一招)。新撰组抱定“求精不求多”的原则,将每人最拿手的剑招改进,使之成为能让敌手一招毙命的杀手锏。齐藤的“牙突”堪称此中绝学。

      牙突的姿势犀利无比,极具魄力,又分为一、二、三式和零式。(牙突一式:常见的平刺;牙突二式:由上而下攻击;牙突三式:刀刃向上翻卷;牙突零式:在极短距离内,由上半身的力量攻击。)其中以零式最为厉害,齐藤曾以这一招腰斩“十刃”中最强之一的“心眼”宇水。

    五、恶·即·斩

      齐藤——我且不是或志志雄,但如你这般腰斩而死,可也……太凄惨了。

      宇水——妈的!

      齐藤——一个无法将自己的信念贯彻始终的人,无论是生是死,都是一场悲剧。

      宇水——你倒是一个不管何时何地……都那么冷酷无情的家伙……

      齐藤——咦,难不成你想我对你说些安慰的话?

      宇水——哼!……胡说八道……把自己的信念贯彻始终……听上去倒是很容易……齐藤……在逐渐步入现代化的明治社会中……你也能一直以手中的利刀,来贯彻“恶·即·斩”的信念吗?

      齐藤——当然。至死不变。

      当听到他说那句“一个无法将自己的信念贯彻始终的人,无论是生是死,都是一场悲剧”时,虽是炎热的夏季,却感到脊背发凉、只冒冷汗。就好像这句话不是针对宇水而是针对我所说!

      真的很惊讶这个男人可以那么毫不留情地将你隐藏在灵魂最深处的卑弱暴露无遗,再把你努力营造的自信捏得粉碎。最可怕的是,你不得不承认他说的每个字都如此正确!

      其实回想他以前就是这样。他能将剑心心中刽子手的灵魂硬生生地揪出来;能对着左之助受伤的肩膀一脚揣下去;能冷笑着说新月村村民“为了活命,就是被视做畜生也不要紧”……——直至那句“至死不变”,才可以长长的叹一口气,然后打心底的折服:

      齐藤一,是个了不起的男人。
     
     
    六、“恶人”与“狼”

      齐藤虽属于那种冷酷的人,但不像苍紫一般成天阴沉着脸。他倒是经常笑,只不过都是冷笑和嘲笑罢了。奇怪的是,“壬生狼”和背负着“恶”字的左之助竟是对很好的“搭档”“笨蛋”和“混蛋”一见面就又打又骂,但不知怎的,总觉得他们之间在滋生着一种特殊的情感……(不要误会我的意思)

      剑心曾说:“真正是左之助是一个比你想象中更有勇气和正义感的人……”

      齐藤答道:“这一点我早就知道。……尽管如此,他仍是个大笨蛋。”

      齐藤曾说:“喂,是分胜负的时候了,要插手的话,可要趁现在。”

      剑心说道:“……看来你很关心左之助呢!”

      齐藤答道:“别胡说,我只怕他一开始就死了。这可有点触霉头。”

      左之助:“这里……就是最终决斗地的遗迹……”

      弥彦想:“难道他是为了确定齐藤的生死才来……?”

      左之助:“我不认为那家伙会死掉,但是,他却没有理由能安全逃脱……究竟是他得胜便逃走了呢?抑或是战死了呢?若他死了,那便是我这残存者得胜。但是他在爆炸中消失了,已不能肯定他的生死……我只好……设法超越他了!”
    弥彦道:“超越他?难道你想超越齐藤?”

      左之助:“对。不但要超越他的超强实力,还要超越他的一切!”

      虽然一个是“无可救药的大傻瓜”,一个是“装模做样阴险男子”,但也许他们都不由自主的被对方人格中的某些东西所吸引。尤其是对左之助来说,满脸嘲讽的齐藤已成为他前进的潜动力,成为值得他“以命相博”去超越的目标。

    七、秋风

      虽然是意料之中的事,齐藤还是走了。

      一个从幕末直至明治时代最强的敌人在剑心的生活中消失了。我是带着崇敬看他远去的背影,但却带着另一种心情回想着那个在窗边抽烟的男人。

      剑心向他做最后决斗的挑战时,他是犹豫了的吧。坐在窗边抽了整整一烟缸的烟。是十年的岁月改变了他,还是他改变了自己?——也许他不曾改变,也许这就是真正的齐藤一,从未怀疑过自己动摇过信念有着绝对存在感的“壬生狼”。

      风起了,窗帘浮动,齐藤的侧影有种让人恍惚的错觉。模糊的眼中,感觉从未有过的温柔在弥漫。

      起风了,秋天到了。

    June 05

    又学了一句话

     

     

     

    life is hardly simple. it's simply hard.

    June 04

    被老师骂了

    原因居然是
    Why you try to make money SO desperately? 一脸鄙视!
     
     
    凄凉亚,到手的 羊肉又退回去了。
     
     
    其实 我这个年纪的,谁不在钱的问题上贪婪,何况,
     
    兄弟饿都饿瘦了。
     
    罢了 罢了
     
    安逸的生活还没结束,不过肯定的是, 党还期望着我 在不久的将来,
    在广大人民群众的广阔天地里,
    与天斗,
    与地斗,
    与人斗,
    大有作为一番
     
    June 02

    Static data and function in CPP

    from http://www.icce.rug.nl/documents/cplusplus/cplusplus10.html#l166

     

    The book "C++ Annotations"  is helpful to those need refer some basic grammar of CPP.

    http://www.icce.rug.nl/documents/cplusplus/cplusplus.html

     

    Chapter 10: Static data and functions

    Don't hesitate to send in feedback: send an e-mail if you like the C++ Annotations; if you think that important material was omitted; if you find errors or typos in the text or the code examples; or if you just feel like e-mailing. Send your e-mail to Frank B. Brokken.

    Please state the document version you're referring to, as found in the title (in this document: 6.5.0) and please state chapter and paragraph name or number you're referring to.

    All received mail is processed conscientiously, and received suggestions for improvements will usually have been processed by the time a new version of the Annotations is released. Except for the incidental case I will normally not acknowledge the receipt of suggestions for improvements. Please don't interpret this as me not appreciating your efforts.

    In the previous chapters we have shown examples of classes where each object of a class had its own set of public or private data. Each public or private member could access any member of any object of its class.

    In some situations it may be desirable that one or more common data fields exist, which are accessible to all objects of the class. For example, the name of the startup directory, used by a program that recursively scans the directory tree of a disk. A second example is a flag variable, which states whether some specific initialization has occurred: only the first object of the class would perform the necessary initialization and would set the flag to `done'.

    Such situations are analogous to C code, where several functions need to access the same variable. A common solution in C is to define all these functions in one source file and to declare the variable as a static: the variable name is then not known beyond the scope of the source file. This approach is quite valid, but violates our philosophy of using only one function per source file. Another C-solution is to give the variable in question an unusual name, e.g., _6uldv8, hoping that other program parts won't use this name by accident. Neither the first, nor the second C-like solution is elegant.

    C++'s solution is to define static members: data and functions, common to all objects of a class and inaccessible outside of the class. These static members are the topic of this chapter.

    10.1: Static data

    Any data member of a class can be declared static; be it in the public or private section of the class definition. Such a data member is created and initialized only once, in contrast to non-static data members which are created again and again for each separate object of the class.

    Static data members are created when the program starts. Note, however, that they are always created as true members of their classes. It is suggested to prefix static member names with s_ in order to distinguish them (in class member functions) from the class's data members (which should preferably start with d_).

    Public static data members are like `normal' global variables: they can be accessed by all code of the program, simply using their class names, the scope resolution operator and their member names. This is illustrated in the following example:

        class Test
        {
            static int s_private_int;
    
            public:
                static int s_public_int;
        };
    
        int main()
        {
            Test::s_public_int = 145;   // ok
    
            Test::s_private_int = 12;   // wrong, don't touch
                                        // the private parts
            return 0;
        }
    
    This code fragment is not suitable for consumption by a C++ compiler: it merely illustrates the interface, and not the implementation of static data members, which is discussed next.

    10.1.1: Private static data

    To illustrate the use of a static data member which is a private variable in a class, consider the following example:
        class Directory
        {
            static char s_path[];
    
            public:
                // constructors, destructors, etc. (not shown)
        };
    
    The data member s_path[] is a private static data member. During the execution of the program, only one Directory::s_path[] exists, even though more than one object of the class Directory may exist. This data member could be inspected or altered by the constructor, destructor or by any other member function of the class Directory.

    Since constructors are called for each new object of a class, static data members are never initialized by constructors. At most they are modified. The reason for this is that static data members exist before any constructor of the class has been called. Static data members are initialized when they are defined, outside of all member functions, in the same way as other global variables are initialized.

    The definition and initialization of a static data member usually occurs in one of the source files of the class functions, preferably in a source file dedicated to the definition of static data members, called data.cc.

    The data member s_path[], used above, could thus be defined and initialized as follows in a file data.cc:

        include "directory.ih"
    
        char Directory::s_path[200] = "/usr/local";
    
    In the class interface the static member is actually only declared. In its implementation (definition) its type and class name are explicitly mentioned. Note also that the size specification can be left out of the interface, as shown above. However, its size is (either explicitly or implicitly) required when it is defined.

    Note that any source file could contain the definition of the static data members of a class. A separate data.cc source is advised, but the source file containing, e.g., main() could be used as well. Of course, any source file defining static data of a class must also include the header file of that class, in order for the static data member to be known to the compiler.

    A second example of a useful private static data member is given below. Assume that a class Graphics defines the communication of a program with a graphics-capable device (e.g., a VGA screen). The initialization of the device, which in this case would be to switch from text mode to graphics mode, is an action of the constructor and depends on a static flag variable s_nobjects. The variable s_nobjects simply counts the number of Graphics objects which are present at one time. Similarly, the destructor of the class may switch back from graphics mode to text mode when the last Graphics object ceases to exist. The class interface for this Graphics class might be:

        class Graphics
        {
            static int s_nobjects;              // counts # of objects
    
            public:
                Graphics();
                ~Graphics();                    // other members not shown.
            private:
                void setgraphicsmode();         // switch to graphics mode
                void settextmode();             // switch to text-mode
        }
    
    The purpose of the variable s_nobjects is to count the number of objects existing at a particular moment in time. When the first object is created, the graphics device is initialized. At the destruction of the last Graphics object, the switch from graphics mode to text mode is made:
        int Graphics::s_nobjects = 0;           // the static data member
    
        Graphics::Graphics()
        {
            if (!s_nobjects++)
                setgraphicsmode();
        }
    
        Graphics::~Graphics()
        {
            if (!--s_nobjects)
                settextmode();
        }
    
    Obviously, when the class Graphics would define more than one constructor, each constructor would need to increase the variable s_nobjects and would possibly have to initialize the graphics mode.

    10.1.2: Public static data

    Data members can be declared in the public section of a class, although this is not common practice (as this would violate the principle of data hiding). E.g., when the static data member s_path[] from section 10.1 would be declared in the public section of the class definition, all program code could access this variable:
        int main()
        {
            getcwd(Directory::s_path, 199);
        }
    
    Note that the variable s_path would still have to be defined. As before, the class interface would only declare the array s_path[]. This means that some source file would still need to contain the definition of the s_path[] array.

    10.1.3: Initializing static const data

    Static const data members may be initialized in the class interface if these data members are of an integral data type. So, in the following example the first three static data members can be initialized since int enum and double types are integral data members. The last static data member cannot be initialized in the class interface since string is not an integral data type:
        class X
        {
            public:
                enum Enum
                {
                    FIRST,
                };
    
                static int const s_x = 34;
                static Enum const s_type = FIRST;
    
                static double const s_d = 1.2;
                static string const s_str = "a";    // won't compile
        };
    
    Static const integral data members initialized in the class interface are not addressable variables. They are mere symbolic names for their associated values. Since they are not variables, it is not possible to determine their addresses. Note that this is not a compilation problem, but a linking problem. The static const variable that is initialized in the class interface does not exist as an addressable entity.

    A statement like int *ip = &X::s_x will therefore compile correctly, but will fail to link. Static variables that are explicitly defined in a source file can be linked correctly, though. So, in the following example the address of X::s_x cannot be solved by the linker, but the address of X::s_y can be solved by the linker:

        class X
        {
            public:
                static int const s_x = 34;
                static int const s_y;
        };
    
        int const X::s_y = 12;
    
        int main()
        {
            int const *ip = &X::s_x;    // compiles, but fails to link
            ip = &X::s_y;               // compiles and links correctly
        }
    

    10.2: Static member functions

    Besides static data members, C++ allows the definition of static member functions. Similar to the concept of static data, in which these variables are shared by all objects of the class, static member functions exist without any associated object of their class.

    Static member functions can access all static members of their class, but also the members (private or public) of objects of their class if they are informed about the existence of these objects, as in the upcoming example. Static member functions are themselves not associated with any object of their class. Consequently, they do not have a this pointer. In fact, a static member function is completely comparable to a global function, not associated with any class (i.e., in practice they are. See the next section (10.2.1) for a subtle note). Since static member functions do not require an associated object, static member functions declared in the public section of a class interface may be called without specifying an object of its class. The following example illustrates this characteristic of static member functions:

        class Directory
        {
            string d_currentPath;
            static char s_path[];
    
            public:
                static void setpath(char const *newpath);
                static void preset(Directory &dir, char const *path);
        };
        inline void Directory::preset(Directory &dir, char const *newpath)
        {
                                                        // see the text below
            dir.d_currentPath = newpath;                // 1
        }
    
        char Directory::s_path[200] = "/usr/local";     // 2
    
        void Directory::setpath(char const *newpath)
        {
            if (strlen(newpath) >= 200)
                throw "newpath too long";
    
            strcpy(s_path, newpath);                    // 3
        }
    
        int main()
        {
            Directory dir;
    
            Directory::setpath("/etc");                 // 4
            dir.setpath("/etc");                        // 5
    
            Directory::preset(dir, "/usr/local/bin");   // 6
            dir.preset(dir, "/usr/local/bin");          // 7
        }
    
    • at 1 a static member function modifies a private data member of an object. However, the object whose member must be modified is given to the member function as a reference parameter.

      Note that static member functions can be defined as inline functions.

    • at 2 a relatively long array is defined to be able to accomodate long paths. Alternatively, a string or a pointer to dynamic memory could have been used.
    • at 3 a (possibly longer, but not too long) new pathname is stored in the static data member s_path[]. Note that here only static members are used.
    • at 4, setpath() is called. It is a static member, so no object is required. But the compiler must know to which class the function belongs, so the class is mentioned, using the scope resolution operator.
    • at 5, the same is realized as in 4. But here dir is used to tell the compiler that we're talking about a function in the Directory class. So, static member functions can be called as normal member functions.
    • at 6, the currentPath member of dir is altered. As in 4, the class and the scope resolution operator are used.
    • at 7, the same is realized as in 6. But here dir is used to tell the compiler that we're talking about a function in the Directory class. Here in particular note that this is not using preset() as an ordinary member function of dir: the function still has no this-pointer, so dir must be passed as argument to inform the static member function preset about the object whose currentPath member it should modify.

    In the example only public static member functions were used. C++ also allows the definition of private static member functions: these functions can only be called by member functions of their class.

    10.2.1: Calling conventions

    As noted in the previous section, static (public) member functions are comparable to classless functions. However, formally this statement is not true, as the C++ standard does not prescribe the same calling conventions for static member functions and for classless global functions.

    In practice these calling conventions are identical, implying that the address of a static member function could be used as an argument in functions having parameters that are pointers to (global) functions.

    If unpleasant surprises must be avoided at all cost, it is suggested to create global classless wrapper functions around static member functions that must be used as call back functions for other functions.

    Recognizing that the traditional situations in which call back functions are used in C are tackled in C++ using template algorithms (cf. chapter 17), let's assume that we have a class Person having data members representing the person's name, address, phone and weight. Furthermore, assume we want to sort an array of pointers to Person objects, by comparing the Person objects these pointers point to. To keep things simple, we assume that a public static

        int Person::compare(Person const *const *p1, Person const *const *p2);
    
    exists. A useful characteristic of this member is that it may directly inspect the required data members of the two Person objects passed to the member function using double pointers.

    Most compilers will allow us to pass this function's address as the address of the comparison function for the standard C qsort() function. E.g.,

        qsort
        (
            personArray, nPersons, sizeof(Person *),
            reinterpret_cast<int(*)(const void *, const void *)>(Person::compare)
        );
    
    However, if the compiler uses different calling conventions for static members and for classless functions, this might not work. In such a case, a classless wrapper function like the following may be used profitably:
        int compareWrapper(void const *p1, void const *p2)
        {
            return
                Person::compare
                (
                    reinterpret_cast<Person const *const *>(p1),
                    reinterpret_cast<Person const *const *>(p2)
                );
        }
    
    resulting in the following call of the qsort() function:
        qsort(personArray, nPersons, sizeof(Person *), compareWrapper);
    
    Note:
    • The wrapper function takes care of any mismatch in the calling conventions of static member functions and classless functions;
    • The wrapper function handles the required type casts;
    • The wrapper function might perform small additional services (like dereferencing pointers if the static member function expects references to Person objects rather than double pointers);
    • As noted before: in current C++ programs functions like qsort(), requiring the specification of call back functions are seldomly used, in favor of existing generic template algorithms (cf. chapter 17).

    May 30

    New Challenge :Numerical Optimization

     
     
    旧的事情没有搞定,又有新困难出现了。
    其实也就是了解一下 突优化 的一些经典解法。
    人家高中或者本科就烂熟在心了,俺至今还挣扎在不懂和懂的边缘。
     
    近一个月效率很低,
    是因为接触的东西太陌生?
    还是因为惰性?
     
    总是很困,无家可归了一个月了,
    效率低所以必须要花更多的时间,
    于是
    眼睛就很疼,胸口也堵得慌
     
    敌人太强大了!
    难道非要鱼死网破
    需要点耐心和天分
    才能闯过这一关
     
    按照 战斗计划,这个月应该是收获的一个月
    但是因为低估了敌人的实力,我军陷入了弹尽粮绝的境地,
    小米加步枪更本就不是人家美式装备的对手
     
    等死吧!
    反正爷爷从今天起一天吃两顿,能死快点
    爷爷死的也牛逼
    临死前也要那你这些Tree Kernel, SVM, Shrink Algorthm, Prime/Dual Form, Mini-Risk, KKT Condition, Quadratic Programming ....
    统统拉下水,垫背。
     
    切,高维空间也就那么点操性,装神弄鬼,不就是近似与优化么。
    看谁玩死谁
    在来一周瞧瞧
    May 15

    strtok

     
    #include<string.h>
     
    char *(strtok)(char *s1, const char *s2)
    {
       char * sbegin, *send;
       static char *ssave = "";
     
       sbegin = (s1) ? s1 : ssave;
       sbegin += strspn(sbegin, s2);
       if(*sbegin == '\0')
       {
           ssave = "";
           return NULL;
       }
     
       send = strpbrk(sbegin, s2);
       if(*send != '\0')
            *send++ = '\0';
     
       ssave = send; 
     
       return sbegin;
    }
     
     
    /**
     *
     *   1061 is beautiful
     *
     */
     
     
    May 11

    雪钟花

     
    雪钟花雪钟花在哪里我想念你
    在清晨在夜晚我在思念在哭泣
    那曾经美好的时光时光永远沉醉的梦想
    那结伴同行的岁月给我勇往直前的力量
    那曾经温暖的时光时光流连忘返的故乡
    那奔腾燃烧的岁月永生难忘
     
     
    雪钟花哦雪钟花在这里等着你
    夜空中有一颗星他是我破碎的心
    那曾经美好的时光时光永远沉醉的梦想
    那结伴同行的岁月给我勇往直前的力量
    那曾经温暖的时光时光流连忘返的故乡
    那奔腾燃烧的岁月永生难忘
    April 03

    重新发明轮子

    目前游荡于纯linguistic理解的NLP 和 纯statistic理解的NLP。
    痛苦的感受到纯statistic理解对模型限制之强, 而linguistic那边风格怪异,又不成体系。
    有时候,
    你必须重新发明轮子,
    因为
    你在火星。
     
    中间人说:
    There remain may nuances in the recipe that do not alter this worldview but can make our trip to obtain good results more directly.
     
    March 29

    上传了最近一个月的照片

    把最近一个月的照片上传了
    包括
    1. M Street钓的蜘蛛蟹
    2. 蒸馒头 煮肉
    3. M Street钓的蝎子鱼和Perch
    4. 80刀买的Washburn垃圾琴(毕竟是Washburn 动静不错)和百威的小箱子
    5. 其实最近我还在blue lake和M street分别钓了些大嘴鲈和sand bass, 不过那条sand bass不够大 被我放生了
     
    比较堕落的事情是:
    1. 看完了连续剧 血色浪漫1 和 血色浪漫2
        觉得2比1更好看,可能是我以前看过王朔那本《玩的就是心跳》,也可能我习惯于把吃饱的感觉归咎于最后一个馒头吧。
        卑鄙是卑鄙者的通行证, 高尚是高尚者的墓志铭
     
    比较笨的事情是:
    1. 买了ACER的500块的本本 之后才知道不hot. 没打开 明天去退
    2. QA Search的工作 目前处于停滞状态,以前的思路是 把Answer Pattern 的选择,首先作为一个分类问题处理,之后从feature vector上导出Answer Pattern。目前的困境是 不知道Answer Sentence的feature vector什么. New Grammar Tree的结构是松散的树结构,如果采用树结构作为feature的话(这个是理想情况),就要严格定义树之间的距离,这个做法似乎是王道 可是老爷子不会给我这么多时间的。
    一个 凑数的做法是用Grammar Tree的所有节点做一个Vector, 每个Vector的节点有不同的关键词,如某vector node是PP, 则包括关键词 where, of, in , at, for,...每个关键词 对应个数字(合理么?) 对于NP 则等于Question中的NP(这个作为Query的必要因素)。不过这样的做法 怎么处理 Answer中包含的Grammar Compoent不唯一的情况呢?
    ----看来起义要提前发起了!
     
     
       
    March 27

    6 steps to creating a super startup

    6 steps to creating a super startup

    Thinking about starting a business? Follow these crucial tips and your company might just become the next big thing.

    FORTUNE Small Business Magazine
    By Anne Field
    March 26 2007: 4:53 PM EDT

    (Fortune Small Business) -- If you want to be an entrepreneur, you're in good company. An average of 464,000 adults a month create new businesses, according to the most recent statistics available from the Kauffman Foundation (kauffman.org), which tracks and promotes entrepreneurship.

    But starting a business is a complicated, risky, all-consuming effort. Indeed, just two-thirds of new small businesses survive at least two years, and only 44 percent survive at least four years, according to a study by the U.S. Small Business Association.

    business_startup.03.jpg
    Quiz launchTake the quiz
    Are you ready to start your own business? Being your own boss may sound great, but not everyone has what it takes to succeed as an entrepreneur. Do you?

    1. If I have to, I'm willing to lower my standard of living for a while - take fewer (or no) vacations and cut back on nonessentials like eating out - while trying to get my business off the ground.
    True
    False

    Taking the six steps below will help put you on the road to success.

    1. Determine if you're an entrepreneur or just a wannabe. Starting a successful business requires a unique set of characteristics. You have to be willing to take calculated risks. In addition, a mix of optimism, high energy, and an ability to live with ambiguity are also crucial.

    According to a recent study of 1,600 Columbia Business School alumni who started businesses, the desire most related to success was the inclination to build something.

    "They took a long-term view," says Murray Low, director of the Eugene M. Lang Center for Entrepreneurship at Columbia.

    Make sure you're prepared to wear many hats, at least in the beginning. "You need to be willing to meet with the chairman of the board, then go back to the office and fix the toilet," says Low.

    2. Pinpoint an opportunity. There are lots of ways to find the right business idea. But for most people, it's wise to begin with your interests, say small-business experts.

    "You should start with what you know best and are most passionate about," says Sarah Chiles, director of Programs at NYU Stern's Berkley Center for Entrepreneurial Studies.

    Back in 1999, Julie Dix started sewing satin tags onto her baby's blankets, after she discovered the infant liked playing with soft edges. Soon, other mothers began telling her what a great idea it was. That's when she teamed with friend Danielle Ayotte and formed Spencer, Mass.-based Taggies. Today, the company sells the blankets, and dozens of other products in six countries.

    The bottom line: "You have to find an underlying need that's not being fully met," says Timothy Faley, managing director of the Samuel Zell & Robert H. Lurie Institute for Entrepreneurial Studies at the University of Michigan's Ross School of Business.

    3. Make sure there's a market for your idea. Get out there and talk to as many potential customers, suppliers and distributors as you can. Trade-show attendees are a particularly good source of information. And remember: You're not trying to sell anything yet; you're just exploring the opportunity.

    "Everyone will be more willing to talk if they think you're just looking for information," says Faley.

    It's also a good idea to make a prototype of your product, so customers can test it out. That goes even for low-tech wares. Early on, Dix and Ayotte made samples and brought them to crafts fairs, as well a local store. When it sold out in just a few days, they knew they were onto something.

    As you get feedback, good or bad, fine-tune your concept accordingly.

    4. Write a business plan. Any plan needs to answer a few key questions: What is your product or service? Who is your customer? What need does it address? And, how are you going to turn your idea into a money-making venture?

    The plan "should lay the foundation on which you build your business," says Faley.

    Divide the document into a few sections. First, and perhaps most important, is the executive summary, detailing in no more than two pages the key information in your plan.

    Next should be a market analysis that describes the needs you're addressing and any potential competitors; a discussion of your marketing plans and the management team; and a financial analysis of the first five years in business, with a sample income statement and balance sheet.

    Be prepared to revisit the plan many times. "It should grow and change along with your company," says Faley.

    5. Determine your business structure. You have four basic choices -- sole proprietorship, partnership, LLC, or corporation. Each offers different legal protections, tax savings, and ownership requirements. They also vary in how complicated they are to set up.

    For example, sole proprietorships and partnerships require little paperwork to establish, but also don't provide the tax breaks and liability protections of other structures.

    With limited liability companies (LLCs), you are personally protected from creditors and lawsuits and can have as many owners as you'd like.

    Corporations also shield your personal assets from creditors and provide various tax breaks. If you incorporate as a C corporation, owners are not responsible for liabilities, because the corporation is considered to be a separate legal entity. But there's also a double taxation, on both earned dividends and profits. An S corporation avoids that problem by having shareholders report earnings on their personal tax forms. But there are limitations on who and how many people can be shareholders.

    6. Look for funding. Most entrepreneurs start their businesses by dipping into their savings, and hitting up friends and family. Perhaps half of all startups, in fact, are funded initially by the founder's credit cards, according to Faley.

    Getting a bank loan is tough unless you have assets - and that often means using your home as collateral.

    Other likely sources include potential suppliers and even prospective customers, who might be willing to help out in return for steep discounts.

    What about venture capital? Fact is, VCs rarely invest in startups.

    March 17

    strtoken 分割char*

         
    Sample Code :
     
          #include <syslib.h>
          #include <string.h>
          #include <stdio.h>

          main()
          {
            char s[]="Golden Global View";
            char *d=" ";
            char *p;
            
            
            p=strtok(s,d);
            while(p)
            {
              printf("%s\n",s);
              p=strtok(NULL,d);
            }

            getchar();
            return 0;
          }
    March 06

    shell script

    Shell Script设计要点

    Shell Script其实就是命令集,可以构成功能强大的命令文件。由于linux命令多,而且功能强大,加上Shell Script提供的完整程序解释程序以及读取和执行你自己的shell程序手段,几乎成了linux管理人员的必修课。
    Shell Script本身学起来很简单,但由于linux命令多且功能参数多,写Shell Script有时并不是容易的事,要靠日积月累。
    要掌握的内容有:
    Shell Script如何构成命令文件
    Shell Script变量
    Shell Script参数
    登录 Script
    交互输入和命令替换
    自动化状态变量
    流程控制
    信号
    *****************************
    Shell Script如何构成命令文件
    1.用文本编辑器写入任何标准的Linux命令或管道行,或相关的一组命令或管道行;
    2.用chmod命令将这一文件变为可执行文件。
    然后可象执行其它文件一样来执行它。
    最简单的例子:
    vi编辑dirsize文件含以下行:
    ls /usr/sbin |wc -w
    然后执行:
    chmod 755 dirsize
    这样在当前目录下就形成了dirsize命令文件,试着运行 :
    ./dirsize
    将列出/usr/sbin目录下文件个数。

    *****************************

    ❑ Shell Script变量

    所有的程序都用到变量,Shell Script也不例外。变量就是一到多个内存单元标以名称,或者说将变量的内容存到一到多个内存单元中。除了我们可以定义变量外,linux系统或一些应用程序已经在shell设置了一些变量。
    1. linux shell著名的变量有:PS1,PS2,PWD,UID,PATH,HOME
    其中,PS1和PS2是shell提示字符串,它们的作用你用echo查一下就知道了:
    echo $PS1
    echo $PS2
    如果还不明白,就给它一些值,如:
    PS1='what is PS1?'
    echo $PS1
    你会在shell下看到变化吗?
    PWD就不用说了,经常用,一般不要让它变化,在转到不同路径时,系统会重新给它值。
    UID是用户识别号。
    PATH是环境变量,多项值用:号分开,让shell按PATH中列出的目录去找执行文件。如果多个目录中有相同名称的可执行文件,以第一个找到的为算,下面就不再找了。找的次序是从前往后,你可以修改它的值,让shell能找到,并正确执行要找的文件。
    HOME是登录系统时,存放某登录用户家目录的完整路径名,常用~来代替HOME,用cd 命令回到的地方。
    2.自定义变量很方便,在shell下可直接给值:
    myvar='This is shell test!'
    查看用echo命令:
    echo $myvar
    在echo命令行中,变量名前要加$,否则,echo会当字符串来操作,而不是当做命令。
    对了,在shell script编程中,echo命令是用得最多的,要掌握熟练哟。
    在ehco中变量后的空格,意味着变量的结束,就是说你的变量不能有空格,如果你的变量组合(运算)要用()将整个变量表达式放在一起:
    echo My kernel ver is : $(uname -r )
    echo Now time is : $(date |tr -s ' ' |cut -d' ' -f4)
    3.让变量字符串在使用时不留空格空方法
    对比:
    myvar=Th
    echo $myvaris test!
    结果为: test!
    因为echo 将$myvaris理解为变量,没有给值的被置空,你的想法不能实现。
    echo ${myvar}is test!
    结果为:
    This test!

    这是你的想法。用{}来处理类似问题。
    4.shell的局部变量和全局变量
    如果不声明,上面所用的都是局部变量,只适用于当前shell.
    要适用于当前用户的所有shell,可用export来声明,如:
    export myvar

    export myvar='This public var test!'
    *****************************

    ❑ Shell Script参数

    1.在实用的shell script中,一般都要用到Shell Script参数。表示形式为:
    $n
    n=0,1,2......
    $0 代表命令本身(命令行的第一个字,至空格结束),在Script中可用以对该命令再操作;
    $1 代表命令后的第一个参数(命令行的第二个字,至空格结束);
    $2 代表命令后的第二个参数(命令行的第三个字,至空格结束);
    举例说明更容易理解:
    dirsize /uer/sbin /usr /etc
    $0=dirsize
    $1= /uer/sbin
    $2=/usr
    $3=/etc
    如果我们想用dirsize对/uer/sbin /usr /etc 目录文件分别计数,或任何三个目录(或以上,参见后面的流程控制)的文件计数,在“❑ Shell Script如何构成命令文件”中的例子显然无能为力。这个要用到Shell Script参数。
    vi dirsize
    包含以下内容:
    echo $1 dirsize is:
    ls $1 |wc -w
    echo $2 dirsize is:
    ls $2 |wc -w
    echo $3 dirsize is:
    ls $3 |wc -w

    就能列出三个目录下的文件个数。
    如果参数不足,以当前目录作为参数。
    2.PATH变量的设置
    做为程序,特别是常用的程序,输入完整路径是件麻烦的事,有必要通过PATH参数的设置,使得在任何目录环境下都能执行,这里还以dirsize为例。
    查看当前PATH参数
    debian:~# echo $PATH
    /usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/games
    在当前用户家目录下建立一个myshell目录,并在PATH中加入该目录。
    debian:~# mkdir ~/myshell
    debian:~# mv dirsize ~/myshell
    debian:~# PATH=$PATH:~/myshell
    debian:~# echo $PATH
    /usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/games:/root/myshell
    试着转到/usr目录来执行dirsize
    debian:~# cd /usr
    debian:/usr# dirs(用tab补齐,已经能看到dirsize)
    dirs dirsize dirsplit
    debian:/usr# dirsize /bin /usr /etc
    /bin dirsize is:
    100
    /usr dirsize is:
    13
    /etc dirsize is:
    210

    ************************************************

    登录 Script

    登录 Script,分为两种情况,全局登录 Script和用户登录 Script.
    1.全局登录 Script,是由系统管理员建立的登录 Script,适用于所有用户,执行优先于用户登录 Script。存放在:
    /etc/profile
    2.用户登录 Script,必须存放在起始目录下(HOME,即~)才能执行。
    有三个文件可用于写用户登录 Script:
    ~/.bash_profile
    ~/.bash_login
    ~/.profile
    bash按上面的顺序找这些文件,并且只执行最先找到的一个。
    3.当退出登录时,bash也能执行退出登录Script,这个文件存放在:
    ~/.bash_logout

    *****************************

    ❑ 交互输入和命令替换
    1.交互输入
    交互输入就是以交互方式从键盘取值,然后将值存放在变量中。

    1.1用read命令和REPLY变量,实现交互输入
    用示例更容易理解:
    vi test1
    echo -n 'what's your name:'
    read
    echo your name is: $REPLY


    debian:~#chmod +x test1
    debian:~#./test1
    what's your name:my test1
    your name is: my test1
    这里的-n作用是抑制新换行符输出,能够在同一行输入字符。
    REPLY作用是直接获取标准输入设备读取的字符串。

    1.2如果在read命令后指定变量,输入行将直接送给变量,而不送给REPLY。
    vi test2

    echo -n 'what's your name:'
    read first second last
    echo The first word was: $first
    echo The second word was: $second
    echo The last word was: $last

    debian:~#chmod +x test2
    debian:~#./test1
    what's your name: a b c
    The first word was: a
    The second word was: b
    The last word was: c

    如果参数不够用,没有用到的置空(null)

    debian:~#./test1
    what's your name: a b
    The first word was: a
    The second word was: b
    The last word was:

    如果参数多,多余的被放在最后:

    debian:~#./test1
    what's your name: a b c d e
    The first word was: a
    The second word was: b
    The last word was: c d e

    2.命令替换

    命令替换就是将管道行的输出给值变量。
    示例说明:
    [root@main ~]# date
    Sat Mar 11 13:16:05 CST 2006
    [root@main ~]# datestore=$(date)
    [root@main ~]# date
    Sat Mar 11 13:16:14 CST 2006
    [root@main ~]# echo $datestore
    Sat Mar 11 13:16:11 CST 2006

    有一条常用的替换命令是basename,这条命令用完整的文件路径名作为参数,去除路径名,只送回文件名:

    [root@main ~]# file1=$(basename /usr/sbin/sucap)
    [root@main ~]# echo $file1
    sucap

    在shell script中,命令替换是经常使用的方法,需要熟练掌握。

    ***************************************************

    自动化状态变量

    所有的linux命令程序,在设计时都 做了规定,它们运行结束后都返回一个值,这个值称为它的退出状态(exit status),退出状态为0值表示程序运行正常,非0值表示退出不正常。对退出的非0值所代表的意思,可参考源代码或相关的说明。
    自动化状态变量,是指在编写的shell script中,针对所使用linux命令对应的退出状态采取自动化或程序化处理方法。同时要求,在编写shell script时,除了正常退出非0值外,对非正常值在程序中做出说明或注释,以便采取相应措施或方便其它shell script调用时进行自动化处理。
    1、对于管道行来说,返回状态只是管理行中最后一条命令返回退出状态。
    2、运行 linux命令或管道行时,shell用$?这一特殊变量来保存返回状态值。
    如:
    debian:~# cat xyz
    cat: xyz: 没有那个文件或目录
    debian:~# echo $?
    1
    debian:~# echo $?
    0
    试图列出当前目录xyz文件的内容,由于没有这个文件,返回值为1。由于已经正确执行了echo $?,并得到了返回值,所以再执行echo $?时,返回值为1。
    3、在shell script中,用exit n命令规定返回状态值:
    debian:~# cat >xyz
    exit 3
    Ctr-d
    debian:~#chmod +x xyz
    debian:~#./xyz
    debian:~#echo $?
    3
    debian:~#echo $?
    0
    4、主要状态变量
    4.1 $?
    用来保存shell 最后执行的命令退出状态值。
    4.2 $$
    用来保存当前shell的PID。
    debian:~# su chinajz
    chinajz@debian:/root$ cd ~
    chinajz@debian:~$ ls
    Desktop hyzqstock40jy.exe Projects swfdec-0.3.6
    chinajz@debian:~$ touch test$$
    chinajz@debian:~$ ls
    Desktop hyzqstock40jy.exe Projects swfdec-0.3.6 test6846
    用touch test$$创建了test6846文件,PID=6846。
    4.3 $#
    它保存传送给当前script命令的参数数目。对应于$1,$2,$3...的个数。这个是很有用的。
    4.4 $*
    它保存传送给当前script命令的所有参数。对应于$1,$2,$3...的清单。
    4.5 对于上面的四个状态变量,只能对其取值,而不能给值。

    ************************************************

    一句有哲理的话

     
    直到昆哥和阿芬死后,我才知道 人为什莫要吸毒。
    其实原因 只有一个:
      空虚
     
                                        -------电影《门徒》