This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun less-css-calculate-indentation () | |
"Return the column to which the current line should be indented." | |
(save-excursion | |
(end-of-line) | |
(let ((indent-level 0)) | |
(while (not (bobp)) | |
;; TODO search backwards | |
(backward-char) | |
(cond ((looking-at "{") (setq indent-level (+ 1 indent-level))) | |
((looking-at "}") (setq indent-level (- indent-level 1))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/DataGen/src $ python main.py 20000 10 test | |
Lines: 20000, Files: 10, Base Name: test, Bucket: None, Prefix: None | |
[ 10%] Process #1 complete. (1.24 s) Hash: d41d8cd98f00b204e9800998ecf8427e | |
Compressed: 1699840 Uncompressed: 3592368 Ratio: 0.473 | |
[ 20%] Process #2 complete. (1.25 s) Hash: d41d8cd98f00b204e9800998ecf8427e | |
Compressed: 1703936 Uncompressed: 3592484 Ratio: 0.474 | |
[ 30%] Process #3 complete. (1.26 s) Hash: d41d8cd98f00b204e9800998ecf8427e | |
Compressed: 1699840 Uncompressed: 3592838 Ratio: 0.473 | |
[ 40%] Process #4 complete. (1.26 s) Hash: d41d8cd98f00b204e9800998ecf8427e | |
Compressed: 1699840 Uncompressed: 3592434 Ratio: 0.473 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@test: 0; | |
.mixin() when (@test = 0) { background: blue !important; } | |
.mixin() when (@test = 1) { @test: 2; background: red !important; } | |
.mixin() when (@test = 2) { background: black !important; } | |
body { | |
@test: 1; | |
.mixin; | |
.mixin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var greet = function(greeting) { | |
var full_greeting = greeting+', '; | |
var greet_name = function(name) { | |
console.log(full_greeting + name); | |
} | |
return greet_name; | |
} | |
var hello = greet('hello'); // builds a greeting function, prints nothing | |
hello('stephen'); // does the actual printing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test a supposedly random string (encrypted or hashed or something) for 50% 1s vs 0s | |
mypass = '\xf8\x16\x01-\xfd3\xf7\x06\xbf\xc4\x1eU=\xc0\xe8a\xf4\xa0\x8b\xd0' | |
x = ''.join(["{0:08b}".format(ord(a)) for a in mypass]) | |
print x.count('0')/(len(x)+0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
460 successful queries. | |
Memory stats: | |
{ rss: 250523648, heapTotal: 256133824, heapUsed: 226484224 } | |
940 successful queries. | |
Memory stats: | |
{ rss: 546824192, heapTotal: 533091840, heapUsed: 504648624 } | |
1340 successful queries. | |
Memory stats: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coli=: 4 : '({. x) i. < y' NB. {data w/header} coli {column name} => column index | |
col=: 4 : '}. (x coli y) {"1 x' NB. {data w/header} coli {column name} => boxed column data | |
colu=: 4 : '> x col y' NB. {data w/header} colu {column name} => unboxed column data | |
coln=: 4 : 'makenum x col y' NB. {data w/header} coli {column name} => numeric column data | |
colsel=: 4 : 'y , |: > x&col each y' NB. {data w/header} colsel {column name} [{column name} ...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name #n tsub ttot tavg | |
..ut/asf/lib/gevent/hub.py.wait:381 126370 4.224324 0.000000 0.000000 | |
../asf/lib/gevent/hub.py.switch:367 127794 1.108121 0.000000 0.000000 | |
../asf/lib/gevent/hub.py.switch:581 126390 0.703636 1.496160 0.000012 | |
..put/asf/lib/gevent/hub.py.get:607 126392 0.529035 0.000000 0.000000 | |
..sf/lib/gevent/hub.py.__init__:545 126392 0.408749 0.546809 0.000004 | |
..asf/lib/gevent/hub.py.get_hub:203 255211 0.309358 0.323718 0.000001 | |
..asf/lib/gevent/socket.py.recv:379 141 0.308193 3.949099 0.028008 | |
..t/asf/lib/gevent/ssl.py.close:347 162 0.070644 0.075873 0.000468 | |
...6/json/decoder.py.JSONObject:162 420 0.063566 0.220138 0.000524 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from StringIO import StringIO | |
import xml.etree.cElementTree as ET | |
def pretty_xml(xml_str, indent=" "): | |
""" | |
A very simple, hopefully not simplistic, XML pretty printer. | |
Concept courtesy Mark Williams. | |
""" | |
if not hasattr(xml_str, "read"): # ElementTree uses file-like objects | |
fn = StringIO(xml_str) # cStringIO doesn't support UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from StringIO import StringIO | |
import xml.etree.cElementTree as ET | |
def pretty_xml(xml_str, indent=" "): | |
""" | |
A very simple, hopefully not simplistic, XML pretty printer. | |
Concept courtesy Mark Williams. | |
""" | |
if not hasattr(xml_str, "read"): # ElementTree uses file-like objects | |
fn = StringIO(xml_str) # cStringIO doesn't support UTF-8 |