블로그 이미지
언제나 늘 푸른 소나무처럼. 자신의 의지로 오롯이 서기
예섬수진

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

Sublime Text2] Package Control

2012. 7. 6. 13:37 | Posted by 예섬수진

1. Package Control 메뉴 생성하기 

A. Console 창 열어, 명령어를 실행한다. 그 후, 툴을 재실행한다. 

a. Console 창 열기 : View > Show Console

b. 실행할 명령어

import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'


B. 재실행 결과, Preferences > Package Control과 Preferences > Package Settings라는 메뉴가 생긴다.


2. vi 명령어(ex> i, a, o, dw, dd) 사용하기

A. Preferences > Settings - Default 값 변경

a. Preferences > Settings - Default을 선택하여, 파일을 연다

b. 파일 하단부에서, ignored_packages의 값을 변경한다. 

 "ignored_packages": [""]


c. 파일 저장 후, 프로그램 재 실행


B. 값 변경 결과, [ESC]를 누르면 command mode로 변경된다. 


C. SublimeBlockCursor 설치 

a. 설치 이유 

- command mode 시 cursor가 _로 표시 되어, cursor의 위치를 파악하기 힘들다. 그래서 해당 package를 설치하여, cursor를 더 잘 보이도록 하였다. 

b. 설치 방법 

- Preferences > Package Control > Package Control : Install Package > SublimeBlockCursor 선택함


3. zen-coding 설치하기

- Preferences > Package Control를 이용하여 설치함. 


4. 현재 파일을 Browser에서 실행하기

A. 기본 Browser에서 실행하도록 Plugin 설정

a. Tools > New Plugin... 선택

b. 열려진 파일을 아래와 같이 수정하여, 저장함[파일명: OpenBrowserCommand.py]

import sublime, sublime_plugin
import webbrowser

class OpenBrowserCommand(sublime_plugin.TextCommand):
def run(self, edit):
url = self.view.file_name()
webbrowser.open_new(url) 


B. Plugin과 단축 키(Ctrl+Shift+b)가 연결되도록 설정

a. Tools > Command Palette... > Preferences: Key Bindings : User 선택

b. 열린 파일을 아래와 같이 수정한 뒤, 저장함

[
  {"keys":["ctrl+shift+b"], "command": "open_browser"}
]


C.  html 문서(*.html / *.htm) 작성 후, 단축키를 눌러 Web Browser로 실행한다.




* 참고 사이트 : http://juhoi.tistory.com/51


'컴퓨터 > Web Programming' 카테고리의 다른 글

html]새 창 띄우면서 링크하기  (1) 2010.02.01

C++]pure virtual function 컴파일 에러

2011. 4. 28. 00:09 | Posted by 예섬수진

Webkit gtk 소스 빌드 시, 아래와 같이 pure virtual function 관련 컴파일 에러를 발견하였다. 
 ../../Source/WebKit/gtk/webkit/webkitwebview.cpp:3496: error: cannot allocate an object of abstract type ‘WebKit::ChromeClient’
 ../../Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h:37: note:   because the following virtual functions are pure within ‘WebKit::ChromeClient’:
../../Source/WebCore/page/ChromeClient.h:229: note: virtual void WebCore::ChromeClient::enumerateChosenDirectory(const WTF::String&, WebCore::FileChooser*) 

확인 결과, pure virtual function을 가진 클래스는 객체를 생성할 수 없기 때문에 발생한 문제 였다. 

pure virtual function을 가진 클래스를 상속받을 경우, 모든 pure virtual function을 재정의하여야 한다. 그렇지 않으면 파생된 클래스 역시 pure virtual function을 가지므로, 객체를 생성할 수 없다. 

책에서만 보던 내용을 Webkit 빌드를 통해 알 수 있었다. 


 

Windows Phone 7]Getting Started

2011. 4. 21. 20:55 | Posted by 예섬수진
(1) Download and install the Windows Phone Developer Tools 
The Windows Phone Developer Tools includes the following
  • Visual Studio 2010 Express for Windows Phone
  • Windows Phone Emulator Resources
  • Silverlight 4 Tools For Visual Studio
  • XNA Game Studio 4.0
  • Microsoft Expression Blend for Windows Phone
 

(2) Download and install the Windows Phone Developer Tools Update

(3) Download and install the Windows Phone Developer Tools Fix

(4) For VS 2010 Express, we need to register product. 
   - Click "Help", then "Register Product" and follow the steps. 

※ Reference URI : APP HUB(http://create.msdn.com/en-us/home/getting_started)



Ubuntu]root 계정 비밀번호 설정하기

2011. 4. 14. 20:35 | Posted by 예섬수진
Ubuntu 설치 후, root 계정으로 로그인 하려고 하면 안된다. 

그 이유는 Linux를 설치하면서, root 계정에 대한 비밀번호를 지정하지 않았기 때문이다. 

Linux 설치 시, 생성한 계정으로 로그인 후, sudo passwd root를 이용하여 root 비밀번호를 설정해 보자. 


로그 아웃 이후, root 계정으로 로그인하면 된다. 

'컴퓨터 > Linux' 카테고리의 다른 글

Ubuntu 9.10]SMB 설정  (0) 2010.06.07
Ubuntu]vim을 이용한 환경 변수 설정(bash)  (0) 2010.05.21
Linux]current directory에 있는 파일 실행하기  (0) 2010.01.21
Linux Tip  (0) 2010.01.08
Linux]Change IP Address  (0) 2010.01.03

How to build EFL

2011. 3. 15. 22:00 | Posted by 예섬수진
1. apt-get install을 이용하여, 빌드에 필요한 Package 설치하기
  (1) apt-cache search를 이용한, package 이름 선택하기 
  (2) 설치할 Package List
[Mandatory]
  • subversion
  • gcc
  • autoconf 2.59 or better
  • automake 1.10 or better
  • libtool
  • make (gnu make)
  • gettext
  • libpam dev headers
  • libfreetype dev headers
  • libpng dev headers
  • libjpeg dev headers
  • zlib dev headers
  • libdbus dev headers
  • libblua 5.1 or better dev headers
  • libx11 dev headers
  • libxcursor dev headers
  • libxrender dev headers
  • libxrandr dev headers
  • libxfixes dev headers
  • libxdamage dev headers
  • libxcomposite dev headers
  • libxss dev headers
  • libxp dev headers
  • libxext dev headers
  • libxinerama dev headers
  • libxkbfile dev headers
  • libxtst dev headers

    [Optional] Build option에 따라 필요한 Package
  • libtiff dev headers (tiff loading support in evas)
  • librsvg dev headers (svg loading support in evas)
  • libungif dev headers (gif loading support in evas)
  • libcurl dev headers (http download/fetch support in ecore)
  • libgnutls dev headers (signed eet files, secure tcp connection support for ecore)
  • libasound2 dev headers (alsa sound card support in E17 mixer module)
2. EFL Code 받기 
    (1) EFL Library      
  • eina : Data Structure 
  • ecore : Event Loop
  • evas : Drawing Object이지만, Event를 받을 수 있음 
  • edje : Layout Engine이지만, Layout을 위한 Script까지 지원
    * eet : Layout Script를 Compie하기 위한 것
  • elementary : evas만으로는 Widget을 구성하기가 힘들어 만들어 짐
     * Button을 표현하기 위해서는, 여러 개의 evas object로 구성되어야 함
        Ex> Image, 글자, border 등  
    (2) EFL Code 받기 
     - 터미널 창에서, 아래 명령어를 이용하여 소스 코드를 받는다. 
svn co http://svn.enlightenment.org/svn/e/trunk
    * 명령어가 완료되면, trunk 폴더가 생긴다.

3. EFL 빌드
    (1) 각 Library Build 명령어 
       ./autogen.sh && make && sudo make install
    
    (2) Script를 이용한, Library 빌드 
#!/bin/sh
set -e
PREFIX="/usr/local"
PROJECTS="\
eina eet evas ecore embryo edje elementary"
SITE="svn.enlightenment.org"
SVN="http://$SITE/svn/e/trunk"
OPT="--prefix=$PREFIX"
#svn co $SVN
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
PATH="$PREFIX/bin:$PATH"
LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
for PROJ in $PROJECTS; do
  cd trunk/$PROJ
  make clean distclean || true
  ./autogen.sh $OPT
  make
  sudo make install
  cd ../..
  sudo ldconfig
done
 

'컴퓨터 > 기타' 카테고리의 다른 글

알고리즘]WERTYU  (0) 2011.02.08
Cairo]Hello, World  (0) 2010.08.11
OpenSource]Hwo to build Cairo  (0) 2010.08.09
단축키 모음  (0) 2010.06.08
Makefile 의문  (0) 2010.03.23

알고리즘]WERTYU

2011. 2. 8. 13:20 | Posted by 예섬수진

새해에는 하루에 한 개 씩 알고리즘 문제를 풀어 보기로 결심하였다.

한 달이 지난 지금.. 처음으로 알고리즘 문제를 풀어 보려고 한다. 

어떤 문제를 풀까.. 하고 알고리즘 책을 살펴보다가 쉬운 문제를 발견하였다.

자 문제부터 보자꾸나!! 


나는 아래와 같이, 대체할 문자 세트를 미리 준비해 놓고 치환하도록 했다. 핵심은 18~29 라인






'컴퓨터 > 기타' 카테고리의 다른 글

How to build EFL  (0) 2011.03.15
Cairo]Hello, World  (0) 2010.08.11
OpenSource]Hwo to build Cairo  (0) 2010.08.09
단축키 모음  (0) 2010.06.08
Makefile 의문  (0) 2010.03.23

Cairo]Hello, World

2010. 8. 11. 00:08 | Posted by 예섬수진
(1) Executed Result
  - A executable file will create png file which contains "Hello, world"

(2) Source code [hello.c]

(3) How to compile code
  1)  check if the system has pkg-config
    * you don't specify path of Cairo libraries and header files when you compile code using pkg-config
 
  2) set PKG_CONFIG_PATH environment variable
    a) for bash
       export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    b) for csh
setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig
 * How to check shell type : enter "echo $SHELL"
   3) compile hello.c
     a) for bash
       cc -o hello $(pkg-config --cflags --libs cairo) hello.c

      b) for csh
       cc -o hello `pkg-config --cflags --libs cairo` hello.c

      * After compile code, you can see created exe file (hello)

(4) Reference

'컴퓨터 > 기타' 카테고리의 다른 글

How to build EFL  (0) 2011.03.15
알고리즘]WERTYU  (0) 2011.02.08
OpenSource]Hwo to build Cairo  (0) 2010.08.09
단축키 모음  (0) 2010.06.08
Makefile 의문  (0) 2010.03.23

OpenSource]Hwo to build Cairo

2010. 8. 9. 23:57 | Posted by 예섬수진
1. Build Environment : Cent OS

2. Required package [you can download package using sudo apt-get install]
  - autoconf : make configuration file 
  - automake : create makefile using created configuration file 
  - libtool : support cross compile * originally, makefile does not consider cross compile
  - gettext

3. Download source codes with git
  - git clone git://anongit.freedesktop.org/git/cairo
  - git clone git://anongit.freedesktop.org/git/pixman.git
* To update source, you can use "git pull" command

4. Build source
  1) build pixman
    - In pixman folder, 
       a) run "./autogen.sh" to make config file and makefile
       b) run "make" to create obj files
       c) run "make install" to install shared object(=dll) on local PC [location : /usr/local/lib]
  
   2) build cairo  
    - In cairo folder, 
       a) run "./autogen.sh" to make config file and makefile
       b) run "make" to create obj files
       c) run "make install" to install shared object(=dll) on local PC [location : /usr/local/lib/cairo]

5. To run cairo using created library [so]
  - modify LD_LIBRARY_PATH variable
       export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

  * how to find required library on linux
      1. find library on specified path [ static ]  
      2. find library on LD_LIBRARY_PATH
      3. find library on system path
        => If system can not find library, system shows message [can not find specific so file]

'컴퓨터 > 기타' 카테고리의 다른 글

알고리즘]WERTYU  (0) 2011.02.08
Cairo]Hello, World  (0) 2010.08.11
단축키 모음  (0) 2010.06.08
Makefile 의문  (0) 2010.03.23
ODBC for MySQL  (1) 2010.02.07

Java]Convert byte to unsigned byte

2010. 7. 16. 23:18 | Posted by 예섬수진
Java에서 byte는 signed byte로 취급한다.  -> 7번째 Bit는 부호 비트가 됨

unsigned byte로 변환하기 위해서는, 아래와 같이 0xFF와 And 연산(&)을 하면 된다.
 1. 소스 코드
 2. 실행 결과 [signed data]
 -125  // 1000 0011
131     // 1000 0011

참고로, 각 자리의 bit 값을 알기 위해서는 다음과 같이 하면 된다.
 1. 소스 코드
 2. 실행 결과[unsigned data]
0th bit = 1
1th bit = 1
2th bit = 0
3th bit = 0
4th bit = 0
5th bit = 0
6th bit = 0
7th bit = 1


Java]Index를 이용한 String Parsing

2010. 7. 12. 22:46 | Posted by 예섬수진
예를 들어, 32Byte 문자열을 구분자 없이 16Byte씩 잘라내고 싶다면 ??

우리는 Java에서 String.substring()이라는 함수를 이용할 수 있다.
 1. String.substring 함수 원형
 


 2. Source Code
 


 3. Source Code의 실행 예제
 


 4. 만약 Code에서 2번째 라인을 originalStr.substring(0, 15)으로 변환한다면 ?