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
7932 \ exists] / | |
7933 -------------------------------------------------------- | |
7934 \ ^__^ | |
7935 \ (oo)\_______ | |
7936 (__)\ )\/\ | |
7937 ||----w | | |
7938 || || | |
7939 | |
7940 fatal: [10.0.143.60]: FAILED! => {} | |
7941 |
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
objects = [A, B, C, ...] | |
for o1 in objects: | |
for o2 in objects: | |
if o1 == o2: | |
continue | |
f = G * (o1.mass * o2.mass) / distance(o1, o2) | |
o1.force += f |
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 colorizeCode(type, value): | |
color = { | |
'I': 'Green', | |
... | |
}.get(type, 'SomeDefaultColor') | |
return '<td align=center BGCOLOR="{}">{}</td>'.format(color, value) |
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
# Create dummy directory. | |
mkdir foo | |
# Inside that directory, a new file is born. | |
touch foo/bar | |
# Reset file's permissions to known values, e.g. ugo=r. | |
chmod ugo=r foo/bar | |
ls -al foo |
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
unroll = [] | |
something = [] | |
try: | |
# Do something... | |
something.append(1) | |
# and add a function to `unroll` which, when called, would remove the last item from the list, "undoing" our action | |
unrolls.append(lambda: something.pop(-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
Fudgy brownies | |
============== | |
## aa | |
* 115g másla do mísy, nechat povolit | |
* přidat 1 lžíci oleje | |
* přidat 255g cukru moučky | |
* dobře utřít |
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
diff --git a/gluetool/__init__.py b/gluetool/__init__.py | |
index ee55a52..177ae02 100644 | |
--- a/gluetool/__init__.py | |
+++ b/gluetool/__init__.py | |
@@ -1,7 +1,9 @@ | |
from .glue import Glue, Module | |
from .glue import GlueError, SoftGlueError, GlueRetryError, GlueCommandError, Failure | |
+from .glue import Result, Ok, Error | |
from . import utils | |
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 ask_question(question, check, when_wrong): | |
while True: | |
# ask the given question, save the response | |
response = input(question) | |
# call the given "check" function, if it returns True, the response is valid, return it immediately | |
if check(response): | |
return response | |
# the response was wrong: print the "error message", and start a new iteration |
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
cap_slova = 0 | |
for slovo in slova: | |
if slovo[0].isupper(): | |
cap_slova += 1 | |
print('There are', cap_slova, 'titlecase words.') | |
# c) number of uppercase words | |
upp_slova = 0 #muzu nechat pojmenovani cap_slova protoze dynamicky jazyk | |
for slovo in slova: |
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
jmeno = None | |
heslo = None | |
vyber_textu = None | |
while True: | |
if not jmeno: | |
jmeno = (input('USERNAME: ')) | |
if jmeno not in MEMBERS: | |
jmeno = None |