This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifdef WIN32 | |
| #include <windows.h> | |
| #define JDA_SLEEP(ms) Sleep(ms) | |
| #else | |
| #include <unistd.h> | |
| #define JDA_SLEEP(ms) usleep(ms) | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import pdfkit | |
| chapters = [ | |
| 'intro', | |
| 'linear_algebra', | |
| 'prob', | |
| 'numerical', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <chrono> | |
| /*! \brief Timer */ | |
| class Timer { | |
| using Clock = std::chrono::high_resolution_clock; | |
| public: | |
| /*! \brief start or restart timer */ | |
| inline void Tic() { | |
| start_ = Clock::now(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <time.h> | |
| #include <stdio.h> | |
| #include <stdarg.h> | |
| void LOG(const char* fmt, ...) { | |
| va_list args; | |
| va_start(args, fmt); | |
| char msg[256]; | |
| vsprintf(msg, fmt, args); | |
| va_end(args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifdef DEBUG | |
| #define cudaCheckError(ans) { cudaAssert((ans), __FILE__, __LINE__); } | |
| inline void cudaAssert(cudaError_t code, const char *file, int line, bool abort=true) | |
| { | |
| if (code != cudaSuccess) | |
| { | |
| fprintf(stderr, "CUDA Error: %s at %s:%d\n", | |
| cudaGetErrorString(code), file, line); | |
| if (abort) exit(code); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme", | |
| "default_line_ending": "system", | |
| "font_size": 14, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], | |
| "tab_size": 2, | |
| "tabs_medium": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| ps = [ | |
| 0.0000008110673199286165000000000000000000, | |
| 0.0000162907226016170940000000000000000000, | |
| 0.0024177576053697383000000000000000000000, | |
| 0.0000000054649286143693143000000000000000, | |
| 0.0003272079103201879800000000000000000000, | |
| 0.0000000148552161462659780000000000000000, |