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

libharu:HPDFPage#close_path

#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.move_to(100, 100) page.line_to(150, 100) page.line_to(150, 50) page.close_path page.stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")

Commons Lang、BooleanUtils.toBooleanDefaultIfNull()

import org.apache.commons.lang.BooleanUtils; public class C2009032400 { public static void main(String[] args) { System.out.println(BooleanUtils.toBooleanDefaultIfNull(true, true)); System.out.println(BooleanUtils.toBooleanDefaultIfNull(fa…

字句解析:lengthOfMatch

PARSER_BEGIN(Test) 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 : { <A: "a"> { System.out.print("lengthOfMatch: "); Sys</a:></space:>…