MUTABLE | IMMUTABLE |
---|---|
#1 list |
~ |
#2 dict |
~ |
#3 set |
~ |
#4 byte array |
~ |
~ | #1 int |
~ | #2 float |
~ | #3 complex |
~ | #4 string |
View 2023-02-23-How-to-Ask-AI-from-Command-Line.py
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 os | |
import sys | |
import openai | |
import pyperclip as clipboard | |
def main(prompt): | |
openai.api_key = os.environ["OPENAI_KEY"] | |
model_engine = "text-davinci-003" | |
completion = openai.Completion.create( |
View 2021-05-27-Mutable-vs-Immutable-Common-Data-Structures-in-Python.md
View BAC-02.14-File-test-operators.md
FLAG | MEANING |
---|---|
-e | file exists |
-a | file exists (deprecated, don't use) |
-f | file is a regular file (not a directory or /dev - device file) |
-s | file is not zero size |
-d | file is a directory |
-b | file is a block device (see below) |
-c | file is a character device (see below) |
-p | file is a pipe |
View RC1-16.02-Towers-of-Hanoi.py
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
move_count = 0 | |
def move_disk(remaining_disks, source, target): | |
global move_count | |
print(f"STEP#{move_count+1}\n" | |
f"\t~~> Disk #{remaining_disks}; {source} > {target}") | |
def count_move(): |
View 2020-12-05-the-trim-horizon-of-AWS-Kinesis-and-the-concept-of-checking.md
TYPE NAME | DESCRIPTION |
---|---|
AT_SEQUENCE_NUMBER |
Start reading from the position denoted by a specific sequence number, provided in the value StartingSequenceNumber. |
AFTER_SEQUENCE_NUMBER |
Start reading right after the position denoted by a specific sequence number, provided in the value StartingSequenceNumber. |
AT_TIMESTAMP |
Start reading from the position denoted by a specific timestamp, provided in the value Timestamp. |
TRIM_HORIZON |
Start reading at the last untrimmed record in the shard in the system, which is the OLDEST data record in the shard. |
LATEST |
Start reading just after the most recent record in the shard, so that you always read the NEWEST data record in the shard. |
View 2021-04-14-On-The-Lease-Table-as-a-State-Maintenance-of-AWS-Kinesis.md
FIELD | COMMENT |
---|---|
checkpoint |
The most recent checkpoint sequence number for the shard. This value is unique across all shards in the data stream. |
checkpointSubSequenceNumber |
When using the Kinesis Producer Library's aggregation feature, this is an extension to checkpoint that tracks individual user records within the Kinesis record. |
leaseCounter |
Used for lease versioning so that workers can detect that their lease has been taken by another worker. |
leaseKey |
A unique identifier for a lease. Each lease is particular to a shard in the data stream and is held by one worker at a time. |
leaseOwner |
The worker that is holding this lease. |
ownerSwitchesSinceCheckpoint |
How many times this lease has changed |
NewerOlder