ikuo/enshu/keisanki/ GUI(Graphica

Size: px
Start display at page:

Download "ikuo/enshu/keisanki/ GUI(Graphica"

Transcription

1 ikuo/enshu/keisanki/ GUI(Graphical User Interface) CD USB ( LSI ) (hardware abstraction) ( ) OS OS (Windows Linux ) Linux OS OS /sbin/lsmod

2 2 2. % /sbin/lsmod OS ( OS ) Module Size Used by Not tainted Module Size Used by rfcomm ( )... psmouse floppy snd_intel8x snd_ac97_codec snd_intel8x0 snd_ac97_bus snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm_oss snd_pcm snd_intel8x0,snd_ac97_codec,snd_pcm_oss snd_timer snd_pcm e snd snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer soundcore snd snd_page_alloc snd_intel8x0,snd_pcm rtc ( )... soundcore e UNIX % ls -l /dev /dev 0 lrwxrwxrwx 1 root root :50 MAKEDEV -> /sbin/makedev* crw-rw root root 10, :50 acpi crw-rw root audio 14, :50 adsp crw-rw root video 10, :50 agpgart crw-rw-rw- 1 root audio 14, :50 audio drwxr-xr-x 3 root root :50 bus/ crw-rw root video 226, :50 card0 lrwxrwxrwx 1 root root :50 cdrom -> hdc crw root root 5, :50 console lrwxrwxrwx 1 root root :50 core -> /proc/kcore drwxr-xr-x 5 root root :50 disk/ drwxr-xr-x 2 root root :50 dri/ crw-rw-rw- 1 root audio 14, :50 dsp drwxr-xr-x 4 root root :50 evms/ crw-rw root video 29, :49 fb0 lrwxrwxrwx 1 root root :50 fd -> /proc/self/fd/ brw-rw root floppy 2, :50 fd0 crw-rw-rw- 1 root root 1, :49 full brw-rw root disk 3, :50 hda brw-rw root disk 3, :50 hda1 : :

3 3 b c /dev read() write() 3 Linux OSS/Free(Open Sound System Free) 3.1 PC 3.2 Web ( ikuo/enshu/keisanki/) chat-appli1.tar.gz % tar xvzf chat-appli1.tar.gz % cd chat-appli/device1/sound 3.3 OSS /dev/audio( /dev/dsp) % cat test.raw > /dev/audio

4 4 3. test.raw % cat /dev/audio > another.raw another.raw Ctrl-C C % gnome-volume-control & gnome-volume-control ( 1) (Alsa mixer) (F) (C) 1:Analog devices ADD1981B (OSS Mixer) 1 1: gnome-volume-control /dev/audio cat

5 sample1.c % make %./play play./play play PATH /usr/bin/play./ : open() ioctl() write() close()

6 6 3. open() #include <fcntl.h> int open(char *path, int oflag); path oflag : : open() 1 path 2 oflag oflag 1 1: O RDONLY O WRONLY O RDWR O NDELAY O APPEND O SYNC O CREAT O TRUNC O EXCL 0 O CREAT 1 ioctl() #include <sys/ioctl.h> int ioctl(ind fd, int request, char *arg); fd request arg : : :

7 ioctl() 1 fd 2 request 3 arg 1 2 request PCM (Pulse Code Modulation) 2 #include <linux/soundcard.h> 2: PCM SOUND PCM WRITE BITS SOUND PCM WRITE CHANNELS SOUND PCM WRITE RATE (8 bit 16 bit) ( : 2 : 1) 3 arg int write() #include <fcntl.h> int write(int fd, char *buf, size_t nbyte); fd buf nbyte : : : write() 1 open() fd close() #include <fcntl.h> int close(int fd); fd :

8 8 3. close() open() fd sample1.c 2. sample1.c : open() ioctl() read() close() read() #include <fcntl.h> int read(int fd, char *buf, unsigned nbyte); fd buf nbyte : : :

9 9 read() 1 open() fd sample1.c record.c record Makefile sample1 ( fwrite()) ( 1) gmix 2. sample1.c ( 2) 4 1 PC (25 ) /dev/ttys open() ioctl() write() read() close()

10 : ioctl() ioctl 2 ( ) 3 TCGETA TCSETA TCSETAW TCSETAF 3: 3 3 TCSETAW 3 ( )

11 #define NCC 8 struct termio{ unsigned short int c_iflag; unsigned short int c_oflag; unsigned short int c_cflag; unsigned short int c_lflag; unsigned char c_line; unsigned char c_cc[ncc]; }; c_iflag c_oflag c_cflag c_lflag c_line c_cc : : : : : : 4.2 sample2.c sample3.c server client client server 4.3 sample2.c sample3.c sample2 sample3 % cd../serial % make

12 sample2.c sample3.c /* TODO sample2.c sample3.c 2. Client ( : fgets() ) man C man read fread % man 2 read % man 3 fread man mech-unix man read read 2

13 : man /dev 5 /etc/passwd 6 7 man 8 root 9 % man man % whatis read 5.2 Linux JF (Japanese FAQ) Linux LDP (Linux Documentation Project) Linux Sound HOWTO Linux Serial HOWTO A,B,C,D

14 14 A. A A.1 sample1.c 1 /* /* 3 59 arg = RATE; 4 sound/sample1.c 60 status = ioctl(fd, SOUND_PCM_WRITE_RATE, &arg); if (status == -1){ /* 6 62 perror("sound_pcm_write_write ioctl failed"); 7 #include <unistd.h> 63 return 1; 8 #include <fcntl.h> 64 } 9 #include <sys/types.h> #include <sys/ioctl.h> 66 /*************************** 11 #include <stdlib.h> 67 /* 12 #include <stdio.h> 68 /*************************** 13 #include <linux/soundcard.h> #define LENGTH 5 /* ( ) 71 fp = fopen("test.raw", "rb"); 16 #define RATE /* 72 if(fp == NULL){ /* 17 #define SIZE 16 /* 18 #define CHANNELS 2 /* 1 = mono 2 = stereo int main() 21 { 77 /* 22 int fd; /* 78 count = fread(buf, sizeof(short), LENGTH*RATE*CHANNELS, fp); 23 int arg; /* ioctl calls 79 if(count!= LENGTH*RATE*CHANNELS){ /* 24 int status; /* 25 int count; /* 80 printf("read count is %d\n", count); 81 // return 1; 26 unsigned short buf[length*rate*channels]; 82 } 27 char *bufp; /* FILE *fp; /* 84 /* 85 fclose(fp); /* 87 /*************************** 31 /* (O_WRONLY) 32 fd = open("/dev/audio", O_WRONLY); 33 if(fd < 0){ /* 34 perror("open of /dev/audio failed"); 35 return 1; 36 } /*************************** 39 /* 40 /*************************** /* 43 arg = SIZE; 44 status = ioctl(fd, SOUND_PCM_WRITE_BITS, &arg); 45 if (status == -1){ /* perror("sound_pcm_write_bits ioctl failed"); 103 /* 47 return 1; 104 status = close(fd); 48 } 105 if(status == -1){ /* perror("device close failed"); 50 /* 107 return 1; 51 arg = CHANNELS; 108 } 52 status = ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &arg); if (status == -1){ /* 54 perror("sound_pcm_write_channels ioctl failed"); 55 return 1; 56 } 70 /* 73 perror("file open failed"); 74 return 1; 75 } /* 89 /*************************** 90 count *= sizeof(unsigned short); 91 /* write 92 bufp = (char *)buf; 93 while (count>0) { 94 status = write(fd, bufp, count); 95 if (status==-1) { /* 96 perror("wrote wrong number of bytes"); 97 return 1; 98 } 99 count -= status; 100 bufp += status; 101 } 110 return 1; 111 } //end of file

15 A.2. sample2.c 15 A.2 sample2.c 1 /* perror("ioctl (TCSETA) failed"); 2 65 return 1; 3 66 } 4 serial/sample2.c /*************************** 6 69 /* client 7 #include <sys/types.h> 70 /*************************** 8 #include <sys/stat.h> 71 9 #include <termio.h> 72 while(1) { 10 #include <sys/file.h> 11 #include <stdio.h> 74 printf("waiting for client to send characters.\n"); 12 #include <stdlib.h> 75 /* 13 #include <fcntl.h> 76 total_count = 0; 14 #include <unistd.h> 77 ptr = buffer; 15 #include <signal.h> #include <string.h> 79 /* \0 17 read 18 int main() 80 while(1) { 19 { 81 /* 1 20 int fd; /* 82 count = read(fd, &c, 1); 21 struct termio tio; /* 83 if(count < 0) { 22 int count, total_count;/* 84 perror("read failed"); 23 int status; /* 85 return 1; 24 char buffer[100]; /* 86 } 25 char c; /* 87 total_count += count; 26 char *ptr; /* /* TODO = c; /* 28 /*************************** 29 /* 30 /*************************** /* (O_RDWR) 33 fd = open("/dev/ttys0", O_RDWR); 34 if(fd < 0) { 35 perror("open of /dev/ttys0 failed"); 36 return 1; 37 } /*************************** 40 /* 100 /* 41 /*************************** 101 printf("read %d bytes\n", total_count); printf("buffer is\n\n %s \n\n", buffer); 43 /* TCGETA 103 break; 104 } 105 }/* 44 status = ioctl(fd, TCGETA, &tio); 45 if(status < 0) { 46 perror("ioctl (TCGETA) failed"); 47 return 1; 48 } /* 111 } 51 tio.c_cflag = B9600; 112 }/* while 52 /* tio.c_lflag &= ~ECHO; 114 /* 54 /* 115 status = close(fd); 55 tio.c_lflag &= ~ICANON; /* 1 read 58 tio.c_cc[vmin] = 1; 59 tio.c_cc[vtime] = 0; return 1; 61 /* TCSETA 122 } 62 status = ioctl(fd, TCSETA, &tio); 63 if(status < 0) { 73 /* client \n 88 /* :TODO 90 /* 91 ptr++; if(c == \n c == \0 ) { 94 /* 95 tcflush(fd, TCIFLUSH); /* \0 98 *ptr = \0 ; /* 1 q 108 if(buffer[0] == q ) { 109 printf("quit servicing!\n"); 110 break; 116 if(status == -1) { 117 perror("device close failed"); 118 return 1; 119 } /* end of file

16 16 A. A.3 sample3.c 1 /* } /* 4 serial/sample3.c 49 tio.c_cflag = B9600; /* 6 51 tio.c_lflag &= ~ECHO; 7 #include <sys/types.h> 52 /* 8 #include <sys/stat.h> 53 tio.c_lflag &= ~ICANON; 9 #include <termio.h> #include <sys/file.h> 55 /* 1 read 11 #include <stdio.h> 56 tio.c_cc[vmin] = 1; 12 #include <stdlib.h> 57 tio.c_cc[vtime] = 0; 13 #include <string.h> #include <fcntl.h> 59 /* TCSETA 15 #include <unistd.h> 60 status = ioctl(fd, TCSETA, &tio); 16 #include <signal.h> 61 if(status < 0) { perror("ioctl (TCSETA) failed"); 18 int main() 63 return 1; 19 { 64 } 20 int fd; /* struct termio tio; /* 66 /*************************** 22 int count; /* 67 /* server 23 int status; /* 68 /*************************** 24 char buffer[100]; /* /* 26 /*************************** 27 /* 28 /*************************** /* (O_RDWR) 31 fd = open("/dev/ttys0", O_RDWR); 32 if(fd < 0) { 33 perror("open of /dev/ttys0 failed"); 34 return 1; 35 } /*************************** 38 /* 39 /*************************** return 1; 41 /* TCGETA 86 } 42 status = ioctl(fd, TCGETA, &tio); 43 if(status < 0) { 44 perror("ioctl (TCGETA) failed"); 45 return 1; 71 /* 72 printf("please input some words and return.\n"); 73 sprintf(buffer, "Hello! JSK Lab.\n"); /* server 76 count = write(/* TODO, buffer, strlen(buffer)); /* 79 printf("write %d bytes\n", /* TODO ); /* 82 status = close(fd); 83 if(status == -1) { 84 perror("device close failed"); return 1; 89 } /* end of file

Baud Rate 9600 Parity NONE Number of Data Bits 8 Number of Stop Bits 1 Flow Control NONE 1 RS232C 200mm 2,000mm DIMM ( ) Telescope East/West LX200 * 1

Baud Rate 9600 Parity NONE Number of Data Bits 8 Number of Stop Bits 1 Flow Control NONE 1 RS232C 200mm 2,000mm DIMM ( ) Telescope East/West LX200 * 1 JARE54 LX200ACF 2012/2/18 2012/6/14 1 Abstract 8 LX200-ACF Linux PC meade Auto Align PC Zero Star Alignment Auto Align Zero Star Alignment 1 1 0.3 Zero Star Alignment 1 0.3 Auto Align 2 54 (2012 11 2013

More information

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l C/C++ 2007 6 18 1 C STL(1) 2 1.1............................................... 2 1.2 stdio................................................ 3 1.3.......................................... 10 2 11 2.1 sizeof......................................

More information

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

More information

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

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

More information

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧)

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧) CM-3G 周辺モジュール拡張技術文書 MS5607 センサ ( 温度 気圧 ) ( 第 1 版 ) Copyright (C)2016 株式会社コンピューテックス 目次 1. はじめに... 1 2. MS5607 について... 1 3. 接続図... 1 4. アプリケーション ソース... 2 5. アプリケーションのコンパイル方法... 7 6. アプリケーションの実行... 8 1. はじめに

More information

C言語におけるファイル入出力の高速化

C言語におけるファイル入出力の高速化 C 言語におけるファイル入出力の高速化 東京大学情報基盤センター 黒田久泰 不連続なメモリ上のデータをファイルに保存する場合 内部バッファサイズを大きくすると実行時間が短縮できます また メモリ上に連続して配置されている大規模なデータをファイルに保存する場合には できるだけ大きなデータサイズでファイル入出力を行うことで実行時間が短縮できます ここでは これらの方法や性能について紹介します 1. 内部バッファサイズの変更方法高水準入出力関数

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

ex14.dvi

ex14.dvi 1,, 0, b (b b 2 b ) n k n = n j b j, (0 n j b 1), n =(n k n k 1...n 1 n 0 ) b, n j j j +1, 0,...,b 1 (digit). b b, n b 1 ñ, ñ = k (b 1 n j )b j b N, n b n, n = b N n, n =ñ+1 b N, n m n + m (mod b N ),

More information

ARM gcc Kunihiko IMAI 2009 1 11 ARM gcc 1 2 2 2 3 3 4 3 4.1................................. 3 4.2............................................ 4 4.3........................................

More information

Microsoft Word - C.....u.K...doc

Microsoft Word - C.....u.K...doc C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ

More information

Microsoft Word - EGX100によるH663通信手引

Microsoft Word - EGX100によるH663通信手引 PowerLogic EthernetGateway(EGX100) による H663 データ取得早分かり手引き 2011 年 11 月 11 日 JAVASYS 1. 概要 H663 は RS-485 によって上位機と通信し データのやりとりを行います 本仕様書は PowerLogic EthernetGateway(EGX100) によるデータ取得の開発に関して簡単な手引きを記述します EGX100

More information

A Responsive Processor for Parallel/Distributed Real-time Processing

A Responsive Processor for Parallel/Distributed Real-time Processing E-mail: yamasaki@{ics.keio.ac.jp, etl.go.jp} http://www.ny.ics.keio.ac.jp etc. CPU) I/O I/O or Home Automation, Factory Automation, (SPARC) (SDRAM I/F, DMAC, PCI, USB, Timers/Counters, SIO, PIO, )

More information

tutorial_lc.dvi

tutorial_lc.dvi 00 Linux v.s. RT Linux v.s. ART-Linux Linux RT-Linux ART-Linux Linux [email protected] 1 1.1 Linux Yes, No.,. OS., Yes. Linux,.,, Linux., Linux.,, Linux. Linux.,,. Linux,.,, 0..,. RT-Linux

More information

DL1010.PDF

DL1010.PDF Delta 1010 24 Bit/96 khz PCI Digital I/O Card 2 M-AUDIO 3 Rack Unit 1. Power LED LED MIDI LED LED MIDI Delta 1010 MIDI MIDI LED LED MIDI Delta 1010 MIDI MIDI MIDI MIDI MIDI MTC Delta 1010 MIDI MIDI MIDI

More information

Microsoft Word - iMCs03…\…t…g…E…F…A…}…j…–…A…‰_v1_1.doc

Microsoft Word - iMCs03…\…t…g…E…F…A…}…j…–…A…‰_v1_1.doc imcs03 ソフトウェアマニュアル Ver. 1.1 株式会社イクシスリサーチ 1 1998 2002, ixs Research Corporation All right reserved. 目 次 1. はじめに...3 2.CH の機能...3 2.1 ピン配置図 ( CN100 ~ CN108)...3 2.2 モータ出力ピン ( CN101 ~ CN105 )...3 2.3 アナログ入力ピン

More information

P6dark P6dark µ-pic 2 µ-pic 2 3 µ-pic µ-pic µ-pic 3 µ-pic (10cm ) MPGC N3035-KA195 No. SN ASD (16ns[C]) (16nsC

P6dark P6dark µ-pic 2 µ-pic 2 3 µ-pic µ-pic µ-pic 3 µ-pic (10cm ) MPGC N3035-KA195 No. SN ASD (16ns[C]) (16nsC 1 2010 P6dark 2011 2 10 1 P6dark µ-pic 2 µ-pic 2 3 µ-pic 256 256 2 3 µ-pic µ-pic 3 µ-pic (10cm ) MPGC N3035-KA195 No. SN 060830-2 ASD (16ns[C]) (16nsC ) PAN16-10A ASD ( ) 3.37V PAN16-30A ASD (+) +3.36V

More information

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

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

エラー処理・分割コンパイル・コマンドライン引数 L10(2017-12-05 Tue) : Time-stamp: 2017-12-17 Sun 11:59 JST hig. recv/send http://hig3.net ( ) L10 (2017) 1 / 21 IP I swallow.math.ryukoku.ac.jp:13 = 133.83.83.6:13 = : IP ( = ) (well-known ports), :. :,.

More information

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

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( )   L09 IP (2017) 1 / 28 L09(2017-11-21 Tue) : Time-stamp: 2017-11-21 Tue 14:52 JST hig TCP/IP. IP,,,. http://hig3.net L09 (2017) 1 / 28 9, IP, - L09 (2017) 2 / 28 C (ex. ) 1 TCP/IP 2 3 ( ) ( L09 (2017) 3 / 28 50+5, ( )50+5. (

More information

FreeBSD 1

FreeBSD 1 FreeBSD 1 UNIX OS 1 ( ) open, close, read, write, ioctl (cdevsw) OS DMA 2 (8 ) (24 ) 256 open/close/read/write Ioctl 3 2 2 I/O I/O CPU 4 open/close/read/write open, read, write open/close read/write /dev

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

Linuxデバイスドライバ.PDF

Linuxデバイスドライバ.PDF Linux [email protected] 2002/10/9 Linux Kernel Conference 2002 1 Linux 2 Linux 3 Software Hardware Device Algolith m Protocol Applicati on 4 CPU 128MB NIC ATI Radeon GeForce2 MX400 Matrox G400 DISK 5 OS

More information

imcs04 ソフトウェアマニュアル imcs04 ソフトウェアマニュアル Ver1.4 株式会社イクシスリサーチ , ixs Research Corporation All right reserved.

imcs04 ソフトウェアマニュアル imcs04 ソフトウェアマニュアル Ver1.4 株式会社イクシスリサーチ , ixs Research Corporation All right reserved. Ver1.4 株式会社イクシスリサーチ 1 1998 2011, ixs Research Corporation All right reserved. 目 次 1. 概要...3 2. エンドポイント...3 2.1 エンドポイント2...3 2.2 エンドポイント3...3 3 USBドライバについて...5 3.1 デバイスのオープン, クローズ...5 3.2 imcs04 のデータを取り込む...5

More information

Microsoft Word - Cプログラミング演習(10)

Microsoft Word - Cプログラミング演習(10) 第 10 回 (6/25) 3. ファイルとその応用 (3) ファイルの更新 シーケンシャルファイルの更新 シーケンシャルファイルでは, 各レコードが可変長で連続して格納されており, その中の特定のレコードを変更することができない そこで一般的には, マスタファイルからデータを取り出し, 更新処理を行ったあとに新マスタファイルに書き込む 注 ) マスタファイル : 主ファイル, 基本ファイルと呼ばれるファイルで内容は比較的固定的であり,

More information

Delta44.PDF

Delta44.PDF Delta44 PCI Analog Recording Interface 2 M-AUDIO 3 Break-Out Box Front Panel: 1. Analog OUTS 1 4 / 2. INS - / Break-Out Box Back Panel: 3. PCI 4. 15 D-sub PCI Delta44 1. Delta44 2. Windows Delta44 WINDOWS

More information

: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p.

: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. stdio considered harmful [email protected] 2005 06 02 stdio considered harmful p. : Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. : stdio stdio Nonblocking

More information

02: 変数と標準入出力

02: 変数と標準入出力 C プログラミング入門 基幹 7 ( 水 5) 1 10: ファイル入出力 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/teachers/w48369 2/CPR1/ 2016-06-15 今日の内容 2 標準ライブラリ関数によりファイルの出力を行う画像ファイルの生成を例題として 配列の作成を復習する 文字列の扱いを復習する

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

2 2 GtkWidget* gtk_drawing_area_new ( void ); /* */ void gtk_drawing_area_size ( GtkDrawingArea *darea, gint width, gint height); realize size allocat

2 2 GtkWidget* gtk_drawing_area_new ( void ); /* */ void gtk_drawing_area_size ( GtkDrawingArea *darea, gint width, gint height); realize size allocat 200 B3 GUI TA http://www.cyber.t.u-tokyo.ac.jp/ tani/class/mech enshu/ 200 7 6 X Window System GUI(Graphical User Interface) GUI (event driven) C GUI(Graphical User Interface) X Window System GUI GUI 2

More information

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

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

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() malloc 2 #include #include #include enum LENGTH = 10 ; int

More information

MAP2496.PDF

MAP2496.PDF Audiophile 2496 24 Bit 96 khz 4 in/ 4 out PCI Digital Recording Interface with MIDI 2 M-AUDIO 3 PCI 1. INS1&2 IN1 IN2 2. OUTS1&2 OUT1 OUT2 3. 15 D-sub S/PDIF MIDI 4. S/PDIF S/PDIF DAT MD A/D S/PDIF 5.

More information

新・明解C言語 ポインタ完全攻略

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

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

2 1. Ubuntu 1.1 OS OS OS ( OS ) OS ( OS ) VMware Player VMware Player   jp/download/player/ URL VMware Plaeyr VMware 1 2010 [email protected] http://www.jsk.t.u-tokyo.ac.jp/~k-okada/lecture/ 2010 4 5 Linux 1 Ubuntu Ubuntu Linux 1 Ubuntu Ubuntu 3 1. 1 Ubuntu 2. OS Ubuntu OS 3. OS Ubuntu https://wiki.ubuntulinux.jp/ubuntutips/install/installdualboot

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

thesis.dvi

thesis.dvi H8 e041220 2009 2 Copyright c 2009 by Kentarou Nagashima c 2009 Kentarou Nagashima All rights reserved , H8.,,,..,.,., AKI-H8/3052LAN. OS. OS H8 Write Turbo. H8 C, Cygwin.,., windows. UDP., (TA7279P).,.

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

untitled

untitled Q 8 1 8.1 (C++) C++ cin cout 5 C++ 16 6 p.63 8.3 #include 7 showbase noshowbase showpoint noshowpoint 8.3 uppercase 16 nouppercase 16 setfill(int) setprecision(int) setw(int) setbase(int) dec

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 [email protected] / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

More information

NI P1200 Release Notes Cover

NI P1200 Release Notes Cover PEX-H2994W Board Support Package Installation on RedHawk Release Notes July 4, 2019 1. はじめに 本書は Concurrent Real Time IncCCRT) の RedHawk 上で動作する インターフェース社製 PEX- H2994W PCI Express ボードサポートパッケージ用リリースノートです

More information

J.JSSAC Vol. 7, No. 2, Mathematica Maple,., Open asir Open xxx asir. Open xxx Open asir, asir., Open xxx, Linux Open asir Open sm1 (kan/sm1). C

J.JSSAC Vol. 7, No. 2, Mathematica Maple,., Open asir Open xxx asir. Open xxx Open asir, asir., Open xxx, Linux Open asir Open sm1 (kan/sm1). C J.JSSAC (1999) Vol. 7, No. 2, pp. 2-17 Open asir HPC (Received 1997/12/1) 1 Open asir Open xxx,., ( ),,,,,.,., (1) (2) (3) (4),. Open xxx,.,., 1.,.,., 0 10, dx,.,., [email protected] [email protected]

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

LAN Copyright c Daikoku Manabu This tutorial is licensed under a Creative Commons Attribution 2.1 Japan License

LAN Copyright c Daikoku Manabu This tutorial is licensed under a Creative Commons Attribution 2.1 Japan License LAN 2014 3 19 Copyright c 1993 2014 Daikoku Manabu This tutorial is licensed under a Creative Commons Attribution 2.1 Japan License. 1 2 1.1................................... 2 1.2.........................

More information

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

Apache Web Server 2 Compaq ActiveAnswers Deskpro Compaq Insight Manager Fastart Systempro Systempro/LT ProLiant ROMPaq Qvision SmartStart NetFlex Quic Technical Guide 1999 5 Internet and E-Commerce Solutions Business Unit Enterprise Solutions Division Apache Web Server Compaq Linux Apache HTTP Compaq Computer Corporation...3...3...4...5...6...7...7...7...8...10...10...16...16

More information

Armadillo-9 ソフトウェアマニュアル

Armadillo-9 ソフトウェアマニュアル Software Manual http://www.atmark-techno.com/ http://armadillo.atmark-techno.com/ Armadillo-9 software manual ver.1.0.16 1.... 1 1.1.... 1 1.2.... 1 1.3.... 1 1.4.... 2 1.5.... 2 1.6.... 2 2.... 3 2.1....

More information

3.2 Linux root vi(vim) vi emacs emacs 4 Linux Kernel Linux Git 4.1 Git Git Linux Linux Linus Fedora root yum install global(debian Ubuntu apt-get inst

3.2 Linux root vi(vim) vi emacs emacs 4 Linux Kernel Linux Git 4.1 Git Git Linux Linux Linus Fedora root yum install global(debian Ubuntu apt-get inst 1 OS Linux OS OS Linux Kernel 900 1000 IPA( :http://www.ipa.go.jp/) 8 12 ( ) 16 ( ) 4 5 22 60 2 3 6 Linux Linux 2 LKML 3 3.1 Linux Fedora 13 Ubuntu Fedora CentOS 3.2 Linux root vi(vim) vi emacs emacs 4

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」 ALTIMA Company, MACNICA, Inc Nios II HAL API Modular Scatter-Gather DMA Core Ver.17.1 2018 8 Rev.1 Nios II HAL API Modular Scatter-Gather DMA Core...3...3...4... 4... 5 3-2-1. msgdma... 6 3-2-2. On-Chip

More information

file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose

filea fileb fp = fopen(a, r); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen(b, r); while(fgets(line, BUFSIZ, fp)) {... fclose I117 9 2 School of Information Science, Japan Advanced Institute of Science and Technology file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line,

More information

comment.dvi

comment.dvi ( ) (sample1.c) (sample1.c) 2 2 Nearest Neighbor 1 (2D-class1.dat) 2 (2D-class2.dat) (2D-test.dat) 3 Nearest Neighbor Nearest Neighbor ( 1) 2 1: NN 1 (sample1.c) /* -----------------------------------------------------------------

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

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1: 005 9 7 1 1.1 1 Hello World!! 5 p r i n t f ( H e l l o World!! \ n ) ; 7 return 0 ; 8 } 1: 1 [ ] Hello World!! from Akita National College of Technology. 1 : 5 p r i n t f ( H e l l o World!! \ n ) ;

More information

ezbus2.PDF

ezbus2.PDF Cool Edit Pro Cubase VST/Nuendo Wavelab Sonar Sound Forge 5.0 I. Cool Edit Pro EZbus Cool Edit Pro Edit Waveform View USB /MIDI Windows Millenium Windows XP EZbus USB MIDI Win 98 SE Win 2000 Cool Edit

More information

演算増幅器

演算増幅器 ネットワークプログラミングの続き前回はチャットを行うプログラムを作成し ネットワークを利用したプログラミングの基本について学んだ 本日は 前回作成したプログラムを改良していく 具体的には 以下の2つの項目について習っていく ホスト名や IP アドレスの取得の方法 fork() システムコールを使い 子プロセスを作成する方法 チャットプログラムの改良 前回のプログラムを以下のように改良していく 太字部分が変更部分である

More information

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D 6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet

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

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション プログラミング応用演習 第 5 回演習 前回までのお話 ポインタ ポインタを用いた文字列処理 構造体 ファイル 再帰的構造体 リスト構造 動的メモリ管理 今日のお題 ポインタやファイルなど これまでの内容の練習 教材 以前 以下に単語を収録したファイルがあることを紹介した : /usr/share/dict/words この中からランダムに単語を取り出したファイルを用意した http://sun.ac.jp/prof/yamagu/2019app/

More information

ファイル入出力と プロセス間通信 \(1\)

ファイル入出力と プロセス間通信 \(1\) ファイル入出力と プロセス間通信 (1) 2004 年 12 月 10 日 海谷治彦 1 目次 まずはマニュアルをみよう. 2 章システムコールインタフェース 3 章汎用関数定義 アンバッファー化入出力 (Unbuffered I/O) open, read, write... lseek, dup... 標準入出力ライブラリ fopen, fscanf, fprintf... 標準入力, 標準出力,

More information

Linux XScreenSaver T020074

Linux XScreenSaver T020074 Linux XScreenSaver T020074 Linux XScreenSaver XScreenSaver Linux Linux Linux X Window System X Window System Xlib XScreenSaver X Window System Xlib XScreenSaver Xlib vroot.h Xlib XScreenSaver Linux Linux

More information

bitvisor-ipc v12b.key

bitvisor-ipc v12b.key PC PC OS PC PC 1 1 2 101 101 enum tre_rpc_direction { TRE_RPC_DIRECTION_REQUEST, TRE_RPC_DIRECTION_RESULT }; struct tre_rpc_request { }; enum tre_rpc_direction direction; ulong id; ulong proc_number;

More information

UNIX

UNIX 2000 1 UNIX 2000 4 14 1 UNIX? 2 1.1 UNIX OS....................................... 2 1.2.................................................... 2 1.3 UNIX...................................... 2 1.4 Windows

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information