2009-04-23から1日間の記事一覧

libharu:HPDFPage#set_line_width

#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page y = 50 [10, 20, 30].each do |w| page.set_line_width(w) page.move_to(100, y) page.line_to(200, y) page.stroke y += 50 end pdf.save_to_file(File.basename($0, ".rb") + "…

Commons Lang、BitField#clearByte()

import org.apache.commons.lang.BitField; public class C2009042300 { public static void main(String[] args) { BitField bf; for (byte i = 0; i < 16; i++) { bf = new BitField(5); System.out.println(i + " : " + bf.clearByte(i)); } } } で、 0 :…

LOOKAHEAD、規則を記述 再び

任意の規則が書けるのかな? PARSER_BEGIN(Test) import java.io.*; public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : </space:>…