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 truthTableGuardTest(): | |
| t = '\t' | |
| print('p', t, 'q' ,t, 'not p', t, 'not p', t, 'p and q', t, 'p or q', t, '(p or q) or (not p and not q)') | |
| for p in [False, True]: | |
| for q in [False, True]: | |
| print(p, t, q, t, not p, t, not q, t, p and q, t, t, p or q, t, t, (p or q) or (not p and not q)) |
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 findHighest(intList): | |
| result = intList[0] | |
| for eachNum in intList: | |
| if eachNum > result: | |
| result = eachNum | |
| return result |
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
| if len (intList) == 0: | |
| return -1 | |
| else: | |
| #.. original code | |
| return result |
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
| .arrow.up { | |
| background-image: url(%%doge-btn%%); | |
| background-position: 0 -13px; | |
| } | |
| .arrow.up:hover { | |
| background-image: url(%%doge-btn%%); | |
| background-position: 0 1px; | |
| } |
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 bubbleSort(aList): | |
| for eachNum in range(len(aList)-1,0,-1): | |
| for i in range(eachNum): | |
| if (aList[i] > aList[i+1]): | |
| temp = aList[i] | |
| aList[i] = aList[i+1] | |
| aList[i+1] = temp | |
| return aList |
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 selectionSort(aList): | |
| # from n-1 to 0 (excluding 0) with the stepping -1 | |
| for eachNum in range (len(aList)-1,0,-1): | |
| positionMax = 0 | |
| for i in range(eachNum+1): | |
| if aList[i] > aList[positionMax]: | |
| positionMax = i | |
| temp = aList[eachNum] | |
| aList[eachNum] = aList[positionMax] | |
| aList[positionMax] = temp |
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 insertionSort(aList): | |
| # starting from 1 because n-1 | |
| for index in range(1,len(aList): | |
| currentValue = aList[index] | |
| position = index | |
| while position > 0 and aList[position-1] > currentValue: | |
| aList[position] = aList[position-1] | |
| position = position-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
| class BinaryTree: | |
| def __init__(self,rootObj): | |
| self.key = rootObj | |
| self.leftChild = None | |
| self.rightChild = None | |
| def getRightChild(self): | |
| return self.rightChild | |
| def getLeftChild(self): |
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 preorder(tree): | |
| if tree: | |
| print(tree.getRootVal()) | |
| preorder(tree.getLeftChild()) | |
| preorder(tree.getRightChild()) | |
| def postorder(tree): | |
| if tree: | |
| postorder(tree.getLeftChild()) | |
| postorder(tree.getRightChild()) |
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
| #!/bin/bash | |
| # Fetch Logs | |
| wget -r --ca-certificate=theCert.pem \ | |
| -A gz --directory-prefix=logs/property/ \ | |
| -R html,gif,"index*","YourOtherExceptions" --no-verbose --no-parent \ | |
| --no-directories --user=YourUsername -e robots=off \ | |
| --password=YourPassword https://subdomain.domain/dir | |