Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
Rubyã¯ãã®ããè¨èªã§ããRubyã触ã£ã¦ããã¨ããã¥ã¢ã«ã«ãæ¸ãã¦ããªããå°ããªçºè¦ãã«ééãããã¨ãããããã¾ãããã®ãããªãçºè¦ãã¯ãããã°ã©ã ã®è³ªãå¹çã®æ¹åã«ã¯ç´çµããªãããããã¾ããããããããããã¼ã ããã°ã©ãã³ã°ã§ã¯å¦¨ãã«ãªãå¯è½æ§ããããã¾ããããããã®ä¸æ¹ã§ãè¨èªèªä½ãèªåã®ç¥ããªãé åãæã¡ç¶ãã¦ãããã¨ãããã®å¯¾è±¡ã«å¯¾ããèå³ã失ãããªãããã®å¤§ããªè¦å ã§ãããã¨ããã®ãã¾ãçãã®ãªãäºå®ãªã®ã§ããã¤ã¾ããçºè¦ãã¯ãã®ããã«ç´çµãã¦ããã®ã§ãã ãã®ããã°ã«ããã¦ãç¥ã£ã¦å¾ããRubyã®ããªãã¢ãªè¨æ³ãã¨ããã¿ã¤ãã«ã§ãä»ã¾ã§ï¼åè¨äºãæ¸ãã¾ããã âç¥ã£ã¦å¾ãã21ã®Rubyã®ããªãã¢ãªè¨æ³â â第ï¼å¼¾ï¼ç¥ã£ã¦å¾ãã12ã®Rubyã®ããªãã¢ãªè¨æ³â â第ï¼å¼¾ï¼ç¥ã£ã¦å¾ãã12ã®Rubyã®ããªãã¢ãªè¨æ³â ãããã®ããªãã¢ã«ã¯ããããæ¤ç´¢ã§è¦ã¤ãããã®ãTwitt
åæ© ã©ã¸ãªã§é²é³ããèªå¦çªçµï¼mp3ï¼ãiPhoneãªã©iOS端æ«ã§èãå ´åãæ®éã¯Musicã¢ããªã§èãããããã¾ããã Musicã¢ããªã§ã¯ä»¥ä¸ã®ãããªä¸ä¾¿ãªç¹ãããã¾ãã ç´°ããªåå¾ã¸ã®ç§»åãã§ããªã ååã®åæ¢ä½ç½®ããåçãããªãï¼å é ããåçãããï¼ ä¸è¨ã®ãããªæ©è½ãæã£ãåçã¢ããªãæ¢ãã°ããã®ããããã¾ããããæ®æ®µä½¿ã£ã¦ããpodcastã¢ããªã§åçã§ããã°ä¸è¨ã®ç¹ã解æ¶ããã¾ããããã§ããªãã¨ãmp3ãã¡ã¤ã«ãç°¡æã«Podcastçªçµã«ããæ¹æ³ãæ¢ãã¦ã¿ã¾ããã ä»çµã¿ Podcastã¯ãRSSãã£ã¼ãã®ä»çµã¿ã使ã£ã¦å ¬éããã¾ãã ãã®ããã«ã¯ã以ä¸ã®ãã®ãå¿ è¦ã§ãã (1) RSSãã¡ã¤ã«ï¼å ¬éããé ç®ã«é¢ããå種æ å ±ã®ãªã¹ã é常ã¯ãWebãµã¤ãã®è¨äºã®è¦ç´ã¨ãªã³ã¯å ã Podcastã®å ´åã¯ãçªçµã«é¢ããæ å ±ï¼ã¿ã¤ãã«ãè¦ç´ãªã©ï¼ã¨é³å£°ãã¡ã¤ã«ã®URL. (2)
ãã®è¨äºã®ãµã㪠ã»æ¨æºå ¥åã§æ¸¡ãããã¹ãã¼ã¹åºåãã®æ´æ°ç¾¤ã¯ããinputs = gets.split.map(&:to_i)ãã¨ããã°ãåè¦ç´ ã«å¯¾ãã¦to_iã§ãæ°å¤åãããç¶æ ã§åãåããã¨ãã§ãã ã»ãããä¸è¨ã&:to_iãã®é¨åã説æã§ããªã人ã¯ããã®è¨äºãèªãã¨ãããããã«ãªãã¯ãã§ãã èæ¯ paizaã¨ãããããã°ã©ã ãæ¸ãæè¡ãè¨æ¸¬(課é¡ãããã¤ããã£ã¦ãããã«å¯¾ãã¦ã³ã¼ããæåºâæ¡ç¹ã¨ããæµã)ãã¦ãããã転è·ã«å©ç¨ã§ããã¨ãããããã°ã©ãã¼ã¨ä¼æ¥ã¨ã®ãããã³ã°ãè¡ããµã¤ãããããæ å ±åéãåå¼·ãã¦ãå©ç¨ããã¦ããã ãã¦ããã®ã§ããããã paizaã®ç°å¢ã®é½åä¸(ãªã³ã©ã¤ã³ã§ãªã¢ã«ã¿ã¤ã æ¡ç¹ããããã)ãæ¨æºå ¥åã§åãåã£ããã¹ããã¼ã¿ããæå¾ éãåä½ãããï¼ã¨ããã®ããåé¡ã解ã大åæã«ãªã£ã¦ããã¾ãããã®ãããå¿ ããæ¨æºå ¥åãé©åã«åãåããã¨ããã³ã¼ããå¿ è¦ã«
çµã¿è¾¼ã¿ã¯ã©ã¹ä¸è¦§ AãE ARGF.class (669) Array (1716) BasicObject (126) Binding (70) Class (67) Complex (432) Data (54) Dir (462) Encoding (2012) Encoding::Converter (207) Encoding::InvalidByteSequenceError (63) Encoding::UndefinedConversionError (45) Enumerator (161) Enumerator::ArithmeticSequence (98) Enumerator::Chain (42) Enumerator::Lazy (341) Enumerator::Yielder (22) Errno::EXXX (27) Exception (124) F
Arrayã®ä»¥ä¸ã®ã¡ã½ããã«ã¤ãã¦ã¾ã¨ãã¦ã¿ãï¼ select (select!) reject (reject!) partition select : æ¡ä»¶ãæºããè¦ç´ ãåæ æ¡ä»¶ãæºããè¦ç´ ãåæããã«ã¯selectã使ãï¼selectã¯ãããã¯ã®è©ä¾¡çµæãtrueã¨ãªãè¦ç´ ãããªãé åãè¿ãï¼éç ´å£çï¼ a = [1, 3, 4, 7, 9, 13] a.select{|e| e % 3 == 0} #=> [3, 9] ç ´å£çã¡ã½ããããï¼ãã ãRuby 1.9.2以éãå¿ è¦ï¼ a.select!{|e| e % 3 == 0} reject : æ¡ä»¶ãæºããè¦ç´ ãåé¤ æ¡ä»¶ãæºããè¦ç´ ãåãé¤ãã«ã¯rejectã使ãï¼rejectã¯ãããã¯ã®è©ä¾¡çµæãtrueã¨ãªãè¦ç´ ãé¤ããé åãè¿ãï¼éç ´å£çï¼ a = [1, 3, 4, 7, 9, 13] a.reject{|e| e
ç°¡åãªãµã³ãã«ã¨è§£èª¬ãæ¸ãã¦ã¿ã¾ããï¼ Yasuriã§ãæ軽ã¹ã¯ã¬ã¤ãã³ã° ãããããã°ä½¿ã£ã¦ã¿ã¦ãã ããï¼ï¼ Yasuri ã¨ã¯ Yasuri (é¢) ã¯ç°¡åã«Webã¹ã¯ã¬ã¤ãã³ã°ãè¡ãããã®ã"Mechanize" ããµãã¼ãããã©ã¤ãã©ãªã§ãï¼ Yasuriã¯ãã¹ã¯ã¬ã¤ãã³ã°ã«ããããããããå¦çãç°¡åã«è¨è¿°ãããã¨ãã§ãã¾ãï¼ ä¾ãã°ã ãã¼ã¸å ã®è¤æ°ã®ãªã³ã¯ãéãã¦ãåãã¼ã¸ãã¹ã¯ã¬ã¤ãã³ã°ããçµæãHashã§åå¾ãã ãã¼ã¸å ã®è¤æ°ã®ããã¹ããã¹ã¯ã¬ã¤ãã³ã°ããååãã¤ãã¦Hashã«ãã ãã¼ã¸å ã«ç¹°ãè¿ãåºç¾ãããã¼ãã«ãããããã¹ã¯ã¬ã¤ãã³ã°ãã¦ãé åã¨ãã¦åå¾ãã ãã¼ã¸ãã¼ã·ã§ã³ã§æä¾ãããåãã¼ã¸ã®ãã¡ãä¸ä½3ã¤ã ããé ã«ã¹ã¯ã¬ã¤ãã³ã°ãã ããããç°¡åã«å®è£ ãããã¨ãã§ãã¾ãï¼ ä¾ require 'yasuri' require 'mechanize' # Nod
ããã«ã¡ã¯ãã¯ã©ã¹ã¡ã½ããã®ç¨²æ¯ã§ãã è¤æ°ãã¼ã¸ã§ã³ã® Ruby ãåãæ¿ããã ãã§ãªãããã¼ã«ã«ãã£ã¬ã¯ããªæ¯ã« Ruby ã®ãã¼ã¸ã§ã³ãæå®ã§ããã rbenv ããã¨ã¦ã便å©ã ã£ãã®ã§ãã¤ã³ã¹ãã¼ã«æ¹æ³ãªã©ãè¨ãã¦ããã¾ãã ãã«ãç°å¢ã®æ§ç¯ Ruby ããã«ãããç°å¢ãæ§ç¯ããã¦ããªãå ´åã¯ãä¸è¨ ruby-build ã® Wiki ãåèã«ãã«ãç°å¢ãæ§ç¯ããã Suggested build environment rbenv + ruby-build ã®ã¤ã³ã¹ãã¼ã« rbenv 㧠Ruby ã®ã¤ã³ã¹ãã¼ã«ãè¡ãã®ã§ rbenv ã®ãã©ã°ã¤ã³ã ruby-build ããä½µãã¦ã¤ã³ã¹ãã¼ã«ããã Linux ã®å ´å ããã§ã¯æ¢ã« Git ãã¤ã³ã¹ãã¼ã«ããã¦ãããã®ã¨ãã¾ãã $ git clone https://github.com/sstephenson/rbenv.
ä¸æºå 1. Xcodeãã¤ã³ã¹ãã¼ã«ãã App StoreããXcodeãã¤ã³ã¹ãã¼ã«ããã 2. Command Line Tools for Xcodeãã¤ã³ã¹ãã¼ã«ãã Xcodeãèµ·å ã¡ãã¥ã¼ããXcode>Open Developer Tool>More Developer Toolsãé¸æã ãã©ã¦ã¶ã®ãã¼ã¸ãéãã®ã§Command Line Tools(OS X 10.10) for Xcodeãæ¢ãã¦ãã¦ã³ãã¼ããã¦ã¤ã³ã¹ãã¼ã«ãã 3. Homebrewãã¤ã³ã¹ãã¼ã« Homebrewã¡ã³ãããã¦ãªãï¼ã¨ãã£ã¦è©±ããã©ãã©è´ãããããªããããããã©ãå¿ããã®ã§æ§ããã¤ã³ã¹ãã¼ã« (ãããããã ãã®å å¤æ´ããªããã°ãªããªããªããã) The missing package manager for macOS â The missing package manage
ããã§ããMatrixï¼è¡åï¼ã¯ã©ã¹ã«è²ã å ¥ãäºå®ã®ããã§ã. .... ãããã£ã¨ä¼ããã¹ãã¢ããä»ã«ããã¨ã®æå·ãä»ã«ãèããã¦æ¥ããã§ãã... ããã¿ã¾ããä»æ¥ã®æã¯è¡åã®ç´¹ä»ãããã¦ä¸ãã.ã å¤ãã®æ¹ã¯èå³ããªãã§ããããã©ã Rubyã«ã¯è¡åããã¯ãã«ãæ±ã Matrix ã¯ã©ã¹ã¨ãããã®ãããã¾ãã¦ã Ruby2.2ã§ã¯è²ã æ°æ©è½ããã°fixãå ¥ãããã§ã. ãè¡åãã¯ãã«æ¼ç®ãããªãRubyããã ã¨è¨ããããããã®ã¢ãã«ã¯ãªãã®ã§ã¯ãªãã§ããããï¼ æ¬æ¥ã¯Ruby2.2以åã«ãããã®ãå«ãMatrixã®ãã¸ã§ãããæãç´¹ä»ãã¾ã. 使ããªãã¨ãã£ãããªãï¼ãããMatrix, 楽ããå¦ã¼ãï¼ 1. LUå解 LUå解ãåºæ¥ãã¨ããäºã¯... nå é£ç«æ¹ç¨å¼ããã¨ãç°¡åã«è§£ãäºãåºæ¥ã¡ããã® # 2x + y = 2 # x + 2y = 3 Matrix[ [2, 1]
åèï¼ http://www.atmarkit.co.jp/ait/articles/1402/27/news042_2.html ä½ã«æãã¤ã¾ã¥ããã®ã§ã¡ã¢ã homebrewã®ã¤ã³ã¹ãã¼ã« RVMã®ã¤ã³ã¹ãã¼ã« Rubyã®ã¤ã³ã¹ãã¼ã« Rubyãã¼ã¸ã§ã³ã®ç¢ºèª 1. Homebrewã®ã¤ã³ã¹ãã¼ã« http://brew.sh/index_ja.html 1-1. ã¤ã³ã¹ãã¼ã« $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" 1-2. ææ°ãã¼ã¸ã§ã³ã«ãã $ brew -v Homebrew 0.9.4 $ sudo brew update失æããã±ã¼ã¹ $ sudo brew update error: The following untracked working tree fil
ãã¼ãã¼ãæä½ [â]次ã®é ç®ãé¸æ [â]åã®é ç®ãé¸æ [Enter]é¸æãããé ç®ãéã Fork me on GitHub â« https://github.com/miyamae/rubydoc-ja/tree/master éçãªãã¡ã¤ã«ã ãã§æ§æããã¦ããã®ã§ããã¦ã³ãã¼ããã¦ãã¼ã«ã«ã§å©ç¨ãããã¨ãã§ãã¾ãã ä½ã£ã¦ã人ï¼ã¿ãã¾ãï¼ BitArts
# -*- coding: utf-8 -*- # call-seq: # prime_list(n) -> array # # * n 以ä¸ã®ç´ æ°ãé åã«ãã¦è¿ãã # * ã¨ã©ãã¹ããã¹ã®ç¯© : å ç®ç # # === Example # prime_list(20) => [2, 3, 5, 7, 11, 13, 17, 19] # def prime_list(n) return [] if n < 2 return [2] if n == 2 limit = (n ** 0.5).to_i arr = (1 .. n).step(2).to_a arr[0] = 2 len = arr.size i = 0 while true i = i + 1 j = arr[i] next unless j break if j > limit k = 2 * i * (i + 1) wh
describe "ãã¹ãã³ã¼ãã¯ã¦ãã¨ã" do let(:test) { "TEST" } it "test let" do test.should == "TEST" end end ã¡ã½ãããæåã«å¼ã³åºãããã¨ãã«æ»ãå¤ããã£ãã·ã¥ããããã以éãåãã¹ã³ã¼ãå ã§ã¡ã½ãããå¼ã³åºããããã³ã«ãã£ãã·ã¥ãããå¤ãè¿ããããã¨ãæå³ãã¾ãã ãããã¡ã¢åã¨ããããã§ããã§ãã¡ã¢åã£ã¦ï¼ ä¸çªç°¡åãªã¡ã¢å 調ã¹ã¦ã¿ãã¨ãã ããããã£ããããæ°ãæ±ããä¾ãå¤ãããªã®ã§nçªç®ã®ãã£ããããæ°ãæ±ããã¡ã½ãããæ¸ãã¦ã¿ãã æ®éã«æ¸ããå ´å
Spice Lifeã®äºååµé¦æããã®ä¸æ©å¤§å¦ã®Rubyæ¦è«ã¹ã©ã¤ããããªããã°ãããã£ãã®ã§ã¾ã¨ãã¦ã¿ã¾ããããããªãã£ããã¼ãªè³æããããã§æã«å ¥ãã¨ããã®ã¯æ¬å½ã«ãããããéãã§ãï¼ (05-02 07:45) MATSUOKA Koheiããã®2014年度ã®è¬ç¾©è³æã追å ã¡ãªã¿ã«ãã¹ã©ã¤ããããããããã®ã§3é¨ä½ã§ãw (1)ãRubyæ¦è«ã®ã¹ã©ã¤ãããã°ãããã£ãã®ã§ã¾ã¨ãã¦ã¿ã(第ä¸é¨)ã<= ä»ãã< strong> (2)ãRuby æ¦è«ã®ã¹ã©ã¤ããç´ æ´ãããã£ãã®ã§ã¾ã¨ãã¦ã¿ã(第2é¨)ã (3)ãRuby æ¦è«ã®ã¹ã©ã¤ããç´ æ´ãããã£ãã®ã§ã¾ã¨ãã¦ã¿ã(第3é¨)ã ð» 2014å¹´ããã°ä¸æ©å¤§å¦ã§Rubyã®é常å¤è¬å¸«ãã¯ããã¾ãã MATSUOKA Koheiãããè¬å¸«ãããã¦ãã2014å¹´ã«ç¾å¨éå¬ä¸ã®Rubyè¬ç¾©ã®è³æã§ããåå¼·ã«ãªãã¾ãï¼ Rubyè¬ç¾©ç¬¬1åï¼
rubyã¨jekyllã¨jekyll-bootstrapã§éçãµã¤ããä½ã åæunixç³»OS gitã¤ã³ã¹ãã¼ã«æ¸ rubenvã§ruby1.9ç³»ãã¤ã³ã¹ãã¼ã«æ¸ å ¨ä½ã®æµãjekyllã®ã¤ã³ã¹ãã¼ã« jekyll-bootstrapã®ãã¦ã³ãã¼ã jekyll-bootstrapã®è¨å® jekyllãèµ·åãã¦ãµã³ãã«ã®ç¢ºèª jekyllã§è¨äºã®æ稿 å ¬éãã 1. jekyllã®ã¤ã³ã¹ãã¼ã«$ gem install jekyll $ rbenv rehash rbenvã使ç¨ãã¦ããã®ã§ãå¼æ°ãå¿ è¦ãªgemãå©ç¨ããåã«rehashãã 2. jekyll-bootstrapã®ã¤ã³ã¹ãã¼ã«$ git clone https://github.com/plusjade/jekyll-bootstrap.git $ cd jekyll-bootstrap 3. jekyll-bootst
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}