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
| function withExec() { | |
| const scopesExpression = /\/scopes\/([0-9]*)/g; | |
| const { 1: scopeId1 } = scopesExpression.exec("/scopes/1234"); | |
| const { 1: scopeId2 } = scopesExpression.exec("/scopes/5678"); | |
| return [scopeId1, scopeId2]; | |
| // Uncaught TypeError: Cannot destructure 'undefined' or 'null'. | |
| } | |
| function withMatch() { |
{ "name": "Migrating to Aurelia from Angular 1.x", "culture": "en-US", "description": "If you have an existing Angular application that you would like to migrate to Aurelia, you can use the conversion guides and implementation notes here to streamline the process.", "engines" : { "aurelia-doc" : "^1.0.0" }, "author": { "name": "Jedd Ahyoung", "url": "http://www.jedd-ahyoung.com" },
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 nest_while(f, value, condition): | |
| ''' | |
| Given function, initial value, and break condition, | |
| calls function with the initial value, and repeats calling | |
| the function with the return value of the previous call, | |
| until the condition returns false. | |
| ''' | |
| if not condition(value): | |
| return value | |
| return nest_while(f, f(value), condition) |
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 decode(compressed): | |
| ''' | |
| Given an Run Length Encoded (RLE) string, decodes it | |
| into its original format, and returns this decoded string. | |
| ''' | |
| groups = groupby(compressed, lambda x: x.isdigit()) | |
| output = '' | |
| count = 1 |
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
| import random | |
| def is_int(x): | |
| ''' | |
| Given a number, returns a boolean declaring if | |
| the number is an integer. | |
| ''' | |
| return x % 1 == 0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| """ | |
| backtrack2.py | |
| ------------- | |
| Converting backtrack to OOP: | |
| """ | |
| """ | |
| Notes: June 3 | |
| Obstacles seem to be being drawn in the wrong squares |