2008-03-26から1日間の記事一覧

PDF::Writer:PDF::SimpleTable#show_headings, #show_headings=

require 'pdf/simpletable' pdf = PDF::Writer.new PDF::SimpleTable.new do |tab| tab.column_order = %w(col1 col2 col3) p tab.show_headings tab.show_lines = :all tab.show_headings = false data = [ { "col1" => "foo", "col2" => "bar", "col3" => …

Java FAQ:byte を unsigned byte として int と相互変換

Java FAQ:S007 Q-11 public class C2008032600 { public static void main(String[] args) { byte b; int i; b = (byte)0xfd; i = b & 0xFF; System.out.println("b : " + b + " " + Integer.toHexString(b)); System.out.println("b : " + i + " " + Integ…

lex を試す。Lexer の複製

マニュアルによると、こういうこと? クラスで定義していないときは、以下のようにやれば良い。 これは、lex() を呼んで再度ルールなどを構築し直すよりも速い。 lexer = lex.lex() ... newlexer = lexer.clone() 一方、クラス定義した場合は、ちょっと考え…