2009-07-29から1日間の記事一覧

prawn:Prawn::Graphics#rectangle

まんま #!/usr/bin/env ruby require "prawn" pdf = Prawn::Document.new pdf.rectangle [300,300], 100, 200 pdf.stroke pdf.render_file(File.basename($0, ".rb") + ".pdf")

Commons Lang、StandardToStringStyle#setArrayStart

import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009072900 { public static void main(String[] args) { StandardToStringStyle x = new StandardToStringStyle(); System.out.println(x.getArrayStart()); x.setArrayStart…

Tutorial 4 Evaluation

まんま >>> from lepl import * >>> from operator import add, sub, mul, truediv >>> class Op(Node): ... def __float__(self): ... return self._op(float(self[0]), float(self[1])) ... >>> class Add(Op): _op = add ... >>> class Sub(Op): _op = su…