2009-03-01から1ヶ月間の記事一覧
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new font = pdf.get_font("Helvetica", nil) [HPDFDoc::HPDF_TS_WIPE_RIGHT, HPDFDoc::HPDF_TS_WIPE_UP, HPDFDoc::HPDF_TS_WIPE_LEFT, HPDFDoc::HPDF_TS_WIPE_DOWN, HPDFDoc::HPDF_TS_BARN_DOORS_HORIZONT…
import org.apache.commons.lang.ArrayUtils; public class C2009032100 { public static void main(String[] args) { Integer[] X = { 0, 1, 2 }; System.out.println(X.toString()); System.out.println(ArrayUtils.toString(X)); System.out.println(Arra…
PARSER_BEGIN(Test) import java.io.*; public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(new InputStreamReader(System.in)); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "あ"> }</a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_gstate_depth で、 1
import org.apache.commons.lang.ArrayUtils; public class C2009032000 { public static void main(String[] args) { Integer[] X = { 0, 1, 2 }; int[] x = ArrayUtils.toPrimitive(X); System.out.println(x); System.out.println(x[0]); } } で、 [I@198…
PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> { image.insert(0, "*"); image.append("*");</a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_text_matrix で、 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
import org.apache.commons.lang.ArrayUtils; public class C2009031900 { public static void main(String[] args) { int[] x = { 0, 1, 2 }; Integer[] X = ArrayUtils.toObject(x); System.out.println(X); System.out.println(X[0]); } } で、 [Ljava.la…
PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> { System.out.println("*" + matchedToken.ki</a:></space:>…
「return NUM2INT(i);」は「return INT2NUM(i);」に修正 #!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_filling_color_space で、 0
import org.apache.commons.lang.ArrayUtils; import java.util.*; public class C2009031800 { public static void main(String[] args) { Map colorMap = ArrayUtils.toMap(new String[][] { {"RED", "#FF0000"}, {"GREEN", "#00FF00"}, {"BLUE", "#0000FF…
PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> { System.out.println("*" + image + "*"); }</a:></space:>…
「return NUM2INT(i);」は「return INT2NUM(i);」に修正 #!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_stroking_color_space で、 0
import org.apache.commons.lang.ArrayUtils; public class C2009031700 { public static void main(String[] args) { int[] x = { 0, 1, 2 }; ArrayUtils.reverse(x); System.out.println(x); for (int i = 0; i < x.length; i++) { System.out.println(x[i…
PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> { System.out.println("*A*"); } | <B: "b"> { System</b:></a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_gray_stroke で、 0.0
import org.apache.commons.lang.ArrayUtils; public class C2009031600 { public static void main(String[] args) { int[] x = { 10, 11, 12, 10 }; int[] n = { }; System.out.println(ArrayUtils.lastIndexOf(x, 10)); System.out.println(ArrayUtils.la…
PARSER_BEGIN(Test) public class Test { public static void main(String args[]) throws ParseException { Test parser = new Test(System.in); parser.Input(); } } PARSER_END(Test) SKIP : { <SPACE: " " | "\t" | "\n" | "\r"> } TOKEN : { <A: "a"> | <C: "c"> } MORE : { <B: "b"> } void Input() : { Token t;</b:></c:></a:></space:>…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_gray_fill で、 0.0
import org.apache.commons.lang.ArrayUtils; public class C2009031500 { public static void main(String[] args) { int[] x1 = { 0, 1, 2 }; int[] x2 = { 1, 2, 3 }; char[] x3 = { 1, 2, 3 }; int[][] x4 = { {} }; System.out.println(ArrayUtils.isSa…
練習問題2『JavaCC―コンパイラ・コンパイラfor Java』の calculator.jj を参考に options { LOOKAHEAD = 2; FORCE_LA_CHECK = true; } PARSER_BEGIN(Calc) import java.util.*; public class Calc { public static void main(String args[]) throws ParseExc…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_cmyk_stroke で、 [0.0, 0.0, 0.0, 0.0]
import org.apache.commons.lang.ArrayUtils; public class C2009031400 { public static void main(String[] args) { int[] x1 = { 0, 1, 2 }; int[] x2 = { 1, 2, 3 }; int[] x3 = { 0, 1, 2, 3 }; int[] x4 = { }; System.out.println(ArrayUtils.isSameL…
『JavaCC―コンパイラ・コンパイラfor Java』の calculator.jj を参考に options { LOOKAHEAD = 2; } PARSER_BEGIN(Calc) import java.util.*; public class Calc { public static void main(String args[]) throws ParseException { Calc parser = new Calc(…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_cmyk_fill で、 [0.0, 0.0, 0.0, 0.0]
import org.apache.commons.lang.ArrayUtils; public class C2009031300 { public static void main(String[] args) { int[] x1 = { 0, 1, 2 }; int[] x2 = { 0, 1, 2 }; int[] x3 = { 1, 2, 3 }; int[] x4 = { }; System.out.println(ArrayUtils.isEquals(x…
『JavaCC―コンパイラ・コンパイラfor Java』の calculator.jj を参考に入力に小数も認め、計算を double で PARSER_BEGIN(Calc) public class Calc { public static void main(String args[]) throws ParseException { Calc parser = new Calc(System.in); p…
#!/usr/bin/env ruby require "hpdf" pdf = HPDFDoc.new page = pdf.add_page p page.get_rgb_stroke で、 [0.0, 0.0, 0.0]
import org.apache.commons.lang.ArrayUtils; public class C2009031200 { public static void main(String[] args) { int[] x = { 10, 11, 12, 10 }; int[] n = { }; System.out.println(ArrayUtils.indexOf(x, 12)); System.out.println(ArrayUtils.indexO…
『JavaCC―コンパイラ・コンパイラfor Java』の calculator.jj を参考に PARSER_BEGIN(Calc) public class Calc { public static void main(String args[]) throws ParseException { Calc parser = new Calc(System.in); parser.Input(); } } PARSER_END(Calc…