글

데이터 분석을 위한 환경 구축하기

이미지
데이터 분석을 위한 환경 구축 시작 데이터 분석을 위해 이용되는 도구들은 다양하나, 앞으로 ML과 관련한 부분도 함께 다루기 위해 Jupyter Notebook 기반의 GUI Tool 환경을 구축 하려고 합니다. 환경 구축 하기 가이드 : https://medium.com/@margaretmz/anaconda-jupyter-notebook-tensorflow-and-keras-b91f381405f8 가이드를 따르는 동안 발생한 문제 1. tensorflow 설치시 에러 $ pip install tensorflow Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow #python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl 해결 방법 https://www.tensorflow.org/install/pip https://stackoverflow.com/questions/38896424/tensorflow-not-found-using-pip 2. python version 안 맞아서 tensorflow import 시 에러 해결 방법 conda create -n [name] python=3.5 python 3.5.6 버젼으로 환경을 구성하면 이슈가 없음 3. tensorflow sample code 수행시 로그 메시지 발생 4. jupyter notebook 환경에서 tensorflow import 시 not found module 에러  해결방법 세팅한 환경 내에 jup...

Jerey Client 에서 HTTPS 사용하기

RESTful 구성시에 https 정보를 내려받는것을 진행해야 하는 경우가 있다. 이럴때 기존 Jersey Client 를 사용하였을 경우에는 정상 동작하지 않는데 이 이유는 TLS(SSL) 구간이 있기 때문이다. 이부분 처리를 위해 아래와 같은 코드를 작성하여 처리한다면 내용을 가져올 수 있게 된다. ===============================  Code ================================ // 이 옵션을 활성화 하여야 처리가 가능 System.setProperty("jsse.enableSNIExtension", "false"); ClientConfig config = new DefaultClientConfig(); HostnameVerifier hv = new HostnameVerifier() { public boolean verify(String hostname, SSLSession session) {                                 // slf4j 사용 logger.debug("hostname={}", hostname); return true; } }; try { // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) { } public ...

JTDS&Mabatis 에서 MSSQL NVARCHAR 처리

MSSQL을 사용할 때 인덱스가 걸려있는 VARCHAR 컬럼데이터를 조회시 NVARCHAR로 데이터를 넘길경우 인덱스가 걸리지 않아 성능에 문제가 발생하는 사례가 존재한다.  하여 보통은 jtds 드라이버 설정시  sendStringParametersAsUnicode=false  값을 주어 유니코드 처리하지 않게 함으로서 VARCHAR로 처리 되도록 하여 해결을 하고 있다.  근데 문제는  VARCHAR 와 NVARCHAR 가 섞여있을 경우에는 어떻게 해야 하는가?  사실 이문제는 아래와 같이 풀면 해결이 될거라고 생각했다.  1) 드라이버에서는 유니코드를 사용하지 않음 처리.      - sendStringParametersAsUnicode=false  2) mybatis mapper 에 jdbcType 을 부여     - #{column, jdbcType=NVARCHAR}  혹은 1)번을 부여하지 않고( default 는 sendStringParametersAsUnicode=true 이다. )  #{column, jdbcType=NVARCHAR} 와 #{column, jdbcType=VARCHAR} 를 명시해주면 되지 않을까?  라고 생각했었다.  하지만, 결론은 안된다는거...  그래서 jtds 드라이버 소스코드를 살펴 보았다.  역시...NVARCHAR 사용을 위한 setNString() 에서 아래와 같은 코드로 구현이 되어있었고,   [ JtdsCallableStatement.java ]   public void setNString(String parameterName, String value)           ...

Comet vs WebSocket

1. Comet a  web application  model in which a long-held  HTTP  request allows a  web server  to  push  data to a  browser , without the browser explicitly requesting it. (  http://en.wikipedia.org/wiki/Comet_(programming) ) Implementations 1) polling  2) long polling:  3) streaming : use chunked 2. WebSocket a web technology providing  full-duplex  communications channels over a single  TCP  connection (  http://en.wikipedia.org/wiki/WebSocket ) Features -  Like  TCP , WebSocket provides for  full-duplex  communication -  Websocket differs from TCP in that it enables a stream of messages instead of a stream of bytes WebSockets connection limit | Chromium | Chrome | Safari | Firefox | Opera | |      924      |    3237   |  2970  |   200    |   900    | ex) http://www....

Jetty

이미지
1. Jetty?  - HTTP server, HTTP client, and javax.servlet  container 2.  Features  - open source  - Small footprint  - Asynchronous (  http://wiki.eclipse.org/Jetty/Feature/Continuations )  - Enterprise scalable  - Embeddable (  http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty )  3. License  - Apache License 2.0  - Eclipse Public License 1.0 4. Owner  - <=6 codehaus   - 7 <= eclipse (  http://wiki.eclipse.org/Jetty/ ) 5. Architecture ( http://wiki.eclipse.org/Jetty/Reference/Jetty_Architecture )  - Conenctor SocketConnector  - for few busy connections or when NIO is not available BlockingChannelConnector  - for few busy connections when NIO is available( This connector uses efficient NIO buffers with a traditional b locking thread mode) SelectChannelConnector  - for many mostly idle connections or asynchronous handling of Ajax ...