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

prawn:Prawn::Graphics::Color#stroke_color=

#!/usr/bin/env ruby require "prawn" pdf = Prawn::Document.new pdf.circle_at [100,100], :radius => 25 pdf.stroke_color = "f0ffc1" #pdf.stroke_color = 0, 99, 95, 0 pdf.stroke pdf.render_file(File.basename($0, ".rb") + ".pdf")

Commons Lang、StandardToStringStyle#setSizeEndText

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

Manual:Matchers:Or (|)

まんま >>> from lepl import * >>> Or(Any('x'), Any('h'), Any('z')).parse_string('hello world') ['h'] >>> Or(Any('h'), Any()[3]).parse_string('hello world') ['h'] >>> Or(Any()[3], Any('h')).parse_string('hello world') ['h', 'e', 'l'] >>> ma…