Tag: Ruby

  • Ruby off the Rails

    Ruby off the Rails — only Ruby essentials, the language, NO Rails.

  • Thai Ruby

    “ Environmentally, Thailand is going straight down the toilet. The rapid depletion of the country’s gem resources is symptomatic of the country’s depletion of other resources, such as forests and fisheries. If residents do not begin to pay greater attention to politics, education and the quality of their leadership (which directly impacts how resources are…

  • Ruby NLP

    NLP softwares in Ruby (old link) Ruby Linguistics Framework WordNet for Ruby Ruby on AI ตัว Ruby Linguistics นี่น่าสนใจ ตรงวิธีการใช้ .. คือมัน รูบี๊ รูบี้ น่ะ ตัวอย่าง: “box”.en.plural #=> “boxes” “mouse”.en.plural #=> “mice” “ruby”.en.plural #=> “rubies” “book”.en.a #=> “a book” “article”.en.a #=> “an article” “runs”.en.present_participle #=> “running” “eats”.en.present_participle #=> “eating” “spies”.en.present_participle #=> “spying” “leaving”.en.infinitive #=> “leave”…

  • Data Structures and Algorithmgs in Ruby

    Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby — by Bruno R. Preiss หนังสือออนไลน์ เกี่ยวกับโครงสร้างข้อมูลและอัลกอริธึมโดยภาษารูบี้

  • Enumerable, Array and Hash for JavaScript

    Ruby-like convenients for JavaScript, explained.

  • Ruby: variable scope, by naming convention

    var — local variable @var — instance variable $var — global variable

  • Ruby gsub, friends and unrelated stuffs

    เราเรียกใช้เมทธอด gsub ของคลาส String (String#gsub) ใน Ruby ได้สองแบบ จาก API doc: คำสั่ง => ผลลัพธ์ str.gsub(pattern, replacement) => new_str str.gsub(pattern) {|match| block } => new_str ตรง pattern นี่ จะเป็น String ธรรมดา ๆ ก็ได้ เค้าให้ตัวอย่างมาแบบนี้ “hello”.gsub(/[aeiou]/, ‘*’) #=> “h*ll*” “hello”.gsub(/([aeiou])/, ‘<\1>’) #=> “h<e>ll<o>” “hello”.gsub(/./) {|s| s[0].to_s + ‘ ‘} #=> “104 101 108 108 111 ” แบบ…

  • jEdit Ruby Editor Plugin

    Ruby Editor Plugin สำหรับ jEdit ความสามารถหลัก ๆ ของ jEdit Ruby Editor Plugin syntax highlighting แสดงสีไวยากรณ์ error list บอกที่ผิด structure browser แสดงโครงสร้างโปรแกรม online API documentation คู่มือ API สด code completion ช่วยเติมโค้ด more และอื่น ๆ นอกจาก FreeRIDE กับ SciTE ที่มากับชุดติดตั้ง Ruby แล้ว IDE อีกตัวที่เหมือนจะมีคนนิยม คือ Mondrian Ruby IDE ยังเป็นเบต้าอยู่ เขียนด้วย Ruby + FOX toolkit เท่าที่ลองก็โอเค มี (1),…

  • Analysing LEXiTRON data files, with Ruby

    สุดสัปดาห์ที่ผ่านมา นั่งเรียน Ruby (กำลังฮิต mk ก็ทำอย่างเดียวกันโดยไม่ได้นัดหมาย) ตอนแรกว่าจะลอง Ruby on Rails เลย .. คืออาทิตย์ก่อนหน้านี้ (สังเกต: ใช้คำว่าว่า อาทิตย์ก่อนหน้า แต่ก็ใช้ สุดสัปดาห์ … สุดอาทิตย์ ไม่มีใครใช้) นั่งเขียน ‘เว็บบอร์ด’ ใหม่อยู่ (โครงการพันล้าน ทำ ๆ รื้อ ๆ มาหลายชาติ ตอนนี้ Google ออกเบต้าไปเรียบร้อยแล้ว :P) ก็เขียนด้วย PHP ตามถนัดน่ะแหละ (ซึ่งผมว่า สำหรับเว็บเล็ก ๆ นะ PHP นี่แหละ เร็วสุดแล้ว หมายถึงสร้างนะ แต่ถ้าทำใหญ่ ๆ ก็รกง่ายมาก) แต่คราวนี้แทนที่จะทำอะไรเองหมด ก็ไปลองใช้พวกไลบรารีใน PEAR มั่ง ซึ่งก็ง่ายดี และทำให้โค้ดสะอาดขึ้นเยอะ (อย่างตัว…

  • jEdit Ruby Editor Plugin

    หลายขั้นตอนหน่อย แต่ดีทีเดียว (ยังไม่มีให้เลือกโดยตรงจาก Plug-in Manager) ผมใช้ jEdit อยู่แล้วด้วย (ทั้งสำหรับ XML, PHP, Python) เลยชอบใจ 🙂