Skip to content

Instantly share code, notes, and snippets.

View moehuster's full-sized avatar
🏠
Working from home

moehuster moehuster

🏠
Working from home
View GitHub Profile
@moehuster
moehuster / sort_json.cpp
Created December 12, 2019 12:02
sort_json by name
#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include <algorithm>
#include <iostream>
using namespace rapidjson;
int main () {
Document d;
@moehuster
moehuster / CertStore.cpp
Created December 3, 2019 13:03
CertStore.cpp
#include <stdio.h>
#include <windows.h>
#include <wincrypt.h>
#include <cryptuiapi.h>
#include <io.h>
#include <tchar.h>
#include <stdlib.h>
#pragma comment (lib, "crypt32.lib")
#include <tchar.h>
#include <Windows.h>
#include <tlhelp32.h>
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
bool findProcess(const TCHAR* processName)
{
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
HANDLE hProcess = INVALID_HANDLE_VALUE;
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
unsigned int get_rand(int x)
{
unsigned int i,res,mask=0;
if (x<=0) return 0;
for (i=0; x>=(1<<i); i++)
mask=(mask<<1)+1;
/*[*/#include<stdio.h>//
#include<stdlib.h>//]++++[->++[->+>++++<<]<][(c)2013]
#ifndef e//[o
#include<string.h>//]![misaka.c,size=3808,crc=d0ec3b36][
#define e 0x1//
typedef struct{int d,b,o,P;char*q,*p;}f;int p,q,d,b,_=0//|
#include __FILE__//]>>>[->+>++<<]<[-<<+>>>++<]>>+MISAKA*IMOUTO
#undef e//[->[-<<+<+<+>>>>]<<<<<++[->>+>>>+<<<<<]>+>+++>+++[>]]b
#define e(c)/**/if((_!=__LINE__?(_=__LINE__):0)){c;}//[20002,+[-.+]
,O,i=0,Q=sizeof(f);static f*P;static FILE*t;static const char*o[]={//
int clean_subdir(TCHAR *szPath)
{
HANDLE hFind;
BOOL bContinue = TRUE;
WIN32_FIND_DATA FindData;
TCHAR szFile[MAX_PATH];
wsprintf(szFile, TEXT("%s\\*"), szPath);
hFind = FindFirstFile(szFile, &FindData);
if (hFind==INVALID_HANDLE_VALUE)
// http://poj.org/problem?id=1051
#include <stdio.h>
#include <string.h>
char hash[32][6]={{".-"},{"-..."},{"-.-."},{"-.."},{"."},{"..-."},{"--."},
{"...."},{".."},{".---"},{"-.-"},{".-.."},{"--"},{"-."},
{"---"},{".--."},{"--.-"},{".-."},{"..."},{"-"},{"..-"},
{"...-"},{".--"},{"-..-"},{"-.--"},{"--.."},{"..--"},{".-.-"},
{"---."},{"----"}};
int len[32]={2,4,4,3,1,4,3,4,2,4,3,4,2,2,3,4,4,3,3,1,3,4,3,4,4,4,4,4,4,4};
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define LEN 10 /* 链表长度 */
#define MAX 99 /* 链表元素最大值 */
struct node {
int data;
struct node* next;
};
@moehuster
moehuster / war.c
Last active August 29, 2015 13:57
#include <cstdio>
#include <cstdlib>
#include <cstring>
int g_life[5]={0};
int red_next[5]={2,0,3,4,1};
int blue_next[5]={1,2,4,0,3};
const char* g_name[5]={"dragon","ninja","iceman","lion","wolf"};
struct warrior{
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <windows.h>
struct node {
int x;
int y;