2009-01-30から1日間の記事一覧

libharu:HPDFDoc#insert_page

#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new p1 = pdf.add_page p1.rectangle(50, 50, 10, 10) p1.stroke p2 = pdf.insert_page(p1) p2.rectangle(50, 50, 100, 100) p2.stroke pdf.save_to_file(File.basename($0, ".rb") + ".pdf") hpdf_insert…

Commons Lang、StringEscapeUtils.escapeSql()

まんま import org.apache.commons.lang.StringEscapeUtils; public class C2009013000 { public static void main(String[] args) { System.out.println(StringEscapeUtils.escapeSql("McHale's Navy")); } } で、 McHale''s Navy

Parsec.Error:errorMessages, messageString

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorMessages <interactive>:1:0: Not in scope: `errorMessages' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinat</interactive>…

debug.setlocal()

debug.getupvalue(), debug.setupvalue() とばし #!/usr/bin/env lua function foo(x, y) print(debug.getlocal(1, 1)) print(debug.getlocal(1, 2)) print(debug.getlocal(1, 3)) print(x, y) debug.setlocal(1, 1, 10) print(x, y) end foo(1, 2) で、 x 1…