2009-03-01から1ヶ月間の記事一覧
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page image = pdf.load_png_image_from_file("pngsuite/basn0g01.png") page.draw_image(image, 100, 100, 50, 50) page.draw_image(image, 300, 100, 100, 100) pdf.save_to_file(Fil…
import org.apache.commons.lang.BooleanUtils; public class C2009033100 { public static void main(String[] args) { System.out.println(BooleanUtils.toStringYesNo(true)); System.out.println(BooleanUtils.toStringYesNo(false)); System.out.printl…
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"> | <B: "b"> } void Input() : {} { ( <A> | <B> | "c" | "de</b></a></b:></a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.move_to(100, 100) page.curve_to3(250, 250, 280, 150) page.stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import org.apache.commons.lang.BooleanUtils; public class C2009033000 { public static void main(String[] args) { System.out.println(BooleanUtils.toStringTrueFalse(true)); System.out.println(BooleanUtils.toStringTrueFalse(false)); System.ou…
字句解析内での呼び出し 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"> { getNextToken(); }</a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.move_to(100, 100) page.curve_to2(250, 250, 280, 150) page.stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import org.apache.commons.lang.BooleanUtils; public class C2009032900 { public static void main(String[] args) { System.out.println(BooleanUtils.toStringOnOff(true)); System.out.println(BooleanUtils.toStringOnOff(false)); System.out.printl…
matchedToken も Token クラスだから、それと同じか〜 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"> } TO</space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.move_to(100, 100) page.curve_to(200, 300, 250, 250, 240, 50) page.stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import org.apache.commons.lang.BooleanUtils; public class C2009032800 { public static void main(String[] args) { System.out.println(BooleanUtils.toString(true, "foo", "bar")); System.out.println(BooleanUtils.toString(false, "foo", "bar"));…
SKIP 内では、matchedToken が使えないから、input_stream.get*() を使うらしい(使う機会は余りなさそうな気もするけど) PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(S…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_trans_matrix rad = 45 / 180.0 * Math::PI page.concat(Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad), 100, 100) p page.get_trans_matrix page.mo…
import org.apache.commons.lang.BooleanUtils; public class C2009032700 { public static void main(String[] args) { System.out.println(BooleanUtils.toIntegerObject(true)); System.out.println(BooleanUtils.toIntegerObject(false)); System.out.pr…
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"> : STATE1 } <STATE1>TOKEN : { <S1A: "a"> { SwitchTo(0); } }</s1a:></state1></a:></space:>…
#!/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_fill_stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import org.apache.commons.lang.BooleanUtils; public class C2009032600 { public static void main(String[] args) { System.out.println(BooleanUtils.toInteger(true)); System.out.println(BooleanUtils.toInteger(false)); System.out.println(Boolea…
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(input_stream); } } void</a:></space:>…
#!/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_stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import org.apache.commons.lang.BooleanUtils; public class C2009032500 { public static void main(String[] args) { System.out.println(BooleanUtils.toBooleanObject(true)); System.out.println(BooleanUtils.toBooleanObject(false)); System.out.pr…
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("curLexState: "); Syste</a:></space:>…
#!/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")
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…
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:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.circle(100, 100, 100) page.fill page.circle(300, 100, 50) page.stroke page.circle(200, 500, 10) page.stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import org.apache.commons.lang.BooleanUtils; public class C2009032300 { public static void main(String[] args) { System.out.println(BooleanUtils.toBoolean(true)); System.out.println(BooleanUtils.toBoolean((Boolean)null)); System.out.printl…
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"> } MORE : { <B: "b"> { System.out.println("+"); ima</b:></a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.arc(100, 100, 90, 0, 270) page.fill page.arc(300, 100, 90, 90, 360) page.stroke page.arc(200, 500, 10, 90, 360) page.stroke pdf.save_to_file(File.basename($0, ".…
import org.apache.commons.lang.BooleanUtils; public class C2009032200 { public static void main(String[] args) { System.out.println(BooleanUtils.negate(true)); System.out.println(BooleanUtils.negate(false)); System.out.println(BooleanUtils…
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) TOKEN_MGR_DECLS : { static int x = 1; } SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> { </a:></space:>…