2015-09-01から1ヶ月間の記事一覧
open-uriのopenメソッドに日本語を用いたら url= "http://search.hatena.ne.jp/keyword?word=野球&mode=rss&ie=utf8&page=1" open(url) 以下の用なエラーを吐いたので、対処法をメモ /usr/lib/ruby/1.9.1/uri/common.rb:176:in `split': bad URI(is not URI?…
rubyのgnuplotで3Dグラフを生成するサンプルを貼っておきます。 require "gnuplot" Gnuplot.open do |gp| Gnuplot::SPlot.new( gp ) do |plot| plot.output "test.eps" plot.xlabel "x" plot.ylabel "y" plot.zlabel "z" plot.set 'terminal postscript 16 e…
非常に便利なメソッドがついているので簡単です。 hash = {:key1 => value1,:key2 => value2} hash.keys # => [:key1,:key2] keyを配列として取得できる hash.values # => [value1,value2] valueを配列として取得できる
scalaをubuntu14.04にインストールし、実行しようとしたら以下のようなエラーが発生。 error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken (bad constant pool tag…
Copyをubuntuのローカルで使えるようにしたのでメモ。 copyは普通に登録して、15GB。 copyは以下のリンクから登録してもらえれば、紹介ボーナスとしてお互いに5GBをもらえます!(つまり初期段階で20GB) 手続きも簡単です。 以下のリンクからアクセス https:/…
iconvでShift_JISからutf-8へ以下のコマンドで変換した時に\が¥になってしまった。 iconv -f Shift_JIS -t UTF8 test_shift_jis.tex > test_utf8.tex これは以下のコマンドに変更すれば良い。 iconv -f cp932 -t UTF8 test_shift_jis.tex > test_utf8.tex