• 전문가 요청 쿠폰 이벤트
*현*
Bronze개인
팔로워0 팔로우
소개
등록된 소개글이 없습니다.
전문분야 등록된 전문분야가 없습니다.
판매자 정보
학교정보
입력된 정보가 없습니다.
직장정보
입력된 정보가 없습니다.
자격증
  • 입력된 정보가 없습니다.
판매지수
전체자료 8
검색어 입력폼
  • [운영체제] 상호배제의 버전별 비교 평가A+최고예요
    ◎ Mutual Exclusion Primitive (Ver.1)program versionone;var processnumber : integer;procedure processonebeginwhile true dobeginwhile processnumber = 2 do; // mutual exclusion entry code (processone)criticalsectionone;processnumber := 2; // mutual exclusion exit code ( 〃 )otherstuffoneendend;procedure processtwo;beginwhile true dobeginwhile processnumber = 1 do; // mutual exclusion entry code (processtwo)criticalsectiontwo;processnumber := 1; // mutual exclusion exit code ( 〃 )otherstufftwoendend;beginprocessnumber := 1; // 공유변수(초기값 1로 setting되어 processone procedure가 먼저실행)parbeginprocessone; // parbegin / parend에 의해 processone 과 processtwo 가processtwo // 동시에 수행하게 된다.parendend.▶▶ 프로그램의 실행① processone : while∼do문을 수행하게 되면, processnumber의 초기치가 1이므로, processone이 먼저 Critical - Section(C.S)에 진입한다.② processtwo : 그동안 processnumber가 1인 것을 확인하고, 그 값이 자신의 process number(=2)와 같아질 때while∼do loop을 계속 수행한다.③ processone : C.S 내의 일을 끝내고, processnumber를 2로 치환한다.④ processtwo : while∼do loop을 돌고 있다가, procescode (processone)p1inside := true; // 자신의 변수를 true로 전환 후 C.S내에 진입criticalsectionone;p1inside := false; // mutual exclusion exit code ( 〃 )otherstuffoneendend;procedure processtwo;beginwhile true dobeginwhile p1inside do; // mutual exclusion entry code (processtwo)p2inside := true;criticalsectiontwo;p1inside := false; // mutual exclusion exit code ( 〃 )otherstufftwoendend;beginp1inside := false; // processone이 C.S 내에 있을 때 p1inside=true 가 되고,p2inside := false; // processtwo이 C.S 내에 있을 때 p2inside=true 가 된다.parbeginprocessone; // parbegin / parend에 의해 processone 과 processtwo 가processtwo // 동시에 수행하게 된다.parendend.▶▶ 프로그램의 실행 (가정 : processone이 processtwo보다 실행속도가 빠름)① processone : processtwo가 C.S내에 있는지(=p2inside가 true인지)test 후, 아니면 p1inside variable을 true로 전환하고 C.S내로 진입.② processtwo : p1inside가 true 이므로, while∼do loop을 돌며 대기 (=busy waiting)③ processone : C.S 내의 일을 끝내고, p1inside를 false로 전환④ processtwo : while∼do loop을 돌고 있다가, p1inside가 false임을 확인하고 loop을 빠져나와 C.S내로 진입한다.⑤ processone : p2inside가rocess가 while 검사를 시작할 때 다른 process는 while 검사를 하지 못하게 하는 것이다. 즉, while 검사전에 자신들의 변수(상태)를 바꿈으로써, 자신이 지금 while 검사를 시작한다는 사실을, 그리고 자신이 C.S에 들어가고자 하는 의지를 미리 알리는 것이다. (⇒ Version 3)◎ Mutual Exclusion Primitive (Ver.3)program versionthree;var p1wantstoenter, p2wantstoenter : boolean;procedure processone;beginwhile true dobegin // 자신의 변수(p1wantstoenter)를 true로 전환하므로써p1wantstoenter := true; // 자신이 C.S에 들어가고자 하는 의사 표시함.while p2wantstoenter do; // mutual exclusion entry code (processone)criticalsectionone;p1wantstoenter := false; // mutual exclusion exit code ( 〃 )otherstuffoneendend;procedure processtwo;beginwhile true dobeginp2wantstoenter := true;while p1wantstoenter do; // mutual exclusion entry code (processtwo)criticalsectiontwo;p2wantstoenter := false; // mutual exclusion exit code ( 〃 )otherstufftwoendend;beginp1wantstoenter := false;p2wantstoenter := false;parbeginprocessone; // parbegin / parend에 의해 processone 과 processtwo 가processtwo // 동시에 수행하게 된다.parendend.▶▶ 프로그램의 실행 (가정 : processoness이므로, 동시에 자신의 변수(flag)를 true로 바꾸고, while문에 도달할 수 있다. 이때 두 process는 서로 상대 process의 상태가 true임을 확인하고는 영원히 while∼do loop만을 하게 될 것이 다. 즉, 두 Process가 동시에 수행할 경우, Indefinite postponement 문제와 deadlock이 발생된다.▶▶ SolutionVersion 3의 문제점은 두 process가 무한 loop에 빠질 수 있다는 것이다. 따라서, 이러한 loop으로부터 빠져나오는 방법을 생각해야 한다. 즉, 각 process들이 while∼do loop을 계속하며, 자신의 flag를 얼마동안 계속에서 false로 유지시켜, 상대 process가 C.S내로 들어갈 기회를 제공해 주는 것이다. (⇒ Version 4)◎ Mutual Exclusion Primitive (Ver.4)program versionfour;var p1wantstoenter, p2wantstoenter : boolean;procedure processone;beginwhile true dobeginp1wantstoenter := true;while p2wantstoenter do;begin // Ver 3.를 보완한 부분p1wantstoenter := false; // 얼마동안 flag를 false로 둠으로써 다른 process가delay(random, fewcycles); // 그의 while loop을 빠져나가 되어,p1wantstoenter := ture; // mutual exclusion과 deadlock 문제가 해결된다.end;criticalsectionone;p1wantstoenter := false;otherstuffoneendend;procedure processtwo;beginwhile true dobeginp2wantstoenter := true;while p1wantstoenter do;beginp2wantstoenter := false;delflag를 false로 둠으로써, 다른 process가 그의 while loop을 지나가게 되고, 이로써, mutual exclusion이 보장되고, deadlock이 해결된다.▶▶ 단점두 process가 Parallel process이므로, 동시에 자신의 변수(flag)를 true로 바꾸고, while문에 도달할 수 있다. 이때 두 process는 서로 상대 process의 상태가 true임을 확인하고는 동시에 while∼do loop의 body를 수행하여 flag를 false로 한 얼마후 true로 하고, 다시 while문은 test하게 될 것이다. 이처럼 while을 검사할 때마다 값이 계속 true가 될 수 있다.즉, 두 Process가 동시에 수행할 경우, Indefinite postponement 문제가 여전히 발생된다.▶▶ Solution⇒ Dekker Algorithm◎ Mutual Exclusion Primitive (Dekker Algorithm)program dekkeralgoritm;var favoredprocess :(first, second);p1wantstoenter, p2wantstoenter:boolean;procedure processone;beginwhile true dobeginp1wantstoenter := true;while p2wantstoenter do;if favoredprocess = second thenbegin // Ver 3.를 보완한 부분p1wantstoenter := false; // 얼마동안 flag를 false로 둠으로써 다른 process가while favoredprocess = second do;p1wantstoenter := ture; // mutual exclusion과 deadlock 문제가 해결된다.end;criticalsectionone;favoredprocess := second;p1wantstoenter := false;otherstuffoneendend;procedure process간다.
    공학/기술| 2003.05.12| 6페이지| 1,000원| 조회(927)
    미리보기
  • [java ] 임의의 위치에 나타난 dog를 잡는 프로그램 평가B괜찮아요
    /**********************************************************************************//* Programming Project # 5.8 (CatchPicture.java) *//* 임의의 위치에 나타나는 그림(dog)을 잡는 프로그램 *//**********************************************************************************/import java.applet.*;import java.awt.*;import java.awt.event.*;import javax.swing.Timer;import java.util.Random;public class CatchPicture extends Applet {CatchMouseListener catchmessage = new CatchMouseListener();Random position = new Random();private final int APPLET_WIDTH = 250;private final int APPLET_HEIGHT = 250;private final int IMAGE_X_SIZE = 25;private final int IMAGE_Y_SIZE = 40;private final int DELAY = 850;private Point point = null;private Timer timer;private Image image;private AudioClip bonk;private int xposition, yposition, catchcount;//-----------------------------------------------------------------------// Animation을 위한 timer, sound를 포함하는 applet을 설정한다.//-----------------------------------------------------------------------public void init() {addMouseListener (new CatchMouseListener());timer = new Timer (DELAY, new CatchActionListener());timer.start();xposition = 0;yposition = 0;catchcount = 0;image = getImage (getCodeBase(), "dog.gif");bonk = getAudioClip (getCodeBase(), "bonk.au");setBackground (Color.white);setSize (APPLET_WIDTH, APPLET_HEIGHT);}//----------------------------------------------------------------------// 현재 mouse를 clicked 한 위치가 image(dog)의 위치에 부합하는지 여부를// 결정하고, mouse로 dog를 catch 한 경우의 수를 count 한다.// catch 하면 일시 정지하고, image를 제외한 applet 부분을 click 하면,// 다시 image가 이동하기 시작한다.//----------------------------------------------------------------------public void catchdog() {if (point.x >= xposition && point.x = yposition && point.y
    공학/기술| 2003.05.12| 3페이지| 1,000원| 조회(475)
    미리보기
  • [java] 고무줄효과를 이용하여 원을 그리는 애플릿
    import java.applet.Applet;import java.awt.*;import java.awt.event.*;public class RubberOvals extends Applet implements MouseListener, MouseMotionListener {private final int APPLET_WIDTH = 200;private final int APPLET_HEIGHT = 200;private int radius = 0;private Point point1 = null;private Point point2 = null;//---------------------------------------------------------------------------// 마우스에 관련한 모든 이벤트들의 listener로 등록하고, Applet을 초기화 한다.//---------------------------------------------------------------------------public void init() {addMouseListener (this);addMouseMotionListener (this);setBackground (Color.white);setSize (APPLET_WIDTH, APPLET_HEIGHT);}//---------------------------------------------------------------------------// return받은 반지름 값으로, 원을 그린다.//---------------------------------------------------------------------------public void paint (Graphics page) {page.setColor (Color.red);if (point1 != null && point2 != null) {radius = computeRadius();page.drawOval(point1.x-radius, point1.y-radius, radius * 2, radius * 2);}}//---------------------------------------------------------------------------// 반지름 계산을 구현한 method 로써,// mouse pressed된 지점의 x, y 값과, mouse가 dragged 되는 지점들의 x, y 값을// 가지고, 반지름을 계산한 후, 정수형으로 변환하여 return 한다.//---------------------------------------------------------------------------public int computeRadius() {double xlen = 0.0, ylen = 0.0;int circleradius = 0;xlen = (double)(Math.abs(point1.x - point2.x));ylen = (double)(Math.abs(point1.y - point2.y));circleradius = (int)(Math.sqrt(xlen * xlen + ylen * ylen));return circleradius;}//---------------------------------------------------------------------------// mouse 가 처음 눌려진 위치의 좌표값을 갖는다.//---------------------------------------------------------------------------public void mousePressed (MouseEvent event) {point1 = event.getPoint();}//---------------------------------------------------------------------------// mouse 가 dragged 됨에 따라 그것의 현재 위치를 구해서 고무줄 효과가// 생기도록, 원을 그린다(repaint() 사용).//---------------------------------------------------------------------------public void mouseDragged (MouseEvent event) {point2 = event.getPoint();repaint();}//---------------------------------------------------------------------------// 사용하지 않는 event method 들을 위한 공백 정의를 제공한다.//---------------------------------------------------------------------------public void mouseClicked (MouseEvent event) {}public void mouseReleased (MouseEvent event) {}public void mouseEntered (MouseEvent event) {}public void mouseExited (MouseEvent event) {}
    공학/기술| 2003.05.12| 2페이지| 1,000원| 조회(496)
    미리보기
  • [해밍코드] 해밍코드와 한글
    1. Hamming code와 hamming distance에 관하여 조사하시오.▶ Hamming code(해밍코드)는 code의 전송 시 발생하는 오류를 검출할 수 있을 뿐만이 아니라 오류 code의 수정이 가능한 코드로써 1byte(8bit)에 3∼4개의 검사(check)용 여분의 bit를 두어 이를 이용하여 2bit의 오류를 찾아내거나 1bit의 오류를 정정할 수 있도록 한 code이다.▶ 미국 Bell 연구소의 Richard W. Hamming에 의하여 개발된 오류 정정 코드들 중에서 가장 간 단한 코드이며, "Error 제어 방식"중 순방향 에러정정방식(FEC)) FEC (Forward Error Correction) : 많은 통신시스템에서 자료 형태는 단 방향 채널을 사용하고 역 채널이 없는 경우가 많아 재전송을 요구할 수는 없고 또, 재전송이 가능하더라도 지연시간이 길다. 따라서 오류가 발생하였을 경우 수신측에서 능동적으로 교정할 수 있는 순 방향 오류정정방식으로 FEC가 디지털 전송의 기본이 되고 있다. 이 기술은 디지털 변조기상에서 구현되며 실제 HW는 DSP칩을 이용하여 설계·구현된다에 해당되는 코드이다.▶ 사용방식 : Hamming code는 오류 검출 뿐 만 아니라 오류 정정까지 가능하지만, 오류 정정을 위해서는 많은 Parity bit를 필요로 하게 된다. 또 Parity bit를 포함한 전송 data bit의 구성은 data bit는 parity bit가 아닌 전송하고자 하는 원래의 Data이며, parity bit의 내용은 data bit가 1인 위치의 bit 번호를 Exclusive-OR 함으로써 계산된다. 4bit 단어들에 대해 해밍코드가 사용된 경우 ‥‥‥‥ 벤다이어그램(Venn diagram) 사용① 세 개의 원들을 서로 교차시켜 일곱 개의 구획을 나눈다. ② 내부의 구획들에는 4개(4bit)의 data bit들을 지정한다. ③ 나머지 구획(3bit)들은 parity bit들로 채운다. (짝수parity bit check code 사용) 각 parity bit의 값은 그것이 속한 원내의 1의 개수가 짝수이면, 0을, 홀수이면 1을 선택한다.* venn diagram*************000 ④ 따라서 이 상태에서 data bit들 중의 하나에 오류가 발생하면, 원내의 1의 개수가 짝수개가 아닌 것을 확인함으로써 오류를 쉽게 발견할 수 있고, 해당 구획의 비트를 변경함으로써 오 류를 정정할 수도 있다.▶ Hamming distance는 code의 오류 검출 및 정정 특성을 부여하는 중요한 매개변수로써, n-차원 vector인 부호벡터 C = (C0, C1, ···,Cn-1)에서 부호벡터 C의 Hamming distance는 부호벡터 C 내에서 0(zero)이 아닌 성분(component)의 개수로 정의할 수 있다. 7차원 부호벡터 C = ( 0 1 1 0 0 1 0 )의 Hamming distance는 3이다.한편, 두 개의 n차원 벡터 X = (X0, X1, ···,Xn-1)와 Y = (Y0, Y1, ···,Yn-1)간의 Ham-ming distance는 X와 Y의 Exculsive-OR 결과값에서 0(zero)이 아닌 성분의 개수로 정의할 수 있다. X = ( 1 1 0 1 1 0 0 )Y = ( 1 0 1 1 0 0 1 )Ex-OR = ( 0 1 1 0 1 0 1 ) ∴ X와 Y의 Hamming distance 는 4 이다.2. How to represent the Korean Character?- 조합형 및 완성형 코드의 표현방법을 조사하여 보고서를 작성하되, 자신의 이름을 예로 사용하시오.▶ 한글은 보는 관점에 따라 크게 ①음절문자로 보아 완성형 한글로 사용하는 경우와,②초성+중성+종성을 하나의 글자로 생각하여 조합형 한글로 사용하는 경우가 있다.▶ 2byte 완성형 한글- * 1987년 정부가 한국표준으로 정한 것으로 가장 많이 사용되는 한글 한 음절마다 2byte의 2 진수를 1대 1로 대응하여 표현하는 방법이다. 즉, 한글을 초성, 중성, 종성으로 나누지 않고 이미 한 음절로 완성된 글자 그 자체를 코드화 한 것이다.* 초성, 중성, 종성의 3성의 조합으로 구성된 한글은 자주 사용되지 않는 글자가 거의 70% 가 되고 이러한 점을 이용하여 나온 것이 완성형 한글이다.* 한글 2350자, 한자 4888자, 사용자정의 188자, 특수문자 1128자, 미지정문자 282자를 표현 가능하다.- 장점 : 다른 프로그램 및 통신 등에 이용되는 것을 피해 작성되었기 때문에 통신에는 매우 적합하다.- 단점 : 한글을 초성, 중성, 종성으로 나누지 않고 이미 한 음절로 완성된 글자 그 자체를 코 드화 한 것이므로 한글과 같이 다양하게 결합 가능한 문자에서는 표현 불가능한 글 자가 발생할 수 있다는 단점이 있다.- 표시원리 : 아래의 MSB) MSB(Most Significant Bit) : MSB가 1(즉, 128 이상)이면 한글코드, 0(128이하)이면 영문 코드임을 컴퓨터에 알린다.를 제외한 bit들에 글자를 음절 단위로 할당한다.First ByteSecond Byte*************21011MSB MSB▶ 2byte 조합형 한글- * 한글의 자음과 모음을 각각 code화 하고 이것들이 초성, 중성, 종성으로 합쳐서 한 글자가 된다는 개념으로써 한글의 생성원리와 가장 근접한 코드이다.* 한글을 내부적으로 처리하는 모든 응용 Program에서 주로 사용된다.
    공학/기술| 2003.05.12| 3페이지| 1,000원| 조회(1,225)
    미리보기
  • [OpenGL 프로그램] Color Cube 평가B괜찮아요
    // ColorCube.c// translate, rotate, scale 을 mouse의 left button menu로 구현// Lookat 함수의 viewer의 위치, cube의 위치, viewer의 방향을// mouse의 right button menu로 구현하여 interactive 하게 변경가능#include #include void polygon(int, int, int, int);void colorcube(void);void myinit(void);void display(void);void myReshape (int, int);void translate_menu(int);void rotate_menu(int);void scale_menu(int);void view_menu(int);void at_menu(int);void up_menu(int);void left_menu(int);void right_menu(int);GLfloat vertex[][3] = {{-1.0,-1.0,-1.0}, {1.0,-1.0,-1.0}, {1.0,1.0,-1.0},{-1.0,1.0,-1.0}, {-1.0,-1.0,1.0}, {1.0,-1.0,1.0}, {1.0,1.0,1.0}, {-1.0,1.0,1.0}};GLfloat normal[][3] = {{-1.0,-1.0,-1.0}, {1.0,-1.0,-1.0}, {1.0,1.0,-1.0},{-1.0,1.0,-1.0}, {-1.0,-1.0,1.0}, {1.0,-1.0,1.0}, {1.0,1.0,1.0}, {-1.0,1.0,1.0}};GLfloat color[][3] = {{0.0,0.0,0.0}, {1.0,0.0,0.0}, {1.0,1.0,0.0}, {0.0,1.0,0.0},{0.0,0.0,1.0}, {1.0,0.0,1.0}, {1.0,1.0,1.0}, {0.0,1.0,1.0}};void polygon(int a, int b, int c, int d) {glBegin(GL_POLYGON);glColor3fv(color[a]);glNormal3fv(normal[a]);glVertex3fv(vertex[a]);glColor3fv(color[b]);glNormal3fv(normal[b]);glVertex3fv(vertex[b]);glColor3fv(color[c]);glNormal3fv(normal[c]);glVertex3fv(vertex[c]);glColor3fv(color[d]);glNormal3fv(normal[d]);glVertex3fv(vertex[d]);glEnd();}void colorcube() {polygon(0, 3, 2, 1);polygon(2, 3, 7, 6);polygon(0, 4, 7, 3);polygon(1, 2, 6, 5);polygon(4, 5, 6, 7);polygon(0, 1, 5, 4);}static GLfloat theta[] = {0.0,0.0,0.0};static GLint rtt = 2;static GLfloat tx = 0.0, ty = 0.0, tz = 0.0;static GLfloat sx = 1.0, sy = 1.0, sz = 1.0;static GLdouble view[] = {0.0,0.0,5.0}; /* 초기 관측자의 위치 */static GLdouble at[] = {0.0,0.0,0.0};static GLdouble up[] = {0.0,1.0,0.0};void display(void) {glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glLoadIdentity ();gluLookAt (view[0], view[1], view[2], at[0], at[1], at[2], up[0], up[1], up[2]);glRotatef(theta[0], 1.0, 0.0, 0.0);glRotatef(theta[1], 0.0, 1.0, 0.0);glRotatef(theta[2], 0.0, 0.0, 1.0);glTranslatef(tx, ty, tz);glScalef (sx, sy, sz);colorcube();glFlush ();glutSwapBuffers();}void translate_menu(int id) {if(id == 1) tx += 1.0;else if(id == 2) tx -= 1.0;else if(id == 3) ty += 1.0;else if(id == 4) ty -= 1.0;else if(id == 5) tz += 1.0;else if(id == 6) tz -= 1.0;display();}void rotate_menu(int id) {if(id == 1) {rtt = 0; theta[rtt] += 2.0;}else if(id == 2) {rtt = 0; theta[rtt] -= 2.0;}else if(id == 3) {rtt = 1; theta[rtt] += 2.0;}else if(id == 4) {rtt = 1; theta[rtt] -= 2.0;}else if(id == 5) {rtt = 2; theta[rtt] += 2.0;}else if(id == 6) {rtt = 2; theta[rtt] -= 2.0;}if(theta[rtt] > 360.0) theta[rtt] -= 360.0;display();}void scale_menu(int id) {if(id == 1) sx += 0.5;else if(id == 2) sx -= 0.5;else if(id == 3) sy += 0.5;else if(id == 4) sy -= 0.5;else if(id == 5) sz += 0.5;else if(id == 6) sz -= 0.5;display();}void view_menu(int id) {if(id == 1) view[0] += 1.0;else if(id == 2) view[0] -= 1.0;else if(id == 3) view[1] += 1.0;else if(id == 4) view[1] -= 1.0;else if(id == 5) view[2] += 1.0;else if(id == 6) view[2] -= 1.0;display();}void at_menu(int id) {if(id == 1) at[0] += 1.0;else if(id == 2) at[0] -= 1.0;else if(id == 3) at[1] += 1.0;else if(id == 4) at[1] -= 1.0;else if(id == 5) at[2] += 1.0;else if(id == 6) at[2] -= 1.0;display();}void up_menu(int id) {if(id == 1) up[0] += 1.0;else if(id == 2) up[0] -= 1.0;else if(id == 3) up[1] += 1.0;else if(id == 4) up[1] -= 1.0;else if(id == 5) up[2] += 1.0;else if(id == 6) up[2] -= 1.0;display();}void left_menu(int id) {}void right_menu(int id) {}void myReshape (int w, int h) {glViewport (0, 0, w, h);glMatrixMode (GL_PROJECTION);glLoadIdentity ();if(w
    공학/기술| 2003.05.12| 8페이지| 2,000원| 조회(2,730)
    미리보기
전체보기
받은후기 3
3개 리뷰 평점
  • A+최고예요
    1
  • A좋아요
    0
  • B괜찮아요
    2
  • C아쉬워요
    0
  • D별로예요
    0
전체보기
해캠 AI 챗봇과 대화하기
챗봇으로 간편하게 상담해보세요.
2026년 03월 30일 월요일
AI 챗봇
안녕하세요. 해피캠퍼스 AI 챗봇입니다. 무엇이 궁금하신가요?
3:20 오후
문서 초안을 생성해주는 EasyAI
안녕하세요 해피캠퍼스의 20년의 운영 노하우를 이용하여 당신만의 초안을 만들어주는 EasyAI 입니다.
저는 아래와 같이 작업을 도와드립니다.
- 주제만 입력하면 AI가 방대한 정보를 재가공하여, 최적의 목차와 내용을 자동으로 만들어 드립니다.
- 장문의 콘텐츠를 쉽고 빠르게 작성해 드립니다.
- 스토어에서 무료 이용권를 계정별로 1회 발급 받을 수 있습니다. 지금 바로 체험해 보세요!
이런 주제들을 입력해 보세요.
- 유아에게 적합한 문학작품의 기준과 특성
- 한국인의 가치관 중에서 정신적 가치관을 이루는 것들을 문화적 문법으로 정리하고, 현대한국사회에서 일어나는 사건과 사고를 비교하여 자신의 의견으로 기술하세요
- 작별인사 독후감