text:
---
layout: engineering-education
status: publish
published: true
slug: what-is-kubernetes
title: What is Kubernetes?
description: Kubernetes can expose a container using the DNS name or its own IP address. If traffic to a single container is high, Kubernetes is able to load balance and distribute the network traffic so that the deployment is stable.
author: gregory-manley
date: 2020-03-16T00:00:00-07:00
topics: [Edge Computing]
excerpt_separator: <!--more-->
images:

  - url: /engineering-education/what-is-kubernetes/hero.jpg
    alt: Kubernetes container management system
---
Kubernetes is an automatic container management system. While it is not a traditional, all-inclusive Platform as a Service (PaaS), due to it operating at the container level, it provides some features common to PaaS such as deployment, scaling, load balancing and monitoring.
<!--more-->

Kubernetes, or K8s, is an open-source system that is used to automate deployment, scaling and management of containerized applications. It provides a framework to run distributed systems, taking care of scaling and failover for your applications.

### What Does Kubernetes Do?
According to [Kubernetes](kubernetes.io/docs/concepts/overview/what-is-kubernetes), the open-source container orchestration system provides you with:

#### Service Discovery and Load Balancing
Kubernetes can expose a container using the DNS name or its own IP address. If traffic to a single container is high, Kubernetes is able to load balance and distribute the network traffic so that the deployment is stable.

#### Storage Orchestration
Kubernetes allows you to automatically mount a storage system of your choice.

#### Automated Rollouts and Rollbacks
You can describe the desired state for your deployed containers and Kubernetes will automatically adapt to the desired state.

#### Automatic Bin Packing
Provide Kubernetes with a cluster of nodes to run containerized tasks, defining how much CPU and RAM each container needs.

#### Self-Healing
Containers that fail are automatically restarted. Kubernetes kills containers that do not respond to the user-defined health check, and does not advertise the containers until they are ready to serve.

#### Secret and Configuration Management
Allows you to store and manage sensitive information (OAuth tokens, SSH keys, etc.)

Basically, Kubernetes is an automatic container management system, allowing developers to focus on designing, building, and upgrading  applications.

### Applications of Kubernetes

Kubernetes runs on many platforms, including Amazon Web Services, Microsoft Azure, and Google Cloud Platform, along with the ability to host it on-premise. K8s applications are generally enterprise-ready containerized solutions.

Some notable examples of K8s applications are:

- GitLab
- CloudBees
- Neo4j
- Seldon
- Aerospike
- Couchbase
- WordPress
- Prometheus
- Section

These are not the only Kubernetes applications out there, and you could even build your own. These applications have the advantage of being easily scalable and new containers can be automatically spawned to minimize down time.

To sum Kubernetes up, it is an automatic container management system. While it is not a traditional, all-inclusive Platform as a Service (PaaS) system, due to it operating at the container level, it provide some features common to PaaS such as deployment, scaling, load balancing and monitoring. All in all, Kubernetes is a great system to implement if you deploy a server side application and want high reliability, low downtime, and great load balancing.

repository: hectorkambow/engineering-education

repo_name: hectorkambow/engineering-education


text:
# Code folding / unfolding

When you are working with nested code structures, you can see a folded view
of your code to get a larger picture.

- Fold one level - `Cmd + Option + [`
- Unfold code one level - `Cmd + Option + ]`

## Exercise

Let's try this with the following HTML code structure.

1. Open `chapter_1.ts`.
2. Put your cursor inside any of the inner functions.
3. Use the `Fold one level` shortcut `Cmd + Option + [`
4. While `Cmd` and `Option` keys are depressed, press `[` key multiple times
   so that whole code structure is completely folded.
5. Now use the shortcut for unfolding code `Cmd + Option + ]`.

license: MIT

repository: WaqasAliAbbasi/VSCodeTutor

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: WaqasAliAbbasi/VSCodeTutor


text:
# tee (gotee)
An implementation of tee in Go.

This program, an implementation of the tee command, first available in 1974,
takes in standard input and for each file specified either appends or writes to
each file until the standard input is done. As it does so it passes out what is
read to standard output.

The `tee` command is a handy way, and one of the only ways to branch standard
input to save to one or more files and to reproduce standard input as standard
output for consumers down the line.  Additionally, to allow for the avoidance of
redirecting standard output to /dev/null, the `-S` option allows for the
avoidance of carry-over of standard input to standard output. This is not
something I have seen on any other implementations.

## Usage

* `gotee -h` print usage
* `gotee` no files specified - use keyboard input instead of stdin and exit on
  Control-C
* `gotee <file1> <file2>` - write to one or more files specified as last arguments
* `gotee -a <file> <file>` - append to existing files and if not existing create
  new files
* `gotee -S <file> <file>` - do not forward standard input to standard output
* `gotee -i` - ignore interrupt. Not implemented but is in original tee
  * I don't quite know what to do with this. If an interrupt is received that
    means that whatever is piping to standard input would have been shut down
    and therefore there would be no standard input to recieve. I would be happy
    to be corrected on this. In theory I could make the loop through standard
    input a function internal to main and restart that function on interrupt,
    but I don't see the point of that. What I have done is in all cases
    intercept an interrupt signal and shut things down as gracefully as
    possible.

## Notes

The official `tee` waits for stdin even when nothing has been sent to it. I've
added support for waiting on keyboard input for string data. Control-C works to
exit this. So although this is reading input as a string, this is likely not
harmful. The main stdin reader reads in bytes and thus can handle `cat test.jpg
| gotee -S out.jpg`.

This works to mimic `command | gotee -S out.txt`

`command | dd status=none of=out.txt`

## Notes

The argument parsing library used here does not deal with arguments such as -1,
-2, -, etc. It may be that an argument will need to have a different identifier to
work around this.

-- Ian Marsman

repository: imarsman/gotee

branch_name: refs/heads/main

repo_name: imarsman/gotee


text:
# Virtualcluster - Enabling Kubernetes Hard Multi-tenancy

Virtualcluster represents a new architecture to address various Kubernetes control plane isolation challenges.
It extends existing namespace based Kubernetes multi-tenancy model by providing each tenant a cluster view.
Virtual cluster completely leverages Kubernetes extendability and preserves full API compatibility.
That being said, the core Kubernetes components are not modified in virtual cluster.

In virtualcluster, each tenant is assigned a dedicated tenant master, which is a vanilla Kubernetes.
Tenant can create cluster scope resources such as namespaces and CRDs in tenant master without affecting others.
As a result, most of the isolation problems due to sharing one apiserver disappear.
The Kubernetes cluster that manages the actual physical nodes is called the super master, which now
becomes a Pod resource provider. Virtual cluster is composed of the following components:

- **vc-manager**: A CRD controller that manage the lifecycle of virtualcluster custom resources. It currently supports
two modes: native mode and cloud mode, to provision tenant master components. In native mode, vc-manager creates
apiserver and controller-manager Pods in local K8s cluster, and in cloud mode, vc-manager calls public APIs to create
master components in public cloud.

- **syncer**: A centralized controller that populates API objects needed for Pod provision from every tenant master
to the super master, and update the object status back. It also periodically scans the synced objects to ensure
the states between tenant master and super master are consistent.

- **vn-agent**: A node daemon that proxies all tenant kubelet API requests to the kubelet process that running
in the node. It ensures each tenant can only access its own Pods in the node.

With all above, from the tenant’s perspective, each tenant master behaves like an intact Kubernetes with nearly
full API capabilities.

## A Short Demo

The below is a short demo created by [@zhuangqh](https://github.com/zhuangqh) which illustrates the high level
usage of a virtualcluster.

[![](http://img.youtube.com/vi/QvpNehTNRyk/0.jpg)](http://www.youtube.com/watch?v=QvpNehTNRyk "vc-demo")

## Quick Start

Please follow the [instructions](./doc/demo.md) to install virtualcluster in your local K8s cluster.

## Supported/Not Supported

Virtualcluster passes most of the Kubernetes conformance tests. One failed test asks for supporting
`subdomain` which cannot be easily done in virtualcluster architecture. There are other considerations
that users should be aware of:

- Virtualclsuter follows a serverless design pattern. The super master node topology is not fully exposed in
each tenant master. Only the nodes that run tenant Pods are shown in the tenant master. As a result,
virtualcluster does not support DaemonSet like workload in tenant master. In other words, the syncer controller
rejects a newly created tenant Pod if its `nodename` has been set in the spec.

- It is recommended to increase the tenant master node controller `--node-monitor-grace-period` parameter to a larger value
( >60 seconds, done in sample clusterversion [yaml](config/sampleswithspec/clusterversion_v1_nodeport.yaml) already).
The syncer controller does not update the node lease objects in tenant master,
hence the default grace period is too small.

- Coredns is not tenant-aware. Hence, tenant should install coredns in tenant master if DNS is required.
The DNS service should be created in tenant master `kube-system` namespace using name `kube-dns`. The syncer controller can then
recognize the DNS service cluster IP and inject it into Pod spec `dnsConfig`.

- To fully support service in virtualcluster, the tenant master CIDR and super master CIDR should be the same.

- Virtualcluster fully support tenant service account.

- Virtualclsuter does not support tenant PersistentVolumes. All PVs and Storageclasses are provided by the super master.

- It is recommended that tenant masters and super master use the same Kubernetes version to avoid
incompatible API behaviors. The syncer controller and vn-agent are built using Kubernetes 1.16 APIs, hence
higher Kubernetes versions are not supported.

## Release

The first release is coming soon.

## Community
Virtualcluster is a SIG multi-tenancy WG incubator project.
If you have any questions or want to contribute, you are welcome to file issues or pull requests.

You can also directly contact virtualcluster maintainers via the WG [slack channel](https://kubernetes.slack.com/messages/wg-multitenancy).

Lead developer<EMAIL_ADDRESS>


text:
# learning-angular

Learning Angular (2/4)

## Prerequisites

```
nvm install 8.5.0
nvm alias default 8.5.0
```

- Node `v8.5.0`
- NPM `5.3.0`

## Setup

Initialize npm

```
npm init -y
```

Install angular

```
npm install -g @angular/cli
npm install --save-dev @angular/cli@latest
```

Create new app

```
ng new myapp --directory ./
```

Serve app

```
ng serve --disable-host-check  --host $IP --port $PORT --public-host https://learning-angular-stormwild.c9users.io/
```

The `--public-host` and `--disable-host-check` arguments are needed to prevent zonejs localhost references and invalid host header errors.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

## Notes

### Build Separate CSS Files

In dev environment styles are embedded on the page, but extracted in production.

Alternatively set the `--extract-css` argument to the `ng build`

### Dependent or Nested Components

Nested components need to be declared in the nearest parent module.

```
// app.module.ts
// CarPartsComponent is referenced from app.component template file

import { CarPartsComponent } from './car-parts.component';

@NgModule({
  declarations: [
    AppComponent, CarPartsComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

```

### NgModel

Using ngModel for two-way data-binding requires the FormsModule.

```
// app.module.ts
import { FormsModule } from '@angular/forms';

@NgModule({
  ...,
  imports: [
    BrowserModule, FormsModule
  ],
  ...
})
export class AppModule { }
```

Otherwise an error will be display:

```
Angular 2: Can't bind to 'ngModel' since it isn't a known property of 'input'
```

## References

- [Introducing Angular Modules - Root Module](https://johnpapa.net/introducing-angular-modules-root-module/)
- [Is it possible to build separate CSS file with angular-cli?](https://stackoverflow.com/questions/42370854/is-it-possible-to-build-separate-css-file-with-angular-cli)
- [Angular 2: Can't bind to 'ngModel' since it isn't a known property of 'input'](https://stackoverflow.com/questions/38880150/angular-2-cant-bind-to-ngmodel-since-it-isnt-a-known-property-of-input)

repository: stormwild/learning-angular

gha_language: TypeScript

gha_license_id: MIT

repo_name: stormwild/learning-angular


text:
# Internationalization

The default language is English as of yet. If you want to use other languages, you can follow the instructions below.

## ConfigProvider

ant-design-vue provides a Vue Component [ConfigProvider](/components/config-provider) for configuring ant-design-vue locale text globally.

ConfigProvider does not include the internationalization of time components. You need to additionally import the internationalization files of the time library (dayjs, momentjs, date-fns, etc.). Below we have taken dayjs as an example.

```html
<template>
  <a-config-provider :locale="locale">
    <App />
  </a-config-provider>
</template>

<script>
  import zhCN from 'ant-design-vue/es/locale/zh_CN';
  import dayjs from 'dayjs';
  import 'dayjs/locale/zh-cn';
  dayjs.locale('zh-cn');

  export default {
    data() {
      return {
        locale: zhCN,
      };
    },
  };
</script>
```

Note: `fr_FR` is the filename, follow below.

Supported languages:

| Language                 | Filename |
| ------------------------ | -------- |
| Arabic                   | ar_EG    |
| Azerbaijani              | az_AZ    |
| Bulgarian                | bg_BG    |
| Bangla (Bangladesh)      | bn_BD    |
| Belarusian               | by_BY    |
| Catalan                  | ca_ES    |
| Czech                    | cs_CZ    |
| Danish                   | da_DK    |
| German                   | de_DE    |
| Greek                    | el_GR    |
| English (United Kingdom) | en_GB    |
| English                  | en_US    |
| Spanish                  | es_ES    |
| Estonian                 | et_EE    |
| Persian                  | fa_IR    |
| Finnish                  | fi_FI    |
| French (Belgium)         | fr_BE    |
| French (Canada)          | fr_CA    |
| French (France)          | fr_FR    |
| Irish (Ireland)          | ga_IE    |
| Galician (Spain)         | gl_ES    |
| Hebrew                   | he_IL    |
| Hindi                    | hi_IN    |
| Croatian                 | hr_HR    |
| Hungarian                | hu_HU    |
| Armenian                 | hy_AM    |
| Indonesian               | id_ID    |
| Italian                  | it_IT    |
| Icelandic                | is_IS    |
| Japanese                 | ja_JP    |
| Georgian                 | ka_GE    |
| Kurdish (Kurmanji)       | kmr_IQ   |
| Kannada                  | kn_IN    |
| Kazakh                   | kk_KZ    |
| Khmer                    | km_KH    |
| Korean                   | ko_KR    |
| Lithuanian               | lt_LT    |
| Latvian                  | lv_LV    |
| Macedonian               | mk_MK    |
| Malayalam (India)        | ml_IN    |
| Mongolian                | mn_MN    |
| Malay (Malaysia)         | ms_MY    |
| Norwegian                | nb_NO    |
| Nepal                    | ne_NP    |
| Dutch (Belgium)          | nl_BE    |
| Dutch                    | nl_NL    |
| Polish                   | pl_PL    |
| Portuguese (Brazil)      | pt_BR    |
| Portuguese               | pt_PT    |
| Romanian                 | ro_RO    |
| Russian                  | ru_RU    |
| Slovak                   | sk_SK    |
| Serbian                  | sr_RS    |
| Slovenian                | sl_SI    |
| Swedish                  | sv_SE    |
| Tamil                    | ta_IN    |
| Thai                     | th_TH    |
| Turkish                  | tr_TR    |
| Urdu (Pakistan)          | ur_PK    |
| Ukrainian                | uk_UA    |
| Vietnamese               | vi_VN    |
| Chinese (Simplified)     | zh_CN    |
| Chinese (Traditional)    | zh_HK    |
| Chinese (Traditional)    | zh_TW    |

See usage at [ConfigProvider](/components/config-provider).

repository: vueComponent/ant-design-vue

gha_language: Vue

gha_license_id: NOASSERTION

repo_name: vueComponent/ant-design-vue


text:
---
title: Run your project
path: /run-project/
---

# Run your project

### Development mode

To run your project in development mode, run:

```sh
yarn dev
```

This enables hot module reloading, integration with various dev tools, etc.

The command above also starts the Fusion.js HTTP server. The development site
will be available at `http://localhost:3000`.

### Production mode

It's sometimes useful to run a project in production mode, for example, to check
bundle size or to debug a production-only issue. To run your project in
production mode locally, run:

```sh
yarn build-production && NODE_ENV=production yarn start
```

**Note**: Development tooling such as hot reloading is not available in
production builds.

### NPM scripts

Fusion.js provides various CLI commands that you can run via `yarn run`. For
example, to run the application in development mode, run `yarn run fusion dev`.

```json
{
  "scripts": {
    "dev": "fusion dev",
    "test": "fusion test",
    "cover": "fusion test --cover",
    "build": "fusion build",
    "build-production": "fusion build --production",
    "start": "PORT_HTTP=\"$PORT_HTTP\" fusion start"
  }
}
```

#### `yarn run fusion --help`

Shows Fusion.js CLI help. Get contextual help for each individual
command by passing `--help` as an argument to a command. For example, to see
what options are available to the `dev` command, run `yarn run fusion dev --help`

#### `yarn dev`

Starts the development mode server (with hot module reloading, etc.)

* `yarn dev --debug` - Enables debugger socket. See
  [Node.js inspector docs for more information](https://nodejs.org/en/docs/inspector).
* `yarn dev --port=1234` - Specifies what port the app should run on
* `yarn dev --no-open` - Don't open browser window automatically
* `yarn dev --no-hmr` - Disables hot module reloading
* `yarn dev --log-level=level` - Filters logs by level. Valid levels are:
  `error`, `warn`, `info`, `verbose`, `debug`, `silly`
* `yarn dev --dir=dir` - Specify the root directory for the application,
  relative to cwd. Defaults to `.`

#### `yarn test`

Runs tests

* `yarn test --cover` - Also runs test coverage
* `yarn test --skip-build` - Tests existing assets without recompiling
* `yarn test --watch` - Re-runs tests when files change
* `yarn test --dir=dir` - Specify the root directory for the application,
  relative to cwd. Defaults to `.`

#### `yarn cover`

Runs test coverage

#### `yarn build`

Builds a development bundle without starting the server

* `yarn build --test` - Builds test assets in addition to development assets
* `yarn build --cover` - Builds test assets with coverage instrumentation in
  addition to development assets
* `yarn build --production` - Builds production assets
* `yarn build --dir=dir` - Specify the root directory for the application,
  relative to cwd. Defaults to `.`

#### `yarn build-production`

Builds a production bundle

#### `yarn start`

Runs a bundle that was built via `yarn build`

* `yarn start --environment=env` - Runs the app as if running in a specific
  environment. Valid environments are: `development`, `production`
* `yarn start --dir=dir` - Specify the root directory for the application,
  relative to cwd. Defaults to `.`

#### `yarn lint`

Runs eslint

<!--
#### `yarn profile`

Opens source-map-explorer

* `yarn profile --environment` - Profiles assets for a specific environment.
  Valid values are: `development`, `production`
* `yarn profile --watch` - Updates source-map-explorer on file change
* `yarn profile --file-count` - Limit the number of files to display when
  showing list of largest files
* `yarn profile --dir=dir` - Specify the root directory for the application,
  relative to cwd. Defaults to `.`
-->

---

### Next steps

* [Core Concepts](/docs/learn-fusion/core-concepts)


text:
## MumblePL

This is a mumble skin for any linux desktop with a touch of my favourite internet spaceship pixel game guild "Pandemic Legion".

Based on [Mumble Lite Theme](https://github.com/mumble-voip/mumble-theme)
and [MetroMumble Theme by xPoke](https://github.com/xPoke/MetroMumble).

##### Screenshots

![mumble](/screenshots/mumble.png)

![mumble-options](/screenshots/mumble-options.png)

##### Installation

Download the repository and unzip the file in a new folder. In Mumble go to Configure > Settings > User Interface > Look and Feel. Choose Skin: YourFolder/PandemicLegion.qss . Hit Apply and restart Mumble.

##### Modification

If you need to change the look of the theme please change /source/PandemicLegion.scss and rebuild the theme with ```sass /source/PandemicLegion.scss PandemicLegion.qss```.

license: Unlicense

repository: ForlornWongraven/MumblePL

repo_name: ForlornWongraven/MumblePL


text:
Template with Android Architecture Components
===========================================================

This is a template that uses Android Architecture Components with Dagger 2 and other useful libraries.

Introduction
-------------

### Building
You can open the project in Android studio and press run.
### Testing
The project uses both instrumentation tests that run on the device
and local unit tests that run on your computer.
To run both of them and generate a coverage report, you can run:

`./gradlew fullCoverageReport` (requires a connected device or an emulator)

#### Device Tests
##### UI Tests
The projects uses Espresso for UI testing. Since each fragment
is limited to a ViewModel, each test mocks related ViewModel to
run the tests.
##### Database Tests
The project creates an in memory database for each database test but still
runs them on the device.

#### Local Unit Tests
##### ViewModel Tests
Each ViewModel is tested using local unit tests with mock Repository
implementations.
##### Repository Tests
Each Repository is tested using local unit tests with mock web service and
mock database.
##### Webservice Tests
The project uses [MockWebServer][mockwebserver] project to test REST api interactions.

### Libraries
* [Android Support Library][support-lib]
* [Android Architecture Components][arch]
* [Android Data Binding][data-binding]
* [Dagger 2][dagger2] for dependency injection
* [Retrofit][retrofit] for REST api communication
* [Glide][glide] for image loading
* [Timber][timber] for logging
* [Navigation][navigation] for implementing common, but complex navigation requirements
* [espresso][espresso] for UI tests
* [mockito][mockito] for mocking in tests

[mockwebserver]: https://github.com/square/okhttp/tree/master/mockwebserver
[support-lib]: https://developer.android.com/topic/libraries/support-library/index.html
[arch]: https://developer.android.com/arch
[data-binding]: https://developer.android.com/topic/libraries/data-binding/index.html
[espresso]: https://google.github.io/android-testing-support-library/docs/espresso/
[dagger2]: https://google.github.io/dagger
[retrofit]: http://square.github.io/retrofit
[glide]: https://github.com/bumptech/glide
[timber]: https://github.com/JakeWharton/timber
[mockito]: http://site.mockito.org
[navigation]: https://developer.android.com/topic/libraries/architecture/navigation/

Pre-requisites
--------------

* Android Studio 3.2 Canary 14 or later and you know how to use it.

* Make sure Android Studio is updated, as well as your SDK and Gradle.
Otherwise, you may have to wait for a while until all the updates are done.

* A device or emulator that runs API level 27

You need to be solidly familiar with the Kotlin programming language,
object-oriented design concepts, and Android Development Fundamentals.
In particular:

* Basic layouts and widgets
* Some familiarity with fragment transitions
* DataBinding
* LiveData
* Fragment Lifecycle
* ViewModel
* Navigation Library
* Dependency Injection
* Observer design pattern
* Singleton design pattern
* Testing

Getting Started
---------------

1. [Install Android Studio](https://developer.android.com/studio/install.html),
if you don't already have it. Make sure you use a version that supports Navigation library.
2. Download the example.
3. Import the example into Android Studio.
4. Build and run the example.
5. Replace UserFragment, User and fragment_user with implementations of your choice.

License
--------

Copyright 2018 Marian Vasilca.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
License for the specific language governing permissions and limitations under
the License.

repository: MarianVasilca/android-mvvm-template

repo_name: MarianVasilca/android-mvvm-template


text:
# vscode-terraform-syntax

## Description

This a [terraform](https://www.terraform.io/) syntax definition, using https://github.com/hashicorp/hcl2/tree/master/extras/grammar as base.

## Scope

The scope of this extension will limit itself to grammar/syntax and snippets as other features can be provided by other extensions and bundled as [Extension Packs](https://code.visualstudio.com/blogs/2017/03/07/extension-pack-roundup).

repository: pecigonzalo/vscode-terraform-syntax

gha_language: HCL

repo_name: pecigonzalo/vscode-terraform-syntax


text:
Keras implementation for the prediction of predefined AD landmarks.

The code was written by Jun Zhang and Mingxia Liu, Department of Radiology at UNC. Jun Zhang is currently working at Duke University

Applications

Predict 50 AD landmarks We used group comparison to define more than 1000 landmarks that are related to the Alzheimer's disease[1]. In our following work[2], we noticed that top 20 to 50 landmarks may be enough for AD classification by intergating deep neural networks. Therefore, we provide the landmark detection code to predict 50 landmarks for new images.

Note that, you must perform the linear alignment for your image (to Img.nii.gz), and then run our code for landmark detection.

Prerequisites

Linux python 2.7

Keras version 0.2.0_4

NVIDIA GPU + CUDA CuDNN (CPU mode, untested) Cuda version 8.0.61

Getting Started

Installation

Install Keras and dependencies

Install SimpleITK with pip install SimpleITK

Install numpywith pip install numpy

Download the pretrained model from https://drive.google.com/file/d/1GiMgubo6swgIgMBFE-zggcwxyT5ey01U/view?usp=sharing

Copy the model to the folder of /Model

cd to current folder and

Apply our Pre-trained Model with GPU

python main.py --input Img.nii.gz

Note we use the Keras backend as follows { "image_data_format": "channels_first", "epsilon": 1e-07, "floatx": "float32", "backend": "tensorflow" }

Citation

If you use this code for your research, please cite our paper:

[1]

@article{zhang2016detecting, title={Detecting anatomical landmarks for fast Alzheimer¡¯s disease diagnosis}, author={Zhang, Jun and Gao, Yue and Gao, Yaozong and Munsell, Brent C and Shen, Dinggang}, journal={IEEE transactions on medical imaging}, volume={35}, number={12}, pages={2524--2533}, year={2016}, publisher={IEEE} }

[2]

@article{liu2018landmark, title={Landmark-based deep multi-instance learning for brain disease diagnosis}, author={Liu, Mingxia and Zhang, Jun and Adeli, Ehsan and Shen, Dinggang}, journal={Medical image analysis}, volume={43}, pages={157--168}, year={2018}, publisher={Elsevier} }

repository: Mozihua/AD-Landmark-Prediction

repo_name: Mozihua/AD-Landmark-Prediction


text:
EasyRepl
========
Easy REPL module - Adds telnet accessible REPL to your server scoped to a passed in context

Example usage

    EasyREPL = require('easyrepl');

    var easyRepl = new EasyREPL({
      abc: abc_instance,
      process: {
        // only expose a subset of process which is useful for debugging
        memoryUsage : process.memoryUsage,
        uptime : process.uptime,
        hrtime : process.hrtime
      }
    });

    easyRepl.start();
    // REPL Setup Done

repository: Reregistered/EasyRepl

repo_name: Reregistered/EasyRepl


text:
# go-plantuml
[![Build Status](https://github.com/bykof/go-plantuml/actions/workflows/test.yml/badge.svg)](https://github.com/bykof/go-plantuml/actions/workflows/test.yml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/bykof/go-plantuml)](https://goreportcard.com/report/github.com/bykof/go-plantuml)
[![go-recipes](https://raw.githubusercontent.com/nikolaydubina/go-recipes/main/badge.svg?raw=true)](https://github.com/nikolaydubina/go-recipes)

go-plantuml generates plantuml diagrams from go source files or directories.
It supports generic fields.

## Installation

```bash
go install github.com/bykof/go-plantuml@latest
```

Please consider that `$GOPATH/bin` should be on our `$PATH`.

## Usage

```bash
Usage:
  go-plantuml [command]

Available Commands:
  generate    Generate a plantuml diagram from given paths
  help        Help about any command

Flags:
  -h, --help     help for go-plantuml
  -t, --toggle   Help message for toggle

Use "go-plantuml [command] --help" for more information about a command.

```

```bash
Usage:
  go-plantuml generate [flags]

Flags:
  -d, --directories strings   the go source directories (default [.])
  -f, --files strings         the go source files
  -h, --help                  help for generate
  -o, --out string            the graphfile (default "graph.puml")
  -r, --recursive             traverse the given directories recursively
  -x, --exclude               exclude file matching given regex expression, not used if using -f flag
```

## Example

For example we have to files in the directory `test`.

```go
// address.go
package models

import "fmt"

var (
	EmptyVariable, AnotherEmptyVariable string
	A, B                                = "1", 2
	PackageVariable                     = "Teststreet"
	AnotherPackageVariable              = "Anotherteststreet"
)

const (
	StartingStreetNumber = 1
)

type (
	AddressLike interface {
		FullAddress(withPostalCode bool) string
	}

	Address struct {
		A, B          string
		Street        string
		City          string
		PostalCode    string
		Country       string
		CustomChannel chan string
		AnInterface   *interface{}
	}
)

func (address Address) FullAddress(withPostalCode bool) string {
	return fmt.Sprintf(
		"%s %s %d",
		PackageVariable,
		AnotherPackageVariable,
		StartingStreetNumber,
	)
}

```

```go
// user.go
package models

import "github.com/bykof/go-plantuml/test/address/models"

type (
	User struct {
		FirstName      string
		LastName       string
		Age            uint8
		Address        *models.Address
		privateAddress models.Address
	}
)

func (user *User) SetFirstName(firstName string) {
	user.FirstName = firstName
}

func PackageFunction() string {
	return "Hello World"
}

```

Then we run `go-plantuml generate` or `go-plantuml generate -d . -o graph.puml`.

This will create a `graph.puml` file and check for .go files inside your current directory.

Which looks like this:

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: bykof/go-plantuml

gha_language: Go

repo_name: bykof/go-plantuml


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
### Changed
- Default residue name and number: `UNK` and `0` are now the default values if `None` or
  `''` is given
### Deprecated
### Removed
### Fixed
- Residues with a resnumber of `0` are not converted to `None` anymore (Issue #13)

## [0.3.1] - 2021-02-02
### Added
- Integration with Zenodo to automatically generate a DOI for new releases
- Citation page
- Docking section in the Quickstart notebook (Issue #11)
- PDBQT, MOL2 and SDF molecule suppliers to make it easier for users to use docking
  results as input (Issue #11)
- `Molecule.from_rdkit` classmethod to easily prepare RDKit molecules for ProLIF
### Changed
- The visualisation notebook now displays the protein with py3Dmol. Some examples for
  creating and displaying a graph from the interaction dataframe have been added
- Updated the installation instructions to show how to install a specific release
- The previous repr method of `ResidueId` was easy to confuse with a string, especially
  when trying to access the `Fingerprint.ifp` results by string. The new repr method is
  now more explicit.
- Added the `Fingerprint.run_from_iterable` method, which uses the new supplier functions
  to quickly generate a fingerprint.
- Sorted the output of `Fingerprint.list_available`
### Deprecated
### Removed
### Fixed
- `Fingerprint.to_dataframe` is now much faster (Issue #7)
- `ResidueId.from_string` method now supports 1-letter and 2-letter codes for RNA/DNA
  (Issue #8)

## [0.3.0] - 2020-12-23
### Added
- Reading input directly from RDKit Mol as well as MDAnalysis AtomGroup objects
- Proper documentation and tests
- CI through GitHub Actions
- Publishing to PyPI triggered by GitHub releases
### Changed
- All the API and the underlying code have been modified
- Repository has been moved from GitHub user @cbouy to organisation @chemosim-lab
### Deprecated
### Removed
- Custom MOL2 file reader
- Command-line interface
### Fixed
- Interactions not detected properly

## [0.2.1] - 2019-10-02
Base version for this changelog

repository: LaYeqa/ProLIF

repo_name: LaYeqa/ProLIF


text:
#### Integrations
##### LogRhythmRest v2
- Added the ***lr-get-alarm-details*** command to enable retrieving details about a given alarm.
- Added the ***lr-alarm-drilldown*** command to enable retrieving
  logs per rule block for a specific alarm ID that fired associated with an AIE alarm.
- Updated the Docker image to: *demisto/python3:<IP_ADDRESS>713*.

repository: demisto/content

gha_language: Python

repo_name: demisto/content


text:
---
layout: post
title: BCH Trading Competition and Lucky Draw
author:
lang: en
data: 2018-01-30
post_id: 10
id: 10
ref: ad
time:
---

Event Time:  Feb.1st – Feb 28th 2018

Bitpie in-wallet exchange went live since V3.0.0. The in-wallet exchange has gained extraordinary popularity in our users and reached 8,000 peak concurrent users at very first day.

To reward our supporters and encourage more users to experience the in-wallet exchange, we have compiled some amazing prizes for our users to win in the BCH trading competition. We will rank users from 1 to 20 in terms of the total BCH volume traded on your account (includes both buys & sells) in the BCH/BTC trading pair during the competition period. The reward program will be as follows:

1st Place to receive a two persons trip to Silicon Valley - Blockchain Exploratory (or equivalent BCH)

2nd Place to receive 2 BCH and an iPhoneX

3rd Place to receive 1 BCH and an iPhoneX

4th - 10th Place: each to receive 1 BCH

11th - 20th Place: each to receive 0.5 BCH

All users who has more than 1 BCH volume traded (includes both Buys & Sells) in the BCH/BTC trading pair during the event period are eligible for a lucky draw. The reward program will be as follows:

10 lucky users will receive 0.5 BCH.

2 lucky users will receive 1BCH.

1 winner will receive the top prize: A trip to Tokyo - Blockchain Exploratory (or equivalent BCH)

Note:

Bitpie reserves the right to cancel or amend the competition or competition Rules and the lucky draw rules at our sole discretion. All trades that we deem to be “wash trades” will not count towards your total trading volume for this trading competition.

Bitpie Limited, Republic of Seychelles


text:
# Overlap-save linear convolution

Implementation of the overlap-save algorithm for one-dimentional long-sequence linear convolution.

This repository is part of my work as monitor in the Digital Signal Processing course (ELC1060), Federal University of Santa Maria.

**Files**
- overlap_save.py: overlap-save method defined in a class data structure
- apply_filter.py: use the above class to apply a FIR filter to a sample signal

**Future**
- Implement optimized Multiband Filterbank using overlap-save (https://www.iro.umontreal.ca/~mignotte/IFT3205/Documents/TipsAndTricks/MultibandFilterbank.pdf"

gha_license_id: Unlicense


text:
# basic-express-server-401

- ### [basic-express-server-main](https://github.com/MURADALSHORMAN/basic-express-server-401)
- ### [basic-express-server-dev](https://github.com/MURADALSHORMAN/basic-express-server-401/tree/dev)

## The Deploy Link

* ### [basic-expressserver.herok](https://basic-expressserver.herokuapp.com/)

# UML

the server recived the request from the clint or the another server that requset send by the server.js to the midleware to handeling it if any Error happend the midleware will send that error to the error Handler and if everything is oj the midleware will send the response to the sever.js  to send it to the claint

![](https://github.com/MURADALSHORMAN/basic-express-server-401/blob/main/lab2.JPG)


text:
---
layout: page
title: Credits
permalink: /credits
---

This website was created using [the Mediumish Jekyll theme from wowthemes.net](https://github.com/wowthemesnet/mediumish-theme-jekyll), which is released under the MIT license.

The source for this website is always available in our repo at [https://github.com/fnndsc/website](https://github.com/fnndsc/website).

repository: rolandixor/chris-project-website

repo_name: rolandixor/chris-project-website


text:
# open-broker-jvm

A library containing Kotlin classes for working with [Open Broker](https://github.com/open-broker/specification/) events, as well as functionality to serialize and deserialize these events.

Releases will be tagged with incrementing _build number_.

[![](https://jitpack.io/v/open-broker/open-broker-jvm.svg)](https://jitpack.io/#open-broker/open-broker-jvm)

repository: open-broker/open-broker-jvm

gha_language: Kotlin

repo_name: open-broker/open-broker-jvm


text:
# Contributing

We welcome contributions to [DVC](https://github.com/iterative/dvc) by the
community.

## How to report a problem

Please search [issue tracker](https://github.com/iterative/dvc/issues) before
creating a new issue. Feel free to add issues related to the project and
[dvc.org](https://dvc.org) site.

## Submitting changes

* Open a new issue in the [issue tracker](https://github.com/iterative/dvc/issues).
* Get the latest development version. Fork and clone the repo:
  ```dvc
      $ git clone https://github.com/iterative/dvc.git
  ```
* Install requirements with `pip install -r requirements.txt` and
`pip install -r test-requirements.txt`. We **strongly** recommend initializing a
[virtual environment](https://virtualenv.pypa.io/en/latest/userguide/) before
installing the required libraries. For example:
  ```dvc
      $ cd dvc
      $ virtualenv .env
      $ source .env/bin/activate
      $ pip install -r requirements.txt
      $ pip install -r test-requirements.txt
  ```
* Install style checkers and pre-commit hooks with
  ```dvc
      pip install pre-commit
      pip install -r test-style-requirements.txt
      pre-commit install
  ```
* Make changes. Check the paragraph below if you need to run it with your changes.
* Add tests for your change to `tests/test_*.py`.
* Run tests with `python -m tests` and make sure all of them pass.
* Submit a pull request, referencing any issues it addresses.

We will review your pull request as soon as possible. Thank you for contributing!

## Running development version

To run DVC from its Git repository you need to setup your environment:

* Export `DVC_HOME` variable that is pointing to the root of your repository:
  ```dvc
  $ export DVC_HOME=/home/user/git/dvc
  ```

* Modify and export `PATH` variable to include location of our wrapper script:
  ```dvc
  $ export PATH=$PATH:$DVC_HOME/bin
  ```

* Check that `dvc` points to your repository:
  ```dvc
   $ which dvc
   /home/user/git/dvc/bin/dvc
   ```

## Style guides
### Commit messages

Format:
```
(component): (short description)

(long description)

Fixes #(github issue id).
```

Message types:

* *component* - name of a component that this patch is affecting. Use `dvc`
in a general case;
* *short description* - short description of the patch;
* *long description* - If needed, longer message describing the patch in more
details;
* *github issue id* - An id of the github issue that this patch is addressing;

Example:
```
  remote: add support for Amazon S3

  Fixes #123
```

### Python style guide
We are using [PEP8](https://www.python.org/dev/peps/pep-0008/?) and are
checking that our code is formated with [black](https://github.com/ambv/black).


text:
Note: this example is a modification of davidcpage's CIFAR10 training example located here:
https://github.com/davidcpage/cifar10-fast.git

Modifications were made to support training on Amazon SageMaker.
If you're looking for the original un-modified code, please refer to the author's github repository linked above.


text:
# List Processing

This is the third assignment in the Teamwork Course @ SoftUni.

Topic: **Project Tracking Tools**

Trello link: https://trello.com/b/to6R87QJ

## Contributors:
  + Dimitur Nikolov
  + Mario Slavov
  + Plamen Stoyanov

### Tasks allocation:

  + Plamen Stoyanov:
	+	Design the project structure,
	+	Create GitHub Repo,
	+	Implement the “delete” command,
	+	Implement the “roll left” command,
	+	Implement the “roll right” command;

  + Dimitur Nikolov:
	+	Design the project structure,
	+	Create Trello Task management board,
	+	Implement the “sort” command,
	+	Implement the “count” command,
	+	Implement the “end” command;

  + Mario Slavov:
	+	Design the project structure,
	+	Implement the processing of the first command line,
	+	Implement the “append” command,
	+	Implement the “prepend” command,
	+	Implement the “reverse” command,
	+	Implement the “insert” command;


text:
### Domains

the essential functions of domains

- definition
 -  natures
 -  basises
- recovery
- static/shared resources
- description (re-representation)
- meta-description/schema (self-representation)

### referring to domains

Strategy 1: direct file reference
in this strategy a construct refers to what domain it is in by giving the path of the file (relative to this file or from the project root)

Strategy 2: file inclusion and relative reference
here the domain is a sibling of the construct, and the domain chosen is by using it's identifier.

Strategy 3: absolute index reference
our project contains a domain index which creates a single namespace for domains both external(imported) and internal.

Strategy 4: Default
you still get a domain when you do not specify, it is the same domain as the space of recovery.

Strategy 5: absolute

### examples

include 'path/to/domain' as relative-domain

<relative-domain.basis> name #tag in operating-domain:
    extra:

### basis resolution.

- look in the immediate surroundings
- look in the domain
- recursively seek through domains
- look in the absolute/platform domain.
- once you find the base nature create the basic object and apply the final initialization patch.

### process imparatives

within the {process} node, we would like to be able to command the creation from data and the extraction to data within the context.

save [[representation]] reset the record to this one
@x = representation
@x : repr
save @x: repr

make x : [[representation]]  turn an inert representation into a live structure in this context
@x ~ representation
@x ~ <basis>
@x = new <>
create, prime, init, new, plant

describe (desgnator) pick a live structure and create a representation of it

describe @x
@x<basis>
@x(?)
@x(<>)
what-is, explain, inquire, extract.

merge/patch/modify: apply this representation as a delta to the structue or representation.

@x << representation
merge @x representation

kill turn a living structure back to representation in place
kill @x === save @x describe @x

resurrect, birth, raise
raise x === make @x @x

delete, remove
delete @x

lift, dig, pick-up, rip turn a live into representation and leave it's place blank
dig @x === describe @x delete @x

modify the domain
use ~ instead of @

### process basises
if a process is the basis it will act as a transform to produce the next structure. Such a form would allow it to require information, and to derive properties from the context and input from many sources. they are the effective replacement of macros.

There is an ambiguity of context though, is the context that of the instance which is not yet constructed, or is it the domain where it lives?

We should make it that the structure in this form does exist to be connected but the context is where the process is defined.
```
process-basis:{
    from init let topside: <basis>
        definite to required-input ask: (hello)
}

<process-basis> instance:

^[instance -> ]
```

the construction of this will fetch hello from whatever

### property modifiers
some times we will want to restrict the way that certain properties are accessed, to create purer abstractions and patterns.

- this structure cannot be killed (invincible)
- only accessible as basis (transcendent)
- cannot be overridden (fixed)
- must be overridden (abstract)
- is constant once alive (constant)

repository: Space-Ed/tau

repo_name: Space-Ed/tau


text:
#26 Functions From Lodash

## add

Adds two numbers.

### Arguments

x: The first number in an addition.
y: The second number in an addition.

### Returns

Integer

### Example
```
add(6, 4);
//returns 10
```

## camelCase

Converts string to camel case.

### Arguments

string: the string to convert to camel case

### Returns

String after conversion to camel case (first letter in each word is capitalized except for the first
word, which is lowercase)

### Example
```
camelCase('--foo-bar--')
//returns 'fooBar'
```

## capitalize

Converts the first character of a string to uppercase and the remaining to lowercase.

### Arguments

string: the string to capitalize

### Returns

String after converting first letter to capital and remaining letters to lowercase.

### Example
```
capitalize('aPPle pIE')
//returns 'Apple pie'
```

## chunk

Splits an array into smaller arrays with each having the length of a given number

### Arguments

array: the array to split up
number: the length of each smaller array created after splitting up array

### Returns

An array of smaller arrays made of elements from a larger array. Each element's length is the same as the number chosen
when the function was called. If the array cannot be split evenly, there will be a final chunk with remaining
elements.

### Example
```
chunk(['a', 'b', 'c', 'd'], 2)
//returns [['a', 'b'], ['c', 'd']]
```

## compact

Creates an array with all falsey values removed.

### Arguments

array: the array from which falsey values will be removed

### Returns

An array with falsey values removed

### Example

```
compact(['bat', 'cap', '', null, 'tree', undefined])
//returns ['bat', 'cap', 'tree']

```

## concat

Creates a new array concatenating an array with additonal arrays and/or values.

### Arguments

array: the array to concatenate
values: values to concatenate with the array

### Returns

An array with the values from the original array as well as additional arrays and/or values
that were provided as arguments.

### Example

```
concat(['Learners Guild'], 'laptops', 'giant monitors', [['desks', 'people']])
//returns ['Learners Guild', 'laptops', 'giant monitors', ['desks', 'people']]

```

## divide

Divide two numbers

### Arguments

x: the numerator
y: the denomenator

### Returns

Integer

### Example

```
divide(1, 5)
//returns 0.2

```

## drop

Slices n elements from the beginning of an array.

### Arguments

array: the array from which to drop elements
n: the number of elements to drop

### Returns

An array with n elements dropped from the beginning

### Example

```
drop([1, 2, 3], 2)
//returns [3]

```

## join

Converts all elements in an array into a string seperated by a given separator

### Arguments

array: the array to convert
separator: the seperator to put between elements after conversion of the array into a string

### Returns

A string made of the array's elements seperated by a given separator

### Example

```
join([2, 4, 6, 8, 'Who', 'do', 'we', 'appreciate.'], ' ')
//returns '2 4 6 8 Who do we appreciate.'

```

## kebabCase

Converts string to kebab case

### Arguments

string: the string to be converted into kebab case

### Returns

A string with a dash between each word

### Example

```
kebabCase('_*_&Our_$String')
//returns 'our-string'

```

## last

Gets the last element of an array.

### Arguments

array: the array from which the last element is wanted

### Returns

The value of the last element of the array

### Example

```
last(['a', 'b', 'c'])
//returns 'c'

```

## lowerFirst

Converts the first character of a string to lowercase, with other characters unchanged

### Arguments

string: the string to convert

### Returns

A string with the first character changed to lowercase

### Example

```
lowerFirst('THIS iS A 100$ bill')
//returns 'tHIS iS A 100$ bill'

```

## min

Computes the minimum value of an array

### Arguments

array: the array from which to find the minimum value

### Returns

The smallest value from the given array

### Example

```
min([8, 17, 45, 1, 5, 7, 19, 1, 47])
//returns 1

```

## multiply

Multiplies two numbers

### Arguments

x: the first factor being multiplied
y: the second factor being multiplied

### Returns

Integer

### Example

```
multiply(-4, 2)
//returns -8

```

## nth

Gets element at index n of an array.

### Arguments

array: the array from which to find element at index n
n: the index from which to return the value

### Returns

Value of element at index n of an array. If n is negative, the nth element from the end is returned

### Example

```
nth([2, 4, 6, 8, 10], -3)
//returns 6

```

## pull

Removes all given values from an array

### Arguments

array: the array to modify
values: the values to remove from the array

### Returns

The array containing only the remaining values after values from arguments are removed

### Example

```
pull([1, 2, 3, 1, 2, 3], 1, 3)
//returns [2, 2]

```

## range

Creates an array of numbers progressing from a starting point up to an ending point (not including end value).

### Arguments

start: the start of the range
end: the end of the range
step: the value to increment or decrement by

### Returns

An array with the numbers from start to end (not encluding end value)

### Example

```
range(-1, 5)
//returns [-1, 0, 1, 2, 3, 4]

```

## repeat

Repeats the given string n times

### Arguments

string: the string to repeat
n: the number of times to repeat the string

### Returns

A string made up of the given string repeated n times

### Example

```
repeat('*', 3)
//returns '***'

```

## reverse

Reverses array so first element becomes the last, second becomes second to last and so on...

### Arguments

array: the array to reverse

### Returns

An array with the given array's elements in reversed order

### Example

```
reverse([1, 2, 3])
//returns [3, 2, 1]

```

## slice

Creates a slice of an array from a given starting point, up to but not including a given end.

### Arguments

array: the array to slice
startingIndex: starting point
endingIndex: end

### Returns

An array sliced from a larger array

### Example

```
slice([1, 2, 3, 4, 5, 6], 1, 5)
//returns [2, 3, 4, 5]

```

## snakeCase

Converts a string to snake case

### Arguments

string: the string to convert

### Returns

A string with an underscore between each word

### Example

```
snakeCase('some string')
//returns ‘some_string’

```

## startsWith

Checks if a given string starts with a given string value

### Arguments

string: the string to inspect
target: the string to compare
position: the position in the string to begin the comparison

### Returns

True if string begins with target at given position (or at index 0 if position not specified) or false

### Example

```
startsWith('abc', 'a')
//returns true

```

## subtract

Subtracts one number from another

### Arguments

x: the number to subtract from
y: the number being subtracted from x

### Returns

Integer

### Example

```
subtract(6, 4)
//returns 2

```

## sum

Computes the sum of the values within an array

### Arguments

array: contains values to be added together

### Returns

Integer

### Example

```
Sum([1, 2, 3, 4])
//returns 10

```

## tail

Gets all but first element of array

### Arguments

array: the array from which to return all but first element

### Returns

The given array but without its first element

### Example

```
tail([4, 5, 6, 7, 8])
//returns [5, 6, 7, 8]

```

## toLower

Converts all letters in string to lower case

### Arguments

string: the array to convert

### Returns

A string with all letters in lowercase. Anything that is not a letter remains unchanged.

### Example

```
toLower(’__FOO_BAR__')
//returns ‘__foo_bar__’

```

repository: yogimasterson/ancient-ant

repo_name: yogimasterson/ancient-ant


text:
> [Go to French version](/fr/Règlements/Codification%20des%20règlements%20du%20Canada/301-400/C.R.C.,%20ch.%20322.md)

# Regulations Respecting Payments in Lieu of Development and Redevelopment Taxes on Federal Property

**C.R.C., c. 322**

Enabling authorities:
- APPROPRIATION ACT NO. 3, 1976

- [APPROPRIATION ACTS](/en/Acts/Revised%20Statutes%20of%20Canada/Z/Z-01.md)

----------

## Short Title

**1** These Regulations may be cited as the Development Tax and Redevelopment Tax Grant Regulations.

## Interpretation

**2** In these Regulations,

***defined area*** means an area within a municipality in which a development tax or redevelopment tax is levied; (*zone déterminée*)

***development tax or redevelopment tax*** means a compulsory levy imposed by a municipality on real property situated within a defined area that is
- **(a)** payable by a taxable owner of real property by virtue of his ownership of such property or of specified actions undertaken by him to develop such property,
- **(b)** calculated by reference to all or part of the frontage, area or other attribute of land or buildings of the owner,
- **(c)** assessed at a uniform rate upon owners of real property liable to pay the tax, and
- **(d)** levied for the purpose of financing all or part of the capital cost of the construction or reconstruction of a trunk or arterial road or any other capital service that has been, is being or will be carried out within the defined area,

but does not include a levy in respect of which payments by way of a grant may be made under section 4 or 6 of the Municipal Grants Act or a levy on real property paid to a municipality in the form of a land transfer or of cash in lieu thereof; (*taxe d'aménagement ou de réaménagement*)

***federal property*** means federal property as defined in subection 6(3) of the Municipal Grants Act; (*propriété fédérale*)

***other attribute of land or buildings*** includes the actual or estimated cost of construction on a site, the number of rooms, living units or beds or the number of persons in occupancy. (*autre caractéristique des biens immeubles*)

## Grants

**3** Subject to section 4, on receipt of an application from a municipality in a form prescribed by the Minister, the Minister may pay to the municipality, in respect of federal property, a grant in lieu of a development tax or redevelopment tax not exceeding the amount of tax that would be payable if federal property were taxable property.

**4** The Minister may, in determining the amount of a grant payable to a municipality under these Regulations in respect of federal property within a defined area, deduct from the amount that would otherwise be payable an amount that, in the opinion of the Minister, is equal to the product of the total proceeds of the development tax or redevelopment tax in respect of that area multiplied by a fraction the denominator of which is the said total proceeds and the numerator of which is that portion of the said total proceeds that relates to the financing of services of a kind that the federal government, at its own expense, has carried out, is carrying out or plans to carry out.

## Application

**5** These Regulations apply in respect of a development tax or redevelopment tax on federal property that would, if the federal property were taxable property, have become due and payable on or after January 1, 1974.

url: https://raw.githubusercontent.com/TravisMadill/CanadianLaws/776186d75e6e345dc5a0f1cd9243028efa9ac34c/en/Regulations/Consolidated Regulations of Canada/301-400/C.R.C., c. 322.md

repository: TravisMadill/CanadianLaws

repo_name: TravisMadill/CanadianLaws


text:
# yt_clipper

yt_clipper is a relatively simple way to clip videos from popular platforms (for now YouTube and vlive).
It provides a graphical UI for video editing that creates instructions in `json` format for clipping the video.
These instruction files are small and in plain text so they can be easily read, modified, and shared with others.
The `clipper script` component provides a way to process these instructions and generate the clips you want.

# Video Quick Start

For a video quickstart check out this gfy: <https://gfycat.com/meekweightyarmyant>

# Quick Start Guide

Visit [this quickstart guide](https://github.com/exwm/yt_clipper/blob/master/quickstart.md) to get up and running with `yt_clipper`.

The contents of the quickstart guide are included here for convenience:

1) First install a user script extension (preferably Tampermonkey) for your browser (preferably chrome).
   - See [this article](https://openuserjs.org/about/Userscript-Beginners-HOWTO) for more information.
2) Next install the `markup script` component of `yt_clipper` by clicking [here](https://openuserjs.org/install/elwm/yt_clipper.user.js).
3) Install the standalone `clipper script` component of `yt_clipper` by visiting [Clipper Script Installation](#clipper-script-installation).
   - Alternatively download the python source [here](https://github.com/exwm/yt_clipper/blob/master/src/clipper/yt_clipper.py) and see [this section](#clipper-script-usage) for usage instructions.
4) Visit a YouTube video page. Check that the `markup script` is [active on the page](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_active_on_page.png). Refresh the page if it is not active.
5) Press **Alt+Shift+A** to activate the `markup script` and its hotkeys. You should see a [flash message](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_hotkeys_activated.png) below the video.
   - Use the various hotkeys to add marker pairs and edit settings to specify how to clip the video.
     - **A** to add markers, **Z** to undo markers, **Shift+Mouseover** a yellow end marker to open [its settings editor](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_marker_pair_editor.png).
     - **W** to open global settings editor, **Shift+W** to toggle additional settings.
   - Click the [shortcuts reference toggle](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_shortcuts_table.png) in the video player bar for an overview of all shortcuts.
   - Hover over an option in a settings editor to see a [tooltip](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_tooltip.png) describing the option.
6) Use the **S** key to save markers data in `.json` format.
7) Generate webms using the saved markers data and the `clipper script`.
   - **Windows:** Drag and drop the saved markers data onto the `yt_clipper_auto.bat`.
   - **Mac:** Launch the `yt_clipper_auto.sh` program, drag and drop the saved markers data onto the terminal, and hit **Enter**.
   - Find generated webms in `yt_clipper/webms/title-suffix` folder where `title-suffix` is the file name stem of the markers data file.
   - See [this section](#additional-helper-scripts) for details on the other helper scripts available.
8) See the [full instructions](https://github.com/exwm/yt_clipper) for more detail and advanced usage as well as changelogs.
9) Check the [changelogs](https://github.com/exwm/yt_clipper/blob/master/changelog.md) for updates as there is not yet an automated mechanism.
10) Join the [`yt_clipper` discord server](https://discord.gg/5RVGNCU) if you want further help or want to contribute.

# Notices

- Windows users getting ffmpeg crashes may want to try the following:
  - Update visual c++ redistributables:
    - For 64-bit Windows: <https://aka.ms/vs/16/release/vc_redist.x64.exe>
    - For other Windows versions and older redistributables check this page: <https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads>.
  - Switch to static ffmpeg build: <https://github.com/BtbN/FFmpeg-Builds/releases> and find the latest release titled something like `ffmpeg-N-101776-gd4575982f4-win64-gpl.zip`.
    - Replace contents of `yt_clipper_win_*/bin` with the contents of the `bin` folder in the ffmpeg zip.

# Browser Support

- Works best on Chrome with the Tampermonkey extension and YouTube video in theater mode.
- You may need to refresh the video page and ensure this user script is active.
- FireFox, Opera, and most Chromium-based browsers not fully tested, but reportedly work as intended.
  - FireFox audio slowdown stutters and in mainline FireFox has a min speed of 0.5.
- Other browsers may or may not work as intended.

# Related Scripts

- Check out the companion script with tools for making some tasks on `gfycat.com` easier (e.g., quickly tagging multiple gfys, copying gfy links in various formats) at <https://openuserjs.org/scripts/elwm/gfy-tools>.

# Table of Contents

- [yt_clipper](#yt_clipper)
- [Video Quick Start](#video-quick-start)
- [Quick Start Guide](#quick-start-guide)
- [Notices](#notices)
- [Browser Support](#browser-support)
- [Related Scripts](#related-scripts)
- [Table of Contents](#table-of-contents)
- [Terminology and Installation](#terminology-and-installation)
- [Markup Script Shortcuts](#markup-script-shortcuts)
  - [Marker Shortcuts](#marker-shortcuts)
  - [Cropping Shortcuts](#cropping-shortcuts)
  - [Video Playback and Preview Shortcuts](#video-playback-and-preview-shortcuts)
  - [Frame Capturing Shortcuts](#frame-capturing-shortcuts)
  - [Save and Load Shortcuts](#save-and-load-shortcuts)
  - [Miscellaneous Shortcuts](#miscellaneous-shortcuts)
  - [Dynamic Speed and Crop Shortcuts](#dynamic-speed-and-crop-shortcuts)
    - [Common Dynamic Chart Shortcuts](#common-dynamic-chart-shortcuts)
    - [Dynamic Speed Chart Shortcuts](#dynamic-speed-chart-shortcuts)
    - [Dynamic Crop Chart Shortcuts](#dynamic-crop-chart-shortcuts)
    - [ZoompPan Mode](#zoomppan-mode)
    - [Dynamic Crop Tips](#dynamic-crop-tips)
- [Useful YouTube Controls](#useful-youtube-controls)
- [Tips](#tips)
  - [User Script Tips](#user-script-tips)
  - [Clipper Script Tips](#clipper-script-tips)
- [Encoding Settings Guide](#encoding-settings-guide)
  - [Articles on CRF and vp9 Encoding](#articles-on-crf-and-vp9-encoding)
  - [Tips and Settings](#tips-and-settings)
    - [Markup Script Tips](#markup-script-tips)
    - [Clipper Script Tips](#clipper-script-tips-1)
  - [Gamma Correction](#gamma-correction)
- [Clipper Script Source](#clipper-script-source)
- [Clipper Script Usage](#clipper-script-usage)
  - [Clipper Default Arguments Files](#clipper-default-arguments-files)
- [Clipper Script Preview Shortcuts](#clipper-script-preview-shortcuts)
- [Clipper Script Installation](#clipper-script-installation)
  - [Manual and Beta/Alpha Version Installation](#manual-and-betaalpha-version-installation)
  - [Additional Helper Scripts](#additional-helper-scripts)
    - [Utility Scripts](#utility-scripts)
      - [Merge Utility Script](#merge-utility-script)
- [All Releases](#all-releases)
- [Clipper Script Dependencies](#clipper-script-dependencies)
- [Changelog](#changelog)

# Terminology and Installation

- `Markup script` refers to the user script installed in your browser through a user script extension. It is used to mark up videos (e.g. on YouTube) before creating webm clips.
  - The required user script extension, for example_Tampermonkey_, can be installed from the appropriate add-on store from your browser.
  - See <https://openuserjs.org/about/Userscript-Beginners-HOWTO> for more information on user scripts.
- `Clipper script` refers to the python script (`.py` )or the installation that consumes marker data in `json` format to generate webm clips.
  - See [Clipper Script Usage](#clipper-script-usage) for usage instructions.
  - See [Clipper Script Installation](#clipper-script-installation) for installation instructions.

# Markup Script Shortcuts

First ensure the script is active on the page by checking your user script extension.

- ![yt_clipper_active_on_page](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_active_on_page.png)

**Alt+Shift+A:** Toggle hotkeys on/off. A green message will flash below the video indicating hotkeys are enabled.

A shortcuts reference can be toggled by clicking the scissor icon in the video controls bar.

- ![yt_clipper_shortcuts_table](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_shortcuts_table.png)

## Marker Shortcuts

**A:** Add marker at current time (start = green, end = yellow, selected = black center). Multiple marker pairs can be added simultaneously.

**Z:** Undo last marker.

**Shift+Z:** Redo last undone marker.

**Ctrl+Shift+Alt+Z:** Delete currently selected marker pair. Does nothing if no pair selected.

**Shift+Mouseover End Marker (Yellow) or Left-Click Any Marker Numbering:** Toggle marker pair editor. Selected marker pairs have a black center.
  ![yt_clipper_marker_pair_editor](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_marker_pair_editor.png)

- Modified marker pair settings are accented orange while settings redundant with a global setting are accented red.
- Reorder marker pairs using the input box in the title of the marker pair settings panel.
- Edit pair crop or speed multiplier.
- Edit `Title Prefix` that will be prepended to the `Title Suffix` and used in the webm name for the marker pair.

**Ctrl+Up**: Select/deselect the most recently selected marker pair or else the first available pair.

**Ctrl+Down**: Toggle auto-hiding of unselected marker pairs. Hidden marker pairs cannot be selected with the mouse.

**Adjusting marker position/time:**

- While a pair is selected use **Shift+Q/Shift+A** to move the start/end marker to current time.
  - Adjust marker position more precisely by first using the **<** and **>** keys to seek videos frame by frame.
- Use **Alt+Shift+Mousewheel** and scroll up/down to move marker one frame forward/backward.
  - When performed on the left half of the window moves the start marker and on the right half the end marker.
- **Alt+Click+Drag** a marker numbering to quickly make rough adjustments to the marker's time.
- Use **Alt+Z/Alt+Shift+Z** to undo/redo marker moves as well as speed and crop changes.
  - Undo/redo history is kept separately for each marker pair.
**Navigating marker pairs without the mouse:**

- Jumping to and selecting marker pairs without the mouse
  - **Ctrl+Left/Right:** Jumps to the nearest previous/next marker.
  - **Alt+Left/Right:** Select the next/previous marker pair relative to the currently or previously selected pair.
  - **Ctrl+Alt+Left/Right:** Select the next/previous marker pair _and jump to its start marker_.

**W:** Global settings editor:
  ![yt_clipper_globals_editor](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_globals_editor.png)

1. Modified global settings are accented red.
2. Change default new marker speed or crop.
   - Any new markers added will use these defaults, but this will not update existing markers.
   - To update existing markers to the default new marker speed/crop use **Alt+Shift+Q/Alt+Shift+X**.
3. Specify crop resolution (automatically scales any existing crops on change).
   - This resolution must match the downloaded video's resolution.
   - By default the max available video resolution is downloaded by the `clipper script` and the crop resolution auto-scaled if a mismatch is detected.
4. Specify any webms you want to merge from the clipped webms.
   - Very fast as it does not require re-encoding webms.
   - The format is similar to that for printer page ranges:
     - Each merge is a comma separated list of marker pair numbers or ranges (e.g., '1-3,5,9' = '1,2,3,5,9').
     - Multiple merges are separated with semicolons (e.g., '1-3,5,9;4-6,8' will create two merged webms).
5. Specify `Title Suffix` appended to each marker pair `Title Prefix` to produce its `Full Title`.
   - By default the `Title Suffix` is the YouTube video ID in square brackets (e.g., \[Bey4XXJAqS8\]).
   - The `Title Suffix` is used for the name of the folder containing all generated webms.

**Shift+W:** Open additional settings when the global settings editor or a marker pair editor is open.

- Settings left blank with a placeholder of `Auto` will be automatically calculated based on the input video bitrate and other video properties. This is the recommended default.
- Marker pair settings are overrides that if set will override the global value for that marker pair only.
- Marker pair settings set to `Inherit` will get their value from the global settings.
- Global settings set to `Inherit` will get their value from the command line options or the `yt_clipper_options` helper script prompt.
- See [Encoding Settings Guide](#encoding-settings-guide) for more information and tips about the possible settings.
- Marker Pair Overrides:
  - ![yt_clipper_marker_pair_editor_overrides](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_marker_pair_editor_overrides.png)
- Global Encode Settings:
  - ![yt_clipper_globals_editor_additional_settings](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_globals_editor_additional_settings.png)

**Alt+Shift+Q/alt+Shift+X:** Update all existing markers to default new marker speed (**Q**) or crop (**X**).

- Set the default new marker speed or crop using **W**.

## Cropping Shortcuts

**X:** When marker or defaults editor is open, begin drawing crop.

- **Click+Drag** on the video to set draw a rectangular crop.

- While drawing crop, pressing **X** again will cancel drawing.

- Crop is given as `x-offset:y-offset:width:height`. Each value is a positive integer in pixels. `Width` and `height` can also be `iw` and `ih` respectively for input width and input height.

**Ctrl+X:** Cycle crop dim opacity by 25% plus one stop point at 90%.
**Ctrl+Shift+X:** Toggle crop crosshair.

**Mouse-Based crop Adjustment:**

- **Ctrl+Hover:** Indicate potential drag action when hovering over crop.
- **Ctrl+Click+Drag:** Drag and move crop or resize crop in the indicated directions.
  - Can release **Ctrl** after dragging begins. Dragging ends when mouse is released.
- **Ctrl+Alt+Drag:** Approximately aspect-ratio-locked mouse resizing of crop.
- **Ctrl+Shift+Drag:** Center-out resize/draw of crop.
- **Ctrl+Shift+Drag:** Horizontally-fixed (Y-only) drag of crop.
- **Ctrl+Alt+Drag:** Vertically-fixed (X-only) drag of crop.

  ![yt_clipper_crop_preview.png](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_crop_preview.png)

**Arrow Key Crop Adjustment**:

- When a crop input box has focus:
  - **UpArrow/DownArrow:** Increment/decrement the value indicated by the current cursor position by `10`.
- When a crop input box does not have focus:
  - **Alt+X:** Toggle crop adjustment with arrow keys.
  - **UpArrow/DownArrow:** Increment/decrement the `y offset` by `10`.
  - **LeftArrow/RightArrow:** Increment/decrement the `x offset` by `10`.
  - **Ctrl** modifier key changes target from `y offset` to `height` or from `x offset` to `width`.
- The **Alt** and **Shift** modifier keys alter the increment/decrement amount.
  - **Alt** sets the amount to `1`, **Shift** to `50`, **Alt+Shift** to `100`.
- The resulting crop values are clamped to valid values.

## Video Playback and Preview Shortcuts

**Shift+Mouse-Wheel:** Scroll the mouse wheel up/down over the video to skip forward/backward one frame per tick.

**Alt+Click+Drag:** Scrub/seek video time backward or forward by dragging left or right respectively.

**C:** Toggle previewing marker pair speed.

- Video playback speed is automatically set to the speed of the current marker pair.
- When outside of a marker pair the playback speed is force set to 1. Toggle off the speed preview to change the player speed manually.

**Shift+C:** Toggle auto looping of currently selected marker pair.

**Ctrl+Shift+C:** Toggle auto crop chart section looping. This setting takes precedence over auto marker pair looping.

**Alt+C:** Toggle auto previewing gamma correction setting when between a marker pair.

**Alt+Shift+C:** Toggle fade loop previewing.

- Note that fade duration defaults to 0.7 seconds and is clamped to a minimum of 0.1 seconds and a maximum of 40% of the output clip duration.

**Ctrl+Alt+Shift+C:** Toggle all previews.

- If any preview feature is disabled, turns it on. If all preview features are enabled, disables all of them.

- Works only when in fullscreen mode or theater mode.
- **Note that this does not yet work with drawing and previewing crops and should be disabled when doing so.**
- **This feature is only for watching or previewing the video, and does not affect webm output.**

**Shift+R:** Toggle big video previews on video progress bar hover.

**Q:** Toggle auto force setting of video playback speed. Takes precedence over any marker pair speed. This can be useful to try out different playback speeds without modifying settings.

**Alt+Q:** Cycle the force-set video speed down by 0.25. Use **Q** to toggle force settings video speed.

**R/Alt+R:** Toggle between a 90 degree clockwise/counter-clockwise rotation and no rotation.

- Note that this is only a preview and you must set the rotation in the global settings editor opened with **W** to rotate the output video.

## Frame Capturing Shortcuts

**E:** Capture frame at current time of video at currently selected video quality/resolution.

- Frame must be buffered and loaded.
- Opens a pop-up window where captured frames are saved.
  - **Download** and **Delete** buttons are provided above each captured frame.
  - You may need to allow pop-ups from `https://www.youtube.com` in your browser settings.

  ![yt_clipper_frame_capturer](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_frame_capturer.png)

**Alt+E** Trigger zipping of all captured frames for download.

## Save and Load Shortcuts

**S:** Save markers info to a `.json` file.

- Can be dropped onto the clipper script installation's helper scrips like `yt_clipper_auto` on Windows. On Mac, run the helper script and try dragging and dropping in the window that opens up when prompted.
- When using the python source of the `clipper script` use`--json/-j` and pass the path of the markers data file.

**Alt+S:** Copy markers `json` data to clipboard. Useful if saving breaks.

**G:** Toggle markers data commands UI. Allows for uploading and loading markers data files in `.json` format and for restoring markers data auto-saved in browser local storage.

- To upload and reload markers data, click `Choose File`, pick your markers `json` file, then click `Load`.
  - ![yt_clipper_load_markers](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_load_markers.png)

## Miscellaneous Shortcuts

**Shift+F:** Flatten a VR video to make it easier to crop.

## Dynamic Speed and Crop Shortcuts

### Common Dynamic Chart Shortcuts

**D:** Toggle dynamic speed chart.

**Alt+D:** Toggle dynamic crop chart.

**Shift+Click:** Add a point at the clicked location.

**Alt+A:** Add a point at the current time.

**Alt+Shift+Click:** Delete a point.

**Right-Click:** Seek to time on bottom time-axis when clicking anywhere in chart area.

**Alt+Right-Click/Ctrl+Alt+Right-Click:** Set chart looping start/end marker.

**Shift+D:** Toggle chart loop markers

- Note that chart loop markers only work when speed previewing is on with **C**.

**Ctrl+Mousewheel:** Zoom in and out of chart.

**Ctrl+Click:** Reset zoom.

**Click+Drag:** Drag a point to move it or drag chart area to pan when zoomed in.

**Alt+Z/Alt+Shift+Z:** Undo/redo marker moves as well as speed and crop changes.

- Undo/redo history is kept separately for each marker pair.

### Dynamic Speed Chart Shortcuts

See [Common Dynamic Chart Shortcuts](#common-dynamic-chart-shortcuts) for shortcuts shared between dynamic charts
like adding and removing points.

**D:** Toggle dynamic speed chart.

<img src="https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_speed_chart.jpg" alt="yt_clipper_speed_chart" style="width:500px;"/>

**Notes:**

- Points are auto-sorted based on their time value on adding or removing points or on drag-end when moving points.
- YouTube playback speed can only be set to a multiple of `0.05` and greater than or equal to `0.25`.
- Audio is not compatible with dynamic speed.

### Dynamic Crop Chart Shortcuts

See [Common Dynamic Chart Shortcuts](#common-dynamic-chart-shortcuts) for shortcuts shared between dynamic charts
like adding and removing points.

Dynamic crop allows for panning a crop in the default `pan-only` mode.
In `pan-only` mode the crops of all crop chart points are maintained equal.
For zooming and panning, enable  `zoompan` mode from the marker pair settings extended options (**Shift+W**).
In `zoompan` mode crops can change size for a zooming effect, but their aspect ratios are maintained equal.

**Alt+D:** Toggle dynamic crop chart.

**Left-Click:** Left-click a crop chart point to seek to it's time.

**Left-Click+Drag:** Left-click and drag a crop chart point to change it's time and seek/scrub the video.

**Ctrl+Shift+C:** Toggle auto crop chart section looping.

- A crop chart section is any two points on the chart.
- The current section is between a green start point and yellow end point. All other points are red.
- As the video time changes, the current crop chart section is automatically updated.
- Takes precedence over marker pair looping.

**Ctrl/Alt+Mouseover:** Select point as start/end of crop section.

- When the currently selected point is green then you are in start mode, and if it is yellow you are in end mode.
- The selected point's crop is editable and it's crop appears more brightly in a matching color (green or yellow).
- As the video time changes, the currently selected point is automatically updated to the start or end point of the new section maintaining the current mode where possible.
- Selected points have a black border and are square. Unselected points are circular.

**Alt+Mousewheel-Up/Down:** Intelligently toggle modes or select points. More specifically:

- **Alt+Mousewheel-Up:** If in end mode, toggle to start mode. If already in start mode, select next point and toggle to end mode.
- **Alt+Mousewheel-Down:** If in start mode, toggle to end mode. If already in end mode, select previous point and toggle to start mode.

**Ctrl+Alt+Shift+Mousewheel-Up/Down:** Set current crop point's crop to that of the next/previous point's crop.

**Ctrl+Shift+Click:** Toggle crop point easing between auto and instant.

- Points with instant easing enabled are darkened.
- Instant easing means that any pan or zoom from a previous point will happen instantly, causing the crop to jump. This is useful if there is a scene change in the video or very fast movement.

**A/Shift+A:** Set target crop component of all points following/preceding the currently selected point. Select crop components by placing your cursor in the crop input field in the marker pair settings.

- For example, let's say you want to align the X-position of all points following the currently selected point. Place your cursor by clicking in the crop input field in the first value. For example  `10|0:100:920:1080` where the `|` represents your cursor. Now hit the **A** key and all following crop points will have an X-Position of `100`.

### ZoompPan Mode

In `zoompan` mode crops can change size for a zooming effect, but their aspect ratios are maintained equal.
The usual crop shortcuts have different effects than usual in this mode as described here.

**Ctrl+Drag:** Resize crop while maintaining aspect ratio.

**Ctrl+Alt+Drag:** Freely resize the crop, updating the aspect ratio of all other crop points to match automatically.

**X:** Draw crop.

- **Click+Drag:** Draw crop while maintaining aspect ratio.
- **Alt+Click+Drag:** Freely draw crop, updating the aspect ratio of all other crop points to match automatically.

### Dynamic Crop Tips

- Use as few points as possible for smoother motion (each point with a crop different from its neighbors causes the crop motion to stop and then start again).
- Try enabling video stabilization to smooth out the motion, especially if many points are used.
- Pause the video and **Right-Click+Drag** to seek/scrub through the video. Use this to preview the crop movement with precise control.

# Useful YouTube Controls

1. Use **[space_bar]** or **K** to pause/play the video.
2. Use **<** and **>** to view a video frame by frame.
3. Use **Left-Arrow** and **Right-Arrow** to jump backwards or forwards by 5 seconds.

# Tips

## User Script Tips

1. If you're new to userscripts check out <https://openuserjs.org/about/Userscript-Beginners-HOWTO> for instructions.
2. Check out the companion script for copying gfy links from gfycat as reddit markdown at <https://openuserjs.org/scripts/elwm/gfy2md>.
3. Refresh the page if the script doesn't load and to clear markers when switching videos in the same window.
4. Videos can be marked up and the markers json or clipper script can be saved before higher quality levels are available, but the final generated webm quality depends on the quality formats available.

## Clipper Script Tips

1. The `clipper script` skips regenerating any existing webms.
   - This makes it easy to delete webms you want regenerated and by rerunning the script.
   - Use this to work incrementally, saving markers data, starting a batch encode, continuing to mark up, overwriting the markers data, and then rerunning the encoding.

# Encoding Settings Guide

## Articles on CRF and vp9 Encoding

1. [Basic crf guide](https://slhck.info/video/2017/02/24/crf-guide.html)
2. [ffmpeg vp9 encoding guide](https://trac.ffmpeg.org/wiki/Encode/VP9)
3. [Google vp9 basic encoding](https://developers.google.com/media/vp9/the-basics/)
4. [vp9 encoding tests](https://github.com/deterenkelt/Nadeshiko/wiki/Tests.-VP9:-encoding-to-size,-part%C2%A01)

## Tips and Settings

### Markup Script Tips

1. Move between input fields with **Tab** and **Shift+Tab**.
2. Numeric input fields can be set using the **Up/Down** arrow keys or the **Mousewheel**.
3. Access additional settings, including various encoding settings using the **Shift+W** additional settings editors.
4. Hover over settings in the `markup script` to view tooltips describing each setting.
  ![yt_clipper_tooltip](https://raw.githubusercontent.com/exwm/yt_clipper/master/assets/image/yt_clipper_tooltip.png)

### Clipper Script Tips

1. The `clipper script` is set to use the vp9 encoder by default (encoding used for webm videos on YouTube).
2. Use `--help`, `-h`, or the `yt_clipper_options` helper script for additional options that can be enabled on the command line.
3. Encoding settings will be automatically selected, unless overridden, based on the detected bitrate and other properties of the input video.

## Gamma Correction

- Play around with the `gamma` setting to bring back shadow or highlight detail.
- Use **Alt+C** to preview `gamma values` with the `markup script`.
- A value of 1 does nothing. Use a value between 0 and 1 to bring back shadow detail and a value greater than 1 to bring back highlight detail.
- Refer to this [gamma correction guide](https://www.cambridgeincolour.com/tutorials/gamma-correction.htm) for more details.

# Clipper Script Source

- You can find the latest mainline clipper script python source file here: <https://github.com/exwm/yt_clipper/blob/master/src/clipper/yt_clipper.py>

# Clipper Script Usage

```sh
python ./yt_clipper.py -h # Prints help. Details all options and arguments.

python ./yt_clipper.py --markers-json markers.json # automatically generate webms using markers json

python ./yt_clipper.py -j markers.json --input-video ./clip.webm  # provide a local input video

python ./yt_clipper.py -j markers.json --preview  # preview marker pairs using ffplay

python ./yt_clipper.py -j markers.json --format bestvideo[width<=1080] # specify download format used by youtube-dl
```

## Clipper Default Arguments Files

Default arguments for the `clipper` script may be set using a simple file format.
A `default_args.txt` file with comments explaining the usage is provided with the clipper script installation.
The file contents are copied below for convenience:

```txt
# By default, this args file will be read by yt_clipper to set default arguments.
# To see all arguments use the `yt_clipper_options` helper script or the `-h` argument.
# Lines that begin with a `#` in this file are comments and are ignored.
# To use other arg files use the `--arg-files` argument outside of an arg file.

# The following commented lines provide an example of how to use this file.
# The lines can be uncommented (by removing the `#`) to test their effects.

# --audio
# --two-pass
# -di -dn 2
# --youtube-dl-alternative yt_dlp
```

# Clipper Script Preview Shortcuts

See <https://ffmpeg.org/ffplay.html#While-playing>.

# Clipper Script Installation

There is an installation that does not require the dependencies below.

1. Extract the appropriate zip file anywhere:
   - Go to <https://github.com/exwm/yt_clipper/releases> and pick a release. In the assets, find the appropriate file for your platform.
2. Simply drag and drop the markers .json file onto the `yt_clipper_auto.bat` file on Windows or at the terminal prompt after executing `yt_clipper_auto` on Mac.
3. Use `Ctrl+C` if you need to cancel the process.
4. All generated webm clips will be placed in `./webms/<markers-json-filename>`.
5. Windows users may require [Microsoft Visual C++ 2010 Redistributable Package (x86)](https://www.microsoft.com/en-US/download/details.aspx?id=5555).

## Manual and Beta/Alpha Version Installation

**Markup script (js):** (1) Find the `yt_clipper*.js` file in the github release assets, (2) right-click > `copy address`, (3) open user script extension dashboard, (4) find and use option to add a script via url (in tampermonkey, utilities tab > `install from url`; in violentmonkey, `+` button at top > `install from url`).

_Alternatively_, (1) Download the `yt_clipper*.js` file from the github release assets, (2) open user script extension dashboard, (3) open yt_clipper for editing, (4) click inside the editor and select everything with `Ctrl+A`, (5) delete everything with say `backspace`, (6) drag and drop the markup script js file into the editor, (7) `Ctrl+S` to save.

**Clipper script (platform-specific zip):** Install as usual by extracting the zip file to a convenient location.

## Additional Helper Scripts

There are some alternative helper scripts for more options:

- Use `yt_clipper_options` to print all the available options and to be prompted for a string with additional options before running the script. This allows you to combine options (e.g., include audio and rotate and denoise).
  - The other helper scripts provide preconfigured subsets of these options.
- Use `yt_clipper_preview` to locally preview markers `json` data with `ffplay`.
  - _Cannot preview audio, video stabilization, or expanded color range._
- Use `yt_clipper_auto_download` to download video before processing markers.
- Use `yt_clipper_auto_input_video` to specify both markers `json` data and an input video for processing.
  - On Windows simply drag and drop both the `json` and the input video onto `yt_clipper_auto_input_video`.
  - On Mac, `yt_clipper_auto_input_video` will prompt for the `json` then the input video.

The helper scripts have a simple format. Copy and edit `yt_clipper_auto` in a text editor to create custom automated versions. For example you could add `--deinterlace` to enable deinterlacing or use `--only 2,5` to process only marker pairs 2 and 5.

- On Windows:

  ```bat
  @echo off
  chcp 65001
  cd /D "%~dp0"

  FOR %%A IN (%*) DO (
    REM you can add options after %%A of the next line as shown
    .\yt_clipper.exe --markers-json %%A
  )

  pause
  ```

- On Mac

  ```bash
  #!/bin/bash
  cd "$(dirname "$0")" || exit

  read -rp "First enter the paths of 1 or more markers json data files (you may be able to drag and drop files at the prompt): " JSONPROMPT

  IFS=$'\n' JSONS=( $(xargs -n1 <<< "$JSONPROMPT") )

  for JSON in "${JSONS[@]}"
  do
    if [ -f "$JSON" ]; then
      # you can add options after $JSON of the next line as shown
      ./yt_clipper --markers-json "$JSON"
    else
      echo "$JSON does not exist"
    fi
  done
  ```

### Utility Scripts

There several utility scripts provided as well that wrap ffmpeg or other tools either for convenience or additional functionality.

1. The `fast_trim` utility script takes a single video file as input and trims it quickly BUT approximately. The script prompts for a start time and an end time to trim the input video file. The output file name will be suffixed with `-trim`.
2. The `vid2gif` utility script converts an input video file to a `gif` with a small file size and resolution. The script will prompt for the output gif fps and scale/resolution.
3. The `preprocess_hevc` utility script preprocesses an input video file (likely `mp4`) with an `hevc` video stream to ensure compatibility with ffmpeg. You may need to use this script if you see errors like `Invalid data found when processing input` from ffmpeg when using `hevc` with the `--input-video`/`-i` option or the `yt_clipper_auto_input_video` helper script. The preprocessed output file name will be suffixed with `-preproc`.

#### Merge Utility Script

The `merge` utility script can be used to merge any webm files in any order:

- On mac, follow the prompts after running the utility script, providing the paths of 2 or more input files in the other you want them merged.
- On Windows:
  - Rename the webm files so they sort in desired lexicographic order.
  - Select/highlight all webms to be merged in your file explorer and drag and drop them onto the `merge.bat` script.
  - The output file name will be `-merged` appended to the first input file name.
  - Check the `merge.txt` file to confirm the correct videos were merged in the correct order.

# All Releases

Since clipper script `v3.6.1`, releases can be tracked here: <https://github.com/exwm/yt_clipper/releases>.

# Clipper Script Dependencies

These dependencies must be manually installed when not using the clipper script installation:

- ffmpeg must be in your path: (<https://www.ffmpeg.org/download.html>).
- install required python packages as listed in the `requirements.txt`:
  - `pip install -r ./src/clipper/requirements.txt`

# Changelog

For a complete changelog, including beta and alpha releases,
see <https://github.com/exwm/yt_clipper/blob/master/changelog.md>.

For pre-version-unification (between `markup` and `clipper` scripts) changelogs see <https://github.com/exwm/yt_clipper/blob/master/changelog-pre-version-unification.md>.


text:
---
layout: default
---

# 1997-12-25 - HUMOR: A Bah Humbug (fwd)

## Header Data

From: Alan<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: a00ea95b9ecf8fc57aeb9d6cbf4d65ccc858cadf0c9cbbaeae66e7489635fa4a

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-12-25 08:27:40 UTC

Raw Date: Thu, 25 Dec 1997 16:27:40 +0800

## Raw message

```
{% raw  %}From: Alan<EMAIL_ADDRESS>Date: Thu, 25 Dec 1997 16:27:40 +0800
To<EMAIL_ADDRESS>Subject: HUMOR: A Bah Humbug (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

This was send to me by a friend.  it was too good not to share...

<EMAIL_ADDRESS>| Note to AOL users: for a quick shortcut to reply
Alan Olsen            | to my mail, just hit the ctrl, alt and del keys.

---------- Forwarded message ----------
Subject: HUMOR: A Bah Humbug

     Sung to the tune of  "Santa Claus is Coming to Town"

          You better watch out,
          You better not cry,
          You better not pout,
          I'm telling you why,
          Santa Claus is tapping,
          Your phone.

          So you mustn't assume
          That you are secure
          On Christmas Eve
          He'll kick in your door
          Santa Claus is tapping
          Your phone...

{% endraw %}
```

## Thread

+ Return to [December 1997](/archive/1997/12)

+ Return to "[Alan <alan@clueserver.org>](/authors/alan_alan_at_clueserver_org_)"

+ 1997-12-25 (Thu, 25 Dec 1997 16:27:40 +0800) - HUMOR: A Bah Humbug (fwd) - _Alan<EMAIL_ADDRESS>


text:
---
layout: post
title: Arizona time
description: Why does internet tell people the wrong time?
---

Today I was supposed to pick up my intern Arnaud Liehrmann at the
local airport in Flagstaff, Arizona. According to the travel agency
PLUS VOYAGES the flight was supposed to take off from DFW (central
time zone) at 18:47 and land in FLG (mountain time zone) at 20:43.

However I got a text message "I just landed" from Arnaud at 20:08. Was
the plane very early? FlightAware says the plane took off at 18:39
and landed at 20:02. So I guess the plane actually was early.

I thought it may have been the same computer glitch which has caused
me problems for scheduling skype calls with people in different time
zones (interviews, etc). So I started reading about how computers keep
track of time zones and daylight savings time. Turns out there are a
couple of guys who keep a database of text files (tzdb) which contains
details about exactly when daylight savings time starts, ends, in
which places, and when those rules have changed in the past.

For example here is the
[northamerica](ftp://ftp.iana.org/tz/tzdb-2019c/northamerica) file in
tzdb:

```
# Now we turn to US areas that have diverged from the consensus since 1970.

# Arizona mostly uses MST.

# From Paul Eggert (2002-10-20):
#
# The information in the rest of this paragraph is derived from the
# Daylight Saving Time web page
# <http://www.dlapr.lib.az.us/links/daylight.htm> (2002-01-23)
# maintained by the Arizona State Library, Archives and Public Records.
# Between 1944-01-01 and 1944-04-01 the State of Arizona used standard
# time, but by federal law railroads, airlines, bus lines, military
# personnel, and some engaged in interstate commerce continued to
# observe war (i.e., daylight saving) time.  The 1944-03-17 Phoenix
# Gazette says that was the date the law changed, and that 04-01 was
# the date the state's clocks would change.  In 1945 the State of
# Arizona used standard time all year, again with exceptions only as
# mandated by federal law.  Arizona observed DST in 1967, but Arizona
# Laws 1968, ch. 183 (effective 1968-03-21) repealed DST.
#
# Shanks says the 1944 experiment came to an end on 1944-03-17.
# Go with the Arizona State Library instead.

# Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
			-7:00	US	M%sT	1944 Jan  1  0:01
			-7:00	-	MST	1944 Apr  1  0:01
			-7:00	US	M%sT	1944 Oct  1  0:01
			-7:00	-	MST	1967
			-7:00	US	M%sT	1968 Mar 21
			-7:00	-	MST
# From Arthur David Olson (1988-02-13):
# A writer from the Inter Tribal Council of Arizona, Inc.,
# notes in private correspondence dated 1987-12-28 that "Presently, only the
# Navajo Nation participates in the Daylight Saving Time policy, due to its
# large size and location in three states."  (The "only" means that other
# tribal nations don't use DST.)
```

Read [tz-how-to.html](ftp://ftp.iana.org/tz/tzdb-2019c/tz-how-to.html)
for an explanation about how to decipher/understand these files.

Apparently Arizona and Hawaii are the only states which do not observe
daylight savings time. In regards to Arizona, that is consistent with
the most recent rule listed in the file shown above.

So if the computer programmers are correctly interpreting the tzdb,
then there should not be any problems. Is the issue that some
programmers do not consult tzdb, and just assume that all of USA
observes daylight savings time?