Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am pagrom on github.
  • I am pagrom (https://keybase.io/pagrom) on keybase.
  • I have a public key whose fingerprint is 8EE9 6856 F0FC A40A 1041 710D A2D3 4118 90F0 1C01

To claim this, I am signing this object:

@PaGrom
PaGrom / merge.py
Created May 6, 2014 14:49
Tool for merging logs by timestamps
import sys
import fileinput
import re
from time import strptime
def merge(f_names):
lines = list(fileinput.input(f_names))
t_fmt = '%a %b %d %H:%M:%S:%f' # format of time stamps
t_pat = re.compile(r'\[(.+?)\]') # pattern to extract timestamp
for l in sorted(lines, key=lambda l: strptime(t_pat.search(l).group(1), t_fmt)):
_ = (
255,
lambda
V ,B,c
:c and Y(V*V+B,B, c
-1)if(abs(V)<6)else
( 2+c-4*abs(V)**-0.4)/i
) ;v, x=1500,1000;C=range(v*x
);import struct;P=struct.pack;M,\
j ='<QIIHHHH',open('M.bmp','wb').write