Mac OS X 10.9 Mavericks 以éã ã¨ãlibv8 㨠therubyracer ã® gem ãã¤ã³ã¹ãã¼ã«ã§ããªããããªãã§ãããæ¯åééãããã©ãæ¯åè¦ããã§ãã¾ãã ãã¢ã¯ãlibv8ãtherubyracerãOS ã®ãã¼ã¸ã§ã³ã®æ´åæ§ããã¨ã¯å®çªã®ãªãã·ã§ã³ãä»ãããã¨ã http://inoao.hatenablog.com/entry/2014/03/27/183523 ã«ãè¶ ä¾¿å©ãªè¡¨ãããã¾ãããããYosemite ãè¼ã£ã¦ããªãã®ã§ãææ°çã¯ãããªãã¾ããYosemite = darwin-14 ã®å¤ã¯ãèªåã§è©¦ãã¦ãã¾ããã£ãçµã¿åããã§ãã CPU OS OS Version libv8 therubyracer
ä¹ ãã¶ãã«ã¢ã¯ã»ã¹ãã°ãè¦ããã nokogiri ã®ã¤ã³ã¹ãã¼ã«æ¹æ³ã§æ¤ç´¢ãã¦ããæ¹ãçµæ§ããã£ããããããªã®ã§ã ææ°ã®æ å ±ãæ¸ãã¦ãããã¨æãã¾ãã # nokogiri ã«éã£ãåé¡ã§ã¯ãªãã®ã§ãæ¡ä»¶ã«ãã£ã¦ã¯ä»ã® gem ã§ãã£ã¦ã解決ããããã 2015/4/27 è¿½è¨ æ¬ç¨¿ã¯ãRuby 2.1.X ã¾ã§ã使ç¨ãã¦ããæ¹ã対象ã§ãã Ruby 2.2.X 以éã®å ´åã¯ãæ¬ç¨¿ã¯å½¹ã«ç«ã¡ã¾ããããã¶ãã TL;DR åå & 解決æ³ã¾ã¨ã åå : å¤ããã¼ã¸ã§ã³ã® rubygems ã«ä¸å ·åããããç°å¢ã«é©ãã gem ãåå¾ã§ããªããã [解決æ³1] æåã§ã¤ã³ã¹ãã¼ã«ãã gem ããã¦ã³ãã¼ããã ã¾ã㯠[解決æ³2] rubygems ãã¢ããã°ã¬ã¼ããã (ãããã) [解決æ³1] æåã§ã¤ã³ã¹ãã¼ã«ãã gem ããã¦ã³ãã¼ããã nokogiri | RubyGems
ã¯ããã« Google Summer of Code 2014ã«SciRubyã®å¦çã¨ãã¦åå ãã¦ãã¾ããã 3ãæã®æéãç¡äºçµäºããã¡ããã¨ããææç©ãã§ããã®ã§è¨äºã«ãã¾ãã Nyaplotã«ã¤ãã¦ãã³ã¼ãã詳ãã使ãæ¹ã¯ãã¡ããã覧ãã ãã: domitry/nyaplot · GitHub domitry/Nyaplotjs · GitHub ãã¼ãªããä½è£ãªãã£ããªãã¨ãGSoCã®ææ³ã¿ãããªã®ã¯ã¾ãè½ã¡çãã¦ããæ¸ãããã¨æãã¾ãã æ¦è¦ IRuby notebookä¸ã§åä½ãããplotã®ããã®gemã ãããã¨ãã ã¤ã³ã¿ã©ã¯ãã£ããª/ã¤ã³ã¿ã©ã¯ãã£ãã«plotãã§ããã IRuby notebookä¸ã§å¯¾è©±çã«ãããããä½ããã¨ãã§ãã¾ããã¾ãæ¨æºã§ç¨æãããæ§ã ãªã¢ã¸ã¥ã¼ã«ãã¦ã¼ã¶ã¼ã®å¯¾è©±çãªæä½ãæ¯æ´ãã¾ãã ä½ã£ãããããã¯SVGãWebGLã使ããã©ã¦ã¶ä¸ã«è¡¨ç¤º
ãã³ãã³åç»ãä¿åãã¦itunesã«è»¢éãããããªã¨ã ã¤ã³ã¹ãã¼ã« ããã±ã¼ã¸ã¯ãsora_hã®ç©ã使ããã¨ã«ããã gem install niconicoããã¥ã¡ã³ãã«ã¯æ¸ãã¦ãªããã©ãruby1.9ã§ããåããªãã1.9ã好ãã«ãªããªãåã«ã¯ãã¡ãã£ã¨ä¸æºã ãã¦ã³ãã¼ãããã require 'niconico' nico = Niconico.new('[email protected]','*****') #ãã°ã¤ã³ã¡ã¢ãããã¹ã¯ã¼ã nico.login $stdout = open("out.flv", "w") puts nico.video("sm12345456").get_video $stdout.flush ä¸è¦§ãåãè¾¼ã åé³ãã¯ãªã©ã®ãã«ãã©ã³ãã³ã°ãã¾ã¨ãã¦ãã¦ã³ãã¼ãããã ããã¯Mechanizeã§ããã£ã¨ã require 'mechanize'
以åãåããããªãã¨ãæ¸ãã¦ããã®ã§ããã pryã§æ¥æ¬èªãå ¥åã§ããªã ãã¨ã«æ°ã¥ããã®ã§ã以ä¸ã®ããã«æ¸ãç´ãã¾ããã rbenvã使ã£ã¦ããã®ã§ãããRubyã®ãã¼ã¸ã§ã³ãä¸ããã¨ãã«ããã¤ãå¿ãã¦ãããã¨ãå¤ãã®ã§ãã¡ã¢ãæ®ãã¦ããã¾ãã ãã¼ã¸ã§ã³ã¢ããå $ ruby -v ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2] gem listã®ä¿å ç¾å¨ã®ç°å¢ã§ã¤ã³ã¹ãã¼ã«æ¸ã®gem listãä¿åãã¦ããã¾ãã $ gem list | awk '{print $1}' > gemlist.txt æ°ããç°å¢ã¸ã®ç¬¬ä¸æ©(ruby-buildã®æ´æ°) rbenvã§å©ç¨ã§ãããã¼ã¸ã§ã³ã®ãªã¹ããåå¾ãã¾ãã gitçãå©ç¨ãã¦ããå ´åï¼ä»¥åã¯ãã¡ããå©ç¨ï¼ $ cd ~/.rbenv/plugins/rub
ããã°ãã¹ããè¤æ°ã«ãã´ãªãæã¦ãã¨ããå ´åã§ã ããè¨äºã¨åãã«ãã´ãªãæã¤è¨äºãæ¢ãã¨ãããã¨ãããããã #Postã¢ãã« class Post < ActiveRecord::Base has_and_belongs_to_many :categories end #交差ãã¼ãã« class CategoriesPost < ActiveRecord::Base end #Categoryã¢ãã« class Category < ActiveRecord::Base has_and_belongs_to_many :posts end post = Post.first categories = Category.joins(:posts).where("posts.id = ?", post.id).select("categories.id") category_ids = c
RubyããChrome/Safari/IE/Firefoxãæä½ãã¦ã¹ã¯ã¬ã¤ãã³ã°ããæ¹æ³ã¨ãã¦ããSeleniumãã使ãæ¹æ³ããã£ãã®ã§ãã¡ãã£ã¨è©¦ãã¦ã¿ã¾ãããä»åã¯ãã®æã®ã¡ã¢ã§ãã Rubyãããã©ã¦ã¶ãæä½ããæ¹æ³ã¨ãã¦ã¯ãä»ã«GemãWatirãã使ãæ¹æ³ãããã®ã§ãããã£ãããã¡ãããæ¤è¨ä¸ããï¼
ç¶ããæ¸ãã¾ããã Rubyã§ãã ã®Arrayã ã¨æã£ã¦ã»ã»ã®ç¶ãã§ããæ£æä¸ã«æ´åãã¦gemåãã¾ããã GrnMini ongaeshi/grn_mini Groonga(Rroonga)ãç°¡åã«ä½¿ããããã«ã©ãããããã®ã§ãã ã«ã©ã æå®ä¸è¦ã§ãã¼ã¿ã追å ãããã¨ãåºæ¥ã¾ãã æ°¸ç¶åãé«åº¦ãªæ¤ç´¢ã¯ã¨ãªãã½ã¼ããã°ã«ã¼ãå(ããªã«ãã¦ã³)ãã¹ããããããã¼ã¸ãã¼ã·ã§ã³ãªã©ãç°¡åã«ä½¿ããã¨ãåºæ¥ã¾ãã æ¤ç´¢ã¨ã³ã¸ã³ãããã«ä½ãã¾ãã ã¤ã³ã¹ãã¼ã« $ gem install grn_mini åºæ¬çãªä½¿ãæ¹ å®ä½ã¯Rroongaã®èãã©ããã¼ã§ããé£ãããã¨ãèããã«ä½¿ãããã工夫ãã¦ãã¾ãã require 'grn_mini' array = GrnMini::Array.new("test.db") åãã¦ãã¼ã¿ã追å ããæã«ã«ã©ã 種é¡ãé¡æ¨ãã¦ä½æãã¾ãã追å ãããã¼ã¿ãæååã®
以ä¸ã"ãã£ã³ãã£ã³"ã¯å·¥å£ã¨èªã¿æ¿ãã¦ãã ãããã°ã¼ã°ã«æ§çãªè«¸äºæ ã§ã...ã ãã¦ãå æ¥ãã£ããã³ã§ãããæ±ããããããgemãèªä½ãã¾ããã ãã£ããã³ã§ããã¯apiãæä¾ãã¦ããªããããªã®ã§(ãããããããããã)ããã£ã³ãã£ã³ç³»ã§ä½¿ããã人ã¯ãã¶ãã¹ã¯ã¬ã¤ãã³ã°ããæãã«ãªãã¨æãã¾ãã ãã®ã¨ãã«å°ãã§ãæ±ãããããªããããªgemãä½ã£ã¦ã¿ã¾ããã詳ãã使ãæ¹ã¯ãREADMEãèªãã§ãã ããã xvideos_helper ã¨ããããããã£ããã³ã§ããã®homeã¨ãtagãã¨ã®åç»ãã¼ã¸ã®URLãæå®ããã°ä½¿ããããªãã¼ã¿ã¯ãã¹ã¦è¿ã£ã¦ãã¾ãã Request require 'xvideos_helper' adult = XvideosHelper::Client.new movie_data = adult.movies_of('http://www.xvideos.c
JavaScriptã®ã¦ããããã¹ããJenkinsã¨ãã§CIãããã¨ããPhantomJSã§å®è¡ããã®ããããã©ãã£ã±ãChromeã¨ãFirefoxã¿ãããªå®éã®ãã©ã¦ã¶ã§ãã¹ãããããã§ãç°å¢ä½ãã®ããã©ãããããªã¼ã¨æã£ã¦ããã©Xvfbã使ãã¨Chromeã¨ãFirefoxãåãã®ã§Linuxçã®Chromeã¨Firefoxã ãã ã¨ããã¨ç°¡åã«ç°å¢ã¤ãããã Xvfbã¨ããã®ã¯ç»é¢å ¥åºåãã·ãã¥ã¬ã¼ããããã¤ã§ãã¹ã¯ãããç°å¢ãç¨æããªãã¦ãChromeã¨ãFirefoxã¨ããåããããã¤ã OSã¯Ubuntsã®12.04ï¼precise64ï¼ã§è©¦ããã ã¾ãXvfbãå ¥ããã $ sudo apt-get install xvfb 次ã«Firefoxãå ¥ããããããããå ¥ãã $ sudo apt-get install firefox Chromeã¯ä¸æéå¿ è¦ã ãã©ããã¨ããå ¥
JavaScriptãå¿ è¦ãªãã¼ã¸ãã¹ã¯ã¬ã¤ãã³ã°ããã«ã¯ã©ããããããã調ã¹ãã Selenium ãã©ã¦ã¶ãæä½ãã¦ã¦ã§ãã¢ããªã®ãã¹ãããããã¼ã«ã FireFox, Chrome, IEãªã©æ§ã ãªãã©ã¦ã¶ã«å¯¾å¿ãã¦ããã å®éã«ãã©ã¦ã¶ãç«ã¡ããã¦è²ã è¡ãã®ã§ããé ãã Rubyã§æ¸ãã¨ãããªãã require "rubygems" require "selenium-webdriver" d = Selenium::WebDriver.for :firefox d.navigate.to 'http://example.com' puts d.page_source ã¡ã½ããåãJavaScriptã©ã¤ã¯ã GUIã®ãªãç°å¢ã§åããã¨ãã¯Xvfbãã¤ã³ã¹ãã¼ã«ããheadlessã使ãã require "rubygems" require "selenium-webdrive
ãã³ãã¬ã¼ãã¨ã³ã¸ã³Slimã使ã£ã¦ã¹ãã¼ãã«HTMLãä½æãã æ¨æ¥ãã¡ã®äºåæã§éå¬ããagatsuma.survive#02ã®ä¸ã§Slimã®èª¬æãæã£ãããã好è©ã ã£ãã®ã§æ¹ãã¦ã¾ã¨ãã¦ã¿ã¾ãã ãã®ã¨ã³ããªã§ã¯ Slimã使ã£ã¦HTMLãä½æãã ãã¨ã ããç®çã¨ãã¦ãããããåçã«Slimã§ã´ãã§ã´ãã§ãããããªè©±ã¯åºã¦æ¥ã¾ãããHTMLã®ä»£æ¿ã«Slimã使ããã¨ãã£ã主æ¨ã®å 容ã§ããããã°ã©ã ã®è©±ãåºã¦æ¥ã¾ããããæ®å¿µãªããã³ãã³ãã©ã¤ã³ãå°ã使ãã¾ãã Slim ã¨ã¯? æ¡å¼µå㯠.slim view ã®æ§æãæ¬è³ªçãªé¨åã¾ã§æ¸ãããã¨ãç®æãããã³ãã¬ã¼ãè¨èª Ruby製ã®ãã³ãã¬ã¼ãã¨ã³ã¸ã³ é«é, 軽é ã¤ã³ãã³ãéè¦ ç¨é Railsããã¸ã§ã¯ãã®ãã³ãã¬ã¼ã Sinatra(Padorino)ã®ãã³ãã¬ã¼ã HTMLã®ä»£æ¿(å人çã«ã¯) Slimã§HTMLãä½æãã
Mac OS X Lionã§ã¯ãreadlineã®ä»£ããã«ä½¿ããã¦ãã libeditãæ¹åããã¦åé¡ãªãéãã¨ããããã°è¨äºãè¦ããããã©ããã¡ã ã£ãã ãã£ãããirbã³ãã³ãã便å©ã«ä½¿ãããã«readlineãã¤ã³ã¹ãã¼ã«ã $ brew install readline $ brew link readline ããããããªãã·ã§ã³æå®ã追å ãã¦ãrubyãã¤ã³ã¹ãã¼ã«ããã $ CONFIGURE_OPTS="--with-readline-dir=/usr/local" rbenv install 1.9.3-p194 ããã§ãOKãirbã§ãpryã§ãæ¥æ¬èªãéãã®ã確èªããã ã¤ãã§ã«ãRubyistããirbãæ¨ã¦ã¦Pryã使ãã â TIM Labsããèªãã§æ°ã«ãªã£ã¦ãã pryã$ gem install pryã§ã¤ã³ã¹ãã¼ã«ã.lsã.cdãªã©ã§ãã·ã§ã«ã³ãã³ãã
åã« Rubyã§MySQLã«ç¹ãããã®ruby-mysqlã¨mysql2 - tagomorisã®ã¡ã¢ç½®ãå ´ ã¨ããã¨ã³ããªã§æ¸ããã¨ããããã¾ããããæããã使ãããã㪠mysql2 ã¨ãã rubyç¨ã®mysqlãã©ã¤ãã«ã¯prepared statementãæ±ãããã®APIããªããMySQLã§ã¯prepared statementã使ã£ã¦ã使ããªãã¦ãé度ã«å½±é¿ã¯ç¡ãããã(å¾ã®tweetåç §)ããO/R Mapperãçµç±ãã¦ã®ä½¿ç¨ãã¡ã¤ã³ã ããä¸è¦ãã¨ããå¤æãªã®ã ããã (p19)MySQLã®å ´å: PreparedStatementãã¼ã«æ©è½ã®å©ç¨æç¡ã¯ãæ§è½ã«ã¾ã£ããå½±é¿ãã¾ããã»ãã©ã¡ã¼ã¿ã®ãã¤ã³ãæ©æ§ã®å©ç¨æç¡ã¯ãæ§è½ã«ã¾ã£ããå½±é¿ãã¾ãã / Microsoft PowerPoint - URL 2012-04-18 11:49:15 via Hatena ããã
æ°å¤ãªãã©ã« æååãªãã©ã« ããã¯ã¹ã©ãã·ã¥è¨æ³ å¼å±é ã³ãã³ãåºå ãã¢ããã¥ã¡ã³ã (è¡æåæååãªãã©ã«) æ£è¦è¡¨ç¾ãªãã©ã« é åå¼ ããã·ã¥å¼ ç¯å²ãªãã¸ã§ã¯ã ã·ã³ãã« %è¨æ³ æ°åã®1ãæåå"hello world"ã®ããã«Rubyã®ããã°ã©ã ã®ä¸ã«ç´æ¥ è¨è¿°ã§ããå¤ã®äºããªãã©ã«ã¨ããã¾ãã æ°å¤ãªãã©ã« 123 0d123 æ´æ° -123 符å·ã¤ãæ´æ° [[trap:Numeric]] 123.45 æµ®åå°æ°ç¹æ° .1 ãªã© "." ã§å§ã¾ãæµ®åå°æ°ç¹æ°ã¯è¨±ãããªããªãã¾ããã0.1 ã¨æ¸ãå¿ è¦ãããã¾ãã 1.2e-3 æµ®åå°æ°ç¹æ° 0xffff 16é²æ´æ° 0b1011 2é²æ´æ° 0377 0o377 8é²æ´æ° ? 表ç¾ã§ã¯å ¨ã¦ã®ããã¯ã¹ã©ãã·ã¥è¨æ³ãæå¹ã§ãã æåã³ã¼ã以å¤ã®æ°å¤ãªãã©ã«ã«ã¯ã`_' ãå«ãããã¨ãã§ãã¾ãã ruby ã¤ã³ã¿ããªã¿ã¯ `_'
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}