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
- 동생과 같이 헬쓰를 다녀왔다. 서로에게 많은 자극이 되었던 거 같다. 오전 1시 17분
이 글은 muphy님의 미투데이 2007년 9월 21일 내용입니다.
번역이 아니라 직역 수준의 책을 읽다가 화가 나서 던져버렸다. 번역했던 분도 이해를 하면서 번역을 했던 걸까?
습작 수준의 레일즈 프로젝트를 하면서 좀 더 레일즈를 자유롭게 다루고 싶었고 루비와 레일즈의 간극을 메꾸기 위한 책을 찾던 중 제목부터 내 마음을 사로잡은 책을 발견했다. 책 이름 또한 멋지다."레일즈를 위한 루비"라니...
ROR 창시자마저 강력추천하고 저자 또한 루비 커뮤니티 리더로 소개되었으니 책 내용은 의심할 여지가 없다고 생각하고 바로 구매를 했다.
처음에 읽다가 참았다. 좀 나아지겠지.근데 기대는 실망으로 바뀌더니 급기야 89 페이지의 이 부분을 읽으면서 책을 던져버리고 말았다.
이하 본문이다.
"그렇다고 상투적인 것도 아니다. 그것은 레일스 프레임워크가 작동하도록 고안된 특성이다. 모든 레일스 프로젝트에서 하는 일(코드뿐만 아니라 구성과 설정까지)의 상세는 광범위한 제약사항과 자유도를 포함하는 세 가지 카테고리 중 하나에 속한다.
* 레일스의 규칙이 그렇게 하라고 되어 있기 때문에 특정 방법에 따라 행해야 하는 것들
* 하기 원하고,(상세한 부분에 있어 자유를 제공하는 반면) 레일스가 인프라를 제공하는 맞춤 방법
* 루비 언어를 사용한,원하는 대로 작성된 코드에 따른 제한없는 개선과 확장 "
머 이런 식이다. 괄호 부분은 아무래도 원서에는 관계 대명사로 쓰여진 걸로 추측된다. 괄호 부분이 상당히 많이 나온다.
내가 이렇게 화가 나는 이유는 다음과 같다.
- 일단 돈이 아깝다.
- 나같은 피해자를 막기위해 내 생애 첫 서평을 쓰려했으나 서평을 쓸 공간이 없다. 강컴에도 아이티씨 출판사에도 할 수 없이 번역하신 분의 블로그의 방명록에 글을 남겼다.
- 다른 누군가 좀 더 나은 번역을 할 기회를 빼앗았다.함께 산 실용주의 프로그래머 란 책과 참 비교된다.




이올린에 북마크하기
이올린에 추천하기