summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2013-02-04 09:12:52 (GMT)
committerJan Huwald <jh@sotun.de>2013-02-04 09:12:52 (GMT)
commitbd37d54a399d8ffd5028d6c5d6a978566684d66b (patch)
tree9d96b06621b62bd7fe643425e12900f3c41fad3f
parentc9e8fc6758d7e34bede3a22360a7831c15f3342c (diff)
add omit_log
-rwxr-xr-xomit_log24
1 files changed, 24 insertions, 0 deletions
diff --git a/omit_log b/omit_log
new file mode 100755
index 0000000..3c6aa2b
--- /dev/null
+++ b/omit_log
@@ -0,0 +1,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