잊지 않겠습니다.

'분류 전체보기'에 해당되는 글 430건

  1. 2009.01.07 SVC 설치법
  2. 2009.01.07 Binding Trac & SVN
  3. 2009.01.07 Thread vs Process (3)
  4. 2009.01.07 Thread vs Process (2)
  5. 2009.01.07 Thread vs Process (1)
  6. 2009.01.07 POP3 Message 포멧
  7. 2009.01.07 Intel Hex File 해석기
  8. 2009.01.07 IE와 FireFox 등의 Cross-browsing 문제
  9. 2009.01.07 Ruby Web Service Client
  10. 2009.01.07 Rails - 03. Active Record Relationship

SVC 설치법

기타 자료들 2009. 1. 7. 13:23
SubVersion 서버 설치 방법 :

1. 아파치 서버 또는 파일시스템 서버를 사용할 것인지를 결정
2. Repository를 작성시켜준다.
    svnadmin create c:\repository
3. password와 권한 설정을 시켜준다.
   권한은 none < read < write 순으로 된다.
4. Port를 설정시켜준다. Default 값은 3690 Port
5. svnserve를 실행
    svnserve -d -r c:\Repository

svn의 접속 :
  너무나 쉽다. 사용하기 쉬운것인 svn의 최대 강점인듯
 svn://IP주소/Repository 를 이용하면 아주 간단하게 svn에 접속 가능하다. 너무나 쉬워서 좋다. ^^


CollarLab의 SVN 사용법[영문]
CollabNet Subversion server installer for Windows
Version 1.4
Release Date: October 23, 2006
Contents
   1. Platform and configuration
   2. Overview
   3. Installation tips
   4. Post-installation instructions
   5. Limitations
   6. Making Subversion work for you
   7. About Subversion and CollabNet
   8. Support for CollabNet Subversion

1. Platform and configuration

   Product: CollabNet Subversion server 1.4
   Supported platform: Windows XP SP2
   Support: FSFS
   Apache Modules: ssl, mod_dav_svn, mod_dontdothat

   Pre-requisite: The user needs administrative privileges to install
                  and uninstall CollabNet Subversion.

2. Overview

   CollabNet Subversion is a free download of open-source Subversion,
   compiled and tested by CollabNet. For more information about
   CollabNet Subversion, visit http://open.collab.net, the online
   community dedicated to Subversion and CollabNet users. Register and
   get free member access to CollabNet Subversion add-ons and services,
   such as:
   - Commonly used GUI Clients
   - A free online training class
   - A support knowledge base
   - Peer to peer support forums
   - Best practices communities around Subversion
   - The openCollabNet Technical Newsletter
   - Release and patch notifications
   - Collaborative software projects
   If you are interested in professional services from CollabNet,
   the primary corporate sponsor of Subversion, go to:
   http://www.collab.net/subversion to read about:
   -  Technical support
   -  Online training
   -  Instructor-led training programs
   -  Migration services (from CVS, Microsoft VSS, etc.)
   -  Subversion consulting

3. Installation tips

     If you are installing an Apache server, the installer will ask you for a
     "Repository URL". This represents the prefix of the URL which users can
     use to connect to Subversion. If you set this URL to 'svn', then users
     will be able to checkout their repository from
        http://hostname/svn/repos-name
     We recommend that you use 'svn' as your URL prefix, as this is common
     practice.

4. Post-installation instructions

   A. Using svnserve
      ==============
   To use svnserve as your server, follow these steps:
     1. Open a new terminal (command prompt)
        NOTE: If you have an old command prompt open (from before Subversion
              was installed), remember to open a brand new command prompt.
     2. Create a subversion repository
        mkdir <Repository_Path>
        svnadmin create <Repository_Path>\<Repository_Name>
        E.g.
        mkdir C:\repositories
        svnadmin create C:\repositories\my-first-repos
     3. Setup a password database
        Edit the svnserve.conf file inside the conf directory of your
        repository using notepad.
        E.g. If your repository is C:\repositories\my-first-repos,
             svnserve.conf will be at
             C:\repositories\my-first-repos\conf\svnserve.conf
       Inside svnserve.conf, you will see the following information:
         ### The password-db option controls the location of the password
         ### database file.  Unless you specify a path starting with a /,
         ### the file's location is relative to the conf directory.
         ### Uncomment the line below to use the default password file.
         #password-db = passwd
       Follow the above instructions, and uncomment the "password-db=passwd"
       line, so that it simply says:
          password-db = passwd
     4. Setup some usernames and passwords
       Next, edit the 'passwd' file. This passwd file is located in the
       same directory as svnserve.conf.
       Inside the passwd file, you will see the following information:
       ### This file is an example password file for svnserve.
       ### Its format is similar to that of svnserve.conf. As shown in the
       ### example below it contains one section labelled [users].
       ### The name and password for each user follow, one account per line.
       [users]
       #harry = harryssecret
       #sally = sallyssecret
       To add a new user account, add your own username and password
       inside the [users] section. For example, if your name is "joe",
       and you want to set your password to "super-secret", add a
       new line like this:
         joe = super-secret
       Go ahead and add as many users as you like.

     5. Open Port on Windows firewall.

        Before starting the server, the firewall needs to be notified that
        this particular port is going to be used. To enable this port in the
        Windows firewall, please follow the instructions given in the below
        URL.
 http://www.microsoft.com/windowsxp/u...xceptions.mspx
        Note: svnserve.exe is the program name which needs to be added to the
        exceptions list. As an alternative, you can also use the port where
        you decide to run the server. By default, svnserve will be run on 3690.
     6. Start svnserve
        svnserve -d -r <Repository_Path>
        E.g. svnserve -d -r C:\repositories
     7. To provide read and write access to anonymous users, modify
        the conf/svnserve.conf file inside the repository.
        anon-access = write
        To restrict an anonymous user from the repository
        anon-access = none

     8. Checkout the repository
        svn co svn://localhost/<Repository_Name>
        E.g. svn co svn://localhost/my-first-repos
     Tip: If you are checking out your Subversion repository from a different
     computer, you should replace 'localhost' with the ip address or hostname
     of the machine which is hosting the Subversion repository.
     9. Setup svnserve so that it starts every time your computer starts
        Open the Windows Explorer and navigate to your CollabNet Subversion
        Server installation. By default, this path is:
           C:\Program Files\CollabNet Subversion Server
        Right click on the "svnserve" executable and select "Create new
        shortcut". A new "Shortcut to svnserve" will appear.

        Right click on this shortcut and select "Properties". Edit the
        "Target" field inside the "Shortcut" tab to match the svnserve
        command you typed in step 5.
        E.g. svnserve -d -r C:\repositories
        Right click on your shortcut again and select "Cut".
        Open the start menu and navigate to:
           All programs > Startup

        Right click on the "Startup" icon and select "Open All Users".
        The "Startup" folder will appear in a new Explorer window. Right click
        in this window and select "Paste".

   B. Using Apache
      ============
   To use Apache as your server, follow these steps:
     1. Open a new terminal (command prompt)
        NOTE: If you have an old command prompt open (from before Subversion
              was installed), remember to open a brand new command prompt.
     2. Configure Apache
        Edit the httpd.conf file inside the httpd\conf directory of your
        CollabNet Subversion Server installation using notepad.
        Tip: By default, httpd.conf will be in the following directory:
             C:\Program Files\CollabNet Subversion Server\httpd\conf\httpd.conf
        At the bottom of the httpd.conf file, you will see a directive that
        location directive that looks something like this:
          <Location /svn>
            DAV svn
            SVNParentPath C:\repositories
          </Location>

        Change the above section to look like the following:
          <Location /svn>
            DAV svn
            SVNParentPath C:\repositories
            SVNListParentPath On
            Require valid-user
            AuthType Basic
            AuthName "Subversion repository"
            AuthUserFile C:\repositories\password-file
          </Location>
     3. Create Subversion users
        You need to now create usernames with passwords, that could be used to
        authenticate with Apache. Use the htpasswd command to create usernames
        and passwords for the Apache server.
        Type the following at the command prompt.
          htpasswd -cm <password-file> <username>
        This command would prompt you for a password for the user. Enter the
        password and re-type the password when prompted.

        E.g. If you wish to create a user 'joe', and the file at
             "C:\repositories\password-file", type the following at the
             command prompt:
               htpasswd -cm C:\repositories\password-file joe
             Enter the desired password for the user and retype the password
             when prompted.

        Go ahead and add as many users as you like.
     4. Create a Subversion repository
        svnadmin create <Repository_Path>\<Repository_Name>
        E.g. svnadmin create C:\repositories\my-first-repos
     5. Open Port on Windows firewall.

        Before starting the server, the firewall needs to be notified that
        this particular port is going to be used. To enable this port in the
        Windows firewall, please follow the instructions given in the below
        URL.
 http://www.microsoft.com/windowsxp/u...xceptions.mspx
        Note: apache.exe is the program name which needs to be added to the
        exceptions list. As an alternative, you can also use the port where
        you decide to run the server. By default, apache will be run on 80.
     6. Start apache
        Type "apache" at the command prompt
     7. Checkout the repository
        svn co http://localhost/svn/<Repository_Name>
        E.g. svn co http://localhost/svn/my-first-repos
        Tip: If you are checking out your Subversion repository from a different
        computer, you should replace 'localhost' with the ip address or hostname
        of the machine which is hosting the Subversion repository.
     8. Setup apache so that it starts every time your computer starts
        Open the Windows Explorer and navigate to the httpd\bin directory
        in your CollabNet Subversion Server installation. By default, this
        path is:
          C:\Program Files\CollabNet Subversion Server\httpd\bin
        Right click on the Apache executable and select "Create new shortcut".
        A new "Shortcut to Apache" will appear. Right click on this shortcut and
        select "Cut".
        Open the start menu and navigate to:
           All programs > Startup

        Right click on the "Startup" icon and select "Open All Users".
        The Startup folder will appear in a new Explorer window. Right click
        in this window and select "Paste".     

5. Limitations

   * These installation instructions were written for Windows XP.
     We have not tested this installer on any other platforms at this time.
   * CollabNet Subversion does not support Berkeley DB based repositories.

6. Making Subversion work for you

   CollabNet extends Subversion with products such as CollabNet Enterprise
   Edition and Subversion on Demand. These are some of the features CollabNet
   products add:
   - X509 certificates, VPNs, leased lines and server data encryption.
   - Role-based Subversion access at the file, directory, operation and
     branch levels.
   - Highly configurable Web-based controls for project owners.
   - Improved search, data migration tools and repository synchronization.
   - Extensive scalability testing of Subversion to ensure it is
     enterprise-ready.
   To find out more about CollabNet solutions and how you can scale a
   Subversion implementation from version control to fully enabling
   distributed development teams, visit http://www.collab.net

7. About Subversion and CollabNet

   CollabNet launched the open-source Subversion project in 2000 in
   response to the demand for an open standard for Web-based software
   configuration management that could support distributed development.
   CollabNet continues to support the Subversion community with development
   resources and hosting. CollabNet also offers Subversion support, training
   and consulting services. CollabNet provides the most widely used
   collaborative development environment in the world. More than 800,000
   developers and IT projects managers collaborate online through CollabNet.
   The company is transforming the way software is being developed by enabling
   organizations to leverage global development talents to deliver better
   products and innovate faster. Using CollabNet Enterprise Edition, with
   Subversion at its core, project members can work as one team throughout the
   lifecycle of a project, regardless of their location. Unlike traditional
   software development tools, CollabNet supports globally distributed teams
   cost-effectively. The savings come from reduced development infrastructure
   costs, increased productivity, improved project visibility and shared access
   to software assets. Visit CollabNet at http://www.collab.net for general
   information.

8. Support for CollabNet Subversion

   You can get technical information and community support for Subversion
   at http://open.collab.net.
   Support for this CollabNet Subversion Installer is provided under the
   terms of your support agreement with CollabNet. For information about
   technical support from CollabNet, go to http://www.collab.net/subversion.
Posted by Y2K
,
설치 방법
  1. SVN 설치 : 직접 받아서 설치하는 것이 좋다.
  2. Python2.5 설치
  3. SVN, Python의 Path 등록
  4. PySQL의 설치
  5. EasyInstaller의 설치
  6. GenShi의 설치
  7. Trac 설치
  8. SVN-TRAC Bind ( easy_install -Z http://subversion.tigris.org/downloads/svn-python-1.4.3.win32-py2.5.exe )

trac bind를 잘 해주는 것이 중요. 오늘은 이것 빼먹어서 한참을 해맸다.

Trac 에서의 한글 처리 문제

문제점 : Trac 에서 한글화일 중 euc-kr 로 인코딩 된 화일을 볼 때 한글이 제대로 나오지 않는 현상

해결 : 해당 프로젝트의 trac.ini 화일의 default_charset 을 euc-kr 로 바꿔주면 됩니다.

Posted by Y2K
,

리눅스 쓰레드 만들기<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>

리눅스는 POSIX 쓰레드를 지원한다. 리눅스 쓰레드는 다음의 코드로 만들어진다:


리눅스에서 쓰레드 만들기

여기에서, t1은 쓰레드 ID를 받기위해 사용되는 매개변수이다. 두 번째 인자는 많은 스케쥴링 옵션을 지원하는 쓰레드 속성 인자이다. 우리는 여기서 디폴트 세팅을 사용할 것이다. 세 번째 인자는 쓰레드를 생성할 때 실행 될 서브루틴(subroutine)이다. 네 번째 인자는 서브루틴으로 전달된 포인터이다. 이것은 쓰레드나 새로 만들어진 쓰레드에 필요한 것을 위해 저장한 메모리를 지시할 수 있다.

리눅스 쓰레드는 서브루틴에서 리턴하거나 pthread_exit() 루틴을 호출하여 종료한다. 쓰레드가 가지고 있는 리소스는 부모 쓰레드가 pthread_join() 루틴을 호출할 때 회복된다. pthread_join()는 프로세스용 wait() 함수와 비슷하다.pthread_join()는 쓰레드에 의해 할당된 힙 메모리(heap memory)를 회복하지 않는다. 전역으로(globally) 할당된 메모리가 프로그램 또는 쓰레드에 의해 자유로워 져야 한다.


Windows 쓰레드 만들기

Windows 쓰레드는 Windows 프로세스를 만드는 것보다 훨씬 간단하다. 쓰레드를 만드는 데에는 리눅스에서 사용한 매개변수를 비롯하여 보안 디스크립터와 초기 스택 크기도 포함된다.


Windows
에서 쓰레드 만들기

첫 번째 인자는 보안 디스크립터 로서 쓰레드 핸들이 상속 될 수 있을 지의 여부를 결정한다. NULL 은 이것이 상속될 수 없다는 것을 의미한다. 두 번째 인자는 스택 사이즈이다. 세 번째와 네 번째 인자는 서브루틴과 패스된 매개변수이다. 다섯 번째 인자는 플래그 인자이다. 쓰레드는 플래그가 CREATE_SUSPENDED로 설정될 때 중지 상태에서 만들어진다. 여섯 번째 인자는 결과 쓰레드 ID를 시스템에 저장한 위치를 가리킨다.

Windows 쓰레드는 호출된 서브루틴에서 리턴하거나 ExitThread() API를 호출하여 종료한다. 부모는WaitForSingleObject(threadid)를 호출하여 쓰레드를 정리하거나 WaitForMultipleObjects() API를 사용하여 다중 이벤트를 기다릴 수 있다.

Posted by Y2K
,

이 번 칼럼에서 Edward G. Bradford 박사는 리눅스와 Windows 시스템에서 쓰레드 및 프로세스 관리에 초점을 맞추었다. 프로세스와 쓰레드의 차이점과 그들을 만들고 없애는 방법을 설명한다. 각자의 시스템에서 쓰레드 관리를 공부할 수 있는 적합한 프로그램도 만들어본다.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>

에 서 처음으로 프로그래밍 소켓을 살펴보고 단일 시스템 내에서 완전하게 작동하는 소켓 코드의 퍼포먼스도 측정했다. 측정 결과는 네트워크 전송 비율을 반영하지는 않지만 소켓용 최대 쓰루풋을 나타냈다. 이번 달 칼럼에서는 프로세스와 쓰레드를 생성하고 없애는 방법을 설명할 것이다. 쓰레드와 프로세스는 매우 유사하다. 리눅스에서, 쓰레드와 프로세스는 구별이 불가능하다.

  

프로세스(Processes)

프로세스는 리눅스와 Windows에서 모두 실행 프로그램을 뜻한다. Windows에서는 .exe 확장자가 있는 파일 이름이 실행파일이다. 프로세스는 소스 파일을 컴파일 하고 실행 파일을 생산함으로서 만들어진다. 컴파일 단계는 Windows와 리눅스 모두 비슷하다:


프로그램 컴파일하기

  

위 두개의 컴파일 결과는 create-pt2.exe (Windows)와, create-pt2 (리눅스)라는 실행파일이다.

프 로세스는 오픈 파일 핸들을 상속 받을 수 있다. Windows에서, 핸들이 작은 정수가 아니기 때문에 정확한 값은 알 수 없다. Windows에서 기존의 오픈 파일을 위해 핸들을 정확한 값으로 초기화 하는 것은 문서화된 프로시져가 아니다. 리눅스에서 파일 디스크립터(descriptor)를 20으로 설정하고 사용하는 것은 매우 쉽다.

일단 프로세스가 만들어지면 시작할 때 명령행에서 프로그램 이름을 타이핑 하면 된다. 리눅스와 Windows 모두 같다:


프로그램 실행하기

Windows 프로그램의 경우, .exe 서 픽스를 타이핑 할 필요가 없다. 프로그램이 실행권한이 있고 합법적인 Windows 바이너리 형식의 프로그램이라면 Windows는 모든 프로그램 이름을 실행 파일로서 인식한다. 따라서 나는 마이크로소프트 컴파일러의 아웃풋을 리눅스와 마찬가지로 create-pt2 라고 이름을 붙였다.

  

쓰레드(Threads)

쓰레드는 실행 콘텍스트(context)이다. 처음에 각 프로세스는 하나의 실행 콘텍스트를 갖는다. 이 실행 콘텍스트를 쓰레드라고 한다. 프로세스가 다른 실행 콘텍스트를 필요로 한다면 간단히 다른 프로세스를 만들 수 있다. 하지만 프로세스 생성은 프로세서 사이클과 메모리 사용의 관점에서 볼 때 사치스러운 일이다. 쓰레드는 다중 실행 콘텍스트를 만드는데 경량의(lightweight) 메커니즘을 제공하도록 되어있다. Windows와 리눅스는 한 쌍의 실행 환경을 제공할 목적으로 오퍼레이팅 시스템에서 쓰레드를 스케쥴링한다.

프 로세스와 쓰레드의 가장 뚜렷한 차이는 프로세스의 모든 쓰레드가 같은 메모리 공간과 시스템 정의의 "도구(facility)"를 공유한다는 점이다. 오픈 파일 핸들(파일 디스크립터), 공유 메모리, 프로세스 동기화 프리머티브(process synchronization primitives), 현재 디렉토리 등이 "도구"이다. 글로벌 메모리가 공유되고 새로운 메모리가 할당되지 않기 때문에 쓰레드를 만드는 것은 프로세스를 만드는 것보다 간단하고 빠르다.

Posted by Y2K
,

아파치 1.x 대 버전과 아파치 2.x 대 버전의 차이점이 이것이 아닐까 합니다. 프로세스로서의 아파치와 스레드로서의 아파치의 성능차이..
아파치 2.x 대 버전부터는 멀티스레드 기능이 추가되었다는 것 아시죠^^

프로세스


프로세스는 컴퓨터 내에서 실행중인 프로그램의 인스턴스이다. 이 용어는 몇몇 운영체계에서 사용되는, "태스크"라는 용어와 의미상으로 가깝다. 유닉스나 몇몇 다른 운영체계에서는, 프로그램이 시작되면 프로세스도 시작된다. 태스크와 마찬가지로, 프로세스는 그 프로세스가 추적 관리될 수 있게 하기 위한 특정한 데이터 셋이 관련되어 실행 중인 프로그램이다. 여러 명의 사용자들에 의해 공유되고 있는 응용프로그램은 일반적으로 각 사용자들의 실행단계에서 하나의 프로세스를 갖는다.

프로세스는 자프로세스라고도 불리는 서브프로세스를 시작시킬 수 있다. 자프로세스는 부프로세스의 복제로서 부프로세스의 자원을 일부 공유하는데, 부프로세스가 종료되면 더 이상 존재할 수 없다.

프로세스들은 몇 가지 IPC 방식을 통하여 정보를 교환하거나 그들의 연산을 동기화할 수 있다.


스레드


1. 유즈넷의 뉴스그룹이나 그와 비슷한 토론의 장에서, 스레드란 초기에 올려진 메시지에 대해 올라간 일련의 응답들을 의미한다. 스레드는 수없이 많은 뉴스그룹내의 각각의 토론들을, 추후에 관련 있는 것끼리 찾아서 이해하거나 또는 그 토론에 참여하는데 도움을 준다. 스레드는 보통 최초의 메시지 위에 관련되는 메시지들을 올려놓는 형식의 그림으로 표시된다.

2. 컴퓨터 프로그래밍에서, 스레드는 다수의 사용자들을 동시에 처리할 수 있는 프로그램이 각각의 사용과 관련하여 가지고 있는 정보들 말한다. 프로그램의 관점에서 보면, 스레드는 한 명의 개별 사용자 또는 특정한 서비스 요청을 서비스하는데 필요한 정보이다. 만약 다수의 사용자들이 그 프로그램을 쓰고 있거나, 또는 다른 프로그램들로부터 동시에 요청이 발생했을 때, 각각의 사용자나 프로그램들을 위해 스레드가 만들어지고, 또 유지된다. 스레드는 프로그램에게 현재 어떤 사용자가 서비스를 받고있는지를 파악하게 함으로써, 다른 사용자들을 위하여 재진입 해야할 것인지의 선택을 할 수 있도록 한다 (단방향 스레드 정보는 특별한 데이터 저장소 내에 그것을 저장하고, 데이터 저장소의 주소를 레지스터에 집어넣음으로써 유지된다. 운영체계는 항상 프로그램이 중단되었을 때 레지스터의 내용을 저장하며, 그리고 다시 제어권이 주어졌을 때 그 내용을 복구한다).

멀티스레딩과 멀티태스킹은 비슷해서 자주 혼동된다. 오늘날의 컴퓨터들은 한번에 단 한 개의 프로그램 명령어만을 수행할 수 있다. 그러나, 그들이 매우 빠르게 동작하기 때문에, 동시에 많은 프로그램들을 실행하고, 많은 사용자들을 서비스하는 것처럼 보이는 것 뿐이다. 윈도우95와 같은 운영체계는 각 프로그램에게 실행될 때 "순서"를 주는데, 다른 프로그램들은 자신들에게 순서가 돌아올 때까지 기다리게된다. 이 프로그램들 각각은 운영체계에 의해 일정량의 자원들이 관계되고 진행상황을 계속 알게되는 하나의 작업, 즉 태스크로 간주된다. 운영체계는 PC 시스템 내의 각 응용프로그램(스프레드시트, 워드 프로세서, 웹 브라우저 등)들을 각각의 별도 태스크로 관리하고, 사용자가 태스크 목록 내에서 그것들을 보거나 관리할 수 있도록 해준다. 만약 그 프로그램이 파일을 읽거나 프린터를 통해 출력하는 등 입출력 요청을 개시했다면, 입출력 작업이 끝났을 때 그 프로그램이 원래의 장소로 정확히 재진입할 수 있도록 하나의 스레드가 만들어진다. 그 동안, 그 프로그램을 동시에 이용하던 태스크들은 또다른 스레드들에서 유지되고 관리된다. 오늘날 대부분의 운영체계는 멀티태스킹과 멀티스레딩을 모두 지원한다. 그들은 또한, 프로그램 프로세스들 안에서 멀티스레딩을 허용함으로써, 그 시스템이 각 스레드를 위해 새로운 프로세스를 만드는데 생기는 추가부담을 줄일 수 있게 해준다.

POSIX.4a라는 C 언어 규격은 프로그래머가 프로그램 내에서 스레드 지원을 포함할 수 있도록 하는 일련의 응용프로그램 인터페이스(API)를 제공한다. 또한, 고급 프로그램개발 도구나 미들웨어에서도 스레드 관리를 편하게 할 수 있는 기능들을 제공하기도 한다. 객체지향 프로그래밍 언어들 역시 여러 가지 방법을 통해 멀티스레딩에 관한 편의를 제공하고 있다. 자바는 언어의 구문 내에 동기변경자를 포함하는 것으로, 또 멀티스레딩을 위해 개발된 클래스(이 클래스들은 다른 클래스들에 의해 상속될 수 있다)들을 제공하는 것으로, 그리고 다중 스레드를 위한 자투리 모으기를 후면에서 실행함으로써 멀티스레딩을 지원한다.

- 출처 http://www.terms.co.kr/ 에서 얻어옴 -

- 결론 -
프로세스는 하나의 프로세스를 처리 후 다음 프로세스 처리로 넘어갈 때 시간이 많이 걸리게 된다. 그러나, 스레드는 컴퓨터의 자원을 아주 조금 점유하므로 하나의 스레드 처리 후 다음 스레드 처리로 넘어가는 시간이 아주 짧다는 점이죠.

Posted by Y2K
,

POP3 Message 포멧

OS 자료들 2009. 1. 7. 13:21
  • 모든 OK Message는 +OK 로 시작
  • 모든 Error Message는 -ERR로 시작
  • Multi Line Message의 경우는 \n\r.\n\r로 종결 
  • Input Message는 모두 \n\r이 들어가면 Server단에서 판단.

Command

  1. STAT : POP3 접속 상태를 알려준다.
  2. USER : user id 입력
  3. PASS : user password 입력
  4. QUIT : 종결
  5. LIST : Message List 얻어내기[가장 오래된 List부터 정렬]
  6. RETR : Message 얻기
  7. DELE : Message 삭제
  8. UIDL : message의 UID를 얻는다. 

POP3 접속 -> 로그인 -> LIST -> RETR (number) -> DELETE (number) 순으로 매일을 얻어내게 된다.

Posted by Y2K
,
Intel CPU의 Hex data를 만들고, 그를 해석하는 구문.
Digital-BioTechnology에서 H/w Firmwareupdate를 위한 Hex File에 대한 구문 해석과 Serial Port를 통한 데이터 송신을 위한 Code.
C++과 STL을 이용해서 구문을 제작하였다. 

Posted by Y2K
,

:긁어온 글입니다. 내용이 너무나 맘에 들어서 혹시 페이지가 닫히면 어쩌나.. 하는 걱정에 들고왔습니다. ^^

(from http://blog.arzz.com/298)

[1]

IE6은 워낙에 문제가 많아, 각종핵과 온갖편법을 동원해야 그나마 FF과 비슷한 모양새를 만들 수 있었고, IE7은 몇가지 부분만 제외하곤 거의 FF와 비슷한 모양을 만들어낼 수 있습니다.

이번글에서 IE계열과 FF계열에서 똑같이 보이게 하기위한 몇가지 작은팁을 소개해 볼까 합니다. 경험에서 우러나온 것이다보니, 약간의 오류가 있을 수 도 있습니다.

하나, 문서타입을 HTML문서 최상단에 반드시 정의하자

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

위의소스처럼 현재문서가 어떤언어로 제작되었는지 DOCTYPE 을 정의해주어야 합니다.
사실 이 한줄로 대다수의 브라우져가 비슷하게 보이게 될 것입니다.
DOCTYPE이 정의되어 있지 않을경우, 각각의 브라우저마다 다른 기준으로 가지고 HTML문서를 랜더링 하기때문에 화면에 보이는 모습이 제각각일 수 밖에 없습니다.
DOCTYPE은 브라우져가 어떤방식으로 HTML을 해석할지 알려주는 중요한 부분이라고 할 수 있겠죠. 저기에 보이듯이 -//W3C//DTD XHTML 1.0 Transitional//EN 부분이 브라우져에게 XHTML 1.0 호환모드로 랜더링 해주세요. 라고 알려주는 부분입니다.
아래의 소스중 원하는 모드로 바꿔주시면 되겠습니다.
 물론 자신이 만든 HTML문서가 어떤모드에 최적화되어있는지부터 알아야겠죠?

HTML 4.01 호환모드
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
가장 최근의 CSS 규격을 따름. 엘리먼트 배치가 자유로움, 스크롤링 레이어 같은건 사용불가능, position, display 속성과 구현 방법의 차이가 상이, frame 사용 불가능

HTML 4.01 엄격모드
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
1999년 12월 24일 확정 규격. 권장하지 않는 element, attribute, frame 사용불가, 엘리먼트 배치가 엄격함, 일부태그가 완전히 먹통, 가장 이상적인 문서작성시 사용.

XHTML 1.0 호환모드
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtm...ansitional.dtd">
1999년 12월 24일 확정된 프레임문서. frameset이 사용가능. 하지만 넷스케이프.. FF(파이어폭스)쪽의 frame은 전혀 작동 되지 않음

XHTML 1.0 엄격모드
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

위의 소스들을 간략하게 해석하자만, "해당 문서 HTML출력용 문서이고 W3W의 HTML DTD 4.01을 기반(소스마다 기반이 다름)으로 (Transitional:호환/Strict:엄격)방식으로 랜더링하며 영어로 출력하며, http://www.w3.org/TR/html4/loose.dtd문서를 참고하면 된다. 라고 해석되어집니다.

여기서 Transitional은 DTD타입을 뜻하는 것으로 아래와 같은 단어로 바꾸어 사용할 수 있습니다.

Strict : 권장 표준안
Transitional : Strict 보단 완화된 표준안
Frameset : 프레임을 나눌경우 프레임페이지에 사용되는 표준안


두울, margin과 padding 등 의 기본값이 다른 브라우져들

줄간격, margin, padding의 기본값이 다른 브라우져들 때문에 컨텐츠의 높이가 달라서 문서전체, 또는 테이블의 높이 등을 맞추기가 힘든경우가 많습니다.
이럴경우에는 전체선택자를 이용하여 기본값을 정의해줍니다. (2008.01.23 23:40 수정)

* {padding:0px; margin:0px; line-height:100%;}


세엣, float 버그

IE의 버그를 해결하고, FF에 영향을 미치지 않도록 앞서 설명한 CSS핵을 이용해보도록 하겠습니다. 
참고 : 2008/01/15 - [이럴땐, 이렇게!/프로그래밍] - 많이 쓰이는 CSS 핵

IE6에서 대표적인 버그로는 float:left; 속성을 주었을때 margin 이 2배로 적용되는 것이 있다.
이를 해결하기위해 언더바(_)을 이용하여 잡아주면 해결됩니다.

.LayerFloatLeft {float:left; _display:inline;}

display 속성을 inline으로 잡아주면 해당버그가 고쳐지며, FF와 IE7에서는 float 이 정의되어있을때 자동으로 inline으로 인식하므로 정상적으로 동작하는 브라우져를 제외시키기 위하여 언더바핵을 사용해서 정의하였습니다.


네엣, input 태그의 아래위 여백문제
사용자 삽입 이미지

IE7에서도 FF과 다르게 input 태그 아래위로 여백이 들어가 있음을 알수있다.


위와 같은 문제를 해결하기 위해, 스타(*)핵을 이용하여 모든 IE계열에서 margin 값을 조정해주면 됩니다.
참고 : 2008/01/15 - [이럴땐, 이렇게!/프로그래밍] - 많이 쓰이는 CSS 핵

**html input, *html input {margin:-1px 0px -1px 0px;}



다섯, 테이블은 가급적 table-layout:fixed 를 사용해서 쓰자.

테이블의 가로폭은 브라우저마다 제각각입니다.(안타깝게도) 안의 내용에 따라 크기가 재정리될수도 있고, 크기가 늘어난다던가 세로가 변한다던가 등의 문제가 항상 머리를 아프게 하죠.

그때 테이블태그에 아래와같이 style 을 지정해두면, 정의한 사이즈가 고정이되며, 한줄한줄 보여지기때문에, 랜더링속도도 훨씬 빨라집니다.
한가지 주의할점은 아래소스를 쓸때 테이블의 제일 첫줄에 가로폭이 반드시 정의되어 있어야 한다는 점입니다.. (또는 아래 예처럼 <col> 태그를 사용해도 됩니다.)

<table style="table-layout:fixed;">
<col width="50%" /><col width="100" /><col width="20" />
<tr>
    <td></td>
    <td></td>
    <td></td>
</tr>
</table>


여섯, 이미지의 쓸데없는 공백문제

사용자 삽입 이미지

IE에서는 이미지 하단과 옆 일부분에 공백이 생겨있다.


위의 그림에서 볼 수 있듯이 IE에서는 <img> 태그에 정렬값(align)이 없을경우 저렇게 공백이 생겨버립니다. 이로인해 약 2~3px 의 공간차가 생겨버리게 되죠.
이럴경우 IE를 위해 아래와 같이 <img> 태그에 align 값을 넣어주면 해결됩니다.

<img src="주소" align="(middle:줄중간|top:줄상단|bottom:줄바닥|absmiddle:줄높이중간(?),단, absmiddle 은 비표준.)" />

2008.01.24 17:56 추가
UTF-8 모드에서 align 을 잘못사용시, Hover:underline 이벤트에 문제가 생길 수 있다고 합니다. (댓글참조)


일곱, TABLE에서 COL 태그와 padding 태그 사용에 따른 문제
사용자 삽입 이미지

padding 값에 따라 길이가 달라진다.


위와같이 FF는 COL 태그에 지정된 100px 에서 안쪽으로 10px 이 여백이 생겼고, IE는 지정된 100px에서 밖으로 10px의 여백이 생겼습니다.
이문제를 해결하려면 2가지 방법이있습니다.

IE에 맞추는 방법
<table>
<tr>
    <td style="width:100px; padding:5px;"></td>
</tr>
</table>

위의 소스처럼 하였을 경우에는 IE, FF 모두 100px 에서 바깥쪽으로 10px 이 증가하게 됩니다.
하지만 가로폭을 여백과 상관없이 꼭 100px로 맞추어야 한다면 아래와 같이 하면 됩니다.

FF에 맞추는 방법
<table style="table-layout:fixed">
<col width="100" />
<tr>
    <td><div style="padding:10px;"></div></td>
</tr>
</table>

위의 소스처럼 TD 엘리먼트안에 DIV나 TABLE을 하나더 넣어 그곳에 padding 값을 정의하면 FF에서처럼 IE도 100px 로 고정되게 됩니다.


IE와 FF에서 같게 보이는 것은 사실 웹표준을 맞춘다기보다 브라우저의 특성을 파악해 맞추는 작업이라는 의미가 강합니다.
완벽하게 웹표준을 맞춰 코딩을 해도, 브라우저의 해석여부에 따라 보이는 모습이 달라지기때문에, 결국 각각에 맞게 맞춰줄수밖에 없는 것이죠.

몇가지 IE와 FF 의 모습을 맞추는 방법을 소개했는데, 다음에 좀더 다양한 내용과 자바스크립트등의 내용을 포함하여 2탄을 준비해볼 생각입니다.

  

Posted by Y2K
,

[업어온 글 : 출처 http://kousenit.wordpress.com/2006/0...rvice-clients/

Yesterday I was in a Barnes and Noble bookstore and I started browsing through the Ruby Cookbook by Carlson and Richardson.

Quick aside: I still can’t believe how quickly Barnes and Noble has descended from a decent bookstore into practically garbage, especially as far as software development is concerned. The number of development books is down to a tiny fraction of that a few years ago, certainly no more than 5%. I was so happy when a BN opened in Glastonbury near my (old) house and unfortunately it’s still the closest bookstore to me, but now it’s just depressing. Even leaving aside the drop in selection, as Malcolm Gladwell points out in The Tipping Point, context matters. If nothing else, the managers of the store in Glastonbury could help themselves considerably if they would just oil the stupid door hinges (it’s been literally years since this was done) and clean the bathrooms every once in a while. If there was a Borders anywhere near them I’d never go in that store again.

Bruce Tate in his book Beyond Java points out that Java developers rarely look outside of Java because the field keeps moving so quickly they feel they have to run as fast as they can just to keep up. I really understand that feeling. At the end of December of 2005 I decided I was going to learn Ruby and Rails. I spent the next couple of months really digging into them and made a lot of progress. Ruby is sufficiently different from Java that it’s not at all an easy transition, though, despite what Rubyists say, and I learned just enough to get stuck on a regular basis.

Eventually I had to go back to Java, partly because I understand it and partly because it’s still paying the bills. I really need to become good at Hibernate, Spring, JSF, Tapestry, etc, and they all take time. Consequently, around the middle of March I switched gears and began really digging into Hibernate again, as I’ve mentioned here on several occasions.

Still, the allure of Ruby is strong. I think I may be past the newbie stage, but I’m hardly any good at it yet. On a scale from 1 to 10, I’d give myself about a 4, and that mostly based on reading rather than experience. I did read the pickaxe book (Programming Ruby by Dave Thomas) and R4R (Ruby for Rails by David Black) as well as the RoR books Agile Web Development with Rails (Dave Thomas again, among others) and a couple of the O’Reilly Rough Cuts. In other words, I’ve read the background material but haven’t yet gone through more than a couple of the Ten Canonical Errors in each technology.

Anyway, I mentioned here that about a week ago I decided to write a quick web service client for my Rensselaer students. I used the Amazon web service, connected with the URL class in Java, and parsed the resulting DOM tree (not fun). So yesterday I was browsing through the Ruby Cookbook, as I said, and found this code from Recipe 16.1:

require 'amazon/search'

$AWS_KEY = 'Your AWS key goes here' # See below.
def price_books(keyword)
  req = Amazon::Search::Request.new($AWS_KEY)
  req.keyword_search(keyword, 'books', Amazon::Search::LIGHT) do |product|
    newp = product.our_price || 'Not available'
    usedp = product.used_price || 'not available'
    puts "#{product.product_name}: #{newp} new, #{usedp} used."
  end
end

price_books(’ruby cookbook’)Wow. It depends on a third party library, but I found that easy to download and install. I tested it out using my RadRails editor and it worked like a charm, with all the product information already converted into a Product class.

Even more amazing is this little snippet from Recipe 16.7, Using a WSDL File to Make SOAP Calls Easier:

require 'soap/wsdlDriver'
wsdl = 'http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver

puts "Stock price: %.2f" % driver.getQuote('TR')

Holy cow. That’s three lines, really, and you can invoke a web service without even having to download the WSDL file. I wrapped it in a class and tried various web services at Xmethods.net and it worked without a problem. Not only that, but the “soap/wsdlDriver” library is built into Ruby 1.8.4.

I don’t even need a comment here. I simply have to find time to build up some experience with Ruby, and then go back to Rails, definitely by the time the next version of the AWDR book comes out. I purchase the “beta book” version from the Pragmatic Programmers already, but I think the hard copy becomes available in the Fall.

Posted by Y2K
,

Database에서의 각각의 객체간의 관계의 정의

belongs_to

1:N 관계에서 1을 나타낸다.

has_many

1:N 관계에서 N을 나타낸다.

class Slide < ActiveRecord::Base
  belongs_to :slideshow
  belongs_to :photo
end
class Photo < ActiveRecord::Base
  has_many :slides
  validates_presence_of :filename
end

  

class Slideshow < ActiveRecord::Base
  has_many :slides
end

  

has_one

1:1 관계를 나타낸다.

belogs_to, has_one을 이용 pair로 구성

  • belogs_to : 기본 Key가 있는 Table
  • has_one : 외래키가 있는 Table

  

Posted by Y2K
,