location ~ /.*\.md {
root /www/;
default_type text/html;
charset UTF-8;
add_before_body /strapdown/prepend;
add_after_body /strapdown/postpend;
| #ifndef _SINGLETON_H__ | |
| #define _SINGLETON_H__ | |
| #include <assert.h> | |
| template <typename T> class Singleton | |
| { | |
| protected: | |
| static T* ms_Singleton; | |
| public: | |
| Singleton( void ) |
| #!/bin/sh | |
| while [ $# -gt 0 ]; do | |
| case $1 in | |
| -u|--user) | |
| SSH_USER=$2 | |
| shift | |
| ;; | |
| -s|--ssh) | |
| SSH_ADDR=$2 |
| #if 0 | |
| g++ -std=c++17 -o a.out -Wall -Wextra $@ $0 || exit | |
| ./a.out | |
| rm -f a.out | |
| exit | |
| #endif | |
| #include <stdio.h> | |
| #include <vector> |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <errno.h> | |
| #include "net_addr.h" | |
| static int ipv4_aton(const char* str, uint8_t addr[4]) | |
| { | |
| const char* DIGIT = "0123456789"; |
| #!/usr/bin/lua | |
| local MOVEMS = 1500 | |
| local line = io.read('*l') | |
| while line do | |
| --local m = {string.match(line, '^([0-9][0-9]):([0-9][0-9]):([0-9][0-9]),([0-9]+) %-%-> ([0-9][0-9]):([0-9][0-9]):([0-9][0-9]),([0-9]+)$')} | |
| local mat = {string.match(line, "^(%d%d):(%d%d):(%d%d),(%d+) %-%-> (%d%d):(%d%d):(%d%d),(%d+)\r$")} | |
| if mat[1] then | |
| local d = {} |
| --- | |
| -- Lua min heap | |
| -- Based on http://lua-users.org/lists/lua-l/2007-07/msg00482.html | |
| -- @author Luis Carvalho <[email protected]> | |
| local assert, setmetatable = assert, setmetatable | |
| local M = {} | |
| local function push (h, k, v) |