2008-02-01から1ヶ月間の記事一覧
require 'pdf/writer' pdf = PDF::Writer.new pdf.image('images/chunkybacon.jpg', { :justification => :left }) pdf.image('images/chunkybacon.jpg', { :justification => :right }) pdf.image('images/chunkybacon.jpg', { :justification => :center }…
(set-category-table (standard-category-table)) => #^[t #&128"...nil "While filling, we can break a line at this character." nil nil] nil]
『とほほのJava入門』を読んでいるところ20. リスナー の「マウスモーションリスナー」 ページのソースをそのまま試す。
「error EOL」があると発生しないようなので、はずしてCUP ファイルは、 import java_cup.runtime.*; parser code {: public void report_error(String message, Object info) { System.out.println("report_error: " + message); System.out.println("repor…
その1 require 'pdf/writer' pdf = PDF::Writer.new pdf.image('images/chunkybacon.jpg', { :resize => :width }) File.open("2008021900.pdf", "wb") { |f| f.write pdf.render } その2 require 'pdf/writer' pdf = PDF::Writer.new pdf.image('images/chu…
(copy-category-table) => #^[t #&128"...nil "While filling, we can break a line at this character." nil nil] nil]
『とほほのJava入門』を読んでいるところ20. リスナー の「マウスリスナー」 ページのソースをそのまま試す。
CUP ファイルは、 import java_cup.runtime.*; parser code {: public void report_error(String message, Object info) { System.out.println("report_error: " + message); System.out.println("report_error: " + info); } :}; terminal A, EOL; non term…
require 'pdf/writer' pdf = PDF::Writer.new pdf.image('images/chunkybacon.jpg', { :width => 100 }) File.open("2008021800.pdf", "wb") { |f| f.write pdf.render }
(standard-category-table) => #^[t #&128"... nil "While filling, we can break a line at this character." nil nil] nil]
『とほほのJava入門』を読んでいるところ20. リスナー の「ウィンドウリスナー」 ページのソースをそのまま試す。AWT の場合には、windowClosed を捕まえて、 終了するようにすれば良いのか?
Summary 以外も詳しく出力される Opening files... Parsing specification from standard input... Checking specification... Building parse tables... Computing non-terminal nullability... Computing first sets... Building state machine... Filling…
require 'pdf/writer' pdf = PDF::Writer.new pdf.image('images/chunkybacon.jpg', { :pad => 100 }) File.open("2008021700.pdf", "wb") { |f| f.write pdf.render }
(category-table-p t) => nil (category-table-p (category-table)) => t
『とほほのJava入門』を読んでいるところ20. リスナー の「アクションリスナー」 ページのソースをそのまま試す。
「-parser」で parser.java に出力されていたのを、 「-symbols」で sym.java に出力されていたのを変更できるようだ。
require 'pdf/writer' pdf = PDF::Writer.new pdf.image('images/chunkybacon.jpg') File.open("2008021600.pdf", "wb") { |f| f.write pdf.render }
(get-unused-category (category-table)) => 33
『とほほのJava入門』を読んでいるところ19. レイアウト の「パネルによるレイアウト」ちょっと改造AWT で、 import java.awt.*; public class C2008021600 extends Frame { C2008021600() { super("PanelTest"); Panel p1 = new Panel(); Panel p2 = new Pa…
import java_cup.runtime.*; terminal A, EOL; non terminal Object input, line; start with input; line ::= EOL | A EOL {: System.out.println("*a*"); :} ; input ::= | input line ; 宣言の最後でなく、宣言の最初の方に書いたらエラーになった
require 'pdf/writer' require 'open-uri' pdf = PDF::Writer.new pdf.add_image_from_file('http://www.ruby-lang.org/images/logo.gif', 100, 100) File.open("2008021500.pdf", "wb") { |f| f.write pdf.render } open-uri を require しなくてもエラーに…
(category-table) => #^[t #&128 ... nil "While filling, we can break a line at this character." nil nil] nil]
『とほほのJava入門』を読んでいるところ19. レイアウト の「ボックスレイアウト」Swing で追加されたものらしい import java.awt.*; import javax.swing.*; class C2008021500 extends JFrame { C2008021500() { JLabel label1 = new JLabel("Label1"); JLa…
import java_cup.runtime.*; init with {: // Init 1 // Init 2 // Init 3 :}; scan with {: // Scan 1 // Scan 2 // Scan 3 :}; terminal A, EOL; non terminal Object input, line; input ::= | input line ; line ::= EOL | A EOL {: System.out.println(…
require 'pdf/writer' pdf = PDF::Writer.new pdf.add_image_from_file('images/chunkybacon.jpg', 100, 100) File.open("2008021400.pdf", "wb") { |f| f.write pdf.render }
(category-docstring ?a) => "ASCII" (category-docstring ?l) => "Latin"
『とほほのJava入門』を読んでいるところ19. レイアウト の「カードレイアウト」AWT で、 import java.awt.*; import java.awt.event.*; public class C2008021400 extends Frame implements ActionListener { CardLayout cl = new CardLayout(); C200802140…
import java_cup.runtime.*; action code {: // Action Code 1 // Action Code 2 // Action Code 3 :}; parser code {: // Parser Code 1 // Parser Code 2 // Parser Code 3 :}; terminal A, EOL; non terminal Object input, line; input ::= | input line…
require 'pdf/writer' pdf = PDF::Writer.new f = open('images/chunkybacon.jpg') image = f.read pdf.add_image(image, 100, 100, 132, 114, nil, {:type => :external, :target => "http://rubyforge.org/projects/ruby-pdf/"}) File.open("2008021300.pd…
(define-category ?a "foo") error--> Category `a' is already defined