• 맥에서 XQuartz 설치하는 방법은 아래와 같다.
    • 첫번째로, 터미널을 실행한 후, 다음과 같이 입력한다.
    • $ curl http://xquartz-dl.macosforge.org/SL/XQuartz-2.7.7.dmg -o /tmp/XQuartz.dmg

      $ open /tmp/XQuartz.dmg

    • 두번째로 파인터 (Finder)에서 XQuartz를 더블클릭한다.

      • "계속" 클릭.

      • "계속" 클릭.

      • "계속" 클릭.

      • "동의" 클릭.

      • "설치" 클릭.

      • 암호 입력 후, "소프트웨어 설치" 클릭.

      • (설치가 완료 되었습니다.) "닫기" 클릭.

      • (설치가 완료 되었기 때문에 XQuartz를 제거 한다.) 파인더 (Finder) 에서 XQuartz 제거.



'STUDY > Mac' 카테고리의 다른 글

[mac] 맥 파인더 미리보기 ( preview mac finder )  (0) 2016.10.29
Xcode란??  (0) 2013.01.09

옥타브 (Octave) 는 수치해석용 자유컴퓨터 소프트 웨어로서, MATLAB과 호솬성이 높다.

옥타브는 GNU 프로젝트의 하나이다.

옥타브는 매스매티카 같은 컴퓨터 대수 체계가 아니라 과학적 계산을 위한 도구이다.

제일 중요한건 Octave는 무료이다.

자세한 내용은 여기 (here).

'STUDY > Octave' 카테고리의 다른 글

옥타브 (Octave) 설치  (0) 2016.02.11

What is Unix ?

UNIX 운영 시스템은 프로그램들의 집합이다. 이 프로그램들은 컴퓨터와 사용자들을 연결해주는것과 같이 행동한다.

시스템 자원과 컴퓨터 내부의 모든 자세한 위치를 할당하는 컴퓨터 프로그램은 운영시스템 및 커널(kernel) 이라고 불려진다.

사용자들과 커널은 잘알려진 쉘 (shell)과 같은 프로그램을 통해서 의사소통한다. 쉘은 한 명령어 줄을 번역한다. 사용자에의한 명령어 입력이 커널이 이해하기 위한 언어로 변환된다.

    • Unix 는 1969년 AT&T의 직원 Bell Labs, Ken Thompson, Dennis Ritchie, Douglas McIlroy와 Joe Ossanna에 의해서 처음 개발되어졌다.

    • 다양한 Unix는 이 분야에서 다양하게 이용가능하다.  Solaris unix, AIX, HP Unix와 BSD이 대표적인 예제들이다. 리눅스 (Linux) 또한 Unix를 무료로 사용할 수 있는 방법이다.
    • 몇 몇 사람들은 동시에 한 UNIX컴퓨터를 사용할 수 있다. 따라서 Unix는 멀티 시스템이라고 불려진다.
    • 한 사용자는 또한 동시에 여러개의 프로그램을 실행시킬수 있어서 멀티 작업자라고도 불려진다.

Unix Architecture

여기 UNIX 시스템 기본 블럭 다이어그램이다.

주요 개념은 UNIX의 모든 버전들은 아래 네개가 기본이다.

    • Kernel : 커널 (kernel)은 운영시스템의 심장이다. 

'STUDY > UNIX' 카테고리의 다른 글

[Terminal] 새로운 파일 생성 (Creating New File)  (0) 2016.12.07
UNIX Tutorial  (0) 2016.02.06

  1. UNIX 지도서
    1. UNIX는 컴퓨터 운영체제 입니다. 이 운영체제는 동시에 여러명의 사용자가 사용할 수 있습니다. UNIX는 1969년 AT&T 벨 연구실 Ken Thompsom 과 Dennis Ritchie 시작하였습니다.
  2. 대상
    1. 이 지도서는 초보자들이 기본적이고 앞선 Unix 명령어들, 쉘 스크립팅과 다양한 유틸리티들을 이해를 도와주기 위해서 준비되었습니다.
  3. 사전에 필요한 것들
    1. 우리는 독자분들이 운영체제와 컴퓨터 기능에대한 기본 지식을 가지고 있을것이라 추측합니다. 다양한 컴퓨터상에 기본 지식은 독자분들의 이 기본 지도서에서 다양한 연습을통한 이해에 도움을 줄것입니다.
  4. Unix 쉘 프로그램 실행
    1. 만약 독자분들이 Unix/Linux 기본 명령어들과 쉘 스크립트를 배우기 원한다면, Unix/Linux를 설치하지 않으셔도 됩니다. CodingGround 에서 높은 수준의 서버를 독자분들의 프로그래밍 경험을 제공해드립니다. 이것은 무료이며 온라인에서만 제공해드립니다.



'STUDY > UNIX' 카테고리의 다른 글

[Terminal] 새로운 파일 생성 (Creating New File)  (0) 2016.12.07
What is Unix?  (0) 2016.02.10

#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <map>
#include <iterator>
#include <string>
#include <fstream>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <strings.h>
#include <memory.h>
#include <stdlib.h>

using namespace std;

typedef map<string, bool> FILE_LIST;

class CFileList
{
public:
    CFileList();
    ~CFileList();

public:
    bool GetFileList(FILE_LIST& list, string strDir); //디렉토리 및 파일목록을 구한다
    void ShowFileList(FILE_LIST& list);//리스트를 출력한다
};

CFileList::CFileList()
{
}

CFileList::~CFileList()
{
}

bool CFileList::GetFileList(FILE_LIST& list, string strDir)
{
    struct stat statinfo;
    memset(&statinfo, 0, sizeof(statinfo));
    lstat(strDir.c_str(), &statinfo);
    if(!S_ISDIR(statinfo.st_mode))
    {
        cout<<strDir + " is not directory"<<endl;
        return false;
    }

    DIR *dir;
    struct dirent *entry;

     if ((dir = opendir(strDir.c_str())) == NULL)
     {
         cout<<strDir + " open error"<<endl;
        return false;
     }

    while ((entry = readdir(dir)) != NULL)
    {
        memset(&statinfo, 0, sizeof(statinfo));
        string strFilePath = strDir + "/" + entry->d_name;
        while(strFilePath.find("//") != string::npos)
                strFilePath.replace(strFilePath.find("//"), 2, "/");

        lstat(strFilePath.c_str(), &statinfo);

        if(S_ISDIR(statinfo.st_mode)) // 디렉토리 이면
        {
            if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
                continue;

            list.insert(pair<string, bool>(strFilePath, true)); //디렉토리 경로를 넣음

 
            string strSubDir = strDir + "/" + entry->d_name;
            GetFileList(list, strSubDir); //디렉토리 안으로 들어감
        }
        else
        {
            //파일이면
            list.insert(pair<string, bool>(strFilePath, false)); //파일경로를 넣음
        }
    }

    //읽은 디렉토리 닫기
     closedir(dir);

    return true;
}

void CFileList::ShowFileList(FILE_LIST& list)
{
    //  특정 폴더 위치
    char path[] = "/media/HP01049471071/2015Y/Image/"; 
   
    FILE_LIST::iterator itr;
    cout << "[ShowFileList] : " << endl;
    for(itr = list.begin(); itr != list.end(); itr++)
    {
        if ( itr->second == true )
        {  
            //  exclude directory
            cout<<"[DIRECTORY] " + itr->first<<endl;
        }
        else
        {
            //  string to char
            char *fileName = new char[(itr->first).length()+1];
            strcpy(fileName,(itr->first).c_str()); 
           
            //  Make a command sentence
            char cmd[1024];
            sprintf(cmd, "mv %s %s", fileName, path );
            sprintf(cmd, "cp %s %s", fileName, path );

            //  move / copy
            system(cmd);

            //  release
            free(fileName);
        }
    }
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        cout<<"usage: filelist [directory path]"<<endl;
        return 1;
    }

    CFileList FileList;

    string strSrcDir = argv[1];

    FILE_LIST file_list;

    FileList.GetFileList(file_list, strSrcDir);
    FileList.ShowFileList(file_list);

    return 0;
}

//    폴더목록 출력(하위 디렉토리 포함)

#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <map>
#include <iterator>
#include <string>
#include <fstream>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <strings.h>
#include <memory.h>
#include <stdlib.h>

using namespace std;

typedef map<string, bool> FILE_LIST;

class CFileList
{
public:
    CFileList();
    ~CFileList();

public:
    bool GetFileList(FILE_LIST& list, string strDir); //디렉토리 및 파일목록을 구한다
    void ShowFileList(FILE_LIST& list);//리스트를 출력한다
};

CFileList::CFileList()
{
}

CFileList::~CFileList()
{
}

bool CFileList::GetFileList(FILE_LIST& list, string strDir)
{
    struct stat statinfo;
    memset(&statinfo, 0, sizeof(statinfo));
    lstat(strDir.c_str(), &statinfo);
    if(!S_ISDIR(statinfo.st_mode))
    {
        cout<<strDir + " is not directory"<<endl;
        return false;
    }

    DIR *dir;
    struct dirent *entry;

     if ((dir = opendir(strDir.c_str())) == NULL)
     {
         cout<<strDir + " open error"<<endl;
        return false;
     }

    while ((entry = readdir(dir)) != NULL)
    {
        memset(&statinfo, 0, sizeof(statinfo));
        string strFilePath = strDir + "/" + entry->d_name;
        while(strFilePath.find("//") != string::npos)
                strFilePath.replace(strFilePath.find("//"), 2, "/");

        lstat(strFilePath.c_str(), &statinfo);

        if(S_ISDIR(statinfo.st_mode)) // 디렉토리 이면
        {
            if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
                continue;


            list.insert(pair<string, bool>(strFilePath, true)); //디렉토리 경로를 넣음

            string strSubDir = strDir + "/" + entry->d_name;
            GetFileList(list, strSubDir); //디렉토리 안으로 들어감
        }
        else
        {
            //파일이면
            list.insert(pair<string, bool>(strFilePath, false)); //파일경로를 넣음
        }
    }

    //읽은 디렉토리 닫기
     closedir(dir);

    return true;
}

void CFileList::ShowFileList(FILE_LIST& list)
{
    FILE_LIST::iterator itr;
    for(itr = list.begin(); itr != list.end(); itr++)
    {
        if ( itr->second == true )
            cout<<"[DIRECTORY] " + itr->first<<endl;
        else
            cout<<"[FILE] " + itr->first<<endl;
    }
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        cout<<"usage: filelist [directory path]"<<endl;
        return 1;
    }

    CFileList FileList;

    string strSrcDir = argv[1];

    FILE_LIST file_list;

    FileList.GetFileList(file_list, strSrcDir);
    FileList.ShowFileList(file_list);

    return 0;
}

//    현재폴더 목록만 출력하는 소스

#include <stdio.h>
#include <unistd.h>
#include <dirent.h>


int main()
{
     DIR            *dir_info;
    struct dirent  *dir_entry;

    dir_info = opendir( ".");              // 현재 디렉토리를 열기
    if ( NULL != dir_info)
    {
        while( dir_entry   = readdir( dir_info))  // 디렉토리 안에 있는 모든 파일과 디렉토리 출력
        {
            printf( "%s\n", dir_entry->d_name);
        }
        closedir( dir_info);
    }
}



※※※※※※ 자세한 설명을 해드릴만큼 알지 못하며, Ubuntu에서 설치를 하고 작동하는것을 확인하는 단계입니다. 자세한 설명을 원하시면 OpenCV 공식 사이트에서 참조 하시기 바랍니다. ※※※※※※




  1. OpenCV install
    1. http://stackoverflow.com/questions/13904117/compiling-and-linking-opencv-in-ubuntu-12-04 에서 참조하였음.
    2.  sudo apt-get install libopencv-dev  
      1. sudo : Ubuntu에서 관리자 권한을 얻음. ( 암호를 알고 있어야 함.)
      2. apt-get install : 필요한 프로그램(libopencv-dev)을 설치하겠다.
      3. libopencv-dev : 설치할려고하는 파일 이름.
  2. 설치를 완료하였습니다.
  3. 이제 설치한 파일을 실행하겠습니다.
    1. g++이 설치가 안되어 있을 경우 설치한다.
      1.  sudo apt-get install g++  : 관리자 권한을 얻어서 g++을 설치한다.
    1. 필요한 예제 파일을 다운 받는다.
      1.  wget http://linux-projects.org/downloads/examples/opencv_test.cpp 
    2. 빌드 한다.
      1. http://elinux.org/Jetson/Installing_OpenCV 에서 참조하였음.
      2.  g++ opencv_test.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -o opencv_test  : 이 예제 프로그램에 한하여 빌드 옵션을 -lopencv_core -lopencv_imgproc -lopencv_highgui 를 사용하였으므로, 사용하는 프로그램에 따라 옵션을 달리 할경우가 많이 발생함.
    3. 프로그램을실행한다.
      1. 참고로 이 예제는 카메라를 필요로합니다 카메라를 연결하시고 사용하세요.
      2.  ./opencv_test 





여기( 영국, 본머스(Bournemouth) )와서 오늘 하루 느낀것....


Q. 대한민국은 주식이 계속 쌀이여야 하나?

  - 오늘 물음에 대한 궁금증을 계속 했던것은... 오늘 봤던것이 아래의 이미지의 모습이였다.


0


위의 이미지를 보면서, 우리나라도 이러한 공간이 있으면, ( 건설 업체들이 건물을 지을려나??? )

최소한 어린이 들이 한번은 뛰어 놀수 있고, 

한번은 더 친구들과 이야기를 할 수 있고, 

조금은 더 건강해 질 수 있고,

조금은 더 밝아 지지 않을까?


그런데 물음이 주식이 쌀이여야 하는가 였을까??? 

내생각은 우리나라의 평지는 도시와 공장들도 있지만, 

논( 쌀 생산 )이 지금의 반으로만 줄어도 위의 사진 같은것 과 주택이 해소 되지 않을까 해서이다. 고층건물( 아파트, 빌라 )로된 건물이 난 싫다. 그냥 전원주택 같은 건물이 좋다. 지금의 논이 반으로 줄어들게 된다면, 그런것을 누릴수 있지 않을까 해서이다. 


※ 참고로 저는 쌀을 개방하는 것을 전 적으로 반대하는 사람입니다. 쌀은 대한민국 국민의 대부분 사람들의 주식이다. 위에 언급한 내용은 지금 쌀을 먹기 싫어서 다른것을 먹거나, 한루 세끼를 꼭 쌀을 먹지 않아도 되는 사람들이 다른 것을 먹었을때에 해당하는 글이며, 대한민국 국민이 쌀을 먹는한 쌀을 자체적으로 생산하여야 한다고 생각하는 사람이다. 주식의 생산이 외국으로 넘어가게 되면, 우리는 나중에 감당할수없는 비용으로 식사를 할 수 밖에 없다고 생각한다. 


"cvCreateFileCapture_FFMPEG"이라는 단어를 검색하고 싶으면, 

다음과 같이 검색을 한다.

grep -e cvCreateFileCapture_FFMPEG /home/OpenCV/ -R


여기서 "grep"를 이용하여 "cvCreateFileCapture_FFMPEG"단어를 "/home/OpenCV/"에서 검색한다. 그냥 "/home/"에서만 검색하고 싶은 경우에는 "-R"를 제외시킨다.


또한 검색 결과를 파일로 저장하고 싶으면 아래와 같이 한다.

grep -e cvCreateFileCapture_FFMPEG /home/OpenCV/ -R >> result.txt


"result.txt"파일명으로 저장된다.

+ Recent posts