Skip to content

Instantly share code, notes, and snippets.

@pk13610
pk13610 / pipe how to.md
Last active August 29, 2015 14:06
pipe 操作注意事项
@pk13610
pk13610 / timeout.py
Last active August 29, 2015 14:22 — forked from baojie/timeout.py
from functools import wraps
import errno
import os
import signal
import time
# timeout any function in given seconds
# solution from http://stackoverflow.com/questions/2281850/timeout-function-if-it-takes-too-long-to-finish
class TimeoutError(Exception):
#include <set>
#include <iostream>
struct MyStruct
{
int kk;
bool operator<(const MyStruct & right) const
{
return kk > right.kk;
@pk13610
pk13610 / ceate_files.cpp
Last active January 10, 2022 09:59
create files on windows
#define _CRT_SECURE_NO_WARNINGS
#include <chrono>
#include <string>
#include <string.h>
#include <iostream>
#include <fstream>
#include <sys/stat.h> // stat
#include <errno.h> // errno, ENOENT, EEXIST
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <process.h>
///////////////////////////1//1///111111/!
// crt_ begthrdex. cpp
// compile with: /MT