2008-04-01から1ヶ月間の記事一覧
require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new p chart.dot p chart.bar p chart.upper_crossbar p chart.lower_crossbar で、 #<PDF::Charts::StdDev::Marker:0x40387c4c @color=#<Color::RGB:0x402688ac @b=0.0, @g=0.0, @r=0.0>, @style=#</pdf::charts::stddev::marker:0x40387c4c>
Java FAQ:S011 Q-18説明の意味が良く理解できない。後半はパタンの話になっているし。
#!/usr/bin/env python import ply.lex as lex tokens = ( 'NUM', ) literals = ['+', '-', '*', '/', '^', 'n'] def t_NUM(t): r'\d+(\.\d+)*' try: t.value = float(t.value) except ValueError: print "Integer value too large", t.value t.value = 0 re…
require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new p chart.inner_borders p chart.outer_borders chart.data << PDF::Charts::StdDev::DataPoint.new(1, 4.0000, 0.5774) chart.render_on pdf pdf.save_as("2008042900.p…
Java FAQ:S011 Q-17まんま class C2008042901 { static void method1() { method2(); } static void method2() { System.out.println("Super#method2()"); } } class C2008042902 extends C2008042901 { static void method2() { System.out.println("Sub#m…
「lex.lex(optimize=1)」「yacc.yacc(optimize=1)」 #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer.…
require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new p chart.label chart.label = PDF::Charts::StdDev::Label.new do |label| label.height = 25 label.background_color = Color::RGB::Blue label.text_color = Color::R…
Java FAQ:S011 Q-16 class C2008042801 { static void bar() { System.out.println("bar"); } } public class C2008042800 { static void foo() { System.out.println("foo"); } public static void main(String[] args) { foo(); C2008042801.bar(); } } …
#!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) def t_A(t): r'A' print t.lexer return t t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer.skip(1) lex.lex() im…
require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new p chart.show_labels chart.show_labels = false chart.data << PDF::Charts::StdDev::DataPoint.new(1, 4.0000, 0.5774) chart.render_on pdf pdf.save_as("2008042700…
Java FAQ:S011 Q-14「詳しくは、S012-01 〜 を参照してください。」となっているのだが、「S016 Q-02」の間違いっぽい
#!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer.skip(1) lex.lex() import ply.yacc as yacc def p_i…
require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new p chart.leading_gap #chart.leading_gap = 100 chart.leading_gap = -200 chart.data << PDF::Charts::StdDev::DataPoint.new(1, 4.0000, 0.5774) chart.render_on pdf…
Java FAQ:S011 Q-13 class C2008042601 { static int x = 10; { System.out.println("C2008042601 {} "); } static { System.out.println("C2008042601 static {} 1 " + x); x = 20; } static { System.out.println("C2008042601 static {} 2 " + x); } C20…
「yacc.yacc(debug=1, debugfile="debugging.out")」 #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer…
require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new p chart.scale pdf.save_as("2008042500.pdf") で、 #<PDF::Charts::StdDev::Scale:0x403882dc @label=#<PDF::Charts::StdDev::Label:0x4038823c @text_size=8, @text_color=#<Color::RGB:0x402689c4 @b=0.0, @g=0.0, @r=0.0>, @decimal_…</pdf::charts::stddev::scale:0x403882dc>
Java FAQ:S011 Q-12 class C2008042501 { { System.out.println("C2008042501 {} "); } C2008042501() { System.out.println("C2008042501()"); } } public class C2008042500 { public static void main(String[] args) { new C2008042501(); } } で、 C20…
「yacc.parse(debug=1)」 #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer.skip(1) lex.lex() import …
require 'pdf/writer' require 'pdf/charts' require 'pdf/charts/stddev' pdf = PDF::Writer.new chart = PDF::Charts::StdDev.new chart.data << PDF::Charts::StdDev::DataPoint.new(1, 4.0000, 0.5774) << PDF::Charts::StdDev::DataPoint.new(2, 4.8333…
Java FAQ:S011 Q-11 class C2008042401 { //void foo() { final void foo() { System.out.println("foo in C2008042401"); } } class C2008042402 extends C2008042401 { C2008042402() { foo(); } void foo() { System.out.println("foo in C2008042402");…
「yacc.yacc(write_tables=0)」 #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer.skip(1) lex.lex() i…
require 'pdf/simpletable' pdf = PDF::Writer.new PDF::SimpleTable.new do |tab| tab.column_order = %w(col1 col2 col3) tab.show_lines = :all data = [ { "col1" => "foo1\nfoo2\nfoo3", "col2" => "bar", "col3" => "baz" }, ] tab.data.replace data …
Java FAQ:S011 Q-10まんま interface C200804230a {} interface C200804230b {} class C20080423ab implements C200804230a, C200804230b {} public class C2008042300 { void method(C200804230a a) {} void method(C200804230b b) {} void callA() { C200…
「yacc.yacc(tabmodule="foo", outputdir="/tmp")」 #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.lexer.…
PDF::SimpleTable には関係ないのだけど require 'pdf/simpletable' pdf = PDF::Writer.new PDF::SimpleTable.new do |tab| tab.column_order = %w(col1 col2 col3) tab.show_lines = :all data = [ { "col1" => "<i>foo</i>", "col2" => "<b>bar</b>", "col3" => "baz" },…
Java FAQ:S011 Q-09まんま public class C2008042200 { static void foo(Object arg) { System.out.println("foo(Object arg)"); } static void foo(String arg) { System.out.println("foo(String arg)"); } public static void main(String[] args) { foo…
「yacc.yacc(tabmodule="foo")」 デフォルトは parsetab.py に出力される #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" %…
require 'pdf/simpletable' pdf = PDF::Writer.new PDF::SimpleTable.new do |tab| tab.column_order = %w(col1 col2 col3) tab.show_lines = :all data = [ { "col1" => "foo", "col2" => "bar", "col3" => "baz" }, ] tab.data.replace data #tab.render_o…
Java FAQ:S011 Q-08throws 節自体、挙動が良く分かっていない… class C2008042101 { void foo(int x) { System.out.println("C2008042101: " + x); } } class C2008042102 extends C2008042101 { C2008042102() { foo(1); } void foo(int x) throws Arithme…
「yacc.yacc(debug=0)」 parser.out が出力されなくなる #!/usr/bin/env python import ply.lex as lex tokens = ( 'A', 'B', 'C', ) t_A = r'A' t_B = r'B' t_C = r'C' t_ignore = " \t" def t_error(t): print "Illegal character '%s'" % t.value[0] t.le…