ivaneeo's blog

          自由的力量,自由的生活。

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks

          #

          class Song
          def initialize(a) #構造函數
          end
          end
          song1 = Song.new("Ruby Tuesday")
          song2 = Song.new("Enveloped in Python")
          # and so on
          posted @ 2006-09-12 14:29 ivaneeo 閱讀(242) | 評論 (0)編輯 收藏

          3.times { puts "Hello!" }

          i.times {| i| ...}
          Iterates the block i times. ##迭代一個閉包i次
          posted @ 2006-09-12 14:27 ivaneeo 閱讀(248) | 評論 (0)編輯 收藏

          把設置:
          ??? ? '(global-font-lock-mode t nil (font-lock))
          ??? ??? '(jde-check-version-flag nil)
          就可以解決jde對cedet版本檢查。
          posted @ 2006-09-11 14:21 ivaneeo 閱讀(656) | 評論 (0)編輯 收藏

          實現要安裝mozilla.

          現在下來配置環境變量:
          ???
          export MOZILLA_FIVE_HOME=/usr/X11R6/lib/mozilla
          export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}


          setenv MOZILLA_FIVE_HOME /usr/X11R6/lib/mozilla

          setenv LD_LIBRARY_PATH ${MOZILLA_FIVE_HOME}: ${LD_LIBRARY_PATH}


          posted @ 2006-09-11 01:21 ivaneeo 閱讀(693) | 評論 (0)編輯 收藏

          轉帖:無法刪除dll文件?

          高手莫笑。。(適用于XP,2003)

          在論壇有時候老聽網友說某某文件刪不掉啊。。之類 的。而且有很多都是dll文件。雖然解決這個問題的方法有很多種。而且也可以把他刪除,但是網友們有沒有想過是為什么刪不掉呢??這是因為你運行的某個程 序正在調用這個dll文件。正在使用的文件是當然不可能給你刪除的。那么,到底是哪個程序在調用這個dll文件呢。我教大家一個方法可以把那個程序很容易 的找出來。。

          在運行里輸入cmd進入命令提示符。
          然后輸入命令tasklist /m>c:123.txt
          回車。。是不是沒有任何反應??
          不要急。到C盤下面去找一找,是不是有了一個123.txt?(當然。你可以自己設定文件的輸出路徑,名字,甚至后綴。但要是文本文件哦。。)
          打開他。里面就是目前運行的各個程序正在調用的dll文件。
          把不能刪除的dll文件的名字記下來。然后到記事本里去編輯-查找。輸入對應的dll文件。是不是找出來了??
          找出來了后問題就好辦多了。打開任務管理器。把對應的那個程序給關了。。就可以順利刪除了。。那就不必進安全模式,進DOS那么麻煩了。。。
          當 然。有些應用程序是以服務形式運行的。那么你就有可能查到的是svhost.exe但是。里面有很多個哦。。這個也好辦。仍然打開命令提示符。輸入 tasklist /svc,當然,你也可以把他輸出為文本文件,如tasklist /svc>C:234.txt。看到了嗎?每個svchost.exe后面是不是對應有一個ID呢?有了ID一對照也可以知道是哪個服務了。。如果 是可關的。就關了他。。不過記住。。系統進程可別亂關哦。
          posted @ 2006-09-03 18:56 ivaneeo 閱讀(978) | 評論 (0)編輯 收藏

          The sine of an angle (specified in radians) can be computed by making use of the approximation sinxbook-Z-G-D-20.gifx if x is sufficiently small, and the trigonometric identity
          ??? ch1-Z-G-19.gif

          to reduce the size of the argument of sin. (For purposes of this exercise an angle is considered ``sufficiently small'' if its magnitude is not greater than 0.1 radians.) These ideas are incorporated in the following procedures:
          ??? (define?(cube?x)?(*?x?x?x))
          ??? (define?(p?x)?(-?(*?3?x)?(*?4?(cube?x))))
          ??? (define?(sine?angle)
          ?? ??? (if?(not?(>?(abs?angle)?0.1))
          ?????? ??? angle
          ?????? ??? (p?(sine?(/?angle?3.0)))))

          posted @ 2006-07-31 15:02 ivaneeo 閱讀(662) | 評論 (0)編輯 收藏

          有100美元需找零.
          ??? 美元中有50美分(half-dollars),25美分(quarters),10美分(dimes),5美分(nickels),1美分(pennies).
          總共有多少種方式?

          分成兩步:
          ??? 1.計算使用50美分找零的方法數.
          ??? 2.上面數目加上除了使用50美分找零的方法數以外的數目.

          (define (count-change amount)
          ? (cc amount 6))

          (define (first-denomination kinds-of-coins)
          ? (cond ((= kinds-of-coins 1) 1)
          ??? ((= kinds-of-coins 2) 2)
          ??? ((= kinds-of-coins 3) 5)
          ??? ((= kinds-of-coins 4) 10)
          ??? ((= kinds-of-coins 5) 20)
          ??? ((= kinds-of-coins 6) 50)))

          (define (cc amount kinds-of-coins)
          ? (cond ((= amount 0) 1)
          ??? ((or (< amount 0)
          ??? ??? (= kinds-of-coins 0))
          ??? ?0)
          ??? (else (+ (cc (- amount?? ?? ?? ?? ?? ?? ?? ?? ;第一步
          ??? ??? ??? (first-denomination kinds-of-coins))
          ??? ??? ???? kinds-of-coins)
          ??? ??? ?(cc amount?? ?? ?? ?? ?? ?? ?? ?? ?? ??? ;第二步
          ??? ??? ???? (- kinds-of-coins 1))))))
          posted @ 2006-07-30 15:51 ivaneeo 閱讀(466) | 評論 (0)編輯 收藏

          Fibonacci函數定義如下:
          ch1-Z-G-7.gif

          (define?(fib?n)
          ??(cond?((=?n?0)?0)
          ????????((=?n?1)?1)
          ????????(else?(+?(fib?(-?n?1))
          ?????????????????(fib?(-?n?2))))))
          遞歸數如下:
          ch1-Z-G-13.gif

          Fib(n)非常接近book-Z-G-D-11.gifn/book-Z-G-D-13.gif5

          book-Z-G-D-11.gif

          同樣下面的式子也成立:
          ch1-Z-G-15.gif

          同樣使用線性迭代效率要高的多:

          (define?(fib?n)
          ??(fib-iter?1?0?n))

          (define?(fib-iter?a?b?count)
          ??(if?(=?count?0)
          ??????b
          ??????(fib-iter?(+?a?b)?a?(-?count?1))))

          posted @ 2006-07-30 13:59 ivaneeo 閱讀(1102) | 評論 (0)編輯 收藏

          Ackermann函數可用遞推關系如下定義
              A(m,0)=A(m-1,0) m=1,2,…
              A(m,n)=A(m-1,A(m,n-1)) m=1,2,… n=1,2,…
            初始條件為
              A(0,n)=n+1,n=0,1,…

          (define?(A?x?y)
          ??(cond?((=?y?0)?0)
          ????????((=?x?0)?(*?2?y))
          ????????((=?y?1)?2)
          ????????(else?(A?(-?x?1)
          ?????????????????(A?x?(-?y?1))))))

          posted @ 2006-07-30 13:21 ivaneeo 閱讀(673) | 評論 (0)編輯 收藏

          關于n!求解:
          1.線性遞歸

          ??? ch1-Z-G-7.gif
          (define?(factorial?n)
          ??(if?(=?n?1)
          ??????1
          ??????(*?n?(factorial?(-?n?1)))))
          如圖所示的線性的膨脹再線性的縮減,就為線性遞歸.

          2.迭代
          ??? ch1-Z-G-10.gif
          (define?(factorial?n)
          ??(fact-iter?1?1?n))

          (define?(fact-iter?product?counter?max-count)
          ??(if?(>?counter?max-count)
          ??????product
          ??????(fact-iter?(*?counter?product)
          ?????????????????(+?counter?1)
          ?????????????????max-count)))

          注:試驗(factorial 10000),遞歸堆棧溢出,而迭代則可以運行.
          posted @ 2006-07-30 11:37 ivaneeo 閱讀(569) | 評論 (0)編輯 收藏

          僅列出標題
          共67頁: First 上一頁 23 24 25 26 27 28 29 30 31 下一頁 Last 
          主站蜘蛛池模板: 台湾省| 长岛县| 浦东新区| 桓台县| 抚松县| 霍林郭勒市| 红安县| 海门市| 梁山县| 克拉玛依市| 平潭县| 易门县| 文水县| 西峡县| 昌黎县| 象山县| 响水县| 上饶市| 栾川县| 丰县| 阿鲁科尔沁旗| 禄劝| 卓资县| 南投县| 呼玛县| 昭通市| 龙泉市| 辛集市| 黄石市| 南皮县| 深水埗区| 晋宁县| 舒兰市| 德格县| 怀安县| 会昌县| 甘孜县| 德令哈市| 湘阴县| 邵阳市| 谢通门县|