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 math | |
| crimes=[(5,4), (6,3), (5,3), (7,3)] | |
| phi=5 | |
| f, g= 2, 2 | |
| b=3 | |
| a=0 | |
| for j in range(10): | |
| for i in range(10): |
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
| Earthquake.init do | |
| output do |item| | |
| next unless item["_stream"] | |
| if "#{item["user"]["screen_name"]}"!="leegeorg07" | |
| notify "#{item["user"]["screen_name"]}: #{item["text"]}" | |
| end | |
| end | |
| end |
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
| cd ruby-1.9.2-p180 | |
| ./configure | |
| make | |
| sudo make install | |
| cd .. | |
| sudo ruby rubygems-1.8.2/setup.rb | |
| cd .. | |
| cd ruby-1.9.2-p180/ext/readline | |
| ruby extconf.rb | |
| make |
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
| Earthquake.init do | |
| output do |item| | |
| next unless item["_stream"] | |
| if "#{item["text"]}".match(/^@jrgifford/) | |
| notify "#{item["user"]["screen_name"]}: #{item["text"]}" | |
| end | |
| end | |
| end |
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
| Earthquake.init do | |
| output do |item| | |
| next unless item["_stream"] | |
| if "#{item["text"]}".match(/@leegeorg07/) | |
| notify "#{item["user"]["screen_name"]}: #{item["text"]}" | |
| end | |
| end | |
| end |
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
| from sys import argv | |
| if len(argv)>1 and argv[1].isdigit(): | |
| r = '' | |
| for i in range(int(argv[1])): | |
| r+='r' | |
| print "oh hai thu{0}".format(r) | |
| else: | |
| print "Please supply a positive integer as an argument" |
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
| print "So you want to call a baby ugly?" | |
| def parent(parent): | |
| print "If the {0} strong or able to beat you up?".format(parent) | |
| print "Say N if you're not sure" | |
| answer=raw_input("Y or N: ") | |
| if answer == "Y": | |
| return True | |
| else: | |
| return False | |
| father=parent("father") |
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
| print "Format Characters:" | |
| print "d OR i: int" | |
| print "o: octal" | |
| print "x: lowercase hex" | |
| print "X: uppercase hex" | |
| print "f OR F: float" | |
| print "c: single char" | |
| print "r: String (using repr())" | |
| print "s: String (using str())" |
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
| a=lambda f, m:open(__import__('sys').argv[f],m);if not raw_input("File %d bytes\nEnter continue, CTRL-C abort." % len(a(1, 'r').read())):a(2, 'w').write(a(1, 'r')) |
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
| matrix = [[0, 1, 2, 3], [1, 0, 5, 6], [2, 5, 0, 4], [3, 6, 4, 0]] | |
| print "A to C" | |
| print matrix[0][2] | |
| print "D to B" | |
| print matrix[3][1] | |
| print " |A|B|C|D" | |
| print "A|%d|%d|%d|%d" % (matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0]) | |
| print "B|%d|%d|%d|%d" % (matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1]) | |
| print "C|%d|%d|%d|%d" % (matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2]) |