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
| var ife = require('if-else'); | |
| var x = ife.shouldThisBeTrue(function(i) { | |
| return i > 3; | |
| }).then(function(i) { | |
| return i*10; | |
| }).otherwiseThis(function() { | |
| return i*-10; | |
| }).using(4); |
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
| switch (value) { | |
| case 1: | |
| return "one"; | |
| case 2: | |
| return "two"; | |
| default: | |
| return "other"; | |
| } |
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
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
| 2e2ec07cdd96 wurstmeister/kafka "/bin/bash" About a minute ago Up About a minute naughty_pike | |
| 1f1d0bcee862 wurstmeister/kafka "/bin/bash" 12 minutes ago Up 12 minutes distracted_mclean | |
| dca72833ce90 wurstmeisterkafkadockere03b1d6_kafka "start-kafka.sh" 14 minutes ago Up 14 minutes 0.0.0.0:32770->9092/tcp wurstmeisterkafkadockere03b1d6_kafka_2 | |
| 5089a7d9dacc wurstmeisterkafkadockere03b1d6_kafka "start-kafka.sh" 17 minutes ago Up 17 minutes 0.0.0.0:32769->9092/tcp wurstmeisterkafkadockere03b1d6_kafka_1 | |
| 64247358793d |
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 parse_num(str): | |
| try: | |
| return int(str) | |
| except ValueError: | |
| pass | |
| try: | |
| return float(str) | |
| except ValueError: | |
| return None |
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 parse_num(str): | |
| return int(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
| #!/usr/bin/env python3 | |
| def echo(str): | |
| print("I will return %s" % str) | |
| return str | |
| print(echo("32")) | |
| print(echo("butter")) |
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 | |
| def parse_num(str): | |
| return 42 | |
| print(parse_num("42")) | |
| print(parse_num("butter")) | |
| print(parse_num("5444")) |
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 | |
| def parse_num(str): | |
| return 42 | |
| for i in range(100): | |
| print(parse_num(str(i))) |
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 | |
| def parse_num(str): | |
| return 42 | |
| print(parse_num('10000000000')) |
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 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
| print('my list has this many in it') | |
| print(len(a)) | |
| for i in a: | |
| print(i) |