10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

Similar documents
オンラインテスト

Web STEPS Web Web Form Cookie HTTP STEPS Web

wide94.dvi

演習室の PC のハードディスクには演習で作成したデータは保管できません 各 PC の ネットワーク接続 ショートカットからメディア情報センターのサーバーにアクセスしてください (Z ドライブとして使用できます ) 講義で使うフォルダ 2/23

演習室の PC のハードディスクには演習で作成したデータは保管できません 各 PC の ネットワーク接続 ショートカットからメディア情報センターのサーバーにアクセスしてください (Z ドライブとして使用できます ) Web プログラミング 1 CGI (3 章 ) 2012/6/12( 水 ) 講義

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

soturon2013

TCP/IP Internet Week 2002 [2002/12/17] Japan Registry Service Co., Ltd. No.3 Internet Week 2002 [2002/12/17] Japan Registry Service Co., Ltd. No.4 2

C G I 入 門 講 座

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

̤Äê

54 5 PHP Web hellow.php 1:<?php 2: echo "Hellow, PHP!Y=n"; 3:?> echo PHP C 2: printf("hellow, PHP!Y=n"); PHP (php) $ php hellow.php Hellow, PHP! 5.1.2

橡Pascal-Tの挙動を調べる

Servlet JSP JSP Servlet/JSP における 日 本 語 の 処 理 - 1

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

Networking Semester 802.3

FileMaker Server Getting Started Guide

FileMaker Server Getting Started Guide

FUJITSU Network Si-R Si-R Gシリーズ Webユーザーズガイド

untitled

IT講習会

Microsoft PowerPoint Perl講習会.ppt [互換モード]

情報システム設計論II ユーザインタフェース(1)

untitled

untitled

unix15-script2_09.key

改訂履歴 版数日付変更理由変更内容変更者 1.0 H29/2/1 新規作成 1.0 版作成 -2-

FileMaker Server 9 Getting Started Guide

エラー処理・分割コンパイル・コマンドライン引数

FileMaker Server Getting Started Guide


(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

08+11Extra

LHD-LAN_E_G_PDF.}.j...A...p65

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

Copyright ClassCat Co.,Ltd. All rights reserved. ClassCat, ClassCat Cute Copyright Sun Microsystems, Inc., 901 San Antonio Road, P

コンピュータ概論

Apache Web Server 2 Compaq ActiveAnswers Deskpro Compaq Insight Manager Fastart Systempro Systempro/LT ProLiant ROMPaq Qvision SmartStart NetFlex Quic

tuat2.dvi

untitled

Oracle Application Server 10g Release 3(10.1.3)Oracle HTTP Serverの概要

1 Linux UNIX-PC LAN. UNIX. LAN. UNIX. 1.1 UNIX LAN. 1.2 Linux PC Linux. 1.3 studenta odd kumabari studentb even kumabari studentc odd kumabari student

Microsoft PowerPoint asp cgi.pptx

( ) Shift JIS ( ) ASCII ASCII ( ) 8bit = 1 Byte JIS(Japan Industrial Standard) X 0201 (X ) 2 Byte JIS ISO-2022-JP, Shift JIS, EUC 1 Byte 2 By

Windows Web Windows Windows WinSock

HTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f

I 2 tutimura/ I 2 p.1/??

2 1. Ubuntu 1.1 OS OS OS ( OS ) OS ( OS ) VMware Player VMware Player jp/download/player/ URL VMware Plaeyr VMware

Web 1 p.2 1 Servlet Servlet Web Web Web Apache Web Servlet JSP Web Apache Tomcat Jetty Apache Tomcat, Jetty Java JDK, Eclipse

Web SOAP Internet Web REST SOAP REST 3 REST SOAP 4

Sokushu2_perl

: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology

実験 5 CGI プログラミング 1 目的 動的にWebページを作成する手法の一つであるCGIについてプログラミングを通じて基本的な仕組みを学ぶ 2 実験 実験 1 Webサーバの設定確認と起動 (1)/etc/httpd/conf にある httpd.conf ファイルの cgi-bin に関する

ohp.mgp

273? C

IP IP DHCP..

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( ) L09 IP (2017) 1 / 28

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) * *

FileMaker Instant Web Publishing Guide

(search: ) [1] ( ) 2 (linear search) (sequential search) 1

インターネットマガジン2003年3月号―INTERNET magazine No.98

HTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f

untitled

リスト 1 1 <HTML> <HEAD> 3 <META http-equiv="content-type" content="text/html; charset=euc-jp"> 4 <TITLE> 住所の検索 </TITLE> 5 </HEAD> 6 <BODY> <FORM method=


World Wide Webの 始 まり CREN( 欧 州 合 同 原 子 核 研 究 機 構 )には 多 く の 科 学 者 が 訪 れ それぞれが 異 なる 文 書 シス テムを 使 っていた 情 報 の 共 有 が 大 きな 課 題 12/05/09 2

LHD-LAN ...[.U.[.Y.}.j...A.. V05.p65


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

¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥°¥é¥ß¥ó¥°ÆÃÏÀ

55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a

3.2.3 MSDOS,N88BASIC

wide96.dvi

Webデザイン論

PowerPoint Presentation

joho07-1.ppt

II 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java

導入基礎演習.ppt

第2回_416.ppt

Asterisk PBX 不正利用防止

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >=


普通教科「情報」の指導に関する調査研究

untitled

EPSON Offirio SynergyWare PrintDirector 取扱説明書 導入ガイド

intra-mart Web for SellSide ver /03/31 Oracle MS-SQL Server IBM DB2 MS-SQL Server IBM DB2 Client Side JavaScript Server Side JavaScript URL -

Unix * 3 PC 2 Linux, Mac *4 Windows Cygwin Cygwin gnuplot Cygwin unix emulator online gnuplot *5 matplotlib *6 SuperMongo *7 gnuplot gnuplot OS *8 Uni

受動的攻撃について

WIDE 1

JavaScript 1.! DOM Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2

FileMaker Instant Web Publishing Guide

FileMaker Server 9 Getting Started Guide

2 1: OSI OSI,,,,,,,,, 4 TCP/IP TCP/IP, TCP, IP 2,, IP, IP. IP, ICMP, TCP, UDP, TELNET, FTP, HTTP TCP IP

2008, 2009 TOSHIBA TEC CORPORATION All rights reserved

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

22 (266) / Web PF-Web Web Web Web / Web Web PF-Web Web Web Web CGI Web Web 1 Web PF-Web Web Perl C CGI A Pipe/Filter Architecture Based Software Gener

FileMaker Instant Web Publishing Guide


WEB DB PRESS Vol.1 65

pdf

Transcription:

tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 11 20 p.1/34

10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAVA 12/18 10. ( ) JAVA 11. 12. ( ) p.2/34

HTTP (Hyper Text Transfer Protocol) web web HTML FTP, SMTP 0.9, 1.0, 1.1 (C)atmarkIT p.3/34

HTTP web Internet Explorer Netscape (Mozilla), Opera lynx, w3m wget, iria Googlebot LWP (Perl), java.net (Java), libwww (C ) socket IO::Socket (Perl), java.net (Java), socket(c) telnet p.4/34

HTTP web Apache IIS (Internet Information Services) LWP (Perl) socket IO::Socket (Perl), java.net (Java), socket(c) p.5/34

HTTP TCP/IP "GET /index.html HTTP/1.0\n\n" GET HEAD POST Content-Type: text/html HTML Content-Type: image/jpeg JPEG p.6/34

HTTP (stateless) ASCII p.7/34

CGI (Common Gateway Interface) HTTP web web web Perl SSI (Server Side Include), Java Servlet, ASP (Active Server Pages) p.8/34

vs CGI (C)atmarkIT p.9/34

CGI CGI GET POST CGI Content-type HTML CGI p.10/34

CGI GET "? = & = " HTML <a href="hoge.cgi?a=1">link</a> POST HTML form p.11/34

Apache CGI CGI HTTP CGI CGI /cgi-bin/ CGI.cgi,.pl CGI chmod +x hoge.cgi CGI p.12/34

vs CGI CGI HTTP p.13/34

OS OS p.14/34

Perl Larry Wall, version 5 (5.004, 5.6) UNIX MS-Windows Mac CPAN (Comprehensive Perl Archive Network)... p.15/34

Perl hello world print "hello world\n"; @array = <STDIN>; for ( $i=$#array; $i>=0; $i-- ) { print $array[$i]; } print reverse(<stdin>); p.16/34

#!/usr/local/bin/perl -w UNIX # ; {} my $hoge; p.17/34

_ 12345 10.56.23E-10 0xffff 16 p.18/34

$hoge @hoge $hoge[0] %hoge $hoge{ zero } 1 $a = "4 + 1"; $b = 4 + 1; print "$a = $b\n"; 1 4 + 1 = 5 2 @array = ("zero", 1, "two"); print "@array\n"; print "$array[2]\n"; 2 zero 1 two two p.19/34

"" $i = 5; print "$i th edtion\n"; # 5 th edition print "${i}th edtion\n"; # 5th edition print $i\n ; # $i\n p.20/34

(1) if ( ) {} while ( ) {} ( unless) ( until) do {} while ( until) else if elsif {} switch perl if ( 1 ) { 1; } elsif ( 2 ) { 2; } else { ; } p.21/34

(2) if, unless, while, until for, foreach next, last $b=1 if $a==0; # if ($a==0) { $b=1; } for ($i = 0; $i < 10; $i++) { next if ( $a[$i] == 0 ); last if ( $a[$i] == -1 ); } for my $elem (@elements) { $elem *= 2; } # # p.22/34

C + - * / % = ++ -- += -= *= /= %= ** **= C << >> & ˆ ==!= < > <= >= eq ne lt gt le ge! && not and or xor. p.23/34

$_ @_ @ARGV $ARGV[0] $ARGV[$#ARGV] shift $0 STDIN STDOUT STDERR %ENV p.24/34

if ("a") if ("") if (<STDIN>) if ("0") p.25/34

-e file -f file -d file -r file -w file while (@ARGV) { my $f = shift @ARGV; if ( -d $f ) { print "$f\n"; } } # # $f # # p.26/34

=! $string = /pattern/; $string = s/hoge/fuga/gi; $string = tr/abcdef/abcdef/; p.27/34

$i = mul_add(2, 3, 4); # $ i = 2 * 3 + 4; print "$i\n"; # 10 sub mul_add { # @_ my ($x, $y, $z) = @_; # $x $y $z return $x * $y + $z; } p.28/34

open(in, "< input"); # input open(out,"> output"); # output while(<in>) { # IN $_ print OUT $_; # OUT $_ } # $_ close(out); # OUT close(in); # IN open open(in, "ls "); # ls open(out, " sort >> out"); # out... p.29/34

print, printf, chop, chomp open, close, system exit, die sleep rand, srand, int man perl man perlfunc p.30/34

CGI Content-type CGI GET hoge.cgi?number=123 123 CGI IP #!/usr/local/bin/perl -w use CGI qw/:standard/; my $child_number = param( number ); my $child_host = remote_host(); print "Content-type: text/plain\n\n"; print "Your number is $child_number.\n"; print "You are working on $child_host.\n"; p.31/34

#!/usr/local/bin/perl -w use Fcntl :flock ; # LOCK_*... open(inout, "+< $datafile"); # flock(inout, LOCK_EX); # $in = <INOUT>; #... seek(inout, 0, 0); # print INOUT "$out\n"; # truncate(inout, tell(inout));# # sleep(10); # close(inout); # close p.32/34

[1] Perl ISBN4-900900-48-6 Larry Wall, Tom Christiansen, Randal L. Schwartz,, [2] Perl http://flex.ee.uec.ac.jp/texi/perl-nyuumon/ p.33/34

Apache 8Mbyte Apache CGI CGI p.34/34