summaryrefslogtreecommitdiff
path: root/omit_log
blob: 3c6aa2b475edb6d10bb84120299132c88f19d125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python

import sys
import math

factor = 2
if len(sys.argv) > 1:
    factor = float(sys.argv[1])


# read sparse matrix 
cur = 0
nxt = 1
last = 0
for line in sys.stdin:
    last = line
    cur = cur + 1
    if cur >= nxt:
        sys.stdout.write(line)
        nxt = math.ceil(nxt * factor)
        last = 0

if last != 0:
    sys.stdout.write(last)
contact: Jan Huwald // Impressum