2016-01-01ãã1å¹´éã®è¨äºä¸è¦§
ã¡ãã£ã¨åã§ãã ThinkPad T460s ãè²·ãã¾ããã ThinkPad T460s ãã¿ï¼ pic.twitter.com/JMp8shnrTfâ ã¨ã¿ãã¾ãã²ã (@tmtms) October 7, 2016 軽ãPCã欲ããã¦ã1kgåå¾ã®PCãæ¢ããããã¦ããã§ããã©ãThinkPad T460s ã 10ä¸å以ä¸ã§è²·ããããã«ãªâ¦
Firefox 50 ã§çµµæåã«è²ãã¤ãã¾ããã 次ã®ãããªããã¹ããã¡ã¤ã«ã表示ãã㨠㨠次ã®ããã«è¡¨ç¤ºãããããã«ãªãã¾ããã ã§ãããUbuntu ã§æ¬¡ã®ãã¡ã¤ã«ã表示ãã㨠次ã®ããã«ããã¨ããã ãç½é»ã§è¡¨ç¤ºããã¦ãã¾ãã¾ããã ã©ããããOSã®ãã©ã³ãâ¦
ãæè¿ã®ruby-core (2016å¹´7æ)ãã«æ¬¡ã®ãããªè¨è¿°ãããã¾ããã Enumerable#sum ã¨ããã¡ã½ããã追å ããã¦ãããç¹å®ã®å ´å(æµ®åå°æ°ç¹æ°ã®é åã¨ã)ã«ã¯èª¤å·®ãç´¯ç©ããªãã¢ã«ã´ãªãºã ãæ¡ç¨ããã¦ãã¾ãã Ruby 2.4 ã« Enumerable#sum ã追å ãããã®ã¯â¦
ãã¼ã¿éä¿¡ç¨ã®ã¹ããã®ä»ã«ãé話ã¨ã¢ãã¤ã«Suicaã®ããã«ã¬ã©ã±ã¼(F-01E)ãæã£ã¦ããã®ã§ãããã¬ã©ã±ã¼ã®2å¹´ç¸ãã®å¥ç´ã®æ´æ°ææã«ãªãã¾ãããæè¿SIMããã¯ããªã¼ã®ã¹ããã§ãSuicaã使ãããã®ãåºã¦ããã®ã§ã1å°ã«ã¾ã¨ãã¾ããã arrows M03 ã®è©â¦
MySQL ã UTF-8 ã§ä½¿ããã¨æã£ã¦ããããã¡ãªã®ã¯ charset utf8 ãæå®ãã¦ãã¾ããã¨ã§ãã MySQL ã® UTF-8 ã«ã¯æ´å²çäºæ ã«ãã utf8 㨠utf8mb4 ã®äºã¤ããã¾ãã UTF-8 ã¯1ãã¤ãã4ãã¤ãã§1æåãæ§æãããæåã³ã¼ãã§ãããMySQL ã® utf8 ã¯4ãã¤â¦
Ruby ã§é·ãæéæããããç¥ããªãå¦çã®ã¿ã¤ã ã¢ã¦ããè¡ãã«ã¯ãããªæãã«ãã¾ãã require 'timeout' begin Timeout.timeout(3) do # 3ç§ã§ã¿ã¤ã ã¢ã¦ã hoge # ä½ãã®å¦ç end rescue Timeout::Error puts 'ãªãã¼ã' # ã¿ã¤ã ã¢ã¦ãçºçæã®å¦ç end â¦
Sequel ã®ç½ ã£ã½ãæåã«ããã£ãã®ã§ã¡ã¢ã 次ã®ãããªãã¼ãã« a, b, c, d ãããã¾ãã¦ã mysql> select * from a; +------+ | id | +------+ | 1 | +------+ mysql> select * from b; +------+ | id | +------+ | 2 | +------+ mysql> select * from c; â¦
ä¾ãã°10åã®è¦ç´ ãæã¤é åããã£ã¦ãããã3ã¤ã«åå²ãããæã«ã a = [1,2,3,4,5,6,7,8,9,10] n = 3 m = Rational(a.size, n).ceil a.each_slice(m).to_a #=> [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10]] ã¿ããã«ããã¨ã3ã¤ã«ã¯åå²ã§ãããã§ãããè¦ç´ æ°â¦
æåã¨ã³ã³ã¼ãã£ã³ã°ã«UTF-8ã使ç¨ããå ´åã1æåã¯1ãã¤ãã4ãã¤ãã§ãã ããæååã®å é ããnæåã®æååãåãåºãã«ã¯æ¬¡ã®ããã«ã§ãã¾ãã str = "æ¬æ¥ã¯æ´å¤©ãªã" n = 3 str[0, n] #=> "æ¬æ¥ã¯" å é ããnãã¤ããè¶ ããªãæ大ã®æååãåãåºâ¦
åå MySQL X Protocol ã§ä½¿ç¨ãã¦ãã Protobuf ã«ã¤ãã¦æ¸ãã¾ããããããã ãã§ã¯ MySQL ã®ãããã³ã«ã¯è§£æã§ãã¾ããã TCP ãæµãããã¼ã¿ã¯åºåãããªãã®ã§ãæ¸ãè¾¼ã¿å´ã Protobuf ãã¼ã¿ããã åãæµãã¦ããèªã¿è¾¼ãå´ãã©ãèªãã§è¯ãã®ãããâ¦
MySQL 5.7.12 ãã追å ããã X Protocol 㯠Protobuf ã¨ããã®ã使ã£ã¦ããããã§ãã Protobuf ã¨ããã®ãããã§åãã¦ç¥ã£ãã®ã§ãã¨ãããã Ruby ãã Protobuf ãå©ç¨ããæ¹æ³ã調ã¹ã¦ã¿ã¾ããã Protobuf ã¯ãã¼ã¿æ§é ããã¤ãåã«ã¨ã³ã³ã¼ãããããâ¦
Ruby 㧠String ãªãã¸ã§ã¯ããè¤è£½ãã¦ããæååãã¼ã¿ã¯è¤è£½ããã¾ããã data = "a"*10*1024*1024 system "grep ^VmSize /proc/#$$/status" t1 = Time.now a = [] 100.times do |i| a.push data.dup end t2 = Time.now system "grep ^VmSize /proc/#$$/sâ¦
æ¨å¹´æ«ã«ãRubyè³ã«ã¯Crystalã¤ãã Advent Calendar 2015ãã¨ããã®ãæ¸ãã¾ããã qiita.com å½æã® Crystal ã®ãã¼ã¸ã§ã³ã¯ 0.10 ã ã£ãã®ã§ããããã®å¾ãã¼ã¸ã§ã³ãããã£ã¦æ¹åããã¦ããããã®ã§ãç´¹ä»ãã¾ãã ã«ã¬ã³ããã£ã¬ã¯ããªã« .crystal ãä½â¦
MySQL 5.7.12 ã§çªå¦ç»å ´ãã MySQL Shell ã¨ã X DevAPI ã¨ã X Protocol ã¨ããé¢ç½ããã ã£ãã®ã§èª¿ã¹ã¦ã¿ã¾ããã Document Store ã¨ããåãæèã§èªããã¦ã¦ãããããã®ç¨èªãä½ã表ãã¦ãã®ããããããã£ãã®ã§ãã¾ããã®è¾ºããã X Protocol mysqlâ¦
å ¨ç¶ç¥ããªãã£ããã§ãããMySQLã«ãã½ã±ãããã¢è¨¼ææ¸èªè¨¼ãã©ã°ã¤ã³ãã¨ããã®ãããã®ãç¥ãã¾ããã http://dev.mysql.com/doc/refman/5.6/ja/socket-authentication-plugin.html ããã使ãã¨OSã®ãã°ã¤ã³ã¦ã¼ã¶ã¼ã¨åãååã®MySQLã¦ã¼ã¶ã¼ã§ããã°â¦
Twitter ãåä¹ãã¡ã¼ã«ã¢ãã¬ã¹ããã¡ã¼ã«ãå±ããã®ã§ãããSubjectãæååããã¦ãã¾ããã Subject: ã¨ã¿ãŸã¾ãâ¢Ã£Â²Ã£âãããTwitterããã®æè¬ã®ã¡ãã»ã¼ã¸ã§ãã ãã¾ã®Twitterãããã®ã¯ãçããã®ãããã§ãã 10å¹´åã®ä»æ¥ãã²ã¨ã¤ã®ãã¤ã¼ããããã¹â¦
ã¡ãã£ã¨ããã£ãã®ã§ã¡ã¢ã ãã¡ã¤ã«ã flock() ã§æä»çã«ããã¯ããããã«æ¬¡ã®ããã«ããã¨æåãã¾ãã % ruby -e 'File.open("hoge").flock(File::LOCK_EX); puts "OK"' OK ããNFS ä¸ã§åããã¨ãããã¨å¤±æãã¾ãã % ruby -e 'File.open("hoge").floâ¦
Postfix 3.1 ããªãªã¼ã¹ããã¾ããã å人çã«æ°ã«ãªã£ãæ°æ©è½ã¯ JSON-format Postfix queue listing. Destination-independent delivery rate delay ã®2ã¤ã§ãã JSONå½¢å¼ãã¥ã¼è¡¨ç¤º ä»ã¾ã§ã¯ mailq ã postqueue -p ã³ãã³ãã§æ¬¡ã®ãããªè¡¨ç¤ºãããã¦ãã¾â¦
2/16 ã« Crystal 0.12 ããªãªã¼ã¹ããã¾ããã 0.12 ã§ã¯ Crystal ã«æåã¨ã³ã³ã¼ãã£ã³ã°å¤æã®ä»çµã¿ãå°å ¥ããã¾ããã Ruby ã¨åããããªæã㧠String#encode ã IO#set_encoding çã追å ããã¾ããã ã¨ãã£ã¦ã Crystal ã®æåã¨ã³ã³ã¼ãã£ã³ã°ã¯ Ruâ¦
ã¹ãã ã¡ã¼ã«â¦ã¨ããããã£ãã·ã³ã°ã¡ã¼ã«ãéããã¦ããã®ã§ãããæååããã¦ãã¾ããã æååãã¡ã¼ã«ç 究家ã¨ãã¦ã¯(ry ã¡ã¼ã©ã¼ã§è¦ã㨠Subject ã¨æ¬æã次ã®ããã«ãªã£ã¦ãã¾ããã From: ããããª_yè¡ã <[email protected]> Subject: æ¬äºº_J_^ãµ_`ãã¹ æååãã¨ã</[email protected]>â¦
DELL ã«ã¦ã¼ã¶ã¼ç»é²ãããã¡ã¼ã«ãéããã¦ãããã§ããããã®ã¡ã¼ã«ãæååããã¦ã¾ããã æååãã¡ã¼ã«ç 究家ã¨ãã¦ã¯è§£æããããå¾ã¾ããã ã¡ã¼ã©ã¼ã§è¦ã㨠Subject ã次ã®ããã«ãªã£ã¦ãã¾ããã ãã«ã¢ã«ã¦ã³ãã«$4EPO?$$$?$@$-!"$"$j$,$H$&$4$6â¦
èªåã®ã¡ã¤ã³PCã¯ãã¼ãPC㧠ThinkPad X220 ã使ã£ã¦ããã§ããããã4å¹´ååã«è²·ã£ããã®ã ãéãã®ã§ãæ°ããã¦ãã£ã¨è»½ãPCã欲ããã¨æã£ã¦ã¾ãã éé 1kg ç¨åº¦ãç»é¢ã¯13ã¤ã³ããCPU㯠Core i5ãã¡ã¢ãª8GB ããããæ¡ä»¶ã«ãã¦æ¢ãã¦ã¿ã¾ããã ãªããâ¦
ååãæ¸ããããã« Crystal ã® String ã®ã¨ã³ã³ã¼ãã£ã³ã°ã¯ UTF-8 åºå®ã§ãããªã®ã§ Ruby ã®ããã«ãã¤ããªãã¼ã¿ã String ãªãã¸ã§ã¯ãã§æ±ããã¨ã¯ã§ãã¾ããã ãã¤ããªãã¼ã¿ã¯ Pointer, Slice, MemoryIO ã§æ±ããã¨ãã§ããããã§ãã èªåã§ãããâ¦
åã«æ¬¡ã®ãããªè¨äºãæ¸ãã¾ããã tmtms.hatenablog.com Ruby ã¨ç°ãªããã¨ã³ã³ã¼ãã£ã³ã°ãå¤æããã UTF-8 ã¨ãã¦æ£ãããã¤ãåãã©ãããå¤å®ããæ¹æ³ãããã¾ãããã¤ããã ããã解決ããããã« Crystal ã« String#scrub 㨠String#valid_encoding?â¦