2013년 7월 16일 화요일

emacs python할때 현재 폴더에 있는 모듈을 불러오지 못할때.

http://stackoverflow.com/questions/2658475/python-mode-import-problem

.emace.d/init.el에

(defun python-reinstate-current-directory ()
  "When running Python, add the current directory ('') to the head of sys.path.
For reasons unexplained, run-python passes arguments to the
interpreter that explicitly remove '' from sys.path. This means
that, for example, using `python-send-buffer' in a buffer
visiting a module's code will fail to find other modules in the
same directory.

Adding this function to `inferior-python-mode-hook' reinstates
the current directory in Python's search path."
  (python-send-string "sys.path[0:0] = ['']"))

(add-hook 'inferior-python-mode-hook 'python-reinstate-current-directory)

위와 같이 추가

2013년 6월 12일 수요일

jython setting

#!/bin/bash
.  /Users/skplanet/TOOL/grinder-3.11/bin/setGrinderEnv.sh

for jarfile in `ls $GRINDERPATH/lib/*.jar`; do
    CLASSPATH="$jarfile:$CLASSPATH"
done

export CLASSPATH

java -classpath $CLASSPATH  org.python.util.jython $1

2013년 5월 8일 수요일

mac os 에서 톰캣으로 돌릴때 java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence 나면 해결 방법

http://stackoverflow.com/questions/1663571/how-to-set-utf8-lang-on-tomcat-java-running-on-mac-os-10-5-8

CATALINA_OPTS="-Dfile.encoding=UTF-8"

2013년 4월 26일 금요일

thrift socket 서버를 sevlet으로 올리기


protected void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        TIOStreamTransport client= new TIOStreamTransport(request.getInputStream(),response.getOutputStream());

        userItemService = new UserItemServiceImpl();
        processor = new UserItemService.Processor<UserItemServiceImpl>(userItemService);

        TTransport inputTransport = inputTransportFactory.getTransport(client);
        TTransport outputTransport = outputTransportFactory.getTransport(client);
        TProtocol inputProtocol = inputProtocolFactory.getProtocol(inputTransport);
        TProtocol outputProtocol = outputProtocolFactory.getProtocol(outputTransport);

        try {
            processor.process(inputProtocol, outputProtocol);
        } catch (TException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

    }

2013년 4월 23일 화요일

erlang bench


1. Add concurix_runtime to your rebar.config file:
{concurix_runtime, ".*",
{git, "https://github.com/Concurix/cx_runtime.git"}}
2. Start the concurix_runtime system:
concurix_runtime:start()
3. Navigate to http://concurix.com/main/bench

http://www.erlang-factory.com/upload/presentations/747/ErlangConfTalk1v3final1.pdf

2013년 4월 8일 월요일

userdir 403 일때

권한을 다 열어도 안될때는

setsebool -P httpd_read_user_content on

jute 관련 요약

  • jute란 thrift, protocol buffer 란 비슷한걸로 생각하면 됨
  • 실행방법은 ant compile_jute하면 기본적인 자바는 생성됨
  • 그 외에 다른 부분들은 build파일 수정해서 하면 됨

최근에 소스 업데이트를 받고 보니 안되서 찾아보니 jute에 추가된 부분이 생성이 안되서 발생하는 문제.

build파일만 보면 된다. ㅡㅡa
  • src/generated 부분은 자바 클라이언트용으로 생성되는 자동 생성 되는 부분이다.
  • jute라고 해서  zookeeper 에서 클라이언트/서버 프로토콜로 사용하는 부분