Time of Update: 2014-10-21
標籤:blog io os sp 資料 div on cti log class MysqlTest #Code here require "mysql" def testMysql
Time of Update: 2015-04-16
標籤:素數篩法 linux64 nasm 彙編 在博文(1)和(2)裡分別用了4中方式寫一個素數篩選的演算法,分別是javascript in browser、node.js、ruby和c;最終的結果是c最快,node.js其次,js in
Time of Update: 2015-03-14
標籤:Since the original tech preview release of FastCGI last year, we‘ve been seeing a lot of requests for getting Ruby on Rails running with our FastCGI. Theoretically, since the FastCGI component uses a standard protocol to support
Time of Update: 2015-01-29
標籤:1. ruby最強大的web架構ruby on rails .必學的.所以可以直接安裝RailsInstaller.地址:http://www.railsinstaller.org/en .安裝過程預設勾選添加環境到PATH. 2. 更改gem鏡像到http://ruby.taobao.org/$ gem sources --remove https://rubygems.org/$ gem sources -a https://ruby.taobao.org/$ gem
Time of Update: 2014-08-04
標籤:style blog http 使用 os 檔案 2014 問題 前不久朋友跟我說 sass 寫 css 很不錯,我就試著去用了,那麼在使用 sass
Time of Update: 2015-03-30
標籤:Proc 和 lambda 的共同點:文法類似Proc.new{|n| n**2}lambda{|n| n**2}都可以用.call方法調用hello_proc = Proc.new{ puts "Hello!" }hello_proc.call #Hello!hello_lambda = lambda{ puts "Hello!" }hello_lambda.call #Hello!都可以用&關鍵字把各自轉換為blocknums = [1,3,4,5,6]cube_proc =
Time of Update: 2015-03-12
標籤:ERROR: Could not find a valid gem ‘sass‘ (>= 0), here is why: Unable to download data from http://rubygems.org/ - Errno::EACCES: Permission denied - connect(2) (http://rubygems.org/latest_specs.4.8.gz)This is work for me. Try
Time of Update: 2015-01-13
標籤:通過許多法術,Ruby 有的編程技巧來實現很多巧妙的編程:數組參數環繞別名白板類擴充類擴充混入類執行個體變數類宏潔淨室代碼處理器上下文探針順延強制動態派發動態方法動態代理扁平範圍幽靈方法鉤子方法核心方法惰性執行個體變數擬態方法猴子打補丁……上面的進階些的技巧,來實現更簡潔的編程(只是指總行數),方便修改上。一個檔案成千行,還是存在的。要看懂,還要瞭解些 Ruby 的基礎才行的。推薦 2星讀《Ruby 元編程》
Time of Update: 2015-01-09
標籤:ruby on rails一、環境安裝centos 作業系統1、安裝rvmcurl -sSL https://get.rvm.io | bash -s stable rvm -v查看是否安裝成功2、安裝rubyrvm install 1.9.3ruby -v 查看ruby版本號碼Rvm命令簡單使用介紹: rvm install ruby &
Time of Update: 2015-01-05
標籤:ruby wc 統計單詞數和行數等 在Ruby中我們定義一個wc方法,用來統計檔案中出現的文本行數、單詞數和字元數,ruby代碼程式如下:def wc(filename) nline = nword = nchar = 0 File.open(filename) do
Time of Update: 2014-12-28
標籤:第一章字串,數字,類和對象為了證明Ruby真的好用,hello world也能寫的如此簡潔: puts ‘hello world‘ 1.輸入/輸出print(‘Enter your name‘)name=gets()puts("Hello #{name}") 註:Ruby是區分大小寫的 2.String類 puts("Hello #{name}")中的變數 name是內嵌在整個String裡的,通過 #{ } 包裹進行內嵌求值,並用雙引號""
Time of Update: 2014-12-18
標籤:des style ar io color os sp for strong IDE: Jetbrains
Time of Update: 2014-12-11
標籤:style blog color 使用 sp 資料 div log bs #數字分為認證Integer,浮點數Float(對應與其他語言中的double),和複數Complex#整數又分為
Time of Update: 2014-12-10
標籤:style blog io ar color os 使用 sp on 類的擴充和繼承class Fixnum def dosome(str) puts str end def
Time of Update: 2014-10-01
標籤:rails總共分為11章節,一個簡單的微博系統。完全是以測試去驅動開發,所以書裡面有很多測試代碼,剛開始會覺得很不習慣,然後過了一段時間後,還是不習慣這樣的開發方式。最後選擇以自己的方式來整理書裡面的知識點。也就是說,我把開發的部分,跟測試部分,區分開來。後面想了下,覺得知識點可以分為以下4點。1.git的使用初始化項目 git init新增內容 git add .提交到本地倉庫 git commit -m "備忘"提交到遠程分支 git push拉取內容 git pull查看分支
Time of Update: 2014-08-05
標籤:ansible 安裝ruby ansible playbook ruby ansible install ruby ansible playbook
Time of Update: 2014-07-30
標籤:aws sqs ruby demo # Amazon SQS搜集整理aws sqs 的文檔以及使用Ruby demo## Amazon Simple Queue Service (SQS) 是一個可伸縮且可靠的訊息傳遞架構,可以使用它簡便地建立、儲存和擷取簡訊。可以使用它構建基於 Amazon Web Services 的應用程式。使用 SQS 是構建鬆散耦合的 Web
Time of Update: 2014-07-19
標籤:style blog http color 使用 strong self,自己,在ruby中表示當前對象或預設對象。程式執行的任一時刻,有且僅有一個self。 1.誰成為self,在什麼位置成為self?要知道哪個對象是self,就必須知道當前的上下文。上下文主要有頂層上下文,類
Time of Update: 2014-07-16
標籤:style blog color div re c #######################類變數######################class Cloud @@count=0 def initialize(user,password,ip)
Time of Update: 2014-07-16
標籤:style blog http color art for 隱馬爾科夫模型中有三個問題:1) 估計問題:給定一個觀察序列O=O1O2...OT和模型u = (A, B,