Scratch 란? 

Scratch



아이들이 그래픽기반으로 컴퓨터 프로그래밍을 이해할 수 있도록 개발된 교육용 프로그래밍 환경(EPL; Educational Programming Language)이다.


MIT Media Lab에서 Squeak기반으로 Smalltalk언어로 개발되었다.


Scratch 공개 사이트 : http://scratch.mit.edu





** 현재 사이트에서 웹으로 Scratch 프로그래밍이 가능하며, Off-line에서 Scratch를 즐기려면 Scratch 1.4 또는 Scratch 2.0 Offline Editor버전을 다운로드하여 사용할 수 있다.


Scratch 2.0 Offline Editor 실행화면


Scratch 교수자를 위한 커뮤니터 사이트(Scratch Ed)가 있어 다양한 컨텐츠를 공유할 수 있다.

Scratch ED 공개 사이트 : http://scratched.media.mit.edu



TED Scratch 

Posted by 혀나미
,
수치 데이터처리에서 정수부와 실수부에 대한 구분은 다음과 같다.

수치 데이터 ==> 123.456

  • 정수부(Significand) -> 123
  • 가수부(Mantissa) -> 456

    수치 데이터를 1.23456E-2 변경했을 경우,
  • 정수부(Significand) -> 1
  • 가수부(Mantissa) -> 23456
  • 지수부(Exponent) -> -2

    로 표현 되어 진다.
  • 수치를 이진수로 표현 했을 경우는 다음과 같다.

    이진수 수치 데이터 (123.456) ==> 1001010101.1111010101

  • 정수부(Significand) -> 1001010101
  • 실수부(Mantissa) -> 1111010101
  • 이를 지수로 변경하면 다음과 같다.
    1.001010101[.]1111010101E-1001
    1.0010101011111010101E-1001


    추가적인 정보 참조 : http://en.wikipedia.org/wiki/Significand

    Posted by 혀나미
    ,
    각종 언어들의 Tutorial을 정리한 사이트
    http://www.tutorialspoint.com
    Posted by 혀나미
    ,

    >> OpenMP 이해하기

     

    OpenMP language extensions

    OpenMP 언어 확장에 대한 5개 영역을 소개.

     

    http://sunyzero.egloos.com/4227785

    Posted by 혀나미
    ,

    >> Multi-core 프로그래밍 시작.

     

    컴퓨터의 성능이 발달되어 최근에 나오는 PC들은  Multi-core 프로세서를 기반으로 하고 있다. 이런 시스템 환경의 활용을 위한 프로그래밍 패러다임을 이해하고자 한다.

     

    개발 환경은 MS Visual Studio2010-beta를 기반으로 Multi-core 프로그래밍에 대한 정보를 수집 및 정리하고 공유하고자 한다.

     

    MSDN 참조 : http://msdn.microsoft.com/en-us/library/tt15eb9t(v=VS.100).aspx

     

     

    ** VS 2010에서 OpenMP사용을 위한 준비

     

    omp.h 헤드파일을 소스 상단에 포함하여야 하며, 프로젝터 설정에서 아래의 그림과 같이 Open MP Support에 대한 설정이 필요하다.

     

     

    ** OpenMP 처음 실행 하는 소스 작성

    다음과 같이 "omp.h"헤드파일을 포함 시키고 컴파일러 디렉티브인 "#pragma"를 정의하여 소스를 작성한다.

     

    #include "stdafx.h"
    #include <Windows.h>

    #include <omp.h>

     

    int _tmain(int argc, _TCHAR* argv[])
    {
     
      #pragma omp parallel
       printf("Mulicore procesing \n");

     

       getchar();

      

       return 0;
    }

     

    현재 실행한 시스템은 아래의 그림과 같이 Core 2 Duo 프로세서 환경에서 실행하였다.

     

     

     

     

     

     

     

    실행 결과는 다음과 같이 Multi-core처리 결과를 보여주고 있다. Duo프로세서 이므로 2개의 출력을 표시한다.

     

     

     

     

     

     

     

     

     

    간단히 개발 환경 설정 및 샘플 프로그램을 구성해보았다.

     

     

    Posted by 혀나미
    ,

    ** Message Queue

     msgQLib - message queue library

     

    ROUTINES

    msgQCreate( ) - create and initialize a message queue
    msgQDelete( ) - delete a message queue
    msgQSend( ) - send a message to a message queue
    msgQReceive( ) - receive a message from a message queue
    msgQNumMsgs( ) - get the number of messages queued to a message queue

     

    DESCRIPTION
    This library contains routines for creating and using message queues, the primary intertask communication mechanism within a single CPU. Message queues allow a variable number of messages (varying in length) to be queued in first-in-first-out (FIFO) order. Any task or interrupt service routine can send messages to a message queue. Any task can receive messages from a message queue. Multiple tasks can send to and receive from the same message queue. Full-duplex communication between two tasks generally requires two message queues, one for each direction.

    To provide message queue support for a system, VxWorks must be configured with the INCLUDE_MSG_Q component.


     

    msgQCreate( ) - create and initialize a message queue

     

    MSG_Q_ID msgQCreate
        (
        int maxMsgs,              /* max messages that can be queued */
        int maxMsgLength,         /* max bytes in a message */
        int options               /* message queue options */
        )

     

    msgQDelete( ) - delete a message queue

     

    STATUS msgQDelete
        (
        MSG_Q_ID msgQId           /* message queue to delete */
        )

     

    msgQSend( ) - send a message to a message queue

     

    STATUS msgQSend
        (
        MSG_Q_ID msgQId,          /* message queue on which to send */
        char *   buffer,          /* message to send */
        UINT     nBytes,          /* length of message */
        int      timeout,         /* ticks to wait */
        int      priority         /* MSG_PRI_NORMAL or MSG_PRI_URGENT */
        )

     

    msgQReceive( ) - receive a message from a message queue

     

    int msgQReceive
        (
        MSG_Q_ID msgQId,          /* message queue from which to receive */
        char *   buffer,          /* buffer to receive message */
        UINT     maxNBytes,       /* length of buffer */
        int      timeout          /* ticks to wait */
        )

     

    msgQNumMsgs( ) - get the number of messages queued to a message queue

     

    int msgQNumMsgs
        (
        MSG_Q_ID msgQId           /* message queue to examine */
        )

     

    Posted by 혀나미
    ,