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
/* (c) 2012 Andrei Nigmatulin */ | |
/* Modifiers solym([email protected]) */ | |
/* 用于去除对 GLIBC 的高版本依赖,将高版本符号替换到低版本 */ | |
#include <elf.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> |
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
package main | |
import "log" | |
import "time" | |
import "sync" | |
var( | |
ch chan int | |
wg sync.WaitGroup | |
) |
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
/***************************************************************************** | |
文件: github_hosts_speed.go | |
描述: 获取 github 相关域名的 ip 地址 | |
作者: solym [email protected] | |
版本: 2020.04.27 | |
日期: 2020年4月27日 | |
历史: | |
*****************************************************************************/ | |
package main |
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
// solym | |
// [email protected] | |
// 2020年3月16日 20点28分 | |
#include <map> | |
#include <memory> | |
#include <mutex> | |
#include <condition_variable> | |
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 <iostream> | |
using namespace std; | |
struct Point { | |
double m_x; | |
double m_y; | |
}; | |
bool pointInPolygon( Point point, Point* vs, int length ) |
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 <iostream> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
string s1 = "Hello World"; | |
string s2 = "你好 美女"; | |
string* ps1 = &s1; |
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
#ifndef __L_Y_M_convenient__ | |
#define __L_Y_M_convenient__ | |
#include <type_traits> | |
namespace convenient | |
{ | |
// 限制值范围 | |
template<typename T> | |
T clamp(T minval, T val, T maxval) |
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 <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
#include <random> | |
int main() |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
// C++ 11支持强类型枚举和constexpr | |
enum EndianOrder : uint32_t{ | |
ENDIAN_BIG = 0x00010203, /* 大端序 ABCD */ | |
ENDIAN_LITTLE = 0x03020100, /* 小端序 DCBA */ | |
ENDIAN_BIG_WORD = 0x02030001, /* 中端序 CDAB, Honeywell 316 风格 */ | |
ENDIAN_LITTLE_WORD = 0x01000302 /* 中端序 BADC, PDP-11 风格 */ |