Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # [email protected] | |
| mylogin, mypwd = "XXX", "XXXpassXXX" # Your AREXIS login | |
| force_reload = 0 # 0/1: reload all pages, whether they have been cached or not | |
| ######################################################################## | |
| from time import sleep | |
| from bs4 import BeautifulSoup | |
| import subprocess as sp |
| --------------------------- MODULE peterson_multi --------------------------- | |
| EXTENDS TLC, Integers, Sequences | |
| CONSTANT ThreadCount | |
| Threads == 1..ThreadCount | |
| AllOtherFlagsLessThan(item, flags) == | |
| \A q \in Threads \ {item}: flags[q] < item | |
| (*--algorithm peterson_multi | |
| variables |
| def identity(nums): | |
| """Identity: | |
| Given a list of numbers, write a list comprehension that produces a copy of the list. | |
| >>> identity([1, 2, 3, 4, 5]) | |
| [1, 2, 3, 4, 5] | |
| >>> identity([]) | |
| [] |
| from /u/cscanlin | |
| #Find all of the numbers from 1-1000 that are divisible by 7 | |
| results = [num for num in range(1000) if num % 7 == 0] | |
| #print(results) | |
| #Find all of the numbers from 1-1000 that have a 3 in them | |
| results = [num for num in range(1000) if '3' in list(str(num))] | |
| #print(results) |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| """ | |
| formula.py - propositional formulas for Python | |
| by Robin Wellner | |
| Hereby, I waive all rights to this library, as described at <http://creativecommons.org/publicdomain/zero/1.0/> | |
| Examples: | |
| foo = Atom('foo') | |
| bar = Atom('bar') |
| var decryptedRow=""; | |
| var pm = PasswordManager.getInstance(); | |
| var model = pm.savedPasswordsList_.dataModel; | |
| var pl = pm.savedPasswordsList_; | |
| for(i=0;i<model.length;i++){ | |
| PasswordManager.requestShowPassword(i); | |
| }; | |
| setTimeout(function(){ | |
| decryptedRow += '"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"'; | |
| for(i=0; i<model.length; i++){ |
| for f in *.shn; do ffmpeg -i "$f" "${f/%.shn/.flac}"; done | |
| $ sudo apt-get install cuetools shntool flac | |
| $ cuebreakpoints file.cue | shnsplit -o flac file.flac |