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
<html><head><title>Definition test</title> | |
<style type='text/css'> | |
.problem-definition { | |
padding-left: 20px; | |
margin-top: 1em; | |
margin-bottom: 1em; | |
} | |
.problem-definitionlines { | |
display: table; | |
} |
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
f = [] * 3 | |
for i in range(3): | |
f[i] = sum | |
i = 0 | |
while i < 3: | |
f[i] = sum | |
i += 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
>>> import random | |
>>> def alternate(a,b): | |
... c = a + b | |
... d = [] | |
... wanted = 'a' | |
... while len(c) > 0: | |
... i = random.randint(0, len(c) - 1) | |
... print 'Is ',c[i],' from a or b?' | |
... if raw_input() == wanted: | |
... d.append( c[i] ) |
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
def fibo(): | |
A = [ | |
[ 0, 1 ], | |
[ 1, 1 ], | |
] | |
x = [0, 1] | |
for i in range(100): | |
print x[0] | |
y = [0, 0] | |
(x[0], x[1]) = x[0] * A[0][0] + x[1] * A[0][1], x[0] * A[1][0] + x[1] * A[1][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
def five(): | |
for x in range(3**8): | |
nums = [] | |
s = '1' | |
for i in xrange(2,10): | |
d = x / (3**(i - 2)) % 3 | |
if d == 0: | |
s = s + str(i) | |
elif d == 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
# encoding: UTF-8 | |
# A ruby class that parses a @massconnect4 tweet and tries to return a reply as | |
# a string. Your bot should handle the tweet detecting and reading. | |
# | |
# connect4 = MassConnect4Player.new( team, unclever) | |
# team is your team either :sun or :moon | |
# unclever is a float from 0.0 to 1.0 , the higher this is the worse it will play | |
# | |
# connect4.play(tweet_text) , take a tweet text from @massconnect4, return a reply |
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
#!/bin/bash | |
W=1280 | |
H=720 | |
ffmpeg -threads 12 -i "$1" -vcodec libx264 -acodec mp3 -vf "scale=$W:$H:force_original_aspect_ratio=decrease,pad=$W:$H:(ow-iw)/2:(oh-ih)/2" "$2" |
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" : "myserver", | |
"accessToken": "SECRET", | |
"uri" : "https://A-B-C-D-abaguhdsfguehdf.plex.direct:32400 | |
} | |
] |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
OlderNewer