Map [1]
| Operation | Time Complexity |
|---|---|
| Access | O(log n) |
| Search | O(log n) |
| Insertion | O(n) for <= 32 elements, O(log n) for > 32 elements [2] |
| Deletion | O(n) for <= 32 elements, O(log n) for > 32 elements |
| // The MIT License(MIT) | |
| // | |
| // Copyright(c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| // this software and associated documentation files(the "Software"), to deal in | |
| // the Software without restriction, including without limitation the rights to | |
| // use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of | |
| // the Software, and to permit persons to whom the Software is furnished to do so, | |
| // subject to the following conditions : |
| # Rails production setup via SQLite3 made durable by https://litestream.io/ | |
| # Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
| # | |
| # try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
| # | |
| # in production you might want to map /data to somewhere on the host, | |
| # but you don't have to! | |
| # | |
| FROM ruby:3.0.2 |
| using namespace System.Collections.Generic | |
| # Encapsulate an arbitrary command | |
| class PaneCommand { | |
| [string]$Command | |
| PaneCommand() { | |
| $this.Command = ""; | |
| } |
Below describes the only way I was able to get (programmatic) access to the YouTube Analytics API on behalf of our Brand Account. Google documentation is convoluted, to say the least, so if you know a more straightforward way, please do share.
Library tab and enable desired APIs (e.g. YouTube Analytics)OAuth consent screen and make project external. Select Test mode| import os | |
| import sys | |
| import datetime | |
| from glob import glob | |
| from argparse import ArgumentParser | |
| # settings | |
| projectNamePrefix = "vlog-" | |
| presetName = "Default" # You have to define this preset by your self. <---- |
| <# | |
| References: | |
| - https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netframework-4.5 | |
| - https://github.com/poshbotio/PoshBot/blob/master/PoshBot/Implementations/Slack/SlackConnection.ps1 | |
| - https://www.leeholmes.com/blog/2018/09/05/producer-consumer-parallelism-in-powershell/ | |
| #> | |
| $client_id = [System.GUID]::NewGuid() | |
| $recv_queue = New-Object 'System.Collections.Concurrent.ConcurrentQueue[String]' |
| #cloud-config | |
| package_update: true | |
| manage_resolv_conf: true | |
| resolv_conf: | |
| nameservers: | |
| - '8.8.8.8' | |
| - '8.8.4.4' | |
| - '1.1.1.1' |
Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:
set -euo pipefail
set -e
| sudo apt install curl gnupg2 ca-certificates lsb-release | |
| echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list | |
| curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
| sudo apt update | |
| NGINX_VERSION=$(apt show nginx | grep "^Version" | cut -d " " -f 2 | cut -d "-" -f 1) | |
| # take note of the nginx version in the "stable" release. e.g. 1.14.2 | |
| echo NGINX version $NGINX_VERSION | |
| wget https://hg.nginx.org/pkg-oss/raw-file/default/build_module.sh | |
| chmod a+x build_module.sh |