• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Matrix
            Klarke's C/C++ Home
            posts - 61,comments - 0,trackbacks - 0

            ---> pdfujitsu01 


            /icd/secure_fujitsu/Fujitsu-PD/

            /icd/secure_fujitsu/Fujitsu-PD/ryon/CM5M202/CCR921352

            posted @ 2011-08-31 09:17 Klarke 閱讀(2620) | 評論 (0)編輯 收藏
            好的編程原則跟好的系統(tǒng)設(shè)計(jì)原則和技術(shù)實(shí)施原則有著密切的聯(lián)系。下面的這些編程原則在過去的這些年里讓我成為了一名優(yōu)秀的程序員,我相信,這些原則對任何一個開發(fā)人員來說,都能讓他的編程能力大幅度的提高,能讓他開發(fā)出可維護(hù)性更強(qiáng)、缺陷更少的程序。

                  我不要自我重復(fù) — 這也許是在編程開發(fā)這最最基本的一個信條,就是要告訴你不要出現(xiàn)重復(fù)的代碼。我們很多的編程結(jié)構(gòu)之所以存在,就是為了幫助我們消除重復(fù)(例如,循環(huán)語句, 函數(shù),類,等等)。一旦程序里開始有重復(fù)現(xiàn)象的出現(xiàn)(例如很長的表達(dá)式、一大堆的語句,但都是為了表達(dá)相同的概念),你就需要對代碼進(jìn)行一次新的提煉,抽象。

              http://en.wikipedia.org/wiki/Don%27t_repeat_yourself
                  提煉原則 — 跟“不要自我重復(fù)原則”相關(guān),這一原則是說“程序中任何一段具有功能性的代碼在源代碼文件中應(yīng)該唯一的存在。”

              http://en.wikipedia.org/wiki/Abstraction_principle_(programming)

              保持簡單 — 簡單化(避免復(fù)雜)永遠(yuǎn)都應(yīng)該是你的頭等目標(biāo)。簡單的程序讓你寫起來容易,產(chǎn)生的bug更少,更容易維護(hù)修改。

              http://en.wikipedia.org/wiki/KISS_principle

              不要開發(fā)你目前用不到的功能 — 除非你真正需要用到它,否則不要輕易加上那些亂七八糟用不到的功能。

              http://en.wikipedia.org/wiki/YAGNI

              用最簡單的方法讓程序跑起來 — 在開發(fā)時有個非常好的問題你需要問問自己,“怎樣才能最簡單的讓程序跑起來?”這能幫助我們在設(shè)計(jì)時讓程序保持簡單。

              http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html

              不要讓我動腦子 — 這實(shí)際上是Steve Krug 關(guān)于web界面操作的一本書的書名,但也適用于編程。主旨是,程序代碼應(yīng)該讓人們花最小的努力就能讀懂和理解。如果一段程序?qū)τ陂喿x者來說需要花費(fèi)太多的努力才能理解,那它很可能需要進(jìn)一步簡化。

              http://www.sensible.com/dmmt.html

              開放/封閉原則 — 程序里的實(shí)體項(xiàng)(類,模塊,函數(shù)等)應(yīng)該對擴(kuò)展行為開放,對修改行為關(guān)閉。換句話說,不要寫允許別人修改的類,應(yīng)該寫能讓人們擴(kuò)展的類。

              http://en.wikipedia.org/wiki/Open_Closed_Principle

              為維護(hù)者寫程序 — 任何值得你編寫的程序在將來都是值得你去維護(hù)的,也許由你維護(hù),也許由他人。在將來,當(dāng)你不得不維護(hù)這些程序時,你對這些代碼的記憶會基本上跟一個陌生人 一樣,所以,你最好還是當(dāng)成一直在給別人寫程序。一個有助于你記住這個原則的辦法是“寫程序時時刻記著,這個將來要維護(hù)你寫的程序的人是一個有嚴(yán)重暴力傾 向,并且知道你住在哪里的精神變態(tài)者”。

              http://c2.com/cgi/wiki?CodeForTheMaintainer

              最少意外原則 — 最少意外原則通常是使用在用戶界面設(shè)計(jì)上,但這個原則同樣適用于編寫程序。程序代碼應(yīng)盡可能的不要讓閱讀者感到意外。也就是說應(yīng)該遵循編碼規(guī)范和常見習(xí)慣,按照公認(rèn)的習(xí)慣方式進(jìn)行組織和命名,不符常規(guī)的編程動作應(yīng)該盡可能的避免。

              http://en.wikipedia.org/wiki/Principle_of_least_astonishment

              單一職責(zé)原則 — 一個代碼組件(例如類或函數(shù))應(yīng)該只執(zhí)行單一的預(yù)設(shè)的任務(wù)。

              http://en.wikipedia.org/wiki/Single_responsibility_principle

              最小化耦合關(guān)系 — 一個代碼片段(代碼塊,函數(shù),類等)應(yīng)該最小化它對其它代碼的依賴。這個目標(biāo)通過盡可能少的使用共享變量來實(shí)現(xiàn)。“低耦合是一個計(jì)算機(jī)系統(tǒng)結(jié)構(gòu)合理、設(shè)計(jì)優(yōu)秀的標(biāo)志,把它與高聚合特征聯(lián)合起來,會對可讀性和可維護(hù)性等重要目標(biāo)的實(shí)現(xiàn)具有重要的意義。”

              http://en.wikipedia.org/wiki/Coupling_(computer_programming)

              最大化內(nèi)聚性 — 具有相似功能的代碼應(yīng)該放在同一個代碼組件里。

              http://en.wikipedia.org/wiki/Cohesion_(computer_science)

              隱藏實(shí)現(xiàn)細(xì)節(jié) — 隱藏實(shí)現(xiàn)細(xì)節(jié)能最小化你在修改程序組件時產(chǎn)生的對那些使用這個組件的其它程序模塊的影響。

              http://en.wikipedia.org/wiki/Information_Hiding

              笛米特法則(Law of Demeter) — 程序組件應(yīng)該只跟它的直系親屬有關(guān)系(例如繼承類,內(nèi)包含的對象,通過參數(shù)入口傳入的對象等。)

              http://en.wikipedia.org/wiki/Law_of_Demeter

              避免過早優(yōu)化 — 只有當(dāng)你的程序沒有其它問題,只是比你預(yù)期的要慢時,你才能去考慮優(yōu)化工作。只有當(dāng)其它工作都做完后,你才能考慮優(yōu)化問題,而且你只應(yīng)該依據(jù)經(jīng)驗(yàn)做法來優(yōu) 化。“對于小幅度的性能改進(jìn)都不該考慮,要優(yōu)化就應(yīng)該是97%的性能提升:過早優(yōu)化是一切罪惡的根源”—Donald Knuth。

              http://en.wikipedia.org/wiki/Program_optimization

              代碼復(fù)用 — 這不是非常核心的原則,但它跟其它原則一樣非常有價(jià)值。代碼復(fù)用能提高程序的可靠性,節(jié)省你的開發(fā)時間。

              http://en.wikipedia.org/wiki/Code_reuse

              職責(zé)分離 — 不同領(lǐng)域的功能應(yīng)該由完全不同的代碼模塊來管理,盡量減少這樣的模塊之間的重疊。http://en.wikipedia.org/wiki/Separation_of_concerns

              擁抱變化 — 這是Kent Beck的一本書的副標(biāo)題,它也是極限編程和敏捷開發(fā)方法的基本信條之一。很多的其它原則都基于此觀念:面對變化,歡迎變化。事實(shí)上,一些經(jīng)典的軟件工程 原則,例如最小化耦合,就是為了讓程序更容易面對變化。不論你是否采用了極限編程方法,這個原則對你的程序開發(fā)都有重要意義。http://www.amazon.com/gp/product/0321278658

            posted @ 2011-08-18 14:01 Klarke 閱讀(196) | 評論 (0)編輯 收藏
            restoreDesign . tri_des_rx_1
            saveTestcase -dir case

            PS:
            restore_setting.tcl
            posted @ 2011-08-12 14:02 Klarke 閱讀(155) | 評論 (0)編輯 收藏
            cvs: error while loading shared libraries: libcrypto.so.4: cannot open shared object file: No such file or directory
            posted @ 2011-08-08 16:06 Klarke 閱讀(109) | 評論 (0)編輯 收藏
            Os:
            uname -a
            cat /etc/issue

            Cpu:
            cat /proc/cpuinfo
            head /proc/meminfo
            posted @ 2011-08-05 16:02 Klarke 閱讀(102) | 評論 (0)編輯 收藏

            Here are a few examples. Also see the documentation for the `-d' option in the previous section.

            • To print the date of the day before yesterday:
              date --date='2 days ago'
              
            • To print the date of the day three months and one day hence:
              date --date='3 months 1 day'
              
            • To print the day of year of Christmas in the current year:
              date --date='25 Dec' +%j
              
            • To print the current full month name and the day of the month:
              date '+%B %d'
              
              But this may not be what you want because for the first nine days of the month, the `%d' expands to a zero-padded two-digit field, for example `date -d 1may '+%B %d'' will print `May 01'.
            • To print a date without the leading zero for one-digit days of the month, you can use the (GNU extension) - modifier to suppress the padding altogether.
              date -d=1may '+%B %-d'
              
            • To print the current date and time in the format required by many non-GNU versions of date when setting the system clock:
              date +%m%d%H%M%Y.%S
              
            • To set the system clock forward by two minutes:
              date --set='+2 minutes'
              
            • To print the date in the format specified by RFC-822, use `date --rfc'. I just did and saw this:
              Mon, 25 Mar 1996 23:34:17 -0600
              
            • To convert a date string to the number of seconds since the epoch (which is 1970-01-01 00:00:00 UTC), use the `--date' option with the `%s' format. That can be useful in sorting and/or graphing and/or comparing data by date. The following command outputs the number of the seconds since the epoch for the time one second later than the epoch, but in time zone five hours later (Cambridge, Massachusetts), thus a total of five hours and one second after the epoch:
              date --date='1970-01-01 00:00:01 UTC +5 hours' +%s
              18001
              
              Suppose you had not specified time zone information in the example above. Then, date would have used your computer's idea of the time zone when interpreting the string. Here's what you would get if you were in Greenwich, England:
              # local time zone used
              date --date='1970-01-01 00:00:01' +%s
              1
              
            • If you're sorting or graphing dated data, your raw date values may be represented as seconds since the epoch. But few people can look at the date `946684800' and casually note "Oh, that's the first second of the year 2000."
              date --date='2000-01-01 UTC' +%s
              946684800
              
              To convert such an unwieldy number of seconds back to a more readable form, use a command like this:
              date -d '1970-01-01 946684800 sec' +"%Y-%m-%d %T %z"
              2000-01-01 00:00:00 +0000
              
            posted @ 2011-08-05 15:59 Klarke 閱讀(862) | 評論 (0)編輯 收藏
             在實(shí)際編寫程序時,經(jīng)常會弄不清楚各個基本數(shù)據(jù)類型的數(shù)據(jù)表示范圍和占用的字節(jié)數(shù)。現(xiàn)在將C/C++的基本數(shù)據(jù)類型總結(jié)如下,所有的類型在 VS2005+32位機(jī)器+win732位操作系統(tǒng) 上進(jìn)行了驗(yàn)證。

            符號屬性   長度屬性      基本型   所占位數(shù)   取值范圍              輸入符舉例                   輸出符舉例

            --             --               char     8             -2^7 ~ 2^7-1       %c             %c、%d、%u
            signed      --               char     8             -2^7 ~ 2^7-1       %c             %c、%d、%u
            unsigned  --               char     8             0 ~ 2^8-1            %c             %c、%d、%u

            [signed]   short          [int]     16            -2^15 ~ 2^15-1                     %hd
            unsigned  short          [int]     16           0 ~ 2^16-1                            %hu、%ho、%hx

            [signed]    --              int        32            -2^31 ~ 2^31-1                     %d
            unsigned   --              [int]     32            0 ~ 2^32-1                            %u、%o、%x

            [signed]    long          [int]     32             -2^31 ~ 2^31-1                    %ld
            unsigned   long          [int]     32             0 ~ 2^32-1                          %lu、%lo、%lx

            [signed]    long long  [int]     64              -2^63 ~ 2^63-1                   %I64d
            unsigned   long long  [int]     64              0 ~ 2^64-1                         %I64u、%I64o、%I64x

            --              --              float     32              +/- 3.40282e+038              %f、%e、%g
            --              --              double 64              +/- 1.79769e+308       %lf、%le、%lg %f、%e、%g
            --              long          double 64              +/- 1.79769e+308              %Lf、%Le、%Lg

            說明: []代表可省略,在C語言中是沒有bool數(shù)據(jù)類型的,C++中有。

            posted @ 2011-07-13 09:53 Klarke 閱讀(580) | 評論 (0)編輯 收藏

            1.
            p4 integ -d -i //depot/icd/fe/10.10/Rel/USR3/Modules/mib/...@909970,909970 //depot/icd/fe/11.10/Rel/RTM/Modules/mib/...
            p4 integ -d -i //depot/icd/fe/11.10/Rel/RTM/Modules/mib/...@909970,909970 //depot/icd/fe/11.10/Rel/USR1/Modules/mib/...          

            2.

            p4 resolve -am                         
            3.

            p4 resolve                               

            posted @ 2011-07-11 13:38 Klarke 閱讀(164) | 評論 (0)編輯 收藏

            1.Q:如何用find找出當(dāng)前目錄下所有的普通文件(不包含隱藏文件)并移動到制定的目錄中。
            A:
            引用:
            find sourcedir -type f -exec mv -f {} targetdir \;


            2.Q:用find . -name [a-zA-Z].* -print 為何什么都不顯示?(目錄夾下是有這樣的文件的)
            A:find . -name "[a-zA-Z].*"
            or
            find . -name "?.*"
            or
            find . -name ".*" #查找隱含文件

            posted @ 2011-07-04 16:18 Klarke 閱讀(91) | 評論 (0)編輯 收藏

            1. Add subdirectories
            find folder -type d -print | xargs cvs add

            2. Add all the files
            find folder -name CVS -prune -o -type f -print | xargs cvs add


            Add File as Binary

            1. cvs add -kb filename

            This is used to add word document

             

             

            posted @ 2011-07-04 16:04 Klarke 閱讀(1173) | 評論 (0)編輯 收藏
            僅列出標(biāo)題
            共7頁: 1 2 3 4 5 6 7 
            久久青青草原综合伊人| 久久精品国产欧美日韩99热| 国产精品国色综合久久| a级成人毛片久久| 狠狠色综合久久久久尤物| 伊人色综合久久天天人守人婷| 亚洲AV无码久久精品成人| 欧美久久综合性欧美| 久久综合鬼色88久久精品综合自在自线噜噜| 伊人久久精品无码二区麻豆| 91精品国产高清久久久久久91| 久久亚洲国产精品成人AV秋霞| 久久中文字幕一区二区| 久久久久久久久久久| 精品久久综合1区2区3区激情| 久久亚洲美女精品国产精品| 色诱久久av| 91精品国产91久久久久久蜜臀| 久久久无码精品亚洲日韩蜜臀浪潮 | 国产精品久久久天天影视| 伊人 久久 精品| 国产激情久久久久影院老熟女免费 | 午夜天堂精品久久久久| 久久免费99精品国产自在现线| 国产精品99久久久久久人| 精品久久久无码21p发布| 欧美色综合久久久久久| 日韩一区二区久久久久久| 国产成人久久精品区一区二区| 精品国产乱码久久久久久人妻| 人妻中文久久久久| 久久99精品国产99久久6| 91精品国产色综久久| 66精品综合久久久久久久| 亚洲成人精品久久| 91精品国产91久久久久久青草| 91精品日韩人妻无码久久不卡| 国内精品久久久久影院一蜜桃 | 99久久99久久久精品齐齐| 久久66热人妻偷产精品9| 99久久中文字幕|