Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| #include <opencv.hpp> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <cmath> | |
| #include <ctime> | |
| #include <string> | |
| #include <iostream> | |
| using namespace cv; | |
| using namespace std; |
| "vim: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| "neovim: curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| " Using vim-plug | |
| call plug#begin('~/.vim/plugged') | |
| " UI | |
| Plug 'iCyMind/NeoSolarized' | |
| Plug 'bronson/vim-trailing-whitespace' | |
| Plug 'machakann/vim-highlightedyank' |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| /* Our own header, to be included before all standard system headers */ | |
| #ifndef _APUE_H | |
| #define _APUE_H | |
| #if defined(SOLARIS) | |
| #define _XOPEN_SOURCE 500 /* Single UNIX Specification, Version 2 for Solaris 9 */ | |
| #define CMSG_LEN(x) _CMSG_DATA_ALIGN(sizeof(struct cmsghdr)+(x)) | |
| #elif !defined(BSD) | |
| #define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */ |
| /** | |
| * determines whether a string is numeric | |
| * LeetCode: http://oj.leetcode.com/problems/valid-number/ | |
| */ | |
| class Solution { | |
| public: | |
| bool isSign(const char c) { | |
| return c == '-' || c == '+'; | |
| } |
| class Solution { | |
| public: | |
| bool isNumber(const char *s) { | |
| if (!s) return false; | |
| bool sign = true; bool num = false; | |
| bool e = true; bool dot = true; int space = 0; | |
| char c; | |
| while (c=*s++) { | |
| if (c != ' ' && space == 2) return false; |
| #include <cstdio> | |
| #include <queue> | |
| #include <iostream> | |
| #include <string> | |
| #include <bitset> | |
| using namespace std; | |
| const int rows = 4, cols = 4; | |
| const int max_num = 1<<(rows * cols); |
| #include <cstdio> | |
| #include <queue> | |
| #include <iostream> | |
| #include <string> | |
| #include <cstring> | |
| #include <climits> | |
| using namespace std; | |
| const int rows = 4, cols = 5; |
| /** | |
| * Definition for an interval. | |
| * struct Interval { | |
| * int start; | |
| * int end; | |
| * Interval() : start(0), end(0) {} | |
| * Interval(int s, int e) : start(s), end(e) {} | |
| * }; | |
| */ | |