2009-07-01から1ヶ月間の記事一覧
まんま #!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009072100 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().isFieldSeparatorAtStart()); } } で、 false
まんま >>> 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…
#!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009072000 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().isFieldSeparatorAtEnd()); } } で、 false
まんま >>> 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('…
#!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071900 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().isDefaultFullDetail()); } } で、 true
まんま >>> 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('…
まんま #!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071800 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().isArrayContentDetail()); } } で、 true
まんま >>> 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('…
まんま #!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071700 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getSummaryObjectStartText()); } } で、
まんま >>> 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(…
まんま #!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071600 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getSummaryObjectEndText()); } } で、 >
まんま >>> 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 …
#!/usr/bin/env ruby require "prawn" p Prawn::Document::KAPPA p Prawn::Graphics::KAPPA で、 0.552284749830794 0.552284749830794
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071500 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getSizeStartText()); } } で、
まんま >>> 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'], '')]
まんま #!/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
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071400 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getSizeEndText()); } } で、 >
まんま >>> from lepl import * >>> DfaRegexp('a*b').parse('aabbcc') ['aab'] >>> Regexp('a*b').parse('aabbcc') ['aab']
まんま #!/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")
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071300 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getNullText()); } } で、 <null></null>
まんま >>> 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']
まんま #!/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
import org.apache.commons.lang.builder.StandardToStringStyle; public class C2009071200 { public static void main(String[] args) { System.out.println(new StandardToStringStyle().getFieldSeparator()); } } で、 ,
まんま >>> 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]