r9.dvi

Size: px
Start display at page:

Download "r9.dvi"

Transcription

1 Ruby B Web ( ) def delete if at then (1) EOF (2)@cur 1 ()@prev 1 def exch if then return a b c d a.next = b; b.next = c; c.next = = b 4 ( 2 ) a b c 1 def backward then return a top; a do forward 1

2 ( ) def invert top; if at then return a b a.next while do c = b.next; b.next = a; a = b; b = = a; (@head ) invert top 1 Buffer class Buffer Cell = Struct.new(data, next) def = Cell.new("EOF", = 1 def getlineno def goto(n) top; (n-1).times do forward def at def = = = 1 def forward if at then = = + 1 def @lineno + 1 def print 2

3 puts(" " # delete exch backward def backward goto(@lineno - 1) def invert top; if at then return a b a.next while do c = b.next; b.next = a; a = b; b = = a; top def subst(str) if at then return a = str.split( / = a[2] def read(file) open(file, "r") do f f.each do s insert(s) def save(file) top open(file, "w") do f while not at do f.puts(@cur.data); forward ( ) def edit e = Buffer.new while true do printf(">") line = gets; c = line[0..0]; s = line[1..-2] if c == "q" then return elsif c == "t" then e.top; e.print elsif c == "p" then e.print; l = e.getlineno; s.to_i.times do e.forward; e.print ; e.goto(l) elsif c == "i" then e.insert(s) elsif c == "r" then e.read(s) elsif c == "w" then e.save(s) elsif c == "s" then e.subst(s); e.print elsif c == "d" then e.delete elsif c == "x" then e.exch

4 elsif c == "b" then e.backward elsif c == "v" then e.invert elsif c == "a" then e.forward; e.insert(s); e.backward elsif c == "c" then e.delete; e.insert(s); e.backward elsif c == "g" then e.goto(s.to_i) else e.forward; e.print / hash1(k) 2 hash2(k) N N N class IntStrTable def = Array.new(997, = Array.new(997, nil) def hash1(n) return n def hash2(n) return n % def put(key, val) h1 = hash1(key); h2 = hash2(key) while true do == key = val; return return h1 = (h1 + h2) def get(key) h1 = hash1(key); h2 = hash2(key) while true do == key then < 0 then return nil h1 = (h1 + h2) N (N 1 ) 1 2 (collision) 4

5 Ruby Hash N put N get N put NN get Ruby Hash ( 1 () ) class IntStrTable4 def = {} def put(key, = val def get(key) (Ruby Hash ) 1 (constant time) O(1) 10, ( ) 50% benchtable def benchtable1(cnt, tbl) puts(bench(1) do cnt.times do i tbl.put(i, "") ) puts(bench(1) do cnt.times do i tbl.get(i) ) irb> benchtable1(1000, IntStrTable2.new) => nil irb> benchtable1(2000, IntStrTable2.new)

6 2.75 => nil irb> benchtable1(000, IntStrTable2.new) => nil 1 logn 1 O(logN) N 1 O(N) AVL (AVL tree) Adelson-Velsky Landis (splay tree) O(logN) (amortized computational complexity) 1.4 ( ) 2 class IntStrTable Node = Struct.new(key, data, left, right) def = nil def put(key, val) == = Node.new(key, val, nil, nil); = if = val elsif = Node.new(key, nil) = Node.new(key, val, def get(key) == nil then return = if key then else return nil def splay(key, ) dummy = lmax = = Node.new(0, 0, nil, nil) while true do if key ==.key then break splay (spray) l r (?)

7 if key <.key if (child =.left) == nil then break if key < child.key else.left = child.right; child.right = = child; child =.left if (child =.left) == nil then break.left = ; = if (child =.right) == nil then break if key > child.key.right = child.left; child.left = = child; child =.right if (child=.right) == nil then break lmax.right = ; lmax = = child lmax.right =.left;.left =.right.left = dummy.right;.right = dummy.left; return splay put get splay put (@ nil) splay splay (top-down) dummy lmax key= 9 child C A B key=8 9 child A B child A child B 9 9 C child A child B 9 C dummy dummy A B 9 C A B 1 7

8 9 8 ( 1) (rotation) dummy 9 9 ( dummy ) D dummy A B lmax C X Y lmax A Y D B X C 2 2 (A) lmin (B) lmax lmax lmax 7 1 D lmax dummy 7 1 D dummy 7 1 D dummy 7 1 D dummy (1) (2) () (4) (5) (1) (4) lmax (5) dummy 8

9 2 2.1 / 1 x + + ( ) x( ) 1( ) ( 4 ) (syntax) ( ) (abstract syntax tree) (expression tree) + + * x 1 * + 2 x 2 x x x * 2 ( + x) * 2 4 ( ) + x * 2 ( + x) * 2 x 2 x 2 ( 4 ) / ( $vars 1 ) $vars = {} class Add def initialize(l, = = r def exec() def to_s() return ( +@left.to_s+ + +@right.to_s+ ) class Mul def initialize(l, = = r def exec() def to_s() return ( +@left.to_s+ * +@right.to_s+ ) class Lit def = v def exec() def to_s() class Var def = v def exec() return $vars[@left] def to_s() 9

10 exec / to s + * Lit ( ) exec @left Add Var (dynamic binding) (polymorphism) irb> $vars[ x ] = 5 => 5 irb> e = Add.new(Var.new( x ), Lit.new(1)) =>... irb> puts(e, e.exec) (x + 1) => nil irb> f = Add.new(Lit.new(), Mul.new(Var.new( x ), Lit.new(2))) =>... irb> puts(f, f.exec) ( + (x * 2)) 1 => nil irb> g = Mul.new(Add.new(Var.new( x ), Lit.new()), Lit.new(2)) =>... irb> puts(g, g.exec) ((x + ) * 2) 1 x 5 4 ( ) 1 (to s ) a. Sub Div b. Assign exec (Var ) s $vars[s] exec irb> e = Assign.new(Var.new( x ), Add.new(Var.new( x ), Lit.new(1))) =>... irb> e.exec => irb> $vars[ x ] => 5 10

11 c. Loop exec exec ( ) irb> f = Loop.new(Lit.new(20), e) e x = x + 1 =>... irb> f.exec =>... irb> $vars[ x ] => d. Seq exec exec irb> g = Seq.new(f, f) f 20 x = x + 1 =>... irb> g.exec => 4 irb> $vars[ x ] => Add Mul (inheritance) (parent class) (superclass) (child class) (subclass) ( ) (override) Node ( to s ) $vars = {} class Node def initialize(l=nil, = = =? def to_s() return ( (operator + / Add (Ruby < ) 11

12 class Add < Node def initialize(l, r) = + def exec() initialize exec ( ) initialize super + exec ( ) class Sub < Node def initialize(l, r) = - def exec() class Mul < Node def initialize(l, r) = * def exec() class Div < Node def initialize(l, r) = / def exec() class Lit < Node def exec() def to_s() class Var < Node def exec() return $vars[@left] def to_s() Lit Node to s initiailze (@op $vars class Assign < Node def initialize(l, r) = = def exec() v $vars[@left.to_s] = v; return v class Seq < Node def initialize(l, r) = ; def 12

13 v (0 ) class Loop < Node def initialize(l, r) = L def exec() do v=@right.exec ; return v to s? class Noop < Node def exec() return 0 def to_s() return? n 5 x 1 n x = x * n n = n - 1 x ( 5 ) def test1 e = Seq.new( puts(e) Assign.new(Var.new( n ), Lit.new(5)), Seq.new( Assign.new(Var.new( x ), Lit.new(1)), Seq.new( Loop.new( return e.exec Var.new( n ), Seq.new( Assign.new(Var.new( x ), Mul.new(Var.new( x ), Var.new( n ))), Assign.new(Var.new( n ), Sub.new(Var.new( n ), Var.new( x )))) Lit.new(1))))), irb> test1 ((n=5);((x=1);((nl((x=(x*n));(n=(n-1))));x))) => 120 (interpreter ) ( ) Ruby 1.8.x 2 1

14 a. x < y 1 0 b. while 0 false true c. if then else d. 2 e. / Ruby (lexical analyzer) 1 class Lexer def = s + $ = 0 def peek() def fwd() def to_s() @pos $ peek fwd ( )1 to s irb> sc = Lexer.new( x=x+1 ) irb> sc.peek => "x" irb> sc.fwd => 1 irb> sc.peek => "=" irb> sc.fwd => 2 irb> sc.fwd => irb> sc.fwd => 4 irb> sc.peek => "1" irb> sc.fwd => 5 irb> sc.peek => "$" irb> puts(sc) x=x+1!$ => nil x=x+1 14

15 Lexer ( peek fwd ) ( ) BNF Ruby prog = stat stat ; prog stat = { prog } L expr stat expr expr = fact fact + expr fact - expr fact * expr fact / expr fact = expr fact = identfier number ( expr ) BNF(Backus Normal Form) = ( ) (identifier ) (number) 1 1 ; ; = = x 1 y x + 1 y x = 1 ; y = x + 1 ; y 5 5 x = 1; L 5 x = x * 2; x ( ) 4 a. x=y=z=1 b. x=2*+4*5 c. n=5;x=1;l(n){x=x*n;n=n-1};x 5 ( ) BNF 4. (syntax analyzer) (parser) (recursive descent parser) 4 15

16 1 ( ) 1 ( 1 ) ( ) prog stat stat stat { L expr expr fact fact fact x prog stat ; prog { prog } stat ; prog stat ; prog expr stat expr stat fact = expr expr fact = expr expr fact + expr factl fact fact = expr fact fact { x = ; y = 5 } ; z = x + y ; z prog def prog(sc) s = stat(sc); c = sc.peek if c == $ c == } then return s elsif c == ; then sc.fwd; return Seq.new(s, prog(sc)) else puts( STAT + sc.to_s); return Noop.new prog stat stat $ } prog ( ) prog = stat stat ; prog = ; prog ; prog stat Seq ( None ) 1

17 stat def stat(sc) c = sc.peek if c == { then sc.fwd; p = prog(sc) if sc.peek!= } puts( NO_} + sc.to_s); return Noop.new sc.fwd; return p elsif c == L sc.fwd; e = expr(sc); return Loop.new(e, stat(sc)) else return expr(sc) { stat = { prog } 1 prog } ( ) prog L stat = L expr stat 1 expr prog Loop stat = expr expr expr def expr(sc) e = fact(sc); c = sc.peek if c == + then sc.fwd; return Add.new(e, expr(sc)) elsif c == - then sc.fwd; return Sub.new(e, expr(sc)) elsif c == * then sc.fwd; return Mul.new(e, expr(sc)) elsif c == / then sc.fwd; return Div.new(e, expr(sc)) elsif c == = then sc.fwd; return Assign.new(e, expr(sc)) else return e fact fact 1 expr 2 expr = fact fact fact def fact(sc) c = sc.peek; sc.fwd if c >= a && c <= z return Var.new(c) elsif c >= 0 && c <= 9 return Lit.new(c.to_i) elsif c == ( e = expr(sc) if sc.peek!= ) puts( NO_) + sc.to_s); return Noop.new sc.fwd; return e else puts( FACTOR + sc.to_s); return Noop.new 17

18 ( fact = ( expr ) expr ) 4 1 def run(s) e = prog(s); puts(e); puts(e.exec) 5 irb> run n=5;x=1;ln{x=x*n;n=n-1};x ((n=5);((x=1);((nl((x=(x*n));(n=(n-1))));x))) 120 => nil (compiler) (comiler-interpreter) (optimization) 5 (semantic analyzer) + 5 ( ) a. 2 9 b. 9 c. 9 C 5 7 ( ) (right associative) 8 ( + + ) A 9A Subject Report 9A Q1. Q2. Q. 5 (x+1)=10 x - y - 1 x - (y - 1) (left associative) 18

r1.dvi

r1.dvi Ruby 2009.9.7 1 ( ) --- ( ( ) ( ) 1 --- ( ) 1 ( ) (?) IT 7K( )?? ( ) ( )? IT ( ) --- ( ) 1 ( ) --- ( ) (?) 2-3% Top-Level ICT Professional 5% ICT Professional 10% 100% 50% 20% Devl. Experiment Adv. ICT

More information

r10.dvi

r10.dvi 2015 10 2015.12.7 1 ( ) 2 2.1 2 : def delete if at then return @cur = @prev.next = @cur.next (1) EOF (2)@cur 1 (3)@prev 1 : def exch if at @cur.next == @tail then return a = @prev; b = @cur.next; c = @cur;

More information

ohp10.dvi

ohp10.dvi 2015 10 2015.12.7 1 ( ) 2 2 : def delete if at then return @cur = @prev.next = @cur.next (1) EOF (2)@cur 1 (3)@prev 1 : def exch if at @cur.next == @tail then return a = @prev; b = @cur.next; c = @cur;

More information

ohp07.dvi

ohp07.dvi 17 7 (2) 2017.9.13 1 BNF BNF ( ) ( ) 0 ( ) + 1 ( ) ( ) [ ] BNF BNF BNF prog ::= ( stat ) stat ::= ident = expr ; read ident ; print expr ; if ( expr ) stat while ( expr ) stat { prog expr ::= term ( +

More information

parser.y 3. node.rb 4. CD-ROM

parser.y 3. node.rb 4. CD-ROM 1. 1 51 2. parser.y 3. node.rb 4. CD-ROM 1 10 2 i 0 i 10 " i i+1 3 for(i = 0; i

More information

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp 7 OCaml () 1. 2. () (compiler) (interpreter) 2 OCaml (syntax) (BNF,backus normal form ) 1 + 2; let x be 2-1 in x; ::= ; let be in ; ::= + - ::= * / ::= 7.1 ( (printable characters) (tokens) 1 (lexical

More information

r02.dvi

r02.dvi 172 2017.7.16 1 1.1? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X ( ) 1.2 1 2-0 ( ) ( ) ( ) (12) ( ) (112) (131) 281 26 1 (syntax) (semantics) ( ) 2 2.1 BNF BNF(Backus Normal Form) Joun Backus (grammer) English

More information

ohp02.dvi

ohp02.dvi 172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer

More information

ohp08.dvi

ohp08.dvi 19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=>

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=> Ruby Ruby 200779 ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( 2+3+4+5+6+7+8+9 ) 44 irb(main):002:0> irb irb(main):001:0> 1+2+3+4 => 10 irb(main):002:0>

More information

Microsoft PowerPoint - 13Kadai.pptx

Microsoft PowerPoint - 13Kadai.pptx 提出 講義での説明を聞いて下さい 櫻井彰人 コンパイラ理論課題 締め切りは 8 月 1 日とします 順不同で できるものをできるだけ多く回答して下さい 電子メールで sakurai あっと ae どっと keio どっと ac どっと jp に送ってください ファイル形式は pdf か MsWord で ただし プログラムはテキストファイルで レポート課題 1 それぞれ 1 問として考えます 電卓

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

( ) ( ) lex LL(1) LL(1)

( ) ( ) lex LL(1) LL(1) () () lex LL(1) LL(1) http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 29 5 14 1 1 () / (front end) (back end) (phase) (pass) 1 2 1 () () var left, right; fun int main() { left = 0; right = 10;

More information

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装 Ruby Scheme 2013-04-16 ( )! SICP *1 ;-) SchemeR SICP MIT * 1 Structure and Interpretaion of Computer Programs 2nd ed.: 2 i SchemeR Ruby Ruby Ruby Ruby & 3.0 Ruby ii https://github.com/ichusrlocalbin/scheme_in_ruby

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

Ruby演習テキスト1

Ruby演習テキスト1 Ruby言語 基礎演習 社会人技術者研修 2014年度 テキスト 社会人技術者研修 2014年度テキスト 2014.11 Ruby基礎演習 1 2014.11 2015.2.1 puts "Hello Ruby >ruby hello.rb ( リターン ) > ruby hello.rb Hello Ruby # はじめての ruby プログラム puts "Hello Ruby" > ruby

More information

() / (front end) (back end) (phase) (pass) 1 2

() / (front end) (back end) (phase) (pass) 1 2 1 () () lex http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 2018 4 1 () / (front end) (back end) (phase) (pass) 1 2 () () var left, right; fun int main() { left = 0; right = 10; return ((left

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 12 of 14 ( RD S ) I 12 of 14 1 / 35 https://bit.ly/oitprog1 ( RD S ) I 12 of 14 2 / 35 game.rb ( RD S ) I 12 of 14 3 / 35 game.rb 11 ( ) 1 require "io/console"

More information

P03.ppt

P03.ppt (2) Switch case 5 1 1 2 1 list0317.c if /*/ intnum; printf(""); scanf("%d", &num); 2 if (num % 3 == 0) puts( 0"); else if (num % 3 == 1) puts(" 1"); else puts( 32"); 3 if list0318.c /*/ intnum; printf("");

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 1, 2 of 14 ( RD S ) I 1, 2 of 14 1 / 44 Ruby Ruby ( RD S ) I 1, 2 of 14 2 / 44 7 5 9 2 9 3 3 2 6 5 1 3 2 5 6 4 7 8 4 5 2 7 9 6 4 7 1 3 ( RD S ) I 1, 2

More information

listings-ext

listings-ext (6) Python (2) ( ) ohsaki@kwansei.ac.jp 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

Emacs Ruby..

Emacs Ruby.. command line editor 27014533 2018 3 1 5 1.1................................... 5 1.2................................... 5 2 6 2.1 Emacs...................................... 6 2.2 Ruby.......................................

More information

Microsoft PowerPoint - ruby_instruction.ppt

Microsoft PowerPoint - ruby_instruction.ppt Ruby 入門 流れ Ruby の文法 画面に出力 キーボードから入力 数値 文字列 変数 配列 ハッシュ 制御構造 ( 分岐 繰り返しなど ) if while case for each 関数 クラス Ruby とは プログラミング言語 インタプリタ言語 オブジェクト指向 国産 ウェブアプリケーションフレームワーク RubyOnRails で注目 弊社での Web アプリケーション開発に利用 画面に出力

More information

Ruby 50 Ruby UTF print, \n [Ruby-1] print("hello, Ruby.\n") [Ruby-2] Hello, Ruby. [Ruby-3] print("hello, \"Ruby\".\n") 2 [Ruby-4] seisuu = 10 pr

Ruby 50 Ruby UTF print, \n [Ruby-1] print(hello, Ruby.\n) [Ruby-2] Hello, Ruby. [Ruby-3] print(hello, \Ruby\.\n) 2 [Ruby-4] seisuu = 10 pr Ruby 50 Ruby UTF-8 1 1 print, \n [Ruby-1] print("hello, Ruby.\n") [Ruby-2] Hello, Ruby. [Ruby-3] print("hello, \"Ruby\".\n") 2 [Ruby-4] seisuu = 10 print(seisuu, "\n") jissuu = 3.141592 print(jissuu, "\n")

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

Parametric Polymorphism

Parametric Polymorphism ML 2 2011/04/19 Parametric Polymorphism Type Polymorphism ? : val hd_int : int list - > int val hd_bool : bool list - > bool val hd_i_x_b : (int * bool) list - > int * bool etc. let hd_int = function (x

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 13 of 14 ( RD S ) I 13 of 14 1 / 39 https://bit.ly/oitprog1 ( RD S ) I 13 of 14 2 / 39 game.rb ( RD S ) I 13 of 14 3 / 39 game.rb 12 ( ) 1 require "io/console"

More information

untitled

untitled 30 callcc yhara ( ( ) (1) callcc (2) callcc (3) callcc callcc Continuation callcc (1) (2) (3) (1) (2) (3) (4) class Foo def f p 1 callcc{ cc return cc} p 2 class Bar def initialize @cc = Foo.new.f def

More information

compiler-text.dvi

compiler-text.dvi 2018.4 1 2 2.1 1 1 1 1: 1. (source program) 2. (object code) 3. 1 2.2 C if while return C input() output() fun var ( ) main() C (C-Prime) C A B C 2.3 Pascal P 1 C LDC load constant LOD load STR store AOP

More information

3360 druby Web Who is translating it? http://dx.doi.org/10.1007/s10766-008-0086-1 $32.00 International Journal of PARALLEL PROGRAMING Must buy! http://dx.doi.org/10.1007/s10766-008-0086-1 toruby LT Linux

More information

ohp1.dvi

ohp1.dvi 2008 1 2008.10.10 1 ( 2 ) ( ) ( ) 1 2 1.5 3 2 ( ) 50:50 Ruby ( ) Ruby http://www.ruby-lang.org/ja/ Windows Windows 3 Web Web http://lecture.ecc.u-tokyo.ac.jp/~kuno/is08/ / ( / ) / @@@ ( 3 ) @@@ :!! ( )

More information

Microsoft PowerPoint - 04SyntaxAnalysis.ppt [互換モード]

Microsoft PowerPoint - 04SyntaxAnalysis.ppt [互換モード] 字句解析と構文解析 コンパイラ理論 4 構文解析導入 字句解析 トークンの提供 トークンの要求 構文解析 櫻井彰人 記号表 次の コンパイラ理論 5 も続けて行います なぜ分けるか? 字句解析を構文解析から分ける理由 : 設計が単純になる 効率 ( 速度等 ) の向上が図れる 可搬性がます 字句解析 構文解析それぞれによいツールが存在する トークン 字句 パターン (Tokens, Lexemes,

More information

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

More information

PL : pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc ( ) Visitor DepthFirstAdapter 1 (Depth

PL : pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc ( ) Visitor DepthFirstAdapter 1 (Depth PL0 2007 : 2007.05.29 pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc () Visitor DepthFirstAdapter 1 (Depth First traversal) ( ) (breadth first) 2 sablecc 1.2

More information

5 IO Haskell return (>>=) Haskell Haskell Haskell 5.1 Util Util (Util: Tiny Imperative Language) 1 UtilErr, UtilST, UtilCont, Haskell C

5 IO Haskell return (>>=) Haskell Haskell Haskell 5.1 Util Util (Util: Tiny Imperative Language) 1 UtilErr, UtilST, UtilCont, Haskell C 5 IO Haskell return (>>=) Haskell Haskell Haskell 5.1 Util Util (Util: Tiny Imperative Language) 1 UtilErr, UtilST, UtilCont,... 5.1.1 5.1.2 Haskell C LR ( ) 1 (recursive acronym) PHP, GNU V - 1 5.1.1

More information

4 (induction) (mathematical induction) P P(0) P(x) P(x+1) n P(n) 4.1 (inductive definition) A A (basis ) ( ) A (induction step ) A A (closure ) A clos

4 (induction) (mathematical induction) P P(0) P(x) P(x+1) n P(n) 4.1 (inductive definition) A A (basis ) ( ) A (induction step ) A A (closure ) A clos 4 (induction) (mathematical induction) P P(0) P(x) P(x+1) n P(n) 4.1 (inductive definition) A A (basis ) ( ) A (induction step ) A A (closure ) A closure 81 3 A 3 A x A x + A A ( A. ) 3 closure A N 1,

More information

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

# let st1 = {name = Taro Yamada; id = };; val st1 : student = {name=taro Yamada; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n II 6 / : 2001 11 21 (OCaml ) 1 (field) name id type # type student = {name : string; id : int};; type student = { name : string; id : int; } student {} type = { 1 : 1 ;...; n : n } { 1 = 1 ;...; n = n

More information

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C 1 6 9 1 main main 1 NULL NULL 1 15 23 25 48 26 30 32 36 38 43 45 47 50 52 for 2 (a) 2 2 1 Yacc 2 (b) 2 3 yytext tmp2 ("") tmp2->next->word tmp2 yytext tmp2->next->word

More information

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 September 2016 1 Windows Cygwin Mac *1 Emacs Ruby 1 1.1 ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 ~/16:00:20> ls 2 2 ls ls -a ~/16:00:20> ls -a

More information

1 Ex Ex. 2 2

1 Ex Ex. 2 2 I 20 100 85 40 85 PDF Windows TA ruby TA6 2 8 1. 2. PDF 3. PDF 1 Ex. 1 2 2 Ex. 2 2 2 Ex. 3 seisu = Array.new(3, 0) seisu[0] = gets.chomp.to_i seisu[1] = gets.chomp.to_i seisu[2] = gets.chomp.to_i wa =

More information

2

2 Haskell ( ) kazu@iij.ad.jp 1 2 Blub Paul Graham http://practical-scheme.net/trans/beating-the-averages-j.html Blub Blub Blub Blub 3 Haskell Sebastian Sylvan http://www.haskell.org/haskellwiki/why_haskell_matters...

More information

untitled

untitled C -1 - -2 - concept lecture keywords FILE, fopen, fclose, fscanf, fprintf, EOF, r w a, typedef gifts.dat Yt JZK-3 Jizake tsumeawase 45 BSP-15 Body soap set 3 BT-2 Bath towel set 25 TEA-2 Koutya

More information

yacc.dvi

yacc.dvi 2017 c 8 Yacc Mini-C C/C++, yacc, Mini-C, run,, Mini-C 81 Yacc Yacc, 1, 2 ( ), while ::= "while" "(" ")" while yacc 1: st while : lex KW WHILE lex LPAREN expression lex RPAREN statement 2: 3: $$ = new

More information

6 (1) app.html.eex 28 lib/nano_planner_web/templates/layout/app.html.eex 27 <footer> Oiax Inc <%= this_year() %> Oiax Inc. 29 </footer>

6 (1) app.html.eex 28 lib/nano_planner_web/templates/layout/app.html.eex 27 <footer> Oiax Inc <%= this_year() %> Oiax Inc. 29 </footer> 6 (1) of_today 6.1 Copyright 2017 lib/nano_planner_web/views layout_view.ex this_year/0 lib/nano_planner_web/views/layout_view.ex 1 defmodule NanoPlannerWeb.LayoutView do 2 use NanoPlannerWeb, view 3 +

More information

r2.dvi

r2.dvi 15 2 1 2015.6.2 ( ( ( Ruby ( ( https://www.ruby-lang.org/ja/documentation/ 2 Chris Pine,, 2,, 2010. Yugui, Ruby,, 2008. Ruby 1 ( Ruby ( 2 ( i i j ( ) /( (regular expression Ruby /.../ ( 1 if / / =~ =~

More information

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool VDM-SL VDM++ 23 6 28 VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web 2 1 3 1.1............................................... 3 1.1.1 bool......................................... 3 1.1.2 real rat int

More information

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè5²ó

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè5²ó 5 2011 6 8 : 1 2 / 31 : 3 / 31 ARPANET in 1969 4 / 31 4 ARPANET ARPANET in 1973 5 / 31 lumeta internet mapping http://www.lumeta.com http://www.cheswick.com/ches/map/ 6 / 31 IP 7 / 31 ( ) (L3) : : 7 Application

More information

jssst-ocaml.mgp

jssst-ocaml.mgp Objective Caml Jacques Garrigue Kyoto University garrigue@kurims.kyoto-u.ac.jp Objective Caml? 2 Objective Caml GC() Standard MLHaskell 3 OCaml () OCaml 5 let let x = 1 + 2 ;; val x : int = 3 ;; val-:

More information

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1 () 2006 2 27 1 10 23 () 30 () 27 [1] p.97252 7 2 2.1 2.1.1 1 LIFO(last in first out, ) (push) (pup) 1 1: 2.1.2 1 List 4-1(p.100) stack[] stack top 1 2 (push) (pop) 1 2 void stack push(double val) val stack

More information

Python @HACHINONE 10 1 V Python 2014 2 : L[i] # -*- coding: utf-8 -*- def search(l, e): """L をリスト e をオブジェクトとする L に e が含まれていれば True そうでなければ False を返す """ for i in range(len(l)): if L[i] == e: return True

More information

Microsoft PowerPoint - 11RubyIntro-No02.ppt [互換モード]

Microsoft PowerPoint - 11RubyIntro-No02.ppt [互換モード] Ruby 入門 東京電機大学櫻井彰人 Ruby とは? Ruby: 松本ゆきひろ氏による (1993) 純粋オブジェクト指向 スクリプト言語 Web プログラムで どんどんポピュラーに Ruby on Rails (http://www.rubyonrails.org/) なぜか きわめて Lisp like 松本行弘 (Matz) Introduction 実行環境 Windows/Unix/Linux/

More information

Microsoft Word - NonGenTree.doc

Microsoft Word - NonGenTree.doc ジェネリクスとコンパレータを使用しない 2 分探索木のプログラム例 BinTreeNG.java: 2 分探索木のクラス BinTreeNG BinTreeTesterNG.java: BinTreeNG を利用するプログラム例 === BinTreeNG.java =========================================================================

More information

RubyKaigi2009 COBOL

RubyKaigi2009 COBOL RubyKaigi2009 COBOL seki@druby.org 3360 Pragmatic Bookshelf druby Web $32.00 International Journal of PARALLEL PROGRAMING !? MapReduce Rinda (map, reduce) map reduce key value [, ] [, ID] map()

More information

Microsoft PowerPoint - Ruby n

Microsoft PowerPoint - Ruby n 一般財団法人 Ruby アソシエーションホームページからの抜粋 技術者向け情報 -> 開発 -> Ruby -> チュートリアル http://www.ruby.or.jp/ja/tech/development/ruby/tutorial/ Tom. Stuart 著, 笹田耕一監訳, 笹井崇司訳 : アンダースタンディングコンピュテーション, オライリー ジャパン ( 第 1 章 ) Ruby

More information

3360 druby Web Who is translating it? http://dx.doi.org/10.1007/s10766-008-0086-1 $32.00 International Journal of PARALLEL PROGRAMING Must buy! http://dx.doi.org/10.1007/s10766-008-0086-1 toruby The

More information

今回の予定 文法から パーサを作る BNF をそのまま解釈する BISON,YACC を動かしてみます 電卓 ( もどき ) を離れ本格的なプログラミング言語を記述するのに必要な構成要素を考えます 正常系だけを相手にするなら ( エラー処理を考えないなら ) 言語の実装はとても簡単 ( 課題ではない

今回の予定 文法から パーサを作る BNF をそのまま解釈する BISON,YACC を動かしてみます 電卓 ( もどき ) を離れ本格的なプログラミング言語を記述するのに必要な構成要素を考えます 正常系だけを相手にするなら ( エラー処理を考えないなら ) 言語の実装はとても簡単 ( 課題ではない プログラミング言語処理系論 (5) Design and Implementation of Programming Language Processors 佐藤周行 ( 情報基盤センター / 電気系専攻融合情報学コース ) 今回の予定 文法から パーサを作る BNF をそのまま解釈する BISON,YACC を動かしてみます 電卓 ( もどき ) を離れ本格的なプログラミング言語を記述するのに必要な構成要素を考えます

More information

連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines "" = [] lines s = let (l,s'

連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines  = [] lines s = let (l,s' 連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) nobsun@sampou.org 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines "" = [] lines s = let (l,s') = break ('\n'==) s in l : case s' of [] -> [] (_:s'')

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

2

2 2011.11.11 1 2 MapReduce 3 4 5 6 Functional Functional Programming 7 8 9 10 11 12 13 [10, 20, 30, 40, 50] 0 n n 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50 *4 = 400 14 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50

More information

BASIC / / BA- SIC Web 1/10 1/10 / / JavaScript

BASIC / / BA- SIC Web 1/10 1/10 / / JavaScript BASIC / / BA- SIC Web 1/10 1/10 // JavaScript MIT Processing line(10,10,100,100); 1 BASIC / Phidgets 1 GAINER 2 USB / Phidgets USB 1: 1 http://www.phidgets.com/ 2 http://gainer.cc/ / / BGM Phidgets University

More information

SystemC言語概論

SystemC言語概論 SystemC CPU S/W 2004/01/29 4 SystemC 1 SystemC 2.0.1 CPU S/W 3 ISS SystemC Co-Simulation 2004/01/29 4 SystemC 2 ISS SystemC Co-Simulation GenericCPU_Base ( ) GenericCPU_ISS GenericCPU_Prog GenericCPU_CoSim

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

15 Phoenix HTML 15.1 ModestGreeter RAVT web/router.ex web/router.ex : 12 scope "/", ModestGreeter do 13 pipe_through :browser get "/", TopCont

15 Phoenix HTML 15.1 ModestGreeter RAVT web/router.ex web/router.ex : 12 scope /, ModestGreeter do 13 pipe_through :browser get /, TopCont 15 Phoenix HTML 15.1 ModestGreeter RAVT web/router.ex web/router.ex : 12 scope "/", ModestGreeter do 13 pipe_through :browser 14 15 + get "/", TopController, :index 16 get "/hello/:name", HelloController,

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200,

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200, WEB DB PRESS Vol.1 79 3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200, http://www.postgresql.org/http://www.jp.postgresql.org/ 80 WEB DB PRESS

More information

JEB Plugin 開発チュートリアル 第4回

JEB Plugin 開発チュートリアル 第4回 Japan Computer Emergency Response Team Coordination Center 電子署名者 : Japan Computer Emergency Response Team Coordination Center DN : c=jp, st=tokyo, l=chiyoda-ku, email=office@jpcert.or.jp, o=japan Computer

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

More information

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1 I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara yasu@jaist.ac.jp / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

More information

Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1) (2) ( ) BASIC BAS

Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1) (2) ( ) BASIC BAS Appendix A BASIC BASIC Beginner s All-purpose Symbolic Instruction Code FORTRAN COBOL C JAVA PASCAL (NEC N88-BASIC Windows BASIC (1 (2 ( BASIC BASIC download TUTORIAL.PDF http://hp.vector.co.jp/authors/va008683/

More information

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó 2 212 4 13 1 (4/6) : ruby 2 / 35 ( ) : gnuplot 3 / 35 ( ) 4 / 35 (summary statistics) : (mean) (median) (mode) : (range) (variance) (standard deviation) 5 / 35 (mean): x = 1 n (median): { xr+1 m, m = 2r

More information

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó 2 2015 4 20 1 (4/13) : ruby 2 / 49 2 ( ) : gnuplot 3 / 49 1 1 2014 6 IIJ / 4 / 49 1 ( ) / 5 / 49 ( ) 6 / 49 (summary statistics) : (mean) (median) (mode) : (range) (variance) (standard deviation) 7 / 49

More information

exec.dvi

exec.dvi 2018 c 6, Mini-C C++ 6211 611, 61, print,,, (run ),,, (int ), 7, x, x "a" 3 "b" 4 "x" 10 (, ), x STL map 1 + 2, 1 2,, x = ;, 1, 2 x { 1 ; 2 ; ; m, if ( ) { 1 else { 2, 1,, 2 0, 1, 3 0, 2,,, main 6 1 ,,

More information

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp 3 Haskell Haskell Haskell 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 6. C Java 3.1 Haskell Haskell GHC (Glasgow Haskell Compiler 1 ) GHC Haskell GHC http://www.haskell. 1 Guarded Horn Clauses III - 1 org/ghc/ Windows

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

Functional Programming

Functional Programming PROGRAMMING IN HASKELL プログラミング Haskell Chapter 10 - Declaring Types and Classes 型とクラスの定義 愛知県立大学情報科学部計算機言語論 ( 山本晋一郎 大久保弘崇 2011 年 ) 講義資料オリジナルは http://www.cs.nott.ac.uk/~gmh/book.html を参照のこと 0 型宣言 (Type Declarations)

More information

2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA

2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA 2005 D 1 1.1 1.2 Pascal CASL ( ) Pascal 1. 2005 10 13 2006 1 19 12 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA TA TA sdate@ist.osaka-u.ac.jp nakamoto@image.med.osaka-u.ac.jp h-kido@ist.osaka-u.ac.jp m-nakata@ist.osaka-u.ac.jp

More information

test.gby

test.gby Beautiful Programming Language and Beautiful Testing 1 Haskeller Haskeller 2 Haskeller (Doctest QuickCheck ) github 3 Haskeller 4 Haskell Platform 2011.4.0.0 Glasgow Haskell Compiler + 23 19 8 5 10 5 Q)

More information

Jlspec

Jlspec 1OFF 通常 OFF 通常 2 ON 設定内容の初期化を行う ( 工場出荷状態 ) OFF 通常 3 ON 自己診断 / 設定内容の印字を行う 4OFF 通常 %!PS-Adobe-2.0 /Courier findfont 10 scalefont setfont /LEFT 36 def /TOP 792 def /PITCH 12 def /LF {show /x LEFT def /y

More information

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2  2 B R b I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT

More information

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name = "" => "" > item.valid? => true valid? true false

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name =  =>  > item.valid? => true valid? true false 10 (1) 16 7 PicoPlanner validations 10.1 PicoPlanner Web Web invalid values validations Rails validates validate 107 10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #

More information

Working Effectively with Legacy tdiary Code using Cucumber and RSpec KAKUTANI Shintaro; Eiwa System Management,Inc.; Nihon Ruby-no-kai pragprog.com Working Effectively with Legacy tdiary code using

More information

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A, B Z Z m, n Z m n m, n A m, n B m=n (1) A, B (2) A B = A B = Z/ π : Z Z/ (3) A B Z/ (4) Z/ A, B (5) f : Z Z f(n) = n f = g π g : Z/ Z A, B (6)

More information

ohp11.dvi

ohp11.dvi 19 11 ( ) 2019.4.20 1 / ( ) n O(n 2 ) O(n 2 ) ( ) 1 d n 1 n logn O(nlogn) n ( n logn C ) 2 ( ) ( merge) 2 1 1 3 1 4 5 4 2 3 7 9 7 1 2 3 4 5 7 9 1: 2 ivec merge 3 ( ) (2) int *ivec_new(int size) { int *a

More information

r11.dvi

r11.dvi 19 11 ( ) 2019.4.20 1 / 1.1 ( n n O(n 2 O(n 2 ) ( 1 d n 1 n logn O(nlogn n ( n logn C 1.2 ( ( merge 2 1 1 3 1 4 5 4 2 3 7 9 7 1 2 3 4 5 7 9 1: 2 ivec merge int *ivec_new(int size) { int *a = (int*)malloc((size+1)

More information

LIFO(last in first out, ) 1 FIFO(first in first out, ) 2 2 PUSH POP : 1

LIFO(last in first out, ) 1 FIFO(first in first out, ) 2 2 PUSH POP : 1 2007 7 17 2 1 1.1 LIFO(last in first out, ) 1 FIFO(first in first out, ) 2 2 PUSH POP 2 2 5 5 5 1: 1 2 データの追加 データの取り出し 5 2 5 2 5 2: 1.2 [1] pp.199 217 2 (binary tree) 2 2.1 (three: ) ( ) 秋田高専 校長 準学士課程学生

More information

MCMD Ruby Package Documentation NYSOL : Ver. 1.0 revise history: March 10, 2014 : nysol November 2, 2013 : first release 2014 3 10 Copyright c 2013 by NYSOL CORPORATION 3 1 5 1.1.....................................................

More information

(CC Attribution) Lisp 2.1 (Gauche )

(CC Attribution) Lisp 2.1 (Gauche ) http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) Lisp 2.1 (Gauche ) 2 2000EY-Office 3 4 Lisp 5 New York The lisps Sammy Tunis flickr lisp http://www.flickr.com/photos/dust/3603580129/ (CC

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

応用数学特論.dvi

応用数学特論.dvi 1 1 1.1.1 ( ). P,Q,R,.... 2+3=5 2 1.1.2 ( ). P T (true) F (false) T F P P T P. T 2 F 1.1.3 ( ). 2 P Q P Q P Q P Q P or Q P Q P Q P Q T T T T F T F T T F F F. P = 5 4 Q = 3 2 P Q = 5 4 3 2 P F Q T P Q T

More information

B 5 (2) VBA R / B 5 ( ) / 34

B 5 (2) VBA R / B 5 ( ) / 34 B 5 (2) VBAR / B 5 (2014 11 17 ) / 34 VBA VBA (Visual Basic for Applications) Visual Basic VBAVisual Basic Visual BasicC B 5 (2014 11 17 ) 1 / 34 VBA 2 Excel.xlsm 01 Sub test() 02 Dim tmp As Double 03

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 200972 (sakai.keiichi@kochi sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi ://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2009/index.html 29 20 32 14 24 30 48 7 19 21 31 Object public class

More information