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
| <?php | |
| function foo() { | |
| try { | |
| throw new Exception("ex1"); | |
| } finally { | |
| try { | |
| throw new Exception("ex2"); | |
| } catch (Exception $e) { | |
| printf("caught in finally message=%s\n", $e->getMessage()); | |
| } |
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
| class Api_Resource_Public_Taxonomy_Node implements Api_ResourceSpec_ITyped { | |
| const DESC = "A node in the taxonomy of items on Etsy"; | |
| use Api_ResourceSpec_Typed; | |
| use Api_ResourceSpec_Declaration; | |
| /** | |
| * @var array | |
| */ |
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
| class A[U <: String, V <: Int] { | |
| def foo(u: U) = 1 | |
| def foo(v: V) = 2 | |
| } |
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
| public Stream<Verse> allVerses() { | |
| return books().stream().reduce( | |
| Stream.empty(), | |
| (sa, b) -> b.chapters().stream().reduce( | |
| sa, | |
| (sb, ch) -> Stream.concat(sb, ch.verses().stream()), | |
| (sb, sc) -> Stream.concat(sb, sc)), | |
| (sb, sc) -> Stream.concat(sb, sc)); | |
| } |
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
| class Bucket { | |
| let id : Int | |
| init(id: Int) { | |
| print("\(id) is upon us.") | |
| self.id = id | |
| } | |
| deinit { | |
| print("\(id) has left the building.") |
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
| x = True | |
| while x: | |
| print('forever') | |
| while x == True: | |
| print('forever') | |
| y = 2 | |
| while y == 2: | |
| print('forever') |
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) |
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
| #!/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("42")) | |
| print(parse_num("butter")) | |
| print(parse_num("5444")) |