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

ActiveSupport、Time#end_of_quarter, Time#at_end_of_quarter

>> require "rubygems" => true >> require "active_support" => true >> Time.local(2008, 12, 31).end_of_quarter => Wed Dec 31 23:59:59 +0900 2008 >> Time.local(2008, 1, 31).end_of_quarter => Mon Mar 31 23:59:59 +0900 2008 >> Time.local(2008, …

Commons Lang、StringUtils.isAlphaSpace()

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

Parsec.Combinator:sepEndBy1

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

C API、lua_getgccount(), lua_getgcthreshold()

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