Ruby On Rails(ROR)使用起來相當於structs+spring+hibernate,不過卻方便很多,幾乎不用寫設定檔,開發的速度也要快很多(ROR的宣傳上說是java速度的10倍,我感覺這個數字不會很誇張),ROR對Ajax技術的結合更是讓開發人員感到很開發起來很輕鬆(比DWR(Direct Web Remoting)還更方便)。
動態規劃解決矩陣連乘問題,隨機產生矩陣序列,輸出形如((A1(A2A3))(A4A5))的結果。代碼:#encoding: utf-8=beginauthor: xu jin, 4100213date: Oct 28, 2012MatrixChainto find an optimum order by using MatrixChain algorithmexample output:The given array is:[30, 35, 15, 5, 10, 20, 25]The
演算法導論上的偽碼改寫而成,加上導論的課後練習第一題的解的建構函式。#encoding: utf-8=beginauthor: xu jindate: Nov 11, 2012Optimal Binary Search Treeto find by using EditDistance algorithmrefer to <<introduction to algorithms>>example output:"k2 is the root of the
最長公用子序列,LCS,動態規劃實現。#encoding: utf-8#author: xu jin, 4100213#date: Nov 01, 2012#Longest-Commom-Subsequence#to find a longest commom subsequence of two given character arrays by using LCS algorithm#example output:#The random character arrays are: ["b",
利用動態規划算法,實現最短編輯距離的計算。#encoding: utf-8#author: xu jin#date: Nov 12, 2012#EditDistance#to find the minimum cost by using EditDistance algorithm#example output:# "Please input a string: "# exponential# "Please input the other string: "# polynomial#
Why's Lucky Stiff 上看來的。俺只是搬運工。能讀原文的老大們不用往下看了。嗯,假如一個類裡有個執行個體方法。我們希望這個方法只運行一次。”切,我還以為是搶雞蛋呢“,熟讀鐵撬書的老大們開始嗤之以鼻,”不就是第391頁裡Tadayoshi Funaba的once嗎?就連上一篇《吃了大力丸的Ruby》也有類似的實現”:01: def once(*ids)02: for id in ids03: module_eval <<- "end;"04:
嗯,我們的功能測試代碼常有個小小的需求:當測試代碼裡的某一個函數拋出異常,系統自動彈出一個調試視窗。調試視窗應該已經包含異常拋出時的上下文資訊,以便測試員進行調試。"靠,還以為什麼新鮮玩意兒,原來不過是Ruby On Rails玩兒得不愛的breakpoint!“,看貼的老大們開始不屑地評論。呵呵,老大們的話自然不會錯,的確是RoR裡常用的 breakpoint。但在俺討論新東西前,先讓小的稍稍介紹一下這個牛X的breakpoint。比如說下面這段代碼:02: class T303:
關鍵字:Ruby On Rails ,InstantRails,Windows,入門,教程本文來自於我在部落格園的部落格:http://www.cnblogs.com/dahuzizyd轉載請註明部落格在部落格園的源地址一直想嘗試Ruby On Rails,但是因為對apache,mysql都不熟,對Rails的環境搭建更是沒信心,所以一直沒有開始,從知道了InstantRails後,終於在windows上搭建了Ruby On Rails開發環境,開始了Rails的學習。現在從最基礎的知識開始,
linux系統的ruby安裝 ruby安裝包 :http://www.ruby-lang.org/en/downloads/ ruby-1.8.6-p111.tar.gz [其實你安裝任何一個版本都可以!方法都是一樣的。不過要記得這些步驟還有命令] 解壓並安裝: tar -xvzf ruby-1.8.6-p111.tar.gz cd ruby-1.8.6-p111 ./configure -prefix=/opt/modules/ruby make make install