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

prawn:Prawn::Graphics::Color#fill_color=

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

Commons Lang、StandardToStringStyle#setFieldNameValueSeparator

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

Manual:Getting Started:Repetition

まんま >>> from lepl import * >>> spaces = Space()[0:] >>> name = Word() > 'name' >>> phone = Integer() > 'phone' >>> line = name / ',' / phone > make_dict >>> newline = spaces & Newline() & spaces >>> matcher = line[0:,~newline] >>> match…