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

ActiveSupport、Time#end_of_week, Time#at_end_of_week

>> require "rubygems" => true >> require "active_support" => true >> Time.local(2008, 12, 31).end_of_week => Sun Jan 04 23:59:59 +0900 2009 >> Time.local(2008, 12, 31).at_end_of_week => Sun Jan 04 23:59:59 +0900 2009

Commons Lang、StringUtils.isBlank()

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

Parsec.Combinator:count

module Main where import Text.ParserCombinators.Parsec test1 :: Parser String test1 = count 3 letter run :: Show a => Parser a -> String -> IO () run p input = case (parse p "" input) of Left err -> do{ putStr "parse error at " ; print err…

C API、lua_setgcthreshold()

/* * $ gcc -Wall -W -I/usr/include/lua50 -o 2008102700 -llua50 2008102700.c */ #include <stdio.h> #include <lua.h> int main(void) { lua_State *L; L = lua_open(); printf("%d %d\n", lua_getgccount(L), lua_getgcthreshold(L)); lua_setgcthreshold(L, 1); printf</lua.h></stdio.h>…