Skip to content

Instantly share code, notes, and snippets.

View htfy96's full-sized avatar
🐢
WFH

Zheng Luo htfy96

🐢
WFH
View GitHub Profile
set shell=/bin/bash
syntax on
if &term =~ '^\(xterm\|screen\)$' && $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
filetype on
filetype plugin on
set autoindent
set nolazyredraw
set number
#include <iostream>
#include <array>
#include <cassert>
using namespace std;
constexpr int f()
{
return 42;
}
@htfy96
htfy96 / tag.cpp
Created March 12, 2017 10:56
tag example
struct Class1
{
using Tag = Tag1;
};
struct Class1B
{
using Tag = Tag1;
};
@htfy96
htfy96 / c10k_read_list.md
Created January 21, 2017 08:22
c10k_read_list
@htfy96
htfy96 / user_defiend_literals.cpp
Created January 8, 2017 12:16
A use case of user defined literals in C++
#include <iostream>
#include <vector>
#include <utility>
#include <initializer_list>
#include <iterator>
#include <cassert>
#include <climits>
#include <map>
using namespace std;
@htfy96
htfy96 / link_aware.md
Created December 12, 2016 12:13
Link-aware job scheduling based on SDN
@htfy96
htfy96 / matrix_mult.cpp
Created December 2, 2016 08:13
Fast matrix multiplication with threads and AVX instructions
#include <iostream>
#include <cstddef>
#include <cstring>
#include <cstdlib>
#include <thread>
#include <functional>
#include <queue>
#include <chrono>
#include <mutex>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cstddef>
#include <csignal>
#include <cstdlib>
#include <unistd.h>
#include <sys/wait.h>
#include <string>
#include <vector>
@htfy96
htfy96 / htShell.cpp
Created November 6, 2016 13:32
Simple Toy shell
// Compile with -std=c++11 -pthread
#include <iostream>
#include <cstdio>
#include <cstddef>
#include <csignal>
#include <cstdlib>
#include <unistd.h>
#include <sys/wait.h>
@htfy96
htfy96 / 11.cpp
Last active October 6, 2016 13:20
// Compile this with C++11: -std=c++11
#include <utility>
#include <iostream>
#include <vector>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;