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
import sys | |
lines = sys.stdin.readlines() | |
lines.sort(reverse = ('-r' in sys.argv)) | |
print ''.join(lines) |
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
import sys | |
def process_lines(lines): | |
for index, line in enumerate(lines): | |
last_line = lines[index - 1] | |
if line != last_line: | |
sys.stdout.write(line) | |
process_lines(sys.stdin.readlines()) |
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
def just_one_kind_of_response?(item, controller) | |
case controller | |
when 'actions' | |
if item.comments.blank? || item.suggestions.blank? | |
return true | |
end | |
when 'thoughts' | |
if item.comments.blank? || item.suggestions.blank? |
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/python | |
import sys | |
labels = [] | |
values = [] | |
for line in sys.stdin: | |
bits = line.strip().split(' ') | |
value = bits.pop(0) | |
label = ' '.join(bits) |