2009-01-01から1ヶ月間の記事一覧
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new pdf.add_page p [HPDFDoc::HPDF_HIDE_TOOLBAR, HPDFDoc::HPDF_HIDE_MENUBAR, HPDFDoc::HPDF_HIDE_WINDOW_UI, HPDFDoc::HPDF_FIT_WINDOW, HPDFDoc::HPDF_CENTER_WINDOW, ] p pdf.get_viewer_preference…
まんま import org.apache.commons.lang.StringEscapeUtils; public class C2009013100 { public static void main(String[] args) { System.out.println(StringEscapeUtils.escapeXml("\"bread\" & \"butter\"")); } } で、 "bread" & "…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t Message <interactive>:1:0: Not in scope: data constructor `Message' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCom</interactive>…
#!/usr/bin/env lua function foo(x) print("in foo()", x) end debug.sethook(foo, "c") print("0") foo() print("1") foo() print("2") debug.sethook() print("3") foo() print("4") で、 in foo() call in foo() call 0 in foo() call in foo() call in …
#!/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…
まんま 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
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.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…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new p pdf.add_page p pdf.get_current_page p pdf.add_page p pdf.get_current_page pdf.save_to_file(File.basename($0, ".rb") + ".pdf") で、 #<HPDFPage:0xb7d7aafc> #<HPDFPage:0xb7d7aac0> #<HPDFPage:0xb7d7aa98> #<HPDFPage:0xb7d7aa70>ちょっと予想と違う動き〜</hpdfpage:0xb7d7aa70></hpdfpage:0xb7d7aa98></hpdfpage:0xb7d7aac0></hpdfpage:0xb7d7aafc>
import java.io.*; import org.apache.commons.lang.StringEscapeUtils; public class C2009012900 { public static void main(String[] args) throws Exception { System.out.println(StringEscapeUtils.escapeJavaScript(" ")); System.out.println(String…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorPos errorPos :: ParseError -> SourcePos module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.…
#!/usr/bin/env lua function foo(x, y) print(debug.getlocal(1, 1)) print(debug.getlocal(1, 2)) print(debug.getlocal(1, 3)) end foo(1, 2) で、 x 1 y 2 nil
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page d = page.create_destination d.set_fit() #d.set_fit_h(0) #d.set_fit_h(100) pdf.set_open_action(d) pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
import java.io.*; import org.apache.commons.lang.StringEscapeUtils; public class C2009012800 { public static void main(String[] args) throws Exception { System.out.println(StringEscapeUtils.escapeJava(" ")); System.out.println(StringEscape…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :i ParseError data ParseError = Text.ParserCombinators.Parsec.Error.ParseError !SourcePos [Text.ParserCombinators.Parsec.Error.Message] -- Defined in Text.Par…
#!/usr/bin/env lua debug.debug() で、 lua_debug> print(debug.getinfo(math.abs)) table: 0x8050a40 lua_debug> table.foreach(debug.getinfo(math.abs), function(k,v) print(k,v); return nil; end) source =[C] what C func function: 0x804f5f0 short…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p [HPDFDoc::HPDF_PAGE_MODE_USE_NONE, HPDFDoc::HPDF_PAGE_MODE_USE_OUTLINE, HPDFDoc::HPDF_PAGE_MODE_USE_THUMBS, HPDFDoc::HPDF_PAGE_MODE_FULL_SCREEN] p pdf.get_page_mode…
まんま import org.apache.commons.lang.StringEscapeUtils; public class C2009012700 { public static void main(String[] args) { System.out.println(StringEscapeUtils.escapeHtml("\"bread\" & \"butter\"")); } } で、 "bread" & "…
module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.ParserCombinators.Parsec.Language lexer :: TokenParser () lexer = makeTokenParser(javaStyle) test = do { setInput "foo" ; string …
#!/usr/bin/env lua debug.debug() で、 lua_debug> print(debug.gethook()) nil 0
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p [HPDFDoc::HPDF_PAGE_LAYOUT_SINGLE, HPDFDoc::HPDF_PAGE_LAYOUT_ONE_COLUMN, HPDFDoc::HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT, HPDFDoc::HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT] p pd…
import java.util.*; import org.apache.commons.lang.time.DateUtils; public class C2009012600 { public static void main(String[] args) { GregorianCalendar c = new GregorianCalendar(); System.out.println(c); System.out.println(DateUtils.trunc…
module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.ParserCombinators.Parsec.Language lexer :: TokenParser () lexer = makeTokenParser(javaStyle) test = do { string "foo" ; x <- getI…
#!/usr/bin/env lua debug.debug() で、 lua_debug> print("foo") foo
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new p pdf.has_doc page = pdf.add_page p pdf.has_doc で、 1 1意味あるのか?エラーの場合には例外を発生した方が良いのか?
import java.util.*; import org.apache.commons.lang.time.DateUtils; public class C2009012500 { public static void main(String[] args) { GregorianCalendar c = new GregorianCalendar(); System.out.println(c); System.out.println(DateUtils.round…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t setPosition setPosition :: SourcePos -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Tok…
#!/usr/bin/env lua print(os.tmpname()) print(os.tmpname()) で、 lua: ./2009012500.lua:3: `tmpname' not supportedもう、ない?
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new p pdf.new_doc page = pdf.add_page pdf.save_to_file(File.basename($0, ".rb") + ".pdf") 意味があるのか不明
import java.util.*; import org.apache.commons.lang.time.DateUtils; public class C2009012400 { public static void main(String[] args) { GregorianCalendar c = new GregorianCalendar(); Iterator iter = DateUtils.iterator(c, DateUtils.RANGE_WEE…