Skip to content

Instantly share code, notes, and snippets.

View luoyetx's full-sized avatar

Jie Zhang luoyetx

View GitHub Profile
@luoyetx
luoyetx / mxnet.build.bat
Last active August 29, 2017 14:57
build mxnet on windows
call "C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/bin/mklvars.bat" intel64
cmake .. -DBLAS=MKL -DCUDA_TOOLKIT_ROOT_DIR="%CUDA_PATH%" -G "Visual Studio 14 2015 Win64"
# add c++11 flags for gcc
if (CMAKE_COMPILER_IS_GNUCXX)
set(ENABLE_CXX11 "-std=c++11")
if (GCC_VERSION VERSION_LESS 4.7)
set(ENABLE_CXX11 "-std=c++0x")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ENABLE_CXX11}")
endif()
#!/usr/bin/env python
import pdfkit
chapters = [
'intro',
'linear_algebra',
'prob',
'numerical',
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <stdio.h>
#include <string.h>
typedef struct {
@luoyetx
luoyetx / sleep.c
Created March 25, 2016 02:32
cross platform sleep function
#ifdef WIN32
#include <windows.h>
#define JDA_SLEEP(ms) Sleep(ms)
#else
#include <unistd.h>
#define JDA_SLEEP(ms) usleep(ms)
#endif
@luoyetx
luoyetx / 0_reuse_code.js
Created March 19, 2016 13:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
cmake .. -DBLAS=MKL -DMKL_INCLUDE_DIR="D:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016\windows\mkl\include" -DUSE_CUDA=OFF -DUSE_CUDNN=OFF
@luoyetx
luoyetx / eval_time_macros.c
Created January 11, 2016 01:43
time evaluation
#define TIMER_BEGIN { double __time__ = cv::getTickCount();
#define TIMER_NOW ((double(cv::getTickCount()) - __time__) / cv::getTickFrequency())
#define TIMER_END }
@luoyetx
luoyetx / ssh.md
Last active August 31, 2015 04:41
ssh for git

生成 key

ssh-keygen -t rsa -C "[email protected]"

将主目录下的 .ssh/id_rsa.pub 的内容上传到服务平台

@luoyetx
luoyetx / points.c
Last active March 6, 2016 14:56
learn c points in a weird way
#include <stdio.h>
int main(int argc, char *argv[]) {
int data[3][4] = {{1,2,3,4},{5,6,7,8},{9,10,11,12}};
int *p1 = (int *)data;
int **p2 = (int **)data;
int *************pn = (int *************)data;
printf("p1[3] = %d\n", p1[3]);
printf("p2[3] = %d\n", p2[3]);