• Installing R and scikit-learn on OSX with openblas

    For R, use homebrew. Don’t miss –with-openblas. In my own experience, using –with-openblas improved performance x20 on a benchmark. To install scikit-learn, use homebrew and pip. Again, –with-openblas improved performance x2 for my program.

    Tags:

  • Sorting two arrays at once in Python

    If two arrays should be sorted with the same criteria, use zip.

    Tags:

  • Linux Kernel 3.9 에서의 SO_REUSEPORT

    http://freeprogrammersblog.vhex.net/post/linux-39-introdued-new-way-of-writing-socket-servers/2 https://lwn.net/Articles/542629/ SO_REUSE_PORT를 사용해서 소켓을 만드는 프로세스를 여러개 띄우면 부모 process 역할은 커널이 알아서 한다. 이 때 어떤 child process가 요청을 처리할지도 공평하게 분배해서 workload의 분산이 잘 이루어짐. 이 방식이 정말 사용하기 쉬운게, 자식 프로세스는 필요하면 그냥 더 띄우기만 하면 되기 때문. 더구나 이건 pre-fork model이므로 접속이 있을때마다 자식 process를 띄우는 것에 비해 프로세스의 수나…

    Tags:

  • HTTPS상의 압축에 따른 취약점 공격: CRIME과 BREACH

    제가 SSL/TLS는 잘 몰라서 틀린점이 있을 수 있습니다. 그리고 편의를 위해 개략적으로만 설명합니다. CRIME의 기본 아이디어는 다음과 같습니다.. (편의를 위해 공격자: attacker, 악의적인 사이트: evil.com, 피해자: victim, 공격대상 사이트: target.com 의 용어를 사용) TLS상에 주고받는 데이터를 해독할 수는 없지만 주고받는 데이터의 크기는 알 수 있다고 가정. attacker가 사용자가 대상 사이트에 전송하는 데이터에 임의의 값을 삽입할…

    Tags:

  • (무료) R을 이용한 데이터 분석 실무 2013. 08. 13버젼 올렸습니다.

    http://r4pda.co.kr/ 에서 확인하실 수 있습니다. 언제부터인지 정확히 기억은 나지 않지만, 이 책을 쓰는 일이 벌써 대략 일년이나 된 작업이 되었습니다. 그간 총 4번에 걸쳐 파일을 업로드했고 매번 3개월 정도의 시간이 걸렸기 때문입니다. 그간 몇분들로부터 내용에 대한 피드백을 받기도 했고, 공유한 내용에 자체에 대해 감사 메일을 주신 분도 계셨습니다. 저로서도 그분들께, 그리고 별다른 말씀없으셨어도 다운받아 가신…

    Tags:

  • 더 빠른 모바일 사이트를 위한 구글의 가이드라인

    https://developers.google.com/speed/docs/insights/mobile DNS Lookup, TCP Connection, HTTP Request/Response에 600ms 가 소요되므로 1초안에 페이지를 로딩하려면 400ms안에 (서버/클라이언트) 렌더링이 끝나야함. 특히 다음에 유의: 1) 서버측 렌더링은 200ms 안에 종료할 것. 2) 리다이렉트는 최소화할 것 3) TCP Slowstart로 인해 congestion window가 커지기 전까지 총 10개의 TCP Packet(14KB)를 주고 받으므로 이 안에 ATF(above the fold)의 렌더링을 끝낼 것. 4) ATF에서…

    Tags:

  • Term의 분포

    Heaps law 코퍼스내 unique term의 수는 (문서의 길이)^b 에 비례. b는 보통 0.4-0.6사이의 수 Zipf’s Law 어떤 term의 빈도는 term빈도에따라 term들을 나열했을때의 랭킹에 반비례

    Tags:

  • Feature Selection

    This is great summary on the features selection: http://files.meetup.com/1225993/Deng_12_12_11_BARUG.pptx. It’s written by Houtao Deng who wrote Feature Selection via Regularized Trees(RRF). Here’s brief summary of the presentation: * Feature Selection Method – Univariate Filter: Information Gain, Chi-Squared – Multivariate Filter: CFS, FCBF – Wrapper Methods: LASSO, SVM-RFE, RF-RFE, RRF * Feature Selection Methods for Classifiers…

    Tags:

  • How to convert list of data frames into one data frame

    Problem to discuss is how to convert the following list of data frames into one data frame. One commonly known approach is to convert the list to vector using unlist(), and then convert to matrix, and then finally make it as data frame. But this has drawback as unlist() will perform type-coercion as vector can…

    Tags:

  • Converting JSON to Data Frame in R

    Here’s an example to load json objects into R’s data frame. You need some formatting of the json file contents if your file is not formatted nicely: Here’s how to for loading the file contents in such case: It takes a bit more effort if json object has some nested elements. This is one of…

    Tags: