This file contains 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
#!/bin/bash | |
sed -E -e "s/^(=>)?\s+0x[a-z0-9]+\s+//g" -e "s/(<\+[0-9]+>:\s+)(\w+\s+)0x[0-9a-f]+ </\1\2</g" "$@" |
This file contains 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> | |
extern const char * pWeakValue; | |
static const char * pDefaultWeakValue = "nullptr"; | |
// #pragma comment(linker, "/alternatename:_pWeakValue=_pDefaultWeakValue") | |
#define DEFINE_WEAK(Type, Name) \ | |
extern Type Name; \ | |
static Type Name##Default; \ | |
__pragma(warning(push)) \ |
This file contains 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> | |
#define DEFINE_WEAK_VARIABLE(Type, Name) \ | |
extern "C" Type Name; \ | |
extern "C" Type Name##Default; \ | |
__pragma(comment(linker, "/alternatename:" #Name "=" #Name "Default")) \ | |
extern "C" Type Name##Default \ | |
#define DEFINE_WEAK_FUNCTION(Type, Name, Params) \ | |
extern "C" Type Name Params; \ |
This file contains 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 <type_traits> | |
// Primary template with a static assertion | |
// for a meaningful error message | |
// if it ever gets instantiated. | |
// We could leave it undefined if we didn't care. | |
#define DEFINE_HAS_METHOD(TraitsName, MethodName) \ |
This file contains 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
#!/usr/bin/env python3 | |
import glob | |
import os | |
import shutil | |
import subprocess | |
import sys | |
import rarfile |
This file contains 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
""" | |
NamedStruct, a combinationof struct and namedtuple in python, make code more readable. | |
You can access the fields by name rather than index. | |
""" | |
from __future__ import print_function | |
import struct | |
from collections import namedtuple |
This file contains 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
#!/usr/bin/env python | |
""" | |
Copy files inside a zip into another zip file without uncompress it ahead, improve the speed, | |
""" | |
import zipfile | |
def zipfile_get_entry(source, name): |
This file contains 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
#!/usr/bin/env python | |
import os | |
import sys | |
import re | |
import heapq | |
import subprocess | |
TOP_N=100 | |
MIN_ALLOC_BYTE=10*1024 |