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> | |
<title>RxJS Tutorial</title> | |
<!-- Load CSS --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css" /> | |
<!-- Load Rubik font --> |
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
import boto3 | |
import json | |
import uuid | |
sqsClient = boto3.client('sqs', region_name='us-east-1') | |
# Source Queue (eg. DLQ) | |
srcQueueUrl = '' | |
# Destination Queues |
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
function customGreet(greetingPrefix) { | |
var customGreetingPrefix = greetingPrefix; // For simplicity we store it explicitly in a local variable | |
function printGreet(name) { | |
console.log(customGreetingPrefix + ' ' + name + '.'); | |
} | |
return printGreet; | |
} | |
greetWithHey = customGreet('Hey'); | |
greetWithHello = customGreet('Hello'); | |
greetWithHey('Tom'); |
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
# Get Base Dependencies | |
apt install -y python3-pip | |
apt-get install python3-venv | |
mkdir -p /var/jupyter_lab_home/ | |
python3 -m venv /var/jupyter_lab_home/venv | |
source /var/jupyter_lab_home/venv/bin/activate | |
# (optional) Get a password hash | |
# python3 -c "from notebook.auth import passwd; print(passwd('cactusLABs20'))" |
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
# ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== | |
# For a given list, find count of consecutive duplicates | |
from itertools import groupby | |
dupCount = [len(list(ListOfOccurrences)) for (element, ListOfOccurrences) in groupby(sortedList)] | |
# ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== | |
# Find permutations and combinations | |
from itertool import permutations, combinations |
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
items1 = ["Item #1", "item #2",] | |
items2 = ["Item #1", "item #2","Item #4", "item #5",] | |
items3 = ["Item #1", "item #2","Item #4", "item #5", "item#6", "item#7",] | |
sys.getsizeof(items1) # 72 bytes | |
sys.getsizeof(items2) # 120 bytes | |
sys.getsizeof(items3) # 152 bytes |
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 doSecretStuffVersion1(rawItem): | |
theSecretCode = rawItem ** 30000 | |
return theSecretCode # Notice the return statement | |
def doSecretStuffVersion2(rawItem): | |
theSecretCode = rawItem ** 30000 | |
yield theSecretCode # Notice the yield statement |
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
import sys | |
secretV1 = doSecretStuffVersion1(5) | |
secretV2 = doSecretStuffVersion2(5) | |
print(secretV1). # 12593025435840... | |
print(type(secretV1)) # <class 'int'> | |
print(secretV2) # <generator object doSecretStuffVersion2 at 0x10ca5ab30> | |
print(type(secretV2)) # <class 'generator'> |
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
secretV2 = doSecretStuffVersion2(5) | |
secretV2Value = next(secretV2) | |
print(secretV2Value) # 12593025435840... | |
print(type(secretV2Value)) # <class 'int'> | |
print(sys.getsizeof(secretV2Value)) # 9312 |
OlderNewer