2008-10-28から1日間の記事一覧

ActiveSupport、Time#end_of_year, Time#at_end_of_year

>> require "rubygems" => true >> require "active_support" => true >> Time.local(2008, 1, 1).end_of_year => Wed Dec 31 23:59:59 +0900 2008 >> Time.local(2008, 1, 1).at_end_of_year => Wed Dec 31 23:59:59 +0900 2008

Commons Lang、StringUtils.isEmpty()

まんま import org.apache.commons.lang.StringUtils; public class C2008102800 { public static void main(String[] args) { System.out.println(StringUtils.isEmpty(null)); System.out.println(StringUtils.isEmpty("")); System.out.println(StringUti…

Parsec.Combinator:between

ほぼ、まんま module Main where import Text.ParserCombinators.Parsec braces = between (char '{') (char '}') run :: Show a => Parser a -> String -> IO () run p input = case (parse p "" input) of Left err -> do{ putStr "parse error at " ; pri…

C API、lua_load()

/* * $ gcc -Wall -W -I/usr/include/lua50 -o 2008102800 -llua50 2008102800.c */ #include <stdio.h> #include <lua.h> #include <lauxlib.h> /* from lauxlib.c */ typedef struct LoadF { FILE *f; char buff[LUAL_BUFFERSIZE]; } LoadF; static const char *getF (lua_State *L, v</lauxlib.h></lua.h></stdio.h>…