2009-01-01から1ヶ月間の記事一覧
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t getPosition getPosition :: GenParser tok st SourcePos module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token imp…
#!/usr/bin/env lua print(os.time()) print(os.time({ year = 2009, month = 1, day = 24 })) で、 1233097898 1232766000
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page page.set_size(HPDFDoc::HPDF_PAGE_SIZE_B5, HPDFDoc::HPDF_PAGE_LANDSCAPE) page = pdf.add_page pdf.save_to_file(File.basename($0, ".rb") + ".pdf") 第二引数は省略できない…
import org.apache.commons.lang.time.DateUtils; public class C2009012300 { public static void main(String[] args) { System.out.println(DateUtils.MILLIS_IN_DAY); System.out.println(DateUtils.MILLIS_IN_HOUR); System.out.println(DateUtils.MILL…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t updateState updateState :: (st -> st) -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.To…
#!/usr/bin/env lua print(os.setlocale("hoge")) print(os.setlocale("ja_JP.eucJP")) で、 nil ja_JP.eucJPどこが変わるのか分からないけど。時間とかか???
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new pdf.set_compression_mode(HPDFDoc::HPDF_COMP_ALL) page = pdf.add_page pdf.save_to_file(File.basename($0, ".rb") + ".pdf") で、 2009012200.rb:10:in `save_to_file': ERROR 0x1058-0x0000 (HPD…
import org.apache.commons.lang.WordUtils; public class C2009012200 { public static void main(String[] args) { System.out.println(WordUtils.wrap(null, 10)); System.out.println(WordUtils.wrap("", 10)); System.out.println(WordUtils.wrap("How …
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t setState setState :: st -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Tex…
#!/usr/bin/env lua print(os.rename("foo", "bar")) print(os.rename("foo", "bar")) で、 true nil foo: No such file or directory 2
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page pdf.save_to_file(File.basename($0, ".rb") + ".pdf")
まんま import org.apache.commons.lang.WordUtils; public class C2009012100 { public static void main(String[] args) { System.out.println(WordUtils.uncapitalize(null)); System.out.println(WordUtils.uncapitalize("")); System.out.println(WordU…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t getState getState :: forall st tok. GenParser tok st st Prelude Text.ParserCombinators.Parsec> getSate <interactive>:1: Variable not in scope: `getSate' module Main whe</interactive>…
#!/usr/bin/env lua print(os.remove("foo")) print(os.remove("foo")) で、 true nil foo: No such file or directory 2
>> require "rubygems" => true >> require "active_support" => true >> DateTime.new(2009).xmlschema => "2009-01-01T00:00:00+00:00"
まんま(例は StringUtils になっているけど…) import org.apache.commons.lang.WordUtils; public class C2009012000 { public static void main(String[] args) { System.out.println(WordUtils.swapCase(null)); System.out.println(WordUtils.swapCase(""…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t unexpected unexpected :: forall a st tok. String -> GenParser tok st a Prelude Text.ParserCombinators.Parsec> parseTest (unexpected "MESSAGE") "abc" Loadin…
#!/usr/bin/env lua print(os.getenv("hoge")) print(os.getenv("HOME")) で、 nil /home/nnakamur
>> require "rubygems" => true >> require "active_support" => true >> DateTime.new(2009).to_time => Thu Jan 01 00:00:00 UTC 2009 >> DateTime.new(2009).to_time.class => Time
まんま import org.apache.commons.lang.WordUtils; public class C2009011900 { public static void main(String[] args) { System.out.println(WordUtils.capitalizeFully(null)); System.out.println(WordUtils.capitalizeFully("")); System.out.println…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t () () :: forall a st tok. GenParser tok st a -> String -> GenParser tok st a Prelude Text.ParserCombinators.Parsec> :t label label :: forall a st tok. GenP…
#!/usr/bin/env lua print("1") --os.exit(1) os.exit() print("2") で、 1
まんま >> require "rubygems" => true >> require "active_support" => true >> DateTime.new(2009) => Thu, 01 Jan 2009 00:00:00 +0000 >> DateTime.new(2009).to_formatted_s(:db) => "2009-01-01 00:00:00" >> DateTime.new(2009).to_s(:db) => "2009-0…
まんま import org.apache.commons.lang.WordUtils; public class C2009011800 { public static void main(String[] args) { System.out.println(WordUtils.capitalize(null)); System.out.println(WordUtils.capitalize("")); System.out.println(WordUtils…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t tokenPrim tokenPrim :: forall a st tok. (tok -> String) -> (SourcePos -> tok -> [tok] -> SourcePos) -> (tok -> Maybe a) -> GenParser tok st a tokenPrim が…
#!/usr/bin/env lua os.execute("echo foo") で、 foo
>> require "rubygems" => true >> require "active_support" => true >> DateTime.new(2009).to_f => 1230768000.0
import org.apache.commons.lang.SystemUtils; public class C2009011700 { public static void main(String[] args) { System.out.println(SystemUtils.isJavaVersionAtLeast((float)1.5)); System.out.println(SystemUtils.isJavaVersionAtLeast((float)1.…
Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t token token :: forall a st tok. (tok -> String) -> (tok -> SourcePos) -> (tok -> Maybe a) -> GenParser tok st a まんま module Main where import Text.Parser…
#!/usr/bin/env lua t1 = os.time({ year = 2009, month = 1, day = 17 }) t2 = os.time({ year = 2009, month = 1, day = 18 }) print(os.difftime(t2, t1)) で、 86400