- 동생과 같이 헬쓰를 다녀왔다. 서로에게 많은 자극이 되었던 거 같다. 2007-09-21 01:17:05
이 글은 멉히님의 2007년 9월 21일의 미투데이 내용입니다.
기본 bjam 을 통해 생성하면 다중 쓰레드 버전(/MDD) 에 대한 링크만 되고 다중 쓰레드 (/MT)에 대한 라이브러리는 생성되지 않는다.
vs2005 로 /MT 옵션으로 빌드시 해당 라이브러리를 찾지 못하는 문제가 생긴다.
이 때 다음과 같은 명령어를 실행한다.
다운받은 부스트의 루트 디렉토리>bjam -d2 link=static runtime-link=static release
한참을 실행하면 (내 컴에서 약 10분) lib 디렉토리 밑에 static library 가 생성된다.
이제 /MT 옵션으로 빌드한 후
dependecy walker 를 통해 해당 dll 의 의존성으로 확인해보자.
First, I modifed the Chat sample from the WCF samples (TechnologySamples\Scenario\PeerChannel) with the following changes.
-
I changed the URI for the service to "net.p2p://eb2TechChatMesh/ServiceModelSamples/Chat" from "net.p2p://chatMesh/ServiceModelSamples/Chat" in the original instance.cs.
-
I build a NetPeerTcpBinding in code instead of a config file.
-
My binding instance resolver mode is Pnrp.
-
The IChat.Chat() implementation has been modified to send additional chats when a certain chat message is received from a specially named member.
(While the following is not precise, the scenario should give you an idea of what I'm doing.) I run the executable on two machines, A and B, at my home. I can chat normally with myself. Though I have nothing interesting to say, the messages are displayed on the console as expected.
I take machine B to a friend's house and start the chat program on machine A before I leave. Machine B never goes "online" (the chat program registers for IOnlineStatus.Online events). Any chat messages entered on B are not seen on A.
To help debug the problem, I also explicitly registered a name on machine A in a command console running netsh, say 0.eb2techTest. Lastly, I enabled WCF tracing.
At the friend's house on machine B and using netsh, I can resolve 0.eb2techchatmesh in the Global_ cloud. I see two IP addresses each for two nodes. I can also resolve the explicit registration 0.eb2techTest.
- netsh p2p pnrp peer resolve 0.eb2techchatmesh Global_ works on machine B.
-
netsh p2p pnrp diag ping host {IPv6 address of machine A registration} Global_ works on machine B.
-
netsh 2p2 pnrp peer resolve 0.eb2techTest Global_ works on machine B.
So, I don't believe the problem is PNRP.
If I examine the svclog for both A and B, I see EndpointNotFoundException exceptions in both logs. I get two sets, one for a net.tcp://{ipv4 address} and one for a net.tcp://{ipv6 address}. The TCP error code is 10060, which has text specifying the connected party did not respond in time or failed to respond.
While I expect the IPv4 attempts to fail, I didn't expect the IPv6 attempts to also fail. It is my (admittedly limited) understanding that Teredo is supposed to make this happen. I'm guessing I could use port forwarding with a UPnP gateway and use a IPv4 address for NetPeerTcpBinding.ListenIPAddress but I'm trying to avoid that. I suspect that I'm missing something.
링크:http://social.msdn.microsoft.com/Forums/en-US/peertopeer/thread/2b0f1217-8740-4dbb-a62c-a39cc1b6c760
1. 해당 URL 에서 Windows Server 2003 Resource Kit Tools 다운로드 및 실행
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
2 . 설치가 되면 설치된 디렉토리(C:\Program Files\Windows Resource Kits\Tools)에서 instsrv.exe, srvany.exe 를 C:\WINDOWS\system32 디렉토리에 복사한다.
3 . 다음의 형식으로 명령어를 수행
* C:\>instsrv [서비스이름] C:\WINDOWS\system32\srvany.exe
4. regedit를 실행하여 해당 서비스의 레지스트리를 찾는다.
* 레지스트리의 위치는 다음과 같다.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[서비스명]
5. 해당 서비스 이름 레지스트리에 "새로만들기 > 키" 를 선택한다. 키의 이름은 Parameters 로 한다.
6 .이번엔 생성된 Parameters에서 "새로만들기 > 문자열 값" 을 선택한다.
* 선택하자마자 이름을 변경할 수 있으며 (이후엔 변경이 불가능하다.) 이름을 Application 으로 한다.
* 만들어진 값을 더블클릭한 후, 값 데이터에 TOW의 실행 배치 파일 경로(ex]C:\경로\uc.bat)를 입력한다.
7. 다시 Parameters에서 "새로만들기 > 문자열 값" 을 선택한다.
* 선택하자마자 이름을 변경할 수 있으며 (이후엔 변경이 불가능하다.) 이름을 AppDirectory 으로 한다.
* 만들어진 값을 더블클릭한 후, 값 데이터에 배치 파일 내부에서 실행되는 실행파일들의 절대경로를 입력한다.
8. "시작 > 관리도구 > 서비스" 로 이동하면 입력했던 서비스 명으로 서비스가 생겼을 것이다.
9. 서비스를 더블 클릭하고, 시작 유형을 "자동" 으로 설정하고 "적용"한다. 서비스가 시작되지 않았으면 "시작" 버튼을 눌러 서비스를 수행한다.
출처 및 참고 URL:
http://silencer.tistory.com/30
http://www.youmean.pe.kr/tc/60?TSSESSIONwwwyoumeanpekrtc=69fe08a7181177101ca676c729379ffa
# -*- coding: utf-8 -*-
import random
trial_count = 10000
def execute_not_switch_game():
success_count = 0
for i in range(trial_count):
car_number = random.randint(1,3)
my_choice = random.randint(1,3)
if car_number == my_choice:
success_count +=1
return success_count
def execute_switch_Game():
success_count = 0
num = 6
for i in range(trial_count):
car_number = random.randint(1,3)
my_choice = random.randint(1,3)
if car_number == my_choice#:#무조건 바꾸는게 전제조건이므로 차를 골랐지만 바꿔야 되므로 실패
continue #따라서success_count 증가시키지 않는다.
showhost_choice = num-car_number-my_choice
switched_choice = num-my_choice-showhost_choice
if car_number == switched_choice:
success_count +=1
return success_count
print execute_not_switch_game(),execute_switch_Game()
어제 친구랑 술마시면서 좀 논쟁거리였음
나도 어제까지 헷갈렸는데 아침에 심심해서 코딩하다보니깐 정리가 되네 -_-; 신기해라
trial_count 값을 증가시켜서 테스트 할 수록 결과값은 1/3, 2/3에 가까워진다.
참고 링크
http://bklove.info/801
1. cx_Oracle 다운받아 설치
http://www.python.net/crew/atuining/cx_Oracle/
2. oracle instant client 다운
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
다운 받아서 system32 에 copy 하던가
압축푼 곳의 dll 화일있는곳을 환경변수로 등록
3. 연결해본다.
>>> import cx_Oracle
>>> cxO = cx_Oracle.makedsn("ip",port,"db")
>>> connection = cx_Oracle.connect("id","password",cxO)
sql 쿼리 example
http://www.orafaq.com/wiki/Python
1 .일단 이클립스 설치 3.3 이상에서 설치
- prerequisite
- jdk 1.5 이상
- 이클립스 다운로드 후 압축 해체
2. pydev plugin 설치
- prerequisite : python 설치 , 환경변수에 python path 추가(PYTHONPATH = C:\Python25;C:\Python25\Scripts;C:\Python25\Lib\site-packages;), path = %PYTHONPATH%
- Help->Software Updates->Find and Install
Search for new features to install->New Remote Site ->name : pydev,url : http://pydev.sourceforge.net/updates ->finish - Python Interpreter setting
Window->Preferences->Pydev->Interpreter - Python
New->Set c:\...\python25\python.exe
3 . turbogears 설치
4. turbogears debugging 하기
개인적으로 약 이틀의 삽질을 한 부분이다.
pydev 에서 사용하는 debugging 모듈은 eclipse 의 frame 기반 debugging 모듈이며 turbogears 의 debbugging 은 자체 모듈을 쓰기 때문에 pydev 의 디버깅, 즉 이클립스의 GUI 기반의 debugging 모듈은 제공하지 않는다.
따라서 이를 제공하기 위해서는 turbogears 의 디버깅 모듈을 disable 시켜서 pydev 디버깅모듈을 쓰도록 설정하여야 한다. 이를 위해서 turbogears 설치시 설치된 C:\Python25\Lib\site-package\DecoratorTools-1.7-py2.5.egg 를 압축을 풀어서 DecoratorTools-1.7\peak\util\decorators.py 의 소스를 수정하여야 한다.
소스 수정 방법은 http://pydev.blogspot.com/2007/06/why-cant-pydev-debugger-work-with.html 를 참조하여 세번째 방법으로 적용한다. 소스 적용 후 egg 로 압축하여 기존의 화일을 새로 압축된 DecoratorTools-1.7-py2.5.egg 화일로 대체한다.
대체 후 이클립스 상에서 python.exe 패스를 재설정해줘야 한다. pydev 개발자 말로는 path 를 caching 시켜서 그렇다고 한다.
window - > preferences -> pydev -> interpreter-Python ->remove ->new
나의 system pythonpath 는 다음과 같다.
참고 자료
http://groups.google.co.kr/group/turbogears/msg/2f75f4a6e94ef413
|
Tracked from fromnil's me2DAY | 2008/11/30 19:52 | DEL
pydev plugin |
|
Tracked from fromnil's me2DAY | 2008/11/30 19:52 | DEL
pydev plugin 설치 관련 글 |
|
Tracked from fromnil's me2DAY | 2008/11/30 19:52 | DEL
pydev plugin 설치 관련 |
- http://www.zdnet.co.kr/builder/dev/web/0,39031700,39160497,00.htm
http://blog.naver.com/kh2un?Redirect=Log&logNo=60024904555
http://blog.naver.com/trustmemsk?Redirect=Log&logNo=50004180860
http://www.ibm.com/developerworks/kr/library/wa-spring3/
http://www.ibm.com/developerworks/kr/library/j-sr2.html
cvs passwd -r kangnam-755 -a muphy



