Skip to content

Instantly share code, notes, and snippets.

View EAirPeter's full-sized avatar

EAirPeter EAirPeter

View GitHub Profile
@EAirPeter
EAirPeter / sign-akmods.sh
Created March 2, 2018 13:05
Sign akmods automatically for Fedora 27.
#! /bin/bash
priv="/etc/pki/private/mok/signing_key.pem"
x509="/etc/pki/private/mok/signing_key.x509"
akdir="/var/cache/akmods"
kver="$(uname -r)"
sifi="/usr/src/kernels/${kver}/scripts/sign-file"
tmpf="/tmp/modsign_tmp.ko"
@EAirPeter
EAirPeter / gpacalc.cpp
Last active June 18, 2018 07:22
A GPA Calculator for HUST
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
inline double ToDouble(const string &sOrg)
try {
return stod(sOrg);
}
@EAirPeter
EAirPeter / SuffixArray-DC3.cpp
Last active November 25, 2017 12:09
An implementation of DC3 algorithm in C++98 (with non-standard long long which is assumed to be 64-bit long)
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <utility>
using namespace std;
typedef int I32;
typedef unsigned int U32;
typedef long long I64;
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "wldap32.lib")
#pragma comment(lib, "ws2_32.lib")
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/filesystem/fstream.hpp>
@EAirPeter
EAirPeter / AchSign.cpp
Last active July 1, 2017 16:43
AchSign
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/gil/image.hpp>
#include <boost/gil/extension/io/png_io.hpp>
#include <boost/lexical_cast.hpp>
#include <algorithm>
@EAirPeter
EAirPeter / AcAutomaton.cpp
Created May 16, 2017 14:35
Aho-Corasick Automaton
#include <cstdio>
#include <cstring>
using namespace std;
// AcAutomaton
struct tnode {
int s;
tnode *f, *w, *c[26];
@EAirPeter
EAirPeter / xenia.log
Created January 16, 2017 19:22
A log from Xenia when opening 4E4D0817.
i> 00004654 Build: detached / 9f5abb02b7c23850440588c8ba6d6405527b625e on Jan 15 2017
i> 00004654 Initializing Vulkan 1.0.0...
i> 00004654 Found 2 global layers:
i> 00004654 - VK_LAYER_NV_optimus (spec: 1.0.8, impl: 0.0.1)
i> 00004654 NVIDIA Optimus layer
i> 00004654 - VK_LAYER_VALVE_steam_overlay (spec: 1.0.3, impl: 0.0.1)
i> 00004654 Steam Overlay Layer
i> 00004654 Found 3 global extensions:
i> 00004654 - VK_KHR_surface (0.0.25)
i> 00004654 - VK_KHR_win32_surface (0.0.5)
@EAirPeter
EAirPeter / SeedCup2016.md
Created November 1, 2016 14:46
A simple document of SeedCup2016.cpp

其他队都错只有我们队

编译和运行

  • 编译
    • 使用GCC-5.1.0或者更高版本GCC进行编译。
    • 编译命令g++ -o SeedCup2016.exe -std=c++14 -O2 -DNDEBUG SeedCup2016.cpp
  • 运行
    • Bin文件夹中的SeedCup2016.exe是Windows平台下32位的可执行文件,如果需要其他平台下的可执行文件请自行编译。
    • 因为本程序仅使用了标准库,所以本程序的代码可以在任何能够编译ISO C++14的平台下编译运行。
    • 本程序将从当前目录下的input.txt中读入需要处理的C语言代码并进行分析,然后会将运行顺序输出到当前目录下的output.txt
@EAirPeter
EAirPeter / SeedCup2016.cpp
Created November 1, 2016 14:32
A simple C snippet simulator
// SeedCup2016.cpp
// Author: EAirPeter(violetcrestfall@hotmail.com)
// Date: 10/25/2016
// Compilation: g++ -o SeedCup2016.exe -std=c++14 -O2 -DNDEBUG SeedCup2016.cpp
// Description: This code is used for participating SeedCup2016.
#ifndef NDEBUG
# define NDEBUG
#endif
/*
* utils/ListG.inl
* Generating List.
* List: A double circular linked list.
*/
#ifndef LISTG_TNAME
# error LISTG_TNAME not defined.
#endif // ifndef LISTG_TNAME