Shift+Space 한영 전환

from 분류없음 2015/12/21 15:39
처음에 그냥 윈도우를 설치할 때 타입3을 선택해 주면 된다. 그러나, 타입1로 설치하고 난 후에 다시 타입3으로 바꾸려면 따로 설정을 바꿀 수 없으므로 레지스트리를 수정해줘야 한다. 나 같은 경우 리눅스에 vmplayer를 설치하고 윈도우를 깔았는데, 한영키가 동작하지 않고, 오른쪽 Alt키를 눌러야 한영전환이 이루어진다. 그래서 그냥 shift+space로 바꾸려고 하는데, 방법을 찾지 못하다가 오늘 구글링으로 드디어 찾았다. 다음과 같이 해 주면 된다. 1. regedit을 실행한다. 2. \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters밑에 3. LayerDriver KOR의 “kdb101a.dll”을 “kdb101c.dll”로 바꾸고, 4. OverrideKeyboardSubtype을 DWORD로 추가하여 값을 5로 세팅한다. 이제 rebooting을 하고 나면 shift+space로 한영전환이 이루어진다.
2015/12/21 15:39 2015/12/21 15:39

Making git server

from Programming 2015/12/14 01:16
$ git clone --bare my_project my_project.git
$ scp -r my_project.git user@git.example.com:/directory/to/git
$ git clone user@git.example.com:/directory/to/git/my_project.git
2015/12/14 01:16 2015/12/14 01:16

Vec2 ? Point?

from Programming/cocos2d-x 2015/12/13 17:29
Point was refactored to Vector2 and then Vec2.
However, Point was already wide-spread, it was typedef-ed to Point in Vec2.h


2015/12/13 17:29 2015/12/13 17:29
Using camera
auto s= Director::getInstance()->getWinSize();
auto camera= Camera::createPerspective(60, (GLfloat)s.width/s.height, 1, 1000);

// set parameters for camera
camera->setPosition3D(Vec3(0, 100, 100));
camera->lookAt(Vec3(0, 0, 0), Vec3(0, 1, 0));

addChild(camera); // add camera to the scene
Creating orthogonal camera
auto s= Director::getInstance()->getWinSize();
auto camera= Camera::createOrthographic(s.width, s.height, 1, 1000);
Hide objects from camera
// camera
camera->setCameraFlag(CameraFlag::USER1);

// node
node->setCameraMask(CameraFlag::USER1);
2015/12/10 17:28 2015/12/10 17:28
Polygon Sprite and AutoPolygon
Check performance between normal sprite and polygon sprite (area to draw vs. function call count)
auto pinfo= AutoPolygon::generatePolygon("filename.png");
auto spp= Sprite::create(pinfo);
Touch event handling
Widget::TouchEventType
ui::Widget::TouchEventType::BEGAN
ui::Widget::TouchEventType::ENDED
LoadingBar
#include "ui/CocosGUI.h"

auto loadingBar= LoadingBar::create("LoadingBarFile.png");
// set the direction of the loading bars progress
loadingBar->setDirection(LoadingBar:::Direction::RIGHT);

this->addChild(loadingBar);

// something happened, change the percentage of the loading bar
loadingBar->setPercent(25);

// more things happened, change the percentage again
loadingBar->setPercent(35);
TextField
#include "ui/CocosGUI.h"

auto textField= TextField::create("", "Arial", 30);

textField->addTouchEventListener([&](Ref* sender, Widget::TouchEventType type) {
  std::cout << "editing a TextField" << std::endl;
});

// make this TextField password enabled
textField->setPasswordEnabled(true);

// set the maximum number of characters the user can enter for this TextField
textField->setMaxLength(10);

this->addChild(textField);
ParallaxNode
// create ParallaxNode
auto paraNode= ParallaxNode::create();

// background image is moved at a ratio of 0.4x, 0.5y
paraNode->addChild(background, -1, Vec2(0.4f, 0.5f), Vec2::ZERO);

// tiles are moved at a ratio of 2.2x, 1.0y
paraNode->addChild(middle_layer, 1, Vec2(2.2f, 1.0f), Vec2(0, -200));

// top image is moved at a ratio of 3.0x, 2.5y
paraNode->addChild(top_layer, 2, Vec2(3.0f, 2.5f), Vec2(200, 800));
5 types of event listeners
  1. EventListenerTouch - responds to touch events
  2. EventListenerKeyboard - responds to keyboard events
  3. EventListenerAcceleration - responds to accelerometer events
  4. EventListenerMouse - responds to mouse events
  5. EventListenerCustom - responds to custom events
EventDispatcher
  • A node of a lower value of FixedPriority receives events before nodes with higher values
  • SceneGraphPriority is a pointer to a Node. Event listeners with higher z-order values receives events before event listeners have lower z-order values.
Touch Events
// Create a "one by one" touch event listener
// (processes one touch at a time)
auto listener1= EventListenerTouchOneByOne::create();

// When "swallow touches" is true, then returning 'true' from the
// onTouchBegan method will "swallow" the touch event, preventing
// other listeners from using it
listener1->setSwallowTouches(true);

// trigger when you push down
listener1->onTouchBegan= [](Touch* touch, Event* event) {
  // your code
  return true; // if you are consuming it
});

// trigger when moving touch
listener1->onTouchMoved= [](Touch* touch, Event* event) {
  // your code
});

// trigger when you let up
listener1->onTouchEnded= [=](Touch* touch, Event* event) {
  // your code
});

// Add listener
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener1, this);
2015/12/07 10:29 2015/12/07 10:29

git commands

from 분류없음 2015/11/05 11:14
Git alias
$> git config --global alias.co checkout
$> git config --global alias.st status
$> git config --global alias.br branch
Update git upstream (tracking remote branch)
$> git branch -u origin/master
$> git branch -u origin/master <local_branch_name>
Clean up changes
$> git reset HEAD^
$> git checkout -- .
$> git clean -df
How to squash
Cherry-pick two changes
$> git rebase -i
Change second change from "pick" to "squash"
How to check out tag
$> git tag
$> git co -b <local_branch_name> <tag_name>
2015/11/05 11:14 2015/11/05 11:14

Vim plugins what I use

from Misc 2015/10/16 15:35
pathogen.vim
  • makes it super easy to install plugins and runtime files in their own private directories
  • Installation
    • $ mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -Lsso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
  • Run Path Manipulation
    • Add following to your .vimrc:execute pathogen#infect()
vim-sensible
  • Installation
    • $ cd ~/.vim/bundle && git clone https://github.com/tpope/vim-sensible.git
vim-airline
  • Installation
    • $ git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline
    • remember to run :Helptags to generate help tags
  • Configuration (.vimrc)
    • :help airline
    • set laststatus=2
    • let g:airline_powerline_fonts=1
    • let g:airline#extensions#tabline#enabled=1
    • let g:airline#extensions#tabline#fnamemode=":t"
    • let g:airline#extensions#branch#enabled=1
vim-fugitive
  • Installation
    • $ cd ~/.vim/bundle
    • $ git cline https://github.com/tpope/vim-fugitive.git
    • $ vim -u NONE -c "helptags vim-fugitive/doc" -c q
  • Configuration (.vimrc)
    • vnoremap b :Gblame<cr>
ctrlp.vim
  • Installation
    • $ cd ~/.vim
    • $ git clone https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim
    • $ vim -u NONE -c "helptags vbundle/ctrlp.vim/doc" -c q
  • Configuration (.vimrc)
    • set wildignore+=*/tmp/*,*.so,*.swp,*.zip
    • let g:ctrlp_working_path_mode='ra'
    • let g:ctrlp_custom_ignore='\v[\/]\.(git|hg|svn)$'
    • let g:ctrlp_user_command='find %s -type f'
vim buffer shortkeys
  • Configuration (.vimrc)
    • nmap <c-t> :enew<cr>
    • nmap <c-l> :bnext<cr>
    • nmap <c-h> :bprevious<cr>
powerline fonts
  • https://github.com/powerline/fonts
2015/10/16 15:35 2015/10/16 15:35
Following is my new .vimrc:
set nocompatible
scriptencoding utf-8
set modelines=5

set smart tab
set tabstop=4
set shiftwidth=4
set expand tab

set backspace=indent,eol,start
set nobackup
set history=50
set ruler
set showcmd
set incsearch
set cindent
set autoindent
set mouse=a
set scrolloff=5
set ignorecase
set showmatch
set nowrap
syn on
set background=dark
colorscheme solarized
set completeopt=menu,longest,preview
set confirm
set hls
set cursorline
set splitbelow
set splitright

"pathogen
execute pathogen#infect()

"vim-airline
let g:airline_powerline_fonts=1
let g:airline#extensions#branch#enabled=1
let g:airline#extensions#tabline#enabled=1
For the fancy status line, install vim-airline using vim-pathogen which is a vim plugin manager. To show git branches, install vim-fugitive To use special fonts modified for the powerline, install powerline-fonts. Then set the font of iTerm2 to one of those powerline-fonts. Enjoy Vimming~
2015/10/08 02:39 2015/10/08 02:39
  1. Click Start -> Run
  2. Type: regedit, and click OK
  3. Go to: HKEY_LOCAL_MACHINE -> System -> CurrentControlSet -> Control -> KeyBoard Layout
    Note: KeyBoard Layout, and not KeyBoard Layouts
  4. Right-click: Keyboard Layout, and select New -> Binary value
  5. Rename: New Value #1 -> Scancode Map
  6. Right click: Scancode Map -> Modify
    0000  00 00 00 00 00 00 00 00
    0008  03 00 00 00 1d 00 3a 00
    0010  3a 00 1d 00 00 00 00 00  
    0018
    
  7. Close regedit and restart your computer

from: http://www.kodiva.com/post/swapping-cap ··· rol-keys

2014/06/17 10:48 2014/06/17 10:48

지능적인 스팸 덧글

from Misc 2012/12/28 11:54

한 동안 블로그를 방치해 뒀더니 이상한 댓글들이 잔뜩 쌓여 있다. ㅋㅋㅋ
영어로 뭐 니 블로그 좋다, 사진 멋지다, 포스팅이 열라 맘에 든다 어쩌구 되어 있는데, 가만 보니 봇이 쫙 뿌린 티가 난다. 내용은 블로그 찬양, 그런데, 이름의 웹 주소가 광고하고자 하는 사이트를 가리키게 되어 있다. 헐~~

그래서 잔뜩 블로킹하고 삭제해 줬더니 이제 좀 나아 졌군. ㅋㅋㅋ

요즘, 너무 시간이 없어서 지원이 사진도 못 찍고, 블로그는 그냥 방치되고...에혀...

WP 사이트 하나 구축하고 싶은데, 시간이 없다...시간이...

2012/12/28 11:54 2012/12/28 11:54