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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- character encoding (allows special characters) --> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>tab name</title> | |
<meta name="description" content="An interactive getting started guide for HTML."> | |
<!-- link to css sheet (colors) --> |
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
$location = Read-Host "Do you want detailed info? (you really don't) [Y/n] " | |
If (($location -eq "yes") -or ($location -eq "Yes") -or ($location -eq "Y") -or ($location -eq "y")) | |
{ | |
netsh wlan show profiles | |
$networkName = Read-Host 'Which of the above is the wifi network that you want to know the password of?' | |
netsh wlan show profile name=`"$networkName`" key=clear |
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
class rs(): | |
def __init__(self, p): | |
self.p = p # set the Galois Field | |
def divide(self, a, b): | |
a %= self.p | |
b %= self.p | |
b_mod_inv = 0 if b % self.p == 0 else self.find_mod_inv(b) | |
return (a*b_mod_inv) % self.p |
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 product(*iters): | |
def loop(prod, first=[], *rest): | |
if not rest: | |
for x in first: | |
yield prod + (x, ) | |
else: | |
for x in first: | |
yield from loop(prod + (x, ), *rest) | |
yield from loop((), *iters) |
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
class StableMatching(): | |
def solve(self, job_prefs: dict, candidates_prefs: dict) -> list(tuple(str, int)): | |
""" | |
Returns a job-optimal stable matching pairing that gives equilibria (¬∃ x=(C*, J*) s.t. x ∉ solution set). | |
--------------------- | |
| Jobs | Candidates | | |
--------------------- | |
| 1 | A > B > C | | |
--------------------- | |
| 2 | B > A > C | |
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 spiralOrder(matrix): | |
""" | |
>>> spiralOrder([[1,2,3],[4,5,6],[7,8,9]]) | |
1 | |
2 | |
3 | |
6 | |
9 | |
8 | |
7 |