MODE | MEANING | STREAM POSITION | COMMENT |
---|---|---|---|
r | reading | beginning of the file | default |
r+ | reading and writing | beginning of the file | |
w | writing only | Overwrites / creates a new file for writing | |
w+ | writing and reading | Overwrites / creates a new file for reading and writing | |
rb | reading in binary | beginning of the file | |
rb+ | reading and writing binary | ||
wb+ | writing and reading binary | Overwrites / creates a new file for reading and writing | |
a | appending | end of the file if exists | If the file does not exist, it creates a new file for writing. |
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
function test-certificate([string[]]$domains, $contextLength = 10, [switch]$download) { | |
$cacertPath = "${env:USERPROFILE}\cacert.pem" | |
if (-not(Test-Path $cacertPath)) { | |
Invoke-WebRequest "https://curl.se/ca/cacert.pem" -OutFile "${env:USERNAME}\cacert.pem" | |
} | |
foreach ($domain in $domains) { | |
$connectDomain = $domain + ":443" | |
if ($download) { | |
echo "q" | | |
openssl s_client -servername $domain -connect $connectDomain -CAfile $cacertPath | |
NO | DESCRIPTION | VALUE |
---|---|---|
1 | Boolean | False |
2 | None keyword | None |
3 | The number zero | 0 |
4 | An empty string | '' |
5 | An empty list | [] |
6 | An empty tuple | () |
7 | An empty dictionary | {} |
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 main(): | |
try: | |
# DO SOMETHING.... | |
except KeyboardInterrupt: | |
# UPON CTRL+C ASK IF A FILE CONTENTS SHOULD BE DROPPED | |
if input("~~> Interrupted ! Clean-up 'output.txt'? (y/N): ") == "y": | |
# RUN DROPPING FUNCTION IF YES | |
delete_output_content() | |
# AND SAY GOOD BYE | |
sys.exit("bye") |
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
documents = [ | |
"Each in the cell of himself is almost convinced of his freedom", | |
"You know I like that violence that you get around here, that kind of ready steady violence", | |
"Yes that is right punk is dead it is another cheap product for the consumers head", | |
"To be or not to be that is the question" | |
] | |
counts = map(count_words,documents) | |
# OUTPUT IS LAZY OBJECT | |
# <map object at 0x01F2F610> |
The concern is documenting how to ignore files in a git project with a .gitignore
file using so called globbing pattens (aka standard wildcards).
ATTRIBUTE | ON PREM | CLOUD |
---|---|---|
COSTS_INIT | great / CAPEX (capital expenses) | small / OPEX (operational/variable expense) |
COSTS_MAINTENANCE | expensive / need to staff data center (DC) | elastic / cheaper (economies of scale) |
COMPLIANCE | own responsibility | shared responsibility model / less risk |
DEPLOYMENT_PACE | slow | fast / efficient (economies of scale) / go global in minutes |
FORECASTING | difficult / imprecise | elastic scaling |
FINANCING | no money no honey | speed and agility / test capacity against real users with minimal costs |
RELIABILITY | additional dimension / failovers required | global infra built with reliability in mind |
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 |
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. |