Skip to content

Instantly share code, notes, and snippets.

@srayuws
srayuws / keyevent.c
Created March 6, 2020 09:01
Code to reproduce.
#include <stdio.h>
#include <windows.h>
int main()
{
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);;
INPUT_RECORD irInBuf[128];
DWORD i,cNumRead;
bool exit = false;
printf("Try to press some key\n");

#SS数据备忘

备忘笔记,任何错误均不负责。

  1. 明文内容
  2. 密文内容
  3. 通讯模型

##明文 SS 的明文数据结构上类似 socks5 协议中描述的数据结构。但是更加简单。SS省略了 socks5 的握手环节。客户端直接把要发的 TCP 包内容写给了服务器。

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
//#define DEBUG
#ifndef DEBUG
#define DEBUG 0
#endif
typedef struct partialSum {
@srayuws
srayuws / lcsIO.hs
Created December 15, 2012 03:54
你懂得……扯上IO就会很麻烦…………
import Data.Array
import Data.Array.IO
import Data.Ix
lcs :: String -> String -> Int
lcs s t = a!(n,m)
where a = array ((0,0),(n,m)) [((x,y), f x y)|x<-[0..n],y<-[0..m]]
n = length s
m = length t
s'= array (0,n-1) $ zip [0..n-1] s