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

PDF::Writer:PDF::SimpleTable#heading_font_size, #heading_font_size=

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

Java FAQ:型変換のまとめ

数値 -> 文字列: String.valueOf(x) か new Integer(i).toString() か Integer.toString(i) など 数値 -> n進数の文字列: Integer.toBinaryString(i), Integer.toOctalString(i), Integer.toString(i, n), Integer.toHexString(i) など 数値オブジェクト -…

lex を試す。状態

機能の詳細はともかく、とりあえず試してみる #!/usr/bin/env python import ply.lex as lex states = ( ('foo', 'exclusive'), ) tokens = ( 'A', 'PLUS', ) t_A = r'a' t_ANY_PLUS = r'\+' t_ANY_ignore = ' \t\n' t_foo_A = r'b' def t_begin_foo(t): r's…