2009-07-01から1ヶ月間の記事一覧

prawn:Prawn::Graphics#horizontal_line

まんま #!/usr/bin/env ruby require "prawn" pdf = Prawn::Document.new pdf.horizontal_line 25, 100, :at => 75 pdf.stroke pdf.render_file(File.basename($0, ".rb") + ".pdf")

Commons Lang、StandardToStringStyle#isFieldSeparatorAtStart

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

Tutorial 3 Delayed Matchers

まんま >>> 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…

prawn:Prawn::Graphics#fill_and_stroke

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

Commons Lang、StandardToStringStyle#isFieldSeparatorAtEnd

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

Tutorial 3 Recursion

まんま >>> 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) >>> add = number & symbol('…

prawn:Prawn::Graphics#fill

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

Commons Lang、StandardToStringStyle#isDefaultFullDetail

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

Tutorial 3 Adding Subtraction

まんま >>> 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) >>> add = number & symbol('…

prawn:Prawn::Graphics#ellipse_at

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

Commons Lang、StandardToStringStyle#isArrayContentDetail

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

Tutorial 3 Back to Basics

まんま >>> 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) >>> add = number & symbol('…

prawn:Prawn::Graphics#curve

まんま #!/usr/bin/env ruby require "prawn" pdf = Prawn::Document.new pdf.curve [50,100], [100,100], :bounds => [[90,90],[75,75]] pdf.stroke pdf.render_file(File.basename($0, ".rb") + ".pdf")

Commons Lang、StandardToStringStyle#getSummaryObjectStartText

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

Tutorial 2 Tokens (Second Attempt)

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

prawn:Prawn::Graphics#circle_at

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

Commons Lang、StandardToStringStyle#getSummaryObjectEndText

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

Tutorial 2 Tokens (First Attempt)

まんま >>> from lepl import * >>> value = Token(SignedFloat()) >>> symbol = Token('[^0-9a-zA-Z \t\r\n]') >>> number = value >> float >>> add = number & ~symbol('+') & number > sum >>> print(add.parse('12+30')) None >>> from logging import …

prawn:Prawn::Graphics::KAPPA

#!/usr/bin/env ruby require "prawn" p Prawn::Document::KAPPA p Prawn::Graphics::KAPPA で、 0.552284749830794 0.552284749830794

Commons Lang、StandardToStringStyle#getSizeStartText

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

Tutorial 2 NfaRegexp()

まんま >>> from lepl import * >>> list(NfaRegexp('a*').match('aaa')) [(['aaa'], ''), (['aa'], 'a'), (['a'], 'aa'), ([''], 'aaa')] >>> list(DfaRegexp('a*').match('aaa')) [(['aaa'], '')] >>> list(Regexp('a*').match('aaa')) [(['aaa'], '')]

prawn:Prawn::Document#text_box

まんま #!/usr/bin/env ruby require "prawn" Prawn::Document.generate(File.basename($0, ".rb") + ".pdf") do text_box "Oh hai text box. " * 200, :width => 300, :height => font.height * 5, :overflow => :ellipses, :at => [100,bounds.top] end

Commons Lang、StandardToStringStyle#getSizeEndText

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

Tutorial 2 DfaRegexp()

まんま >>> from lepl import * >>> DfaRegexp('a*b').parse('aabbcc') ['aab'] >>> Regexp('a*b').parse('aabbcc') ['aab']

prawn:Prawn::Document#start_new_page

まんま #!/usr/bin/env ruby require "prawn" pdf = Prawn::Document.new pdf.start_new_page(:size => "LEGAL", :layout => :landscape) pdf.start_new_page(:left_margin => 50, :right_margin => 50) pdf.render_file(File.basename($0, ".rb") + ".pdf")

Commons Lang、StandardToStringStyle#getNullText

import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071300 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getNullText()); } } で、 <null></null>

Tutorial 2 Regexp()

まんま >>> from lepl import * >>> Regexp('a+').parse('aaabb') ['aaa'] >>> Regexp(r'\w+').parse('abc def') ['abc'] >>> Regexp('a*(b*)c*(d*)e*').parse('abbcccddddeeeeee') ['bb', 'dddd']

prawn:Prawn::Document#span

まんま #!/usr/bin/env ruby require "prawn" Prawn::Document.generate(File.basename($0, ".rb") + ".pdf") do span(350, :position => :center) do text "Here's some centered text in a 350 point column. " * 100 end end

Commons Lang、StandardToStringStyle#getFieldSeparator

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

Tutorial 2 Separators

まんま >>> from lepl import * >>> number = SignedFloat() >> float >>> spaces = ~Space()[:] >>> with Separator(spaces): ... add = number & ~Literal('+') & number > sum ... >>> add.parse('12 + 30') [42.0] >>> add.parse('12+30') [42.0]