Last active
September 2, 2016 21:01
-
-
Save stefanor/905cf9d63e0a90f1a81df35565ed6671 to your computer and use it in GitHub Desktop.
buffering demo
This file contains hidden or 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
#!/usr/bin/env python3 | |
import difflib | |
import subprocess | |
import sys | |
qty = 1000000 | |
seq = subprocess.check_output( | |
('seq', str(qty))).decode('utf-8') | |
seqjs = subprocess.check_output( | |
('nodejs', 'seq.js', str(qty))).decode('utf-8') | |
diff = difflib.unified_diff(seq.splitlines(keepends=True), | |
seqjs.splitlines(keepends=True), | |
fromfile='seq', tofile='seqjs') | |
sys.stdout.writelines(diff) |
This file contains hidden or 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
'use strict'; | |
var end = parseInt(process.argv[2]); | |
var output = '' | |
for (var i=1; i <= end; i++) { | |
output += i + '\n'; | |
} | |
console.log(output.slice(0, -1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment