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

prawn:Prawn::Graphics#horizontal_rule

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

Commons Lang、StandardToStringStyle#isUseClassName

import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009072200 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().isUseClassName()); } } で、 true

Tutorial 3 Building an AST with Node

まんま >>> from lepl import * >>> symbol = Token('[^0-9a-zA-Z \t\r\n]') >>> value = Token(UnsignedFloat()) >>> negfloat = lambda x: -float(x) >>> number = Or(value >> float, ... ~symbol('-') & value >> negfloat) >>> expr = Delayed() >>> ad…