Saturday, June 13, 2009

Sony MDR-E888LP


미역이가 추천한 이어폰.
Miyuk recommended this earphone.

싱가폴와서 처음으로 이어폰을 샀다. 이 나라 전자제품이 죄다 비싸서 망설였지만,
It's the first time to buy an earphone in Singapore. Most electronics are very expensive so that I've hesitated to buy it.

이어폰 없이 정처없이 걸어 다니기엔 너무 힘들었다.
But, it's too difficult to stroll. (So boring)

동봉해준 플라스틱 케이스가 맘에는 들지만 너무 커서 실용성이 떨어진다 -0-.
A plastic portable case is included. But, it's too big to carry it. Not useful.

그리고 왜이리 크냐. 가뜩이나 큰 내 귓구멍 더 늘릴 셈이냐.
In addition to this is a huge earphone. It will make my ear hole bigger already big.

이번 이어폰은 좀 망가지지 않고 오래갔으면 좋겠다.
I hope this earphone will be alive long long time without any break.

================================

사용결과!!!! 대박이네 이거!!! 나 같은 막귀도 느낄 수 있는 다른 음질!!! 뭔가 선명하다!!
After tying!!! It's nice!!! Even my poor ear can feel its different sound!!! Some thing clear!!!

Thursday, June 11, 2009

boost::thread - wakup threads

지난번 포스팅에 이은 boost::thread 관련 두번째.
The second posting is following the previous one.

이번에 얘기할 건, waiting - wakeup 방식의 thread scheduling 을 boost::thread 를 이용해서 하는 부분.
What I want to say, how to use 'waiting-wakeup' type threading model by 'boost::thread'.

waiting - wakeup 은 sleep - wakeup 이라고 말도 하고 다양한 용어가 있으니 아래 그림을 보고 이해하시길.
It may cause some confusing because of the name 'waiting - wakeup'. It's also called as 'sleep - wakeup' and more. To make sure understanding, I put a drawing below.




뭐, 흔한 방법 중 하나 이니 모르시는 분은 없을 듯. :) 대표적인 건 Open MP.
This is one of the common threading models. Most programmers probably know it. :)
One of the popular things is Open MP.

boost::thread 에서 thread 간 동기화는 기본적으로 mutex 와 condition 을 이용하는데, 이 경우에는 barrier 가 도움이 많이 된다.
Generally, we use 'mutex' and 'condition' for thread synchronization in the boost::thread.
In particular, 'barrier' is helpful for this case.

기본적인 thread 동기화는 다음과 같이 이루어진다. 참고로 모든 코드는 pseudo-code 로 작성됨.
A basic routine looks like the following codes. (Note: All codes are written as pseudo-codes)


boost::mutex mutex;
boost::condition condition;
...

[in a thread]
boost::
mutex::unique_lock lock(mutex);
...
condition.wait(lock);
...
do something

unique_lock, scoped_lock 등의 결정은 그 때 상황에 맞게 잘 조절.
You can choose 'scoped_lock' instead of 'unique_lock' if you want to do.

Windows 로 보면Event 로 보면 되고, Linux 에는 뭐 이름이 거의 같으므로 패스.
You can consider it as 'Event' in Windows OS, and you can just know it in Linux because its name is almost similar with them.

그런데 이것만으로 n 개의 slave threads 를 기다렸다가 wakeup 하는 구조를 짜기에는 코드가 지저분해진다.
However, it's not enough to make 'N threads waiting - wakeup' threading model. It may spoil your codes.

그래서 Windows 에 있는 Semaphore 와 거의 같은 동작을 하는 barrier 를 쓰면 쉽게 할 수 있다.
You can make it easy by using 'barrier' which works as 'Semaphore' in Windows.


boost::scoped_ptr[boost::barrier] barrier;
barrier.reset(new boost::barrier( Number of related threads));

[in a thread]
barrier.wait();

[in the other thread]
barrier.wait();

barrier 를 생성할 때 숫자를 넣는 데 이건 이 barrier 를 사용하게 되는 thread 의 숫자이다.
You need to pass a number when you create a barrier instance, which means the number of threads will use the barrier.

즉, 두 개의 threads 에서 barrier 를 access 한 다면 2 를 넘겨준다.
In other words, you need to pass '2' value if two threads access the barrier.

그러면 barrier.wait() 가 두번째 불릴 때 모든 barrier.wait() 가 return 되게 된다.
So, when the 'barrier.wait()' function is called twice, all threads wake up.

만약 1을 넣고 barrier.wait() 를 부르면? 그냥 아무일 없었다는 듯이 return 한다.
If you passed '1' value and the call 'barrier.wait(), nothing happens. Just go without any block.

또한, 숫자를 5 를 넣어놓고 barrier.wait() 를 4번만 불렀다면, 모든 thread 는 barrier.wait() 가 한번 더 불릴 때까지 무한 대기한다.
In addition, if you set '5' value and have called 'barrier.wait()' four times, all thread still be in waiting state until one more calling of 'barrier.wait()'.


Main thread 1개와 Slave thread 3 개를 위의 waiting - wakeup 방식으로 개발해보자.
Let's do it with one main thread and three slave threads.


SlaveThread::boost::mutex m_mutex;
SlaveThread::boost::condition m_condition;
void
SlaveThread::WakeUp() { m_condition.notify_one(); }
MainThread::boost::barrier m_barrier;

[in the main thread]
main loop
{
... // Do something
...
for_each(
WakeUp(threads) ); // Wake up all slaves
...
m_barrier.wait(); // Wait for slaves.
...
... // Do something
}

[in a slave thread]
thread loop
{
scoped_lock lock(m_
mutex);
m_condition.wait(lock); // Wait for a signal from the main thread.
... // Waked Up!!! Do something
...
mainthread::m_barrier.wait(); // Wait for the barrier.
}

뭐 이런식으로 짤 수 있겠다.
We can do that like this way.

하지만!!! 위의 방식에는 구조적인 문제가 있다.
But!!! The codes have a structural problem.

어떤 게 문제인지 함 맞춰보시길. :)
Can you find the problem? :)

Tuesday, June 9, 2009

boost::thread - mutex, condition, barrier.

어플리케이션을 여러 플랫폼에서 쓰이도록 만들고 있을 때 Thread를 써야 하는 상황이라면,
It is supposed to need to use a thread when you are developing a portable application,

ifdef 를 남발하거나, 자기만의 wrapper 클래스를 만들어 그안에서 ifdef 를 남발해야 하지만
You may use 'ifdef' macros, or you may use 'ifdef' macros internally in your own thread wrapper class.

boost::thread library 를 사용한다면 보다 간결하게 할 수 있음.
But, you can make it simple if you use the 'boost::thread' library.

(물론, boost::thread 가 겁나 좋다! 이걸 쓰자! 이런 얘기가 아님. -0-; 하나의 후보일 뿐.)
(Of course, I don't want to say that the 'boost::thread' library is pretty good, so you should use it!. No. It is just one of the candidates.)

boost::thread


thread 하면 빠질 수 없는 것이 동기화.
A synchronization is necessary in a threading.

boost::thread 가 지원하는 동기화 객체는 크게보면 세가지.
There are three important synchronization objects which we normaly use for the 'boost::thread'.

mutex, condition, barrier.

쓰이는 방법이 전통적인 pthread 형태를 닮았다.
The usuages of them are similary to a traditional way of the 'pthread'.

간단한 예제 (한글) :http://meat.tistory.com/186
A simple example. (in Korean)



헌데, boost 의 FAQ 에서도 확인할 수 있듯이, 동기화 지원이 상대적으로 빈약하기 그지없다.
By the way, as you can notice it in the FAQ of the 'boost', it's rather weak in a synchronization.

그 이유야 전체 플랫폼을 커버해야 하다보니 뭔가 부족한 부분이 있고,
The reason is that the 'boost' should support several platforms so that it might not much enough than the specific OS.

각 OS 에 특화된 최신 동기화 기술들을 쓸 수가 없다.
Also, it can't use the latest and specialized tech in each OS specific.

그러므로 고성능 어플리케이션을 제작할 때에는 사용을 다시한번 고려해볼 필요가 있다.
Therefore, you need to consider it again if you are developing a high-end application.

Thursday, June 4, 2009

Irina Sheik









압도적이란 말은 이럴 때 쓰라고 있는 거 같다.
When do we use 'absolutely' word? I think this is the time.

싱가폴 쇼핑거리에 있는 많고 많은 브랜드 중에서 이 모델이 모두를 압도하는 듯 하다.
This model is absolutely most attractive one for the entire models of various brands on a high street in Singapore.

이쁘다를 떠나서 '섹시함' 에 있어서는 진짜 대박이다.
For considering only 'Sexy', she is the best. ('Pretty' is different.)

내가 광고판 보고와서 꼭 검색해봐야지 라고 생각한게 30년만에 처음있는 일. 보통 귀차나서 절대 안할 일인데 말이지.
She let me search her information on the Internet. (That's the first time I've ever done) In most case,  I don't do that because of a troublesome.

하하하. 진짜 몸매가 말도 안된다. 이건 사기!
Ouch!! I don't believe in it. I can't. She is really awesome.


Guess. Spring 2009. Photoshoots Highlights


더 많은 정보는 여기서.
You can find more information about her as the following links.

Tuesday, June 2, 2009

Terminator 4



지난 토요일 밤. 심야영화로 30살 먹어서 처음으로 영화관에서 혼자서! 영화를 봤다.
I watched this movie last Saturday night. It's my first time which I watched a movie alone in a theater.

한국에서 먼저 개봉해버려서 이런 저런 평들이 많이 올라왔었다.
I can see lots of reviews because this movie already released in Korea.

재밌다 재미없다 말들이 많았지만, 나는 터미네이터의 팬! 무조건 보는 거다. 만들어준 거에 감사할 뿐이다.
I'm a fan of the Terminator series. That means I should watch it regardless of reviews which say it is interesting or not. I just wanna say thank you for this movie.

봤더니, 재밌자나 이거!!! 누구야 재미없다고 한 사람들. 허허. 어케 재미없을 수가 있찌.
At last I watched it. It's really interesting. Who said it's not interesting??? How could they say that?

작가가 스토리를 짜맞추려고 노력한 흔적이 엄청나게 보인다.
I could understand the entire story which the writers made it with his best effort.

베일형님도 배트맨하고는 다르게 연기하려고 노력하는 티가 팍팍 났다.
I also could see that Christian Bale had tried to act as Jon Conner who are different from the Batman.

하지만 정작 주인공은 마커스. ㅋ (샘 워싱턴)
But, the main character is Macus. (Sam Worthington) Funny. 

물론, 아쉬움은 있다. 터미네이터1, 2 에 비하면 그 임팩트가 부족하다. 뭔가 한방이 부족해.
Of course, it's not much enough than Terminator 1, 2. There are some lacks of somethings.

3는 열외. (I don't want to comment the Terminator 3.)
결말 부분도 아쉬움이 많긴했다. (The ending is too much NOT enough.)

그래도 충분히 재밌었고, 새로운 스토리로 이끌어 나가게 된 점이 좋았다.
I wanna say it can make you satisfied. And it can let itself follow a new story.

또한, 샘 워싱턴의 새로운 발견은 앞으로의 가능성을 충분히 보여준 것 같다.
In addition to Sam can do more and more. He may act more in lots of good movies near future.

아마 터미네이터의 이름을 달지 않고 새 시리즈로 나왔다면 훨씬 높은 점수를 받았을 듯 하다.
I guess it can get a higher grade if it didn't make its title related to the Terminator series.



아 그리고... 혼자보는 것도 그렇게 나쁘진 않더군. 심야니깐. ㅋ
Em.... It's not too much bad that watching a movie alone. Because it was at late night. :)


Common things

오늘 집에 오는 길에 눈에 띄는 문구를 봤다.
I saw an interesting sentence on a billboard while came back home.

"Melt wife's heart without melting your wallet."

... 와 이 얼마나 심금을 울리는 문구인가.
That's a definitely touching my heart.

예전에 미쿡 광고에서도 저런 비슷한 문구를 본 적이 있었는데,
I saw a similar sentence in a commercial advertisement of the united states a few years ago.

남자들의 고민은 세상 어디나 비슷한가보다.
I guess the consideration of male being is almost similar in the entire world.


그리고 또 하나 비슷한 거. 다음 광고를 보시라.
In addition to a similar thing. Please look the following commercial advertisement.



Sunday, May 31, 2009

Kimchi Gatsu Don

오늘은 김치가쯔돈을 만들어봤음.

이번에도 목표는 도시락이기 때문에, 많은 양을 요리!

이렇게 생겼음.




요리하는 데 무려 1시간 10분이나 걸렸음. ㅠㅠ

돈까스 굽는 데 시간이 35분 소요!!! 역시 힘들다.

뭐 돈까스 구우면서 빨래도 널고, 간단하게 청소도 하고 할일 다 했음.

그 후 김치와 깻잎을 겁나게 썰어서 볶으면서,

새송이버섯을 추가해서 같이 볶았음.

그 후 밥넣고 볶다가 계란 투하!!!

한입 먹어봤는데, 굿굿. 3~4 일치 도시락 완성!


====

전투가 끝난 후의 모습.




아 힘들다. ;;;

지금은 스파4 하면서 쉬고 있는 중.

좀 쉬고 다시 부엌에 가서 그릇에 나눠 넣어야 함. 아 귀차나~

Thursday, May 28, 2009

Bing

http://www.bing.com



A counter attack from MS!!!
As you see the trailer movie clip, you may feel it seems a kind of specified search engine.
It's more closer to a normal user than google's.
I think MS has referred to Naver search style.
And they've mixex a general search and naver's style and google's style. I think so.

I feel this search engine is quite good. 
Easier than google's. More comfortable than google's.
They also created a movie clip site (like youtube) and also created a map. (like google map)
Good, good, good.

However, I think the final winner may be still same. :)

Wednesday, May 27, 2009

Champions League 08~09

일찍 자다가 일어나서 보는 중.

우여곡절 끝에 채널을 찾아내서 지금 아랍방송으로 보는 중. -_-;

박지성 선발!!!! 이런 역사적인 순간이!!!

보통 때라면 바르샤를 응원했겠지만, 지성이가 나왔으니 무조건 지성이 응원.

아 에투 골... 이건 너무 어이없게 들어갔네.

루니 실수가 너무 많다.

중원에서 완전 밀리는 중. 캐릭과 안데르송 이놈들 왜이래. 스콜스 형님이 나와야 할 듯.

메시 이 개사기 녀석!! 말이 되냐 저 드리볼이!!!

샤비랑 이니에스타한테 완전 밀린 후 메시의 돌파....

지성이는 평이한 활약. 팀이 워낙에 밀리고 있어서 눈에잘 안 띄지만 실수 두어번. ㅠㅠ

날도는 공이 안와서 약올라 있는 중.

전반 끝. 아 메시 개사기!!!

이거 이런식이면 지성이 교체 확정인데...

후반에 다시 쓰겠음.

===============

후반.

아 테베즈 나오려고 하길래 지성이 빼는 줄 알았더니 안데르송 교체!!! 캬하하핫. 살았다 지성이.

지성이 왼쪽으로 이동. 국민브라와 다시 호흡.

샤비 프리킥 골대 강타. 헉헉.

루니는 계속 삽질중.

지성이는 공이 안온다.

앙리의 부드러운 터치와 드리볼은 예술이군.

점점 맨유가 살아나고는 있음. -> 이 말은 지성이 교체 예정... ㅠㅠ

쩝.. 결국 베르바랑 교체.

이러다가 동점만들면 지성이 불쌍해서 어째.

와 루니는 메시를 막을 수가 있구나. 몸빵으로.

지성이 나가니까 더 밀리는 맨유.

메시!!!!!!!!!!!!!!!!!!!!

아니 왜 샤비를 아무도 안막어 -_-;  날도 이색히 지성이 자리로 왔으면 수비를 해야할 거 아냐.

날도 이녀석 멘탈이 부족해. 약이 잔뜩 올라있어서 제 플레이를 못하고 있음.

스콜스형 분노의 십자꺽기!

반데사르가 벌써 세개째 막아주고 있음.. 반데사르 아니였으면 5:0 임.

바르샤 우승!!!!!!!!!!!!!!!!!!!!

앙횽 드디어 ㅜㅜ.... 감동의 앙횽

날도 울라그러네.

오늘의 패인은 긱스-캐릭-안데르송 조합을 내세운 퍼거슨 영감탱이!!!

우승컵에 팀 이름 새기는 걸 손으로 직접하는구나 -0-;

와 근데 겁나 잘 새기네.

샤비랑 이니에스타를 압박을 못했던 것이 가장 컸다.

그러니 에투, 메시, 앙리가 날라다니지.

그러고보면 첼시가 정말 잘했었음. 에시앙과 발락 같은 애들이 맨유에도 있었더라면...

메시 겁나 우네 ㅋ

세리에는 카메라워크가 진짜 역동적임. 게임보는 거 같음.

앙횽 너무 좋아한다~

맨유의 가장많이 뛴 선수가 리오 퍼디난드임. 아 진짜 미들진 뭐한거야!!! (바르샤는 샤비가 1등)

영감탱이 넋을 잃었음.

에투의 벼락슛이 참 컸음. 그 이후로 바르샤는 패스 플레이가 살아남.

날도 이거 프리메가로 가버리는 거 아냐.

==============

축하한다 바르샤.

지성이는 수고많았다. 아쉽겠지만 다음 기회를 노리자.

Tuesday, May 26, 2009

Lunch boxes




도시락을 만들어봤다.
최근에 종종 (스팸, 남은 소고기 등을 이용해서) 만들고 있는데,
이번에는 집에서 온 재료를 제대로 활용했다.

먼저 김치를 볶고, 깻잎을 잘라서 (많은 양) 같이 볶았다.
집에서 온 소불고기(양념된 거) 를 넣고 볶으면 국물도 같이 생기게 되는데,
이를 약간 오래 익힌 후, 고기를 잘게 잘라주었다.
양념된 소불고기에는 양파, 버섯, 당근, 마늘 등이 종합해서 들어있었다. 최고.
그 후 밥을 넣고 볶다가 계란까지 추가해서 완성된 볶음밥.

3일치 점심식사 완성~

불고기 감사합니다. 어무이.