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

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

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:short a = 2; a = -a; がコンパイルエラーに

Java FAQ:S007 Q-09 public class C2008032400 { public static void main(String[] args) { // short a = 2; a = -a; // 精度が落ちている可能性 short a = 2; a = (short)-a; System.out.println(a); } } で、 -2

lex を試す。複数のクラスを記述

一つのファイルに複数のクラスを記述 #!/usr/bin/env python import ply.lex as lex class MyLexer1: tokens = ( 'A', 'PLUS', ) t_A = r'a' t_PLUS = r'\+' def t_error(self,t): print "Illegal character '%s'" % t.value[0] t.lexer.skip(1) # Build the…