2009-05-14から1日間の記事一覧

libharu:HPDFEncoder#get_byte_type

「rb_define_method(rb_cHPDFEncoder, "get_byte_type", hpdf_encoder_get_byte_type, 1);」を 「rb_define_method(rb_cHPDFEncoder, "get_byte_type", hpdf_encoder_get_byte_type, 2);」に修正 #!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page…

Commons Lang、Validate.noNullElements()

import org.apache.commons.lang.Validate; public class C2009051400 { public static void main(String[] args) { String[] str_list1 = {"foo", "bar", "baz"}; Validate.noNullElements(str_list1); String[] str_list2 = {"foo", "bar", "baz", null}; …

『Rubyを256倍使うための本 無道編』の 13.defun/intp.y を移植

関数定義可能。変数スコープあり。コードを理解できていないので、意味(動作)から推測(IntpFrame クラスはなし) class Node: def exec_list(self, nodes): for x in nodes: x.evaluate() class RootNode(Node): def __init__(self, tree): self.tree = tree …