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

PDF::Writer:PDF::SimpleTable::Column::Heading#justification, #justification=

require 'pdf/simpletable' pdf = PDF::Writer.new PDF::SimpleTable.new do |tab| tab.column_order = %w(col1 col2 col3) tab.show_lines = :all tab.show_headings = true tab.columns["col1"] = PDF::SimpleTable::Column.new("COL1") {|col| col.headin…

Java FAQ:文字 '0' を数値の 0 に、数値の 0 を文字 '0' 変換

Java FAQ:S007 Q-08 public class C2008032300 { public static void main(String[] args) { char c; int i; c = '0'; i = Character.digit(c, 10); System.out.println(i); i = 0; c = Character.forDigit(i, 10); System.out.println(c); c = '1'; i = Ch…

lex を試す。クラスとして記述

まんま #!/usr/bin/env python import ply.lex as lex class MyLexer: # List of token names. This is always required tokens = ( 'NUMBER', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'LPAREN', 'RPAREN', ) # Regular expression rules for simple tokens t_…