text:
# Direct Debits - v3.1.9 <!-- omit in toc -->

- [Overview](#overview)
- [Endpoints](#endpoints)
  - [GET /accounts/{AccountId}/direct-debits](#get-accountsaccountiddirect-debits)
  - [GET /direct-debits](#get-direct-debits)
- [Data Model](#data-model)
  - [Resource Definition](#resource-definition)
  - [UML Diagram](#uml-diagram)
  - [Permission Codes](#permission-codes)
  - [Data Dictionary](#data-dictionary)
- [Usage Examples](#usage-examples)
  - [Specific Account](#specific-account)
    - [Get Accounts Direct Debits Request](#get-accounts-direct-debits-request)
    - [Get Accounts Direct Debits Response](#get-accounts-direct-debits-response)
  - [Bulk](#bulk)
    - [Get Direct Debits Request](#get-direct-debits-request)
    - [Get Direct Debits Response](#get-direct-debits-response)

## Overview

The direct-debits resource is used by an AISP to retrieve the direct debits for a specific account identified by AccountId or to retrieve direct debits for all accounts that the PSU has consented to.

This resource description should be read in conjunction with a compatible Account Information Services API Profile.

## Endpoints

Endpoints for the resource and available methods.

|  |Resource |HTTP Operation |Endpoint |Mandatory? |Scope |Grant Type |Idempotency Key |Parameters |Request Object |Response Object |
| --- |--- |--- |--- |--- |--- |--- |--- |--- |--- |--- |
| 1 |direct-debits |GET |GET /accounts/{AccountId}/direct-debits |Conditional |accounts |Authorization Code |No | Pagination| |OBReadDirectDebit2 |
| 2 |direct-debits |GET |GET /direct-debits |Optional |accounts |Authorization Code |No |Pagination | |OBReadDirectDebit2 |

### GET /accounts/{AccountId}/direct-debits

An ASPSP must provide this endpoint for AISPs to retrieve the direct-debits for a specific account identified by AccountId.

### GET /direct-debits

An ASPSP may provide this endpoint for AISPs to retrieve direct-debits for all accounts that the PSU has consented to. This will retrieve the direct-debit resources for all authorised accounts linked to the account-request.

## Data Model

### Resource Definition

A resource that contains a set of elements that describes the list of direct debits that have been set up on a specific account (AccountId).
An account (AccountId) may have no direct debits set up, or may have multiple direct debits set up.

### UML Diagram

![ OBReadDirectDebit2 ](./images/OBReadDirectDebit2.svg)

### Permission Codes

The resource requires the ReadDirectDebits permission. The resource response payload does not differ depending on the permissions granted.

### Data Dictionary

| Name |Occurrence |XPath |EnhancedDefinition |Class |Codes |Pattern |
| --- |--- |--- |--- |--- |--- |--- |
| OBReadDirectDebit2 | |OBReadDirectDebit2 | |OBReadDirectDebit2 | | |
| Data |1..1 |OBReadDirectDebit2/Data | |OBReadDataDirectDebit2 | | |
| DirectDebit |0..n |OBReadDirectDebit2/Data/DirectDebit |Account to or from which a cash entry is made. |OBDirectDebit2| | |
| AccountId |1..1 |OBReadDirectDebit2/Data/DirectDebit/AccountId |A unique and immutable identifier used to identify the account resource. This identifier has no meaning to the account owner. |Max40Text | | |
| DirectDebitId |0..1 |OBReadDirectDebit2/Data/DirectDebit/DirectDebitId |A unique and immutable identifier used to identify the direct debit resource. This identifier has no meaning to the account owner. |Max40Text | | |
| MandateIdentification |1..1 |OBReadDirectDebit2/Data/DirectDebit/MandateIdentification |Direct Debit reference. For AUDDIS service users provide Core Reference. For non AUDDIS service users provide Core reference if possible or last used reference. |Max35Text | | |
| DirectDebitStatusCode |0..1 |OBReadDirectDebit2/Data/DirectDebit/DirectDebitStatusCode |Specifies the status of the direct debit in code form. |OBExternalDirectDebitStatus1Code |Active Inactive | |
| Name |1..1 |OBReadDirectDebit2/Data/DirectDebit/Name |Name of Service User. |Max70Text | | |
| PreviousPaymentDateTime |0..1 |OBReadDirectDebit2/Data/DirectDebit/PreviousPaymentDateTime |Date of most recent direct debit collection. |ISODateTime | | |
| Frequency |0..1 |OBReadDirectDebit2/Data/DirectDebit/Frequency |Regularity with which direct debit instructions are to be created and processed |OBExternalDirectDebitFrequency1Code | | |
| PreviousPaymentAmount |0..1 |OBReadDirectDebit2/Data/DirectDebit/PreviousPaymentAmount |The amount of the most recent direct debit collection. |OBActiveOrHistoricCurrencyAndAmount | | |
| Amount |1..1 |OBReadDirectDebit2/Data/DirectDebit/PreviousPaymentAmount/Amount |A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217. |OBActiveCurrencyAndAmount_SimpleType | |`^\d{1,13}$\|^\d{1,13}\.\d{1,5}$` |
| Currency |1..1 |OBReadDirectDebit2/Data/DirectDebit/PreviousPaymentAmount/Currency |A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 "Codes for the representation of currencies and funds". |ActiveOrHistoricCurrencyCode | |^[A-Z]{3,3}$ |

## Usage Examples

### Specific Account

#### Get Accounts Direct Debits Request

```
GET /accounts/22289/direct-debits HTTP/1.1
Authorization: Bearer Az90SAOJklae
x-fapi-auth-date:  Sun, 10 Sep 2017 19:43:31 GMT
x-fapi-customer-ip-address: <IP_ADDRESS>
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Accept: application/json
```

#### Get Accounts Direct Debits Response

```
HTTP/1.1 200 OK
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
```

```json
{
  "Data": {
    "DirectDebit": [
      {
        "AccountId": "22289",
        "DirectDebitId": "DD03",
        "MandateIdentification": "Caravanners",
        "DirectDebitStatusCode": "Active",
        "Name": "Towbar Club 3 - We Love Towbars",
        "PreviousPaymentDateTime": "2017-04-05T10:43:07+00:00",
        "PreviousPaymentAmount": {
          "Amount": "0.57",
          "Currency": "GBP"
        }
      }
    ]
  },
  "Links": {
    "Self": "https://api.alphabank.com/open-banking/v3.1/aisp/accounts/22289/direct-debits/"
  },
  "Meta": {
    "TotalPages": 1
  }
}
```

### Bulk

#### Get Direct Debits Request

```
GET /direct-debits HTTP/1.1
Authorization: Bearer Az90SAOJklae
x-fapi-auth-date:  Sun, 10 Sep 2017 19:43:31 GMT
x-fapi-customer-ip-address: <IP_ADDRESS>
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Accept: application/json
```

#### Get Direct Debits Response

```
HTTP/1.1 200 OK
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
```

```json
{
  "Data": {
    "DirectDebit": [
      {
        "AccountId": "22289",
        "DirectDebitId": "DD03",
        "MandateIdentification": "Caravanners",
        "DirectDebitStatusCode": "Active",
        "Name": "Towbar Club 3 - We Love Towbars",
        "PreviousPaymentDateTime": "2017-04-05T10:43:07+00:00",
        "PreviousPaymentAmount": {
          "Amount": "0.57",
          "Currency": "GBP"
        }
      },
      {
        "AccountId": "31820",
        "DirectDebitId": "DD77",
        "MandateIdentification": "Golfers",
        "DirectDebitStatusCode": "Active",
        "Name": "Golf Club",
        "PreviousPaymentDateTime": "2017-05-06T09:00:00+00:00",
        "PreviousPaymentAmount": {
          "Amount": "22.30",
          "Currency": "GBP"
        }
      }
    ]
  },
  "Links": {
    "Self": "https://api.alphabank.com/open-banking/v3.1/aisp/direct-debits/"
  },
  "Meta": {
    "TotalPages": 1
  }
}
```

repository: OpenBankingUK/read-write-api-docs-pub

gha_language: Shell

repo_name: OpenBankingUK/read-write-api-docs-pub


text:
# Avg Aggregation

> More info about avg aggregation is in the [official elasticsearch docs][1]

A single-value metrics aggregation that computes the average of numeric values that are extracted from the aggregated documents.

## Simple example

```JSON
{
    "aggregations": {
        "avg_grade": {
            "avg": {
                "field": "grade"
            }
        }
    }
}
```

And now the query via DSL:

```php
$avgAggregation = new AvgAggregation('avg_grade');
$avgAggregation->setField('grade');

$search = new Search();
$search->addAggregation($avgAggregation);

$queryArray = $search->toArray();
```

[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-avg-aggregation.html

license: MIT

repository: handcraftedinthealps/ElasticsearchDSL

extension: md

gha_language: PHP

gha_license_id: MIT

license_type: permissive

repo_name: handcraftedinthealps/ElasticsearchDSL


text:
# RateABurger

![demo](rateaburger.gif)

RateABurger is a full stack React Native application where users can add restaurants, add and rate burgers and then see the best burgers in Finland.

## Built with

### Frontend
- React Native
- Expo
- TypeScript
- UI Kitten

### Backend: https://github.com/janimaenpaa/rateaburger-backend
- Node.js
- Express.js
- TypeScript
- TypeORM
- PostgreSQL
- AWS SDK (for uploading images to AWS S3 bucket)

## Getting Started

### Prerequisites

NPM and Expo CLI are required to run this app.

To install Expo CLI

```
npm install --global expo-cli
```

### Installing

A step by step series of examples that tell you how to get a development env running

Clone the project

```
git clone https://github.com/janimaenpaa/rateaburger.git
```

Then install dependencies

```
cd rateaburger
npm install
```

### Running the app

To start the Expo client, type

```
npm start
```

## Author

*  [**Jani Mäenpää**](https://github.com/janimaenpaa)

## License

This project is licensed under the MIT License.

repository: janimaenpaa/rateaburger

branch_name: refs/heads/master

repo_name: janimaenpaa/rateaburger


text:
[![Build](https://github.com/apigee/apigee-remote-service-golib/workflows/Build/badge.svg)](https://github.com/apigee/apigee-remote-service-golib/workflows/Build/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/apigee/apigee-remote-service-golib)](https://goreportcard.com/report/github.com/apigee/apigee-remote-service-golib)
[![codecov.io](https://codecov.io/github/apigee/apigee-remote-service-golib/coverage.svg?)](https://codecov.io/github/apigee/apigee-remote-service-golib)
[![In Solidarity](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static/badge-flat.png)](https://github.com/apps/in-solidarity)

# Apigee Remote Service Golib

Apigee's Go library to communicate with Apigee's remote-service proxy and other runtime services.

## Getting Started

There is specific documentation for your Apigee platform:

* [Apigee Edge on Google Cloud or Hybrid](https://cloud.google.com/apigee/docs/api-platform/envoy-adapter/latest/concepts)
* [Classic Apigee Edge](https://docs.apigee.com/api-platform/envoy-adapter)

## Support

Issues filed on Github are not subject to service level agreements (SLAs) and responses should be
assumed to be on an ad-hoc volunteer basis. The [Apigee community board](https://community.apigee.com/)
is recommended as for community support and is regularly checked by Apigee experts.

Apigee customers should use [formal support channels](https://cloud.google.com/apigee/support).

repository: apigee/apigee-remote-service-golib

branch_name: refs/heads/main

gha_language: Go

repo_name: apigee/apigee-remote-service-golib


text:
# Slim Boilerplate
A slim boilerplate equipped with Model-View-Controller design pattern out of the box.

**Installation**

`composer install`

**Start server**

`composer start`

repository: Ming-desu/slim-boilerplate

repo_name: Ming-desu/slim-boilerplate


text:
# TheMicroServices

Demonastrate Event Driven Microservice based architecture.

# Domain

Borrowed 3 Boundned context from ERP.

1) Purchase: User can purchase Item. Purchase department store that purchased item information.
2) Sales: After saling items, user can store sales information
3) Inventory: When any purchase or Sales occured, Stock will be automatically updated.

# Architecture

System is consist of 3 Microservices:

0. CQRS (DDD) is implemented inside Microservices.

1. Purchase Microservice: This microservice is responsible to manage Purchase related informtion and raised an event after purchase done. Based on the event,
consumer will be updated accordingly.

2. Sales Microservice: This microservice is responsible to manage Sales related information. When any sales happend it will raised an event so that its interested
party can update and act accordingly.

3. Inventory Microservice: This microservice is responsible to manage Products and also when any purchase or sales happended it will update stock based on their raised events.

4. Follow no share architecture. Means Every Microservice has its own database.

Here, I have shouwn 3 ways to communicate Microservice to Microservice communication:
  i) Event Driven: Any microservice Publish events to the Message Queue. Other Microservices subscribe those events and act accordingly.
  ii) REST: Not recommended approach. But showing here as an example. One Microservice Directly call other Micrservice to the REST way.
  iii) GRPC: Recommended approach for now a days. It is very similar like old Remote Procedure Call(RPC).

![Overall Architecture](https://github.com/habibsql/TheMicroservices/blob/main/Docs/OverallArchitecture.JPG?raw=true)

# Technology

1. C#
2. ASP.NET Core
3. RabbitMQ: Message Broker for event pub/sub feature.
4. MongoDB: NoSQL database (Prefefer NoSQL instead of SQL for better schemaless/scalability/speed etc.
5. Rest/GRPC for communication
6. Polly: A Nuget package for setting Auto Retry Remote call settings.

repository: mmrmilon/TheMicroServices

repo_name: mmrmilon/TheMicroServices


text:
# Exploring
 Virtual Environments

## with Brian Rutledge

- [What are they?](#what)
- [How do I create one?](#create)
- [How do they work?](#how)
- [Where do they live?](#where)
- [Tips](#tips)
- [Related tools](#related)
- [Reference](#reference)

Type "p" to see notes, or "?" for more help.

???

Hi there! First, a bit about me. I'm a developer at [EnergySage](https://www.energysage.com).
We're a startup in downtown Boston, and use Django to power the world's first and largest online marketplace for solar panel installation.

- Take your time
- Look ahead
- Breathe

TODO

- s/Python version/Python interpreter/
- Run commands on Ubuntu?
- Better typography
    - Quotes
- Personal links

---
name: assumptions

## Assumptions

You've got Python 3 installed on macOS or Linux

You're somewhat familiar with a Unix-like command line

You've used `pip install`

???

- Before we dive in, let's take a moment to review the assumptions I made when putting together these slides
- Doesn't mean this won't be useful, I just won't be covering how to get to this point
- Not exclusive to Python 3; much of this applies to Python 2
- I'm not a Windows user, but the references provide instructions
- Installing Python is non-trivial; we could do a whole talk (*hint*). See the "Installing" slide.
- I'll probably use "venv" or "virtualenv" interchangeably with "virtual environment"
- Show of hands?

---
name: what

## What are they?

Isolated workspaces for Python projects

???

- High level, I like to think of them like this
- When I start working on a new project, I usually create one

--

A place to install and use packages independently from other Python environments

???

- More concretely
- Let's define a couple of those terms
- An isolated copy of Python?

--

"packages" == "[distribution packages](https://packaging.python.org/glossary/#term-distribution-package)"

- Libraries, frameworks, standalone apps, etc.
- Installed with `pip` into `site-packages` directory

???

- "packages" is overloaded
- Python Packaging Authority
- requests, pandas, Django, Flask, jupyter, Scrapy
- `site-packages` inside a Python environment
--

"other Python environments"

- OS-installed Python, aka "system Python"
- User-installed Python, e.g. from python.org or Anaconda
- Other virtual environments

???

- An installation of Python

---

### Why should I use them?

Avoid conflicting package dependencies

???

- At work, we use Django 1.8, but I maintain my band's website uses 1.11
- Allows me to develop both on the same laptop
- System Python might rely on an older version of a package, and you want to use the newer one
- Installing the newer version might break OS tools that depend on the old package
- Keep system Python clean

--

Use different versions of Python for different projects

???

- At work, we use Python 2.7, my band's website uses Python 3.6
- venvs are tied to a specific Python executable, meaning a specific version

--

Install packages without `sudo pip install`

???

- Might see instructions online for installing to system Python
- But we don't want to touch system Python
- Can't use `sudo` on shared hosting
- venvs usually live in your home directory
- Install whatever you want

---
name: create

## How do I create one?

A minimal example:

???

- Python 3 makes this easy
- Let's say I want to play with a web API; I'll want to use `requests`.

--

```
$ python3 -m venv api_venv
```

???

- `$` indicates a new command line; the command starts after it
- Ask Python 3 to run the `venv` module to create a virtualenv
- Creates a directory; we'll take a look inside of that later

--

```
$ source api_venv/bin/activate
```

???

- We need to activate the venv to use it
- We'll see what this does later

--

```
(api_venv)$ pip install requests
# ... install output ...
```

???

- Now I'm inside the venv, as we can see from the prompt
- It's safe to install packages

--

```
(api_venv)$ python
Python 3.6.2 (default, Jul 17 2017, 16:44:45)
>>> import requests
# Play with a web API...
>>> ^D
```

???

- We'll see why `python` works later

--

```
(api_venv)$ deactivate
```

--

```
$
```

???

- Now I'm outside the venv

--

What just happened?

???

- Let's look at our shell environment before and after we ran `activate`

---

### Before `activate`

```
$ which python3 && python3 --version
/usr/local/bin/python3
Python 3.6.2
```

???

- Ask Python 3 where it lives, and what version it is
- I installed this with Homebrew

--

```
$ python3 -m pip list
pip (9.0.1)
setuptools (32.2.0)
wheel (0.29.0)
```

???

- Ask Python what packages are installed
- Using `pip` with a known version of Python

---

### After `activate`

```
(api_venv)$ which python && python --version
/Users/brian/Code/api_venv/bin/python
Python 3.6.2
```

???

- Same version, but now it lives in our venv directory
- `venv` lets us use `python` instead of `python3`

--

```
(api_venv)$ pip list
certifi (2<IP_ADDRESS>)
chardet (3.0.4)
idna (2.5)
pip (9.0.1)
requests (2.18.3)
setuptools (28.8.0)
urllib3 (1.22)
```

???

- `requests` and its dependencies
- Clearly different environments for running Python
- It's safe to use `pip` inside a venv

---
name: how

## How do they work?

Let's go back in time, and into the weeds...

---
layout: true

### Python 2: `virtualenv`

---

```
$ which python && python --version
/usr/bin/python
Python 2.7.10
```

???

- First, let's look at system Python
- This is the version that comes with macOS

--

```
$ python -m pip list
altgraph (0.10.2)
bdist-mpkg (0.5.0)
bonjour-py (0.3)
macholib (1.5.1)
matplotlib (1.3.1)
modulegraph (0.10.4)
numpy (1.8.0rc1)
pip (9.0.1)
py2app (0.7.3)
pyobjc-core (2.5.1)
pyobjc-framework-Accounts (2.5.1)
pyobjc-framework-AddressBook (2.5.1)
# many more...
```

???

- So many packages that we don't need or want

---

```
$ python -m pip install --user virtualenv
```

???

- venvs are not part of the language
- First version of `virtualenv` on PyPI on 9/14/2007
- More complicated than `pip install`, but it's the safest cross-platform command

--

```
$ python -m virtualenv api_virtualenv
New python executable in /Users/brian/Code/api_virtualenv/bin/python
Installing setuptools, pip, wheel...done.
```

???

- Similar to `python3 -m venv`, create a new virtualenv
- Unlike `venv`, output gives us a hint about what's going on

--

Or

```
$ virtualenv api_virtualenv
```

???

- Commonly documented, does the same thing

--

But it's not clear which version of Python we're using

???

- Specifying a different version requires a command line argument
- For clarity and consistency, use `python -m virtualenv`

---
classes: small

.small[
```
api_virtualenv
├── bin
*│   ├── activate
│   ├── pip
│   ├── pip2
*│   ├── python
│   ├── python2 -> python
│   # more executables and activate scripts
├── include
│   └── python2.7 -> /System/Library/Frameworks/Python.framework/Versions/2.7/...
├── lib
│   └── python2.7
│       ├── distutils
*│       ├── site-packages
│       │   ├── pip
│       │   ├── setuptools
│       │   ├── wheel
│       │   # more packaging resources
│       ├── no-global-site-packages.txt
│       ├── orig-prefix.txt
│       ├── site.py
│       ├── os.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/...
│       ├── posixpath.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/...
│       ├── re.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/...
│       # many more symbolic links
```
]

???

- Let's see what's inside our virtualenv
- Abbreviated output of `tree -L 4 --dirsfirst -I '*.pyc|*.dist-info' api_virtualenv`
- All this, and I haven't installed any packages!
- Isolated `site-packages` is what we want; that's where pip installs packages
- None of the system packages
- Adds `activate` scripts
- What does all the other stuff in `lib` do?

---

Tells Python to behave like it's installed in the virtualenv directory

--

```
$ python -c "import sys; print(sys.prefix)"
/System/Library/Frameworks/Python.framework/Versions/2.7
```

???

- `sys.prefix` == "Where does system Python think it's installed?"
- Determined by moving up from location of executable and looking for specific files
- https://carljm.github.io/pipvirtualenv-preso/#10

--

```
$ api_virtualenv/bin/python -c "import sys; print(sys.prefix)"
/Users/brian/Code/api_virtualenv
```

--

```
$ api_virtualenv/bin/python -m pip list
pip (9.0.1)
setuptools (36.2.7)
wheel (0.29.0)
```

???

- Sure enough, we're not using the system `site-packages`
- But now we don't have a standard library; batteries not included!

---

Creates hacked copy of [`site.py`](https://docs.python.org/2/library/site.html) to use standard library from original [`sys.prefix`](https://docs.python.org/2/library/sys.html#sys.prefix)

```
$ cat api_virtualenv/lib/python2.7/orig-prefix.txt
/System/Library/Frameworks/Python.framework/Versions/2.7
```

???

- `site.py` tells Python where to look for packages
- Load the standard library from over here
- https://carljm.github.io/pipvirtualenv-preso/#20
- But `site.py` imports from standard library!

--

Creates symbolic links to standard library modules imported by `site.py`

???

- I know we're in the weeds, but I think this is really interesting
- You don't need to understand this in order to use virtualenv
- A crucial part of developing Python is a big, clever hack
- Hacks are brittle

--

Python upgrades or OS could cause problems by changing `site.py`

???

- `virtualenv` has to play catch-up
- Last release of `virtualenv` on 11/16/2016, 3.6 released 12/23/2016

---
layout: true

### Python 3: `venv`

---

.small[
```
api_venv
├── bin
*│   ├── activate
│   ├── pip
│   ├── pip3
*│   ├── python -> python3
│   ├── python3 -> /usr/local/bin/python3
│   # more executables and activate scripts
├── include
├── lib
│   └── python3.6
*│       └── site-packages
│           ├── certifi
│           ├── chardet
│           ├── idna
│           ├── pip
│           ├── requests
│           ├── setuptools
│           ├── urllib3
│           # more packaging resources
└── pyvenv.cfg
```
]

???

- Back to the venv that we created earlier
- `tree -L 4 --dirsfirst -I '__pycache__|*.dist-info' api_venv`
- Much shorter, even with installed packages!
- Still have `site-packages`, `activate`, etc., but no symbolic links
- Handy `python` symbolic link

---

`venv` added to standard library in Python 3.3

???

- Python 3.3 released on 9/29/2012

--

No need for hacked `site.py` and standard library symbolic links

Adds `pyvenv.cfg` to tell Python that this is a venv

```
$ cat api_venv/pyvenv.cfg
home = /usr/local/bin
# ...
```

???

- And where to find the standard library

---
layout: false

### What does `activate` do?

```
$ source api_venv/bin/activate
```

???

- `source` allows script to modify current shell session
- Doesn't work without it

--

```
(api_venv)$ env | grep -e VIRTUAL_ENV -e PATH
VIRTUAL_ENV=/Users/brian/Code/api_venv
PATH=/Users/brian/Code/api_venv/bin:/Users/brian/.local/bin:/usr/local/bin:/usr/bin:...
```

???

- Modifies `$PS1` using directory name
- `$VIRTUAL_ENV` is root of venv
- Modifies `$PATH`
- Before `activate` wouldn't have `api_venv/bin`

--

```
(api_venv)$ which python
/Users/brian/Code/api_venv/bin/python
```

--

Just a shortcut to `python`

--

Use the virtualenv without `activate` via `api_venv/bin/python`

--

```
(api_venv)$ deactivate

$ env | grep -e VIRTUAL_ENV -e PATH
PATH=/Users/brian/.local/bin:/usr/local/bin:/usr/bin:...
```

???

- Cleans up
- Pretty much the same in Python 2 and 3

TODO

[Virtualenv's `bin/activate` is Doing It Wrong](https://gist.github.com/datagrok/2199506)

- Shell-specific scripts
- Brittle `$PS1` modification
- Doesn't solve setting/unsetting environment variables
- Sub-shell is better

---
name: where

## Where do they live?

Depends on the project, and your preferences

Should be isolated from your source code

???

### `~/Code/project/`

```
$ python3 -m venv project
$ cd project
$ source bin/activate
(project)$ vim project.py
```

Need `bin`, etc. in `.gitignore`

`bin`, etc. could conflict with your project

Hard to delete

Not recommended

---

### `~/venvs/project/`

```
$ python3 -m venv ~/venvs/project
$ source ~/venvs/project/bin/activate
(project)$ cd ~/Code/project
(project)$ vim project.py
```

--

Completely isolated from code

Consistent (i.e., aliasable) `activate`

???

- Because all venvs are in the sampe place...
- Replace `~/venvs` with whatever you want
- No need to `.gitignore`

--

This is my preference

---

### `~/Code/project/venv/`

```
$ cd ~/Code/project
$ python3 -m venv venv
$ source venv/bin/activate
(venv)$ vim project.py
```

--

Common pattern, similar to Node and Ruby

Need `venv` in `.gitignore`

Use `--prompt` option for `(project)$`

???

- Isolate the venv in a sub-directory in your project
- Don't put venv in source control

---
layout: true

## Tips

---
name: tips

From my experience...

---

Delete with `rm -rf`

Avoid editing files in the venv

Recreate instead of moving or upgrading

???

- Don't take them too seriously
- Not in version control, so edits need to be copied to other development machines
- Not relocatable

--

Use [`pip install -r requirements.txt`](https://pip.pypa.io/en/stable/user_guide/#requirements-files), and check out [pip-tools](https://github.com/jazzband/pip-tools)

Check out [autoenv](https://github.com/kennethreitz/autoenv) and [direnv](https://direnv.net) for managing shell environment

???

- Makes it easy to recreate virtualenvs
- Auto-activate venv, set/unset environment variables

--

Think twice before using `pip` outside of a venv

--

Prefer `venv` over `virtualenv` for Python 3

--

Don't need venv for scripts that only use standard library

Start scripts with `#!/usr/bin/env python3`

???

TODO

Outside of a venv, be explicit about which Python you're using:

```
$ python3.6 -m pip install --user
$ python2.7 -m virtualenv
```

---
name: related
layout: false

## Related tools

???

- Make venv easier to work with
- Reduce typing, establish conventions
- Leverage isolation

---
layout: true

### [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/)

---

Keeps virtualenvs and project directories isolated and organized

???

- Installation is more than just `pip install`

--

```
$ mkproject -p python3 api_project
Running virtualenv with interpreter /usr/local/bin/python3
New python executable in /Users/brian/.virtualenvs/api_project/bin/python3.6
# ... virtualenv output ...
Setting project for api_project to /Users/brian/Code/api_project

(api_project)$ pwd
/Users/brian/Code/api_project
```

???

- Shell commands replace `python3 -m venv`
- Created venv, project directory, activated, and `cd`'d into project

--

We `deactivate`, time passes...

--

```
$ workon api_project

(api_project)$ pwd
/Users/brian/Code/api_project
```

???

- Now we're back in the virtualenv and our project directory

---

Convenient access to virtualenvs by name

Adds pre- and post- hooks for `activate` and `deactivate`

???

- Including tab completion
- Set/unset environment variables

--

Adds hacks on top of `virtualenv` and its hacks

Slows down shell startup

???

- Has a lazy-loading option
- Some attempts at a `venv`-based alternative, but nothing as prevelant

--

IMHO, better to use `venv` / `virtualenv` directly, and set up your own shortcuts

See my [`.bash_profile`](https://github.com/bhrutledge/dotfiles/blob/2b9e35ff6efe3d000dbed6f6b50e04599c49f0a5/.bash_profile)
and [`.bashrc`](https://github.com/bhrutledge/dotfiles/blob/2b9e35ff6efe3d000dbed6f6b50e04599c49f0a5/.bashrc#L22-L63)
for an example

???

- I used virtualenvwrapper for a long time, got frustrated by its magic

---
layout: false

### [pew](https://github.com/berdario/pew)

A better `virtualenvwrapper`

--

```
$ pew mkproject -p python3 api_pew
Running virtualenv with interpreter /usr/local/bin/python3
New python executable in /Users/brian/.virtualenvs/api_pew/bin/python3.6
# ... virtualenv output ...
Setting project for api_pew to /Users/brian/Code/api_pew
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
```

???

- Behaves similarly to `virtualenvwrapoper`
- New shell session avoids need for shell-specific hacks
- Only need to update environment

--

```
(api_pew)$ exit
```

???

- No `deactivate`; our shell environment is gone

--

```
$ pew workon api_pew

(api_pew)$
```
???

- Pure Python, install with `pip`
- Still uses `virtualenv`, but there's an open issue about using `venv`

---

### [pipsi](https://github.com/mitsuhiko/pipsi)

Install command line tools into separate virtualenvs

--

```
$ pipsi install --python python3 pew
New python executable in /Users/brian/.local/venvs/pew/bin/python3.6
  Linked script /Users/brian/.local/bin/pew
# ...
```

???

- Use instead of `pip install`

--

```
$ /Users/brian/.local/venvs/pew/bin/python -m pip list
pew (0.1.26)
pip (9.0.1)
requests (2.18.4)
virtualenv (15.1.0)
# ...
```

--

```
$ pew version
0.1.26
```

???

- Uses `virtualenv` to be compatible with many versions of Python
- Shortcut for manual venv and symlink into `~/bin`

---

### A few more

???

- I haven't used these much, but they look cool

--

[Pipenv](http://docs.pipenv.org/en/latest/): "Sacred Marriage of Pipfile, Pip, & Virtualenv"

- "[`Pipfile`](https://github.com/pypa/pipfile) will be superior to `requirements.txt`"
- Relies on [pew](https://github.com/berdario/pew)

???

- One command to manage venvs and packages
- Bleeding edge

--

[pyenv](https://github.com/pyenv/pyenv): "Simple Python version management"

- Install and switch between multiple versions of Python
- [`pyenv virtualenv 3.6.2 api_pyenv`](https://github.com/pyenv/pyenv-virtualenv)

???

- Deep hooks into shell

--

[tox](https://tox.readthedocs.io/en/latest/): "Automate and standardize testing in Python"

- Creates a virtualenv for combinations of Python and package versions
- Installs and tests your project in each

???

- For example, a project that supports Django 1.8+, Python 2.7-3.6

---
name: reference

## Reference

- [Python Virtual Environments - a primer](https://realpython.com/blog/python/python-virtual-environments-a-primer/)
- [Don't Make Us Say We Told You So: virtualenv for New Pythonistas](https://www.youtube.com/watch?v=Xdv7vwIIThY)
- [Reverse-engineering Ian Bicking's brain: inside pip and virtualenv](http://pyvideo.org/pycon-us-2011/pycon-2011--reverse-engineering-ian-bicking--39-s.html) ([Slides](https://carljm.github.io/pipvirtualenv-preso/))
- [venv documentation](https://docs.python.org/3/library/venv.html)
- [PEP 405 -- Python Virtual Environments](https://www.python.org/dev/peps/pep-0405/)
- [virtualenv documentation](https://virtualenv.pypa.io/en/stable/)
- [Installing Python Modules](https://docs.python.org/3/installing/index.html)

???

- Watch to the end of video to see the genesis of `venv` in Python 3

TODO

- https://groups.google.com/forum/#!forum/python-virtualenv
- GitHub issues

### Using with other dev tools

- IDLE
    - `python3 -m idlelib`
    - `python2 -c "from idlelib.PyShell import main; main();`
- tmux
- Fabric
- jupyter
- Apache
- vim
- jedi

---

### Alternatives

[Conda](https://conda.io/docs/index.html)

- Used by, but not exclusive to, the Anaconda distribution of Python
- Handles package installation and virtual environments for multiple languages

[Docker](https://www.fullstackpython.com/docker.html)

- Use a `Dockerfile` to build an image for a specific Python version with a specific set of packages
- Run scripts, apps, etc. in containers using that image

---
name: installing

### Installing/upgrading Python 3

- [Python Setup and Usage](https://docs.python.org/3/using/index.html)
- [Properly Installing Python](https://python-guide-pencheil.readthedocs.io/en/latest/starting/installation.html)
- [pyenv: Simple Python version management](https://github.com/pyenv/pyenv)
- [Anaconda](https://www.continuum.io/downloads)

Ubuntu

- `apt install python3-venv python3.6-venv`
- Don't try to change `/usr/bin/python3`, e.g. via `update-alternatives`
    - [`ModuleNotFoundError: No module named 'apt_pkg'`](https://bugs.launchpad.net/ubuntu/+source/python3.6/+bug/1631367)
- Use `python3.6 -m venv` instead

???

- Vagrantfile in repo

TODO

- TL;DR

repository: bhrutledge/exploring-venv

repo_name: bhrutledge/exploring-venv


text:
A **Gemfile** is included so MCollective dependencies can be packaged for offline install.
To download the gems do the following:

	bundle package

This will download all required gems in ./vendor/cache
Make sure to do this on a Windows machine.


text:
# fixerio_scrape
Scrape Fixio rates everyday at 9am

## Set up repo
```
./scripts/bootstrap.sh
```

## Run tests
```
./scripts/run_tests.sh
```

## Set up
Download (AWS CLI)[https://docs.aws.amazon.com/cli/latest/userguide/installing.html]

## Build zip file
The application will run inside a lambda function. We use docker to build the packages required for running on lambda.
```
./scripts/build_zip.sh
```

## Create S3 bucket
```
aws s3api create-bucket --bucket fixerio-example --region us-west-2 --create-bucket-configuration LocationConstraint=us-west-2
```

## Create IAM role
The lambda function will need access to the s3 bucket created above. We need to create an IAM role to associate it with the lambda role.
```
aws iam create-role --role-name fixerio-lambda * To Be Finished *
```

## Create Lambda function
Create the lambda on aws
```
aws lambda create-function \
--region us-west-2 \
--function-name fixerio \
--zip-file fileb://build/fixerio_scrape.zip \
--handler app.handler \
--role fixerio-lambda \
--runtime python3.6 \
--environment Variables="{ACCESS_KEY=$ACCESS_KEY,S3_BUCKET=$S3_BUCKET}"
```

## Create cloudwatch event
AWS cloudwatch events will be used to trigger the lambda function every weekday.
```
* To be finished *
```


text:
----------------

## Day15
> ![](https://img.shields.io/badge/AndroidEveryday-Day15-green.svg?style=flat)
> ***Time : November 14th,2015*** / ***Author : [xiaomeixw](https://github.com/xiaomeixw)***

#### library ####

1.UI:

- _[TSnackBar](https://github.com/AndreiD/TSnackBar) --- (From [AndreiD](https://github.com/AndreiD)) :
Android Snackbar from the Top (similar to Crouton). [从顶部而下的Snackbar]._

- _[CharacterPickerView](https://github.com/alafighting/CharacterPickerView) --- (From [alafighting](https://github.com/alafighting)) :
An Android wheel view like ios system. [仿ios滚轮view]._

- _[WheelView](https://github.com/LukeDeighton/WheelView) --- (From [LukeDeighton](https://github.com/LukeDeighton)) :
An Android Widget for selecting items that rotate on a wheel. [滚轮盘]._

- _[WheelView](https://github.com/wangjiegulu/WheelView) --- (From [wangjiegulu](https://github.com/wangjiegulu)) :
An Android wheel view. [滚动view]._

- _[WheelView-Android](https://github.com/lantouzi/WheelView-Android) --- (From [lantouzi](https://github.com/lantouzi)) :
An Android wheel view. [滚动选择view]._

- _[droidicon](https://github.com/theDazzler/droidicon) --- (From [theDazzler](https://github.com/theDazzler/)) :
Over 1600 customizable icons for Android including 750+ Google Material Design icons, 25 ready-made social badges, and more!. [Material Design icons图标]._

2.Logic：

- _[Renderers](https://github.com/pedrovgs/Renderers) --- (From [pedrovgs](https://github.com/pedrovgs) & Tag  is [Adapter](https://github.com/pedrovgs/Renderers)) :
Renderers is an Android library created to avoid all the boilerplate needed to use a RecyclerView/ListView with adapters. [封装的一套ListView和RecyclerView]._

		//1.Create your Renderer or Renderers extending Renderer<T>
		public abstract class VideoRenderer extends Renderer<Video> {
			......
		}

		//2.Create a RendererBuilder with a Renderer prototypes collection and declare the mapping between the content to render and the Renderer used.
		public class VideoRendererBuilder extends RendererBuilder<Video> {
			......
		}

		//3.Initialize your ListView/RecyclerView with your RendererBuilder and your AdapteeCollection inside Activities and Fragments.
		private void initListView() {
    		listView.setAdapter(adapter);
		}

		private void initListView() {
    		recyclerView.setAdapter(adapter);
		}

- _[materialup](https://github.com/Alelak/materialup) --- (From [Alelak](https://github.com/Alelak)) :
Unofficial MaterialUp API Wrapper for Android. [MaterialUp(一个UI灵感设计分享网站)的一个非官方的API]._

		//Get popular posts:
		MaterialUp.getPosts(context, page, MaterialUp.SORT.POPULAR, new MaterialUpCallback() {
		    @Override
		    public void onSuccess(List <Post> posts, Response response) {
		        // do stuff with posts!
		    }

		    @Override
		    public void onFailure(Request request, IOException e) {
		        // show a toast!

		    }
		});

		//Get latest posts:
		MaterialUp.getPosts(context, page, MaterialUp.SORT.LATEST, new MaterialUpCallback() {
		    @Override
		    public void onSuccess(List <Post> posts, Response response) {
		        // do stuff with posts!
		    }

		    @Override
		    public void onFailure(Request request, IOException e) {
		        // show a toast!

		    }
		});

3.Architecture:

- _[screenplay](https://github.com/weefbellington/screenplay) --- (From [weefbellington](https://github.com/weefbellington)) :
A minimalist, View-based application framework for Android. [极简view框架]._

		public class ExampleStage extends Stage {

		    private final ExampleApplication application;
		    private final Rigger animationRigger;

		    public ExampleStage(ExampleApplication application) {
		        animationRigger = new CrossfadeRigger(application);
		        addComponents(new ClickBindingComponent());
		    }

		    @Override
		    public int getLayoutId() {
		        return R.layout.example_scene;
		    }

		    @Override
		    public Rigger getRigger() {
		        return animationRigger;
		    }

		    private class ClickBindingComponent implements Component {
		        @Override
		        public void afterSetUp(Stage stage, boolean isInitializing) {
		            View parent = stage.getView();
		            View nextButton = parent.findViewById(R.id.next);
		            nextButton.setOnClickListener(showNextStage);
		        }

		        @Override
		        public void beforeTearDown(Stage stage, boolean isFinishing) {}

		        private View.OnClickListener showNextStage = new View.OnClickListener() {
		            @Override
		            public void onClick(View v) {
		                // add a new scene to the history and trigger a transition
		                Flow flow = application.getMainFlow();
		                flow.set(new NextStage(application));
		            }
		        };
		    }
		}

#### article ####

- _[What is all this Clean Architecture jibber-jabber about?](http://pguardiola.com/blog/clean-architecture-part-1/) --- (From Author  [Pablo Guardiola](http://pguardiola.com/) blog [http://pguardiola.com/blog](http://pguardiola.com/blog)) --- [No Source]_

	Tately, there are a lot of people in the Android community, talking about Architecture, especially about Clean. That's good news!

	I'm pretty sure some of you are familiar with terms like layers, Ports and Adapters, boundaries, etc. but others aren't.

	Although Architecture is not new in Mobile development, (E.g. Forgetting Android by Jorge J. Barroso and Software Design patterns on Android by Pedro Vicente Gómez), we developers, after years of hard work, are realising that it's an important aspect if we want our apps to succeed.

	So... What's the problem?? [Translation：所有关于Clean Architecture的思考].

	Chinese Translation Address : Waiting for someone to Translation it.

#### App-Demo ####

- _[UltimateAndroidAppTemplate](https://github.com/AndreiD/UltimateAndroidAppTemplate) --- (From [AndreiD](https://github.com/AndreiD) ) :
A ready to use android app template. Powered by Android Annotations Retrofit API ready to be used Picasso for image loading Snackbar, RecyclerView, Pull to Refresh etc. Feedback contact by email for feedback / Settings Page with some dummy settings etc. [使用一些知名的Library组成的模板类型App-Demo]._

		dependencies {
		    compile fileTree(include: ['*.jar'], dir: 'libs')
		    apt "org.androidannotations:androidannotations:$AAVersion"
		    compile "org.androidannotations:androidannotations-api:$AAVersion"
		    compile 'com.android.support:appcompat-v7:23.0.1'
		    compile 'com.android.support:support-v4:23+'
		    compile 'com.android.support:support-annotations:23+'
		    compile 'com.android.support:recyclerview-v7:23+'
		    compile 'com.android.support:design:23+'
		    compile 'de.greenrobot:eventbus:2.4.0'
		    compile 'com.squareup.retrofit:retrofit:1.9.0'
		    compile 'com.squareup.okhttp:okhttp:2.3.0'
		    compile 'com.squareup.picasso:picasso:2.5.2'
		    compile 'com.android.support:recyclerview-v7:23+'
		    compile 'com.android.support:design:23+'
		    //-------- app fonts -----------
		    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
		    //----- nice progress app ----
		    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
		}

	![](https://img.shields.io/badge/The%20Day15-End%20!-ED1C24.svg?style=flat)

repository: xiaomeixw/Library-Everyday-Gitbook

repo_name: xiaomeixw/Library-Everyday-Gitbook


text:
# Node-seed [![Build Status](https://travis-ci.org/BAM-X/node-seed.svg?branch=master)](https://travis-ci.org/BAM-X/node-seed)
Seed for small express apps developed with Docker and Docker-Compose

## Useful commands
``` bash
# build app/test container
docker-compose build app

# run eslint
docker-compose run --rm eslint

# run tests
docker-compose run --rm test

# run app
docker-compose up -d app
```

repository: askmuhsin/node-seed

repo_name: askmuhsin/node-seed


text:
---
title: "Get Started"
description: "In this section, you'll learn how to send an email on the web using the WeDeploy API Client."
buttonTitle: "I'm ready to start!"
tutorialTitle: "Getting started with WeDeploy Email on the web"
parentId: "email-web"
layout: "tutorial"
time: 20
weight: 1
---

#### Get Started

Sending emails with WeDeploy is super easy. This tutorial will walk you through how to send an email in your app using the API Client and how to deploy your project with git.

###### What you'll need

Git

A WeDeploy account

###### What you'll do

Clone the sample repo

Add config file

Link the API client

Add the API method

Deploy a project

Send an email


text:
**NOTICE:** Prior to submitting a pull request, please ensure you abide by the
[Guidelines for Code Contributions], including but not limited to:

- PR is associated with at least one issue
- Submit from a **topic** branch, not a pre-existing Cement branch
- Make every effort to comply with [PEP8]
- All tests pass successfully
- Coverage reports 100% code coverage

---

**Issue:** #

[Guidelines for Code Contributions]: https://github.com/datafolklabs/cement/blob/master/.github/CONTRIBUTING.md#guidelines-for-code-contributions
[PEP8]: http://www.python.org/dev/peps/pep-0008/

repository: datafolklabs/cement

gha_language: Python

repo_name: datafolklabs/cement


text:
> [Go to French version](/fr/Lois/Lois%20révisées%20du%20Canada/L/L-6.md)

# Canada Lands Surveys Act

**R.S.C. 1985, c. L-6**

----------

## Short Title

**Short title**

**1** This Act may be cited as the Canada Lands Surveys Act.
> R.S., c. L-5, s. 1

## Interpretation

**Definitions**

**2**

- **(1)** In this Act,

***Board***[Repealed, 1998, c. 14, s. 91]

***Canada Lands Surveyor*** means a Canada Lands Surveyor within the meaning of section 2 of the [Canada Lands Surveyors Act](/en/Acts/Statutes%20of%20Canada/1998/c.%2014.md); (*arpenteur des terres du Canada*)

***candidate***[Repealed, 1998, c. 14, s. 91]

***commission***[Repealed, 1998, c. 14, s. 91]

***Commissioner*** means
- **(a)** in respect of lands under his or her administration and control under the [Yukon Act](/en/Acts/Statutes%20of%20Canada/2002/c.%207.md), the Commissioner of Yukon, and
- **(b)** in respect of lands under his or her administration and control under the [Northwest Territories Act](/en/Acts/Statutes%20of%20Canada/2014/c.%202,%20s.%202.md), the Commissioner of the Northwest Territories, and
- **(c)** in respect of the lands referred to in subsection 49(1) of the [Nunavut Act](/en/Acts/Statutes%20of%20Canada/1993/c.%2028.md), the Commissioner of Nunavut; (*commissaire*)

***examination***[Repealed, 1998, c. 14, s. 91]

***Minister*** means, except in Part III, the Minister of Natural Resources; (*ministre*)

***monument*** means a post, stake, peg, mound, pit, trench or any other object, thing or device used under this Act or under the Dominion Lands Surveys Act, chapter 117 of the Revised Statutes of Canada, 1927, to mark a boundary of surveyed lands; (*borne-signal*)

***prescribed***[Repealed, 1998, c. 14, s. 91]

***Secretary***[Repealed, 1998, c. 14, s. 91]

***survey*** includes a resurvey and a special survey; (*arpentage*)

***surveyor*** means a Canada Lands Surveyor or a person who is entitled to survey lands in a province under the laws of the province; (*arpenteur*)

***Surveyor General*** means a person who is a Canada Lands Surveyor and is appointed as Surveyor General in the manner authorized by law or a person authorized by the Minister to carry out the duties of the Surveyor General. (*arpenteur général*)

- **(2)** [Repealed, 1998, c. 14, s. 91]
> R.S., 1985, c. L-6, s. 2; 1993, c. 28, s. 78; 1994, c. 41, s. 37; 1998, c. 14, ss. 91, 99(F); 2002, c. 7, s. 99; 2014, c. 2, s. 15

## Administration

**Minister to have control**

**3**

- **(1)** The Minister has the administration, direction and control of surveys under this Act.

**Duties of Surveyor General**

- **(2)** The Surveyor General, subject to the direction of the Minister, has the management of surveys under this Act and the custody of all the original plans, journals, field notes and other papers connected with those surveys.

**Substitute for Surveyor General**

- **(3)** The Minister may authorize an employee of the Department of Natural Resources who is a surveyor to carry out all or any of the duties of the Surveyor General.
> R.S., 1985, c. L-6, s. 3; 1994, c. 41, s. 38(E); 1998, c. 14, s. 98(F)

**Governor in Council may make regulations**

**4**

- **(1)** The Governor in Council may make such orders and regulations as he deems necessary to carry out this Act or to meet any cases with reference to surveys under the management of the Surveyor General for which no provision is made in this Act.

**Tariff of fees**

- **(2)** The Minister may establish a tariff of fees to be charged by the Department of Natural Resources for copies of maps, plans, field notes, or any other type of record or document arising from or respecting surveys under this Act and those fees shall form part of the Consolidated Revenue Fund.
> R.S., 1985, c. L-6, s. 4; 1994, c. 41, s. 38; 1998, c. 14, s. 98(F)

**PART I**
## Powers and Duties of Canada Lands Surveyors

**5 to 16** [Repealed, 1998, c. 14, s. 93]

### Duties and Powers of Surveyors

**Verification of surveys**

**17**

- **(1)** The Surveyor General shall require every surveyor to verify and affirm by oath or otherwise to the satisfaction of the Surveyor General on each return of his surveys under this Act that the surveyor has faithfully and correctly executed such surveys in accordance with this Act and with any instructions issued to the surveyor by the Surveyor General.

**Proceedings on false surveys**

- **(2)** Where a court of competent jurisdiction finds that a survey or any part thereof has not been executed as verified under subsection (1), the Attorney General of Canada may, on application of the Surveyor General, institute proceedings to recover costs from the surveyor who verified the returns.
> R.S., 1985, c. L-6, s. 17; 1998, c. 14, s. 98(F)

**Field notes**

**18** Every surveyor shall keep exact and regular field notes of all his surveys under this Act and shall file them with the Surveyor General in the order of time in which the surveys have been performed.
> R.S., 1985, c. L-6, s. 18; 1998, c. 14, s. 98(F)

**19 to 21** [Repealed, 1998, c. 14, s. 94]

**Surveys made by Canada Lands Surveyor under other Act**

**22** The provisions of sections 17, 18 and 23 apply, with any modifications that the circumstances require, to surveys under any other Act of Parliament, or any regulation made under such an Act, or any law of the Legislature of Yukon, of the Northwest Territories or for Nunavut if the Act, regulation or law requires the surveys to be made by a Canada Lands Surveyor.
> R.S., 1985, c. L-6, s. 22; 1993, c. 28, s. 78; 1998, c. 14, s. 95, c. 15, ss. 32, 51; 2002, c. 7, s. 100; 2014, c. 2, s. 16

### Standard of Measure

**Canadian measure of length**

**23**

- **(1)** The measure of length for surveys under this Act is the Canadian measure of length defined by the [Weights and Measures Act](/en/Acts/Revised%20Statutes%20of%20Canada/W/W-6.md).

**Means of measurement**

- **(2)** In any survey under this Act, a surveyor shall use
	- **(a)** a measuring device that is of a type approved by the Surveyor General and that is calibrated, checked and verified in accordance with the instructions of the Surveyor General; or
	- **(b)** other means of measurement of length, position or direction authorized by the Surveyor General under the circumstances that the Surveyor General may prescribe.
> R.S., 1985, c. L-6, s. 23; 1998, c. 14, s. 98(F)

**PART II**
## Surveys of Canada Lands

### General

**Definition of Canada Lands**

**24**

- **(1)** In this Part, ***Canada Lands*** means
	- **(a)** any lands belonging to Her Majesty in right of Canada or of which the Government of Canada has power to dispose that are situated in Yukon, the Northwest Territories or Nunavut and any lands that are
		- **(i)** surrendered lands or a reserve, as those expressions are defined in the [Indian Act](/en/Acts/Revised%20Statutes%20of%20Canada/I/I-5.md), other than reserve lands described in regulations made under section 4.1 of the [First Nations Commercial and Industrial Development Act](/en/Acts/Statutes%20of%20Canada/2005/c.%2053.md),
		- **(ii)** Category IA-N land, as defined in subsection 2(1) of the [Naskapi and the Cree-Naskapi Commission Act](/en/Acts/Statutes%20of%20Canada/1984/c.%2018.md),
		- **(ii.1)** Category IA land, as defined in subsection 2(2) of the [Cree Nation of Eeyou Istchee Governance Agreement Act](/en/Acts/Statutes%20of%20Canada/2018/c.%204,%20s.%201.md),
		- **(iii)** Sechelt lands, as defined in the [Sechelt Indian Band Self-Government Act](/en/Acts/Statutes%20of%20Canada/1986/c.%2027.md), chapter 27 of the Statutes of Canada, 1986,
		- **(iv)** settlement land, as defined in the [Yukon First Nations Self-Government Act](/en/Acts/Statutes%20of%20Canada/1994/c.%2035.md), and lands in which an interest is transferred or recognized under section 21 of that Act,
		- **(v)** lands in the Kanesatake Mohawk interim land base, as defined in the [Kanesatake Interim Land Base Governance Act](/en/Acts/Statutes%20of%20Canada/2001/c.%208.md), other than the lands known as Doncaster Reserve No. 17, or
		- **(vi)** Tlicho lands, as defined in section 2 of the [Mackenzie Valley Resource Management Act](/en/Acts/Statutes%20of%20Canada/1998/c.%2025.md); and
	- **(a.1)** any lands belonging to Her Majesty in right of Canada or of which the Government of Canada has power to dispose that are situated in any National Park of Canada or in the Rouge National Urban Park established by the [Rouge National Urban Park Act](/en/Acts/Statutes%20of%20Canada/2015/c.%2010.md); and
	- **(b)** any lands under water belonging to Her Majesty in right of Canada or in respect of any rights in which the Government of Canada has power to dispose.

**Surveys of Canada Lands**

- **(2)** Surveys of Canada Lands shall be made in accordance with the instructions of the Surveyor General.
> R.S., 1985, c. L-6, s. 24; R.S., 1985, c. 20 (2nd Supp.), s. 4; 1993, c. 28, s. 78; 1994, c. 35, s. 35; 1998, c. 14, ss. 98(F), 100(F); 2000, c. 32, s. 49; 2001, c. 8, s. 24; 2002, c. 7, s. 101; 2005, c. 1, s. 98; 2010, c. 6, s. 9; 2015, c. 10, s. 55; 2018, c. 4, s. 129

**When surveys undertaken**

**25** The Minister shall cause surveys to be made of Canada Lands on the request of a minister of any department of the Government of Canada or a Commissioner administering the Lands and may do so in any other case in which he deems it to be expedient.
> R.S., 1985, c. L-6, s. 25; 1998, c. 14, s. 100(F)

**Who may survey Canada Lands**

**26**

- **(1)** Subject to subsection (2), no person other than a Canada Lands Surveyor shall survey Canada Lands.

**Who may survey Canada Lands within the boundaries of a province**

- **(2)** A Canada Lands Surveyor or any other surveyor authorized by the Surveyor General may survey Canada Lands that lie within the boundaries of a province but, where surveys of those Canada Lands affect or are likely to affect the rights of landowners of adjoining lands that are not Canada Lands the surveys shall be made by a surveyor of the province in which those surveys are made.
> R.S., 1985, c. L-6, s. 26; 1998, c. 14, ss. 98 to 100(F)

### Surveys

**Minister may direct manner of survey**

**27** The Minister may direct that Canada Lands be surveyed, laid out and defined in any manner, by any method of surveying and with any description that the Minister considers desirable in the circumstances affecting those lands.
> R.S., 1985, c. L-6, s. 27; 1998, c. 14, s. 100(F)

**Coordinated Survey Area**

**28**

- **(1)** The Minister may establish a Coordinated Survey Area within any lands dealt with in this Act or alter any such Area by a notice published in the [Canada Gazette](http://www.gazette.gc.ca/).

**Position of monuments**

- **(2)** Within a Coordinated Survey Area, the position of all new monuments placed and all monuments that are relevant to the placement of new monuments shall be determined by surveyed connection to reference points specified for that purpose and shall be expressed in terms of the system of coordinates specified for the Area, in accordance with the instructions of the Surveyor General.

**Idem**

- **(3)** Within a Coordinated Survey Area, the position of all monuments placed prior to the establishment of the Area may be determined and shall be expressed in the manner described in subsection (2), in accordance with the instructions of the Surveyor General.

**Where position of monument is lost**

- **(4)** Where the position of a monument that has been determined in accordance with this section is lost, the coordinates of the monument are, in the absence of evidence to the contrary, proof of its position.
> R.S., 1985, c. L-6, s. 28; 1998, c. 14, s. 98(F)

### Plans

**Plotting of plans**

**29**

- **(1)** Plans of Canada Lands that are surveyed under this Part shall be plotted, under the direction of the Surveyor General, from the surveyor’s field notes and other documents relating to the survey.

**Content of plans**

- **(2)** The direction and length of boundaries and the nature and position of the boundary monuments of the parcels of land laid out shall be shown on the plans.

**Confirmation**

- **(3)** The Surveyor General shall indicate his confirmation on the plans, if he is satisfied that the survey has been carried out in conformity with this Act and that the survey and plans are satisfactory to the minister of the department of the Government of Canada or the Commissioner administering the Canada Lands in respect of which the survey was made.

**Effect of confirmation**

- **(4)** On confirmation by the Surveyor General, the plans shall be deemed to be official plans under this Act.

**Confirmation of plans**

- **(5)** No survey of Canada Lands under this Part shall be deemed to be completed until the plans thereof have been confirmed under this section.

**New plans to correct clerical errors, etc.**

- **(6)** Where the Surveyor General finds that a plan that has been confirmed under this section has been improperly or incorrectly plotted from the surveyor’s field notes and other documents relating to the survey or that there is an omission, clerical error or other defect in the plan, the Surveyor General may cause a new plan to be plotted from the surveyor’s field notes and other documents relating to the survey or a new plan to be made correcting the omission, clerical error or other defect.

**Effect of new plan**

- **(7)** The new plan referred to in subsection (6) shall, after confirmation thereof by the Surveyor General, be deemed to be the official plan under this Act of the lands thereby affected and shall be substituted for all, or corresponding portions of all, former official plans of the lands thereby affected.
> R.S., 1985, c. L-6, s. 29; 1998, c. 14, ss. 98(F), 100(F)

**Plans to be sent for filing**

**30** The Minister shall cause a copy of an official plan under this Act to be sent to the registrar of deeds or of land titles of the county, district or other registration division in which the lands are situated for filing in the registry or land titles office of that county, district or other registration division.
> R.S., c. L-5, s. 44

**Administrative plans**

**31** The Surveyor General may, for administrative purposes, make such plans of public lands as the Surveyor General deems expedient, but plans made under this section need not be confirmed under section 29 or sent to a registrar under section 30.
> R.S., 1985, c. L-6, s. 31; 1998, c. 14, s. 98(F)

### Boundaries

**True boundary lines**

**32**

- **(1)** All boundary lines of roads, streets, lanes, lots, parcels or other authorized subdivisions of Canada Lands that are defined by monuments in surveys made under this Part shall, after confirmation of the plans by the Surveyor General, be the true boundary lines of those roads, streets, lanes, lots, parcels or other authorized subdivisions, whether or not they are found to contain, on admeasurement, the exact area or dimensions described or expressed in a plan, letters patent, grant or other instrument affecting those Canada Lands.

**Roads, etc., to be public highways**

- **(2)** With respect to Canada Lands situated in Yukon, the Northwest Territories or Nunavut, all allowances laid out in surveys of roads, streets, lanes or commons in any city, town, village or settlement shall be public highways or commons.
> R.S., 1985, c. L-6, s. 32; 1993, c. 28, s. 78; 1998, c. 14, ss. 98(F), 100(F); 2002, c. 7, s. 102; 2014, c. 2, s. 17(F)

### Resurveys

**Resurveys**

**33**

- **(1)** Canada Lands may be resurveyed under this Part
	- **(a)** for the purposes of correcting errors or supposed errors or re-establishing lost monuments; or
	- **(b)** at the request of the member of Her Majesty’s Privy Council for Canada or the Commissioner charged with administering the Canada Lands in respect of which the resurvey is to be made.

**Plans of resurveyed lands**

- **(2)** Plans of Canada Lands that are resurveyed shall be dealt with in accordance with this Part and shall, after confirmation thereof by the Surveyor General, be deemed to be the official plans under this Act of the lands thereby affected and shall be substituted for all, or corresponding portions of all, former official plans of the lands thereby affected.
> R.S., 1985, c. L-6, s. 33; 1998, c. 14, ss. 98(F), 100(F)

**PART III**
## Special Surveys of Territorial Lands

### Scope and Administration

**Definitions**

**34** In this Part,

***Minister*** means the Minister of Northern Affairs; (*ministre*)

***territorial lands*** means any lands situated in Yukon, the Northwest Territories or Nunavut. (*terres territoriales*)
> R.S., 1985, c. L-6, s. 34; 1993, c. 28, s. 78; 2002, c. 7, s. 1032019, c. 29, s. 374

### Special Surveys

**Scope and purposes of special surveys**

**35** Special surveys of territorial lands may be made for any or all of the following purposes:
- **(a)** the correction of errors or supposed errors in existing surveys or plans;
- **(b)** the subdivision of land not previously subdivided or the showing of divisions of land not previously or correctly shown on an existing plan of subdivision;
- **(c)** fixing the location or width of roads or highways;
- **(d)** establishing any boundary lines the positions of which, due to incorrect placing or loss or obliteration of monuments defining the lines on the ground, have become doubtful or difficult of being ascertained; and
- **(e)** any other purpose deemed necessary by the Minister or the Commissioner.
> R.S., c. L-5, s. 49; 1976-77, c. 30, s. 28

**When undertaken**

**36**

- **(1)** The Minister of Natural Resources shall cause a special survey of territorial lands to be made when requested to do so by the Minister or the Commissioner.

**Surveyor General to manage**

- **(2)** The Surveyor General, subject to the direction of the Minister of Natural Resources, has the management of special surveys.

**Canada Lands Surveyor**

- **(3)** No person, other than a Canada Lands Surveyor, shall make a special survey.

**How survey is made**

- **(4)** A special survey shall be made by a Canada Lands Surveyor in accordance with the instructions given to him by the Surveyor General and all sections of this Act with respect to the powers, duties and obligations of Canada Lands Surveyors and to the making of surveys apply, with such modifications as the circumstances require, to special surveys.
> R.S., 1985, c. L-6, s. 36; 1994, c. 41, s. 37; 1998, c. 14, ss. 98(F), 99(F)

### Procedure of Special Surveys

**Plotting of plans**

**37**

- **(1)** On completion of a special survey referred to in subsection 36(1), the surveyor shall send all field notes and other documents relating to the survey to the Surveyor General who shall direct the plotting of the plan of the territorial lands so surveyed.

**Plan sent to Minister or Commissioner**

- **(2)** On the completion of the plotting of the plan referred to in subsection (1), the Surveyor General shall sign the plan and forward it, together with such supporting documents as the Surveyor General thinks necessary, to the Minister or the Commissioner.
> R.S., 1985, c. L-6, s. 37; 1998, c. 14, s. 98(F)

**Appointment of Hearing Officer**

**38**

- **(1)** On receiving the plan forwarded by the Surveyor General pursuant to subsection 37(2), the Minister or the Commissioner shall appoint a Hearing Officer to inquire into and report on any complaints that may be made against the special survey or plan.

**Place of inquiry**

- **(2)** A Hearing Officer shall hold hearings in or as near as practicable to the locality in which the special survey has been made.

**Publication of notice**

- **(3)** The Minister or the Commissioner shall cause to be published in the [Canada Gazette](http://www.gazette.gc.ca/) and in a newspaper, if any, in the locality in which the special survey has been made a notice setting forth
	- **(a)** a description of the scope and purposes of the special survey and the lands affected thereby;
	- **(b)** his declaration that the special survey and plan are the true and correct survey and plan of the lands thereby affected, that all boundaries and lines fixed by the survey and plan are the true boundaries and lines, whether of roads, streets, lanes, rivers or creeks or as between adjoining owners or between adjoining lots and whether or not the boundaries and lines were in fact before the declaration the true boundaries and lines, and that the special survey and plan shall be substituted for all, or corresponding portions of all, former surveys or plans of the lands affected that have been theretofore registered;
	- **(c)** the name of the Hearing Officer appointed by him and the time and place at which the Hearing Officer will hear complaints; and
	- **(d)** that each person who has an interest in land affected by the special survey and plan and who desires to complain against the survey or the plan shall deliver, at least thirty days before the date set for the Hearing Officer’s hearing, to the Minister or the Commissioner a written statement setting forth the nature and grounds of his complaint.
> R.S., 1985, c. L-6, s. 38; 1998, c. 14, s. 98(F)

**Where no complaints**

**39** Where no complaints are received pursuant to paragraph 38(3)(d), the Minister or the Commissioner shall return the plan to the Surveyor General to be confirmed by him.
> R.S., 1985, c. L-6, s. 39; 1998, c. 14, s. 98(F)

**Hearing of complaints**

**40**

- **(1)** Where complaints are received pursuant to paragraph 38(3)(d), the Hearing Officer shall hear them at the time and place set forth in the notice published pursuant to subsection 38(3), but may adjourn the hearing on giving due notice to the complainants.

**Nature of hearing**

- **(2)** A Hearing Officer shall hear only those complaints of which written notice has been given to the Minister or the Commissioner but may, for this purpose, receive any evidence he thinks proper, call any witnesses and exercise any of the powers of a commissioner under the [Inquiries Act](/en/Acts/Revised%20Statutes%20of%20Canada/I/I-11.md).

**Report**

- **(3)** A Hearing Officer shall, on completion of the hearing, report his findings and recommendations to the Minister or the Commissioner.
> R.S., c. L-5, s. 54; 1976-77, c. 30, s. 32

**Minister’s or Commissioner’s decision**

**41**

- **(1)** The Minister or the Commissioner shall, after receiving a Hearing Officer’s report, decide whether the plan and whether any of the matters set forth in the declaration referred to in paragraph 38(3)(b) should be approved or amended, varied or altered as a result of the complaints.

**Notice of decision**

- **(2)** The Minister or the Commissioner shall prepare a notice of decision setting forth
	- **(a)** that he has received the Hearing Officer’s report;
	- **(b)** his decision as to the disposition of the complaints and the resulting changes, if any, in the plan and in any of the matters set forth in the declaration referred to in paragraph 38(3)(b);
	- **(c)** that any person to whom the notice of decision is mailed has a right of appeal from the decision to the Supreme Court of Yukon, the Supreme Court of the Northwest Territories or the Nunavut Court of Justice, as the case may be, within sixty days after the date of the notice; and
	- **(d)** that any person who appeals from the decision is required to serve the Minister or the Commissioner with a notice of appeal within the time referred to in paragraph (c).

**To whom notice of decision sent**

- **(3)** The Minister or the Commissioner shall cause a copy of the notice of decision to be mailed by registered mail to each of the following persons at his latest known address:
	- **(a)** persons whose complaints have been heard by the Hearing Officer pursuant to section 40; and
	- **(b)** persons whose interests in land affected by the special survey and plan are, in the opinion of the Minister or the Commissioner, affected by his decision under this section to an extent that differs in any way from the extent to which they were affected by the declaration referred to in paragraph 38(3)(b).

**Who may appeal**

- **(4)** Any person to whom a notice of decision is mailed under this section may, within sixty days after the date of the notice of decision and if within that time the person serves the Minister or the Commissioner with a notice of appeal, appeal from the decision of the Minister or the Commissioner to the Supreme Court of Yukon, the Supreme Court of the Northwest Territories or the Nunavut Court of Justice, as the case may be.
> R.S., 1985, c. L-6, s. 41; 1999, c. 3, s. 79; 2002, c. 7, s. 104

**Where complaints withdrawn, etc.**

**42** Where all persons who have a right of appeal under section 41 have submitted written withdrawals of their complaints or have notified the Minister or the Commissioner in writing that they do not intend to appeal, the Minister or the Commissioner shall return the plan to the Surveyor General who shall confirm, amend, alter or vary the plan as directed by the Minister or the Commissioner.
> R.S., 1985, c. L-6, s. 42; 1998, c. 14, s. 98(F)

**Where no appeal taken**

**43** Where there is no appeal from the decision of the Minister or the Commissioner within the time limited therefor, the Minister or the Commissioner shall return the plan to the Surveyor General who shall confirm, amend, alter or vary the plan as directed by the Minister or the Commissioner.
> R.S., 1985, c. L-6, s. 43; 1998, c. 14, s. 98(F)

**Powers of court on appeal and effect of judgment**

**44** Where an appeal is taken from the decision of the Minister or the Commissioner, the court hearing the appeal may confirm, amend, alter or vary the decision of the Minister or the Commissioner and the Surveyor General shall accordingly confirm, amend, alter or vary the plan.
> R.S., 1985, c. L-6, s. 44; 1998, c. 14, s. 98(F)

**Registration of plans**

**45**

- **(1)** The Minister of Natural Resources shall send to the registrar of land titles of the registration district in which the lands affected thereby are situated, for filing in the appropriate land titles office, a copy of
	- **(a)** the plan confirmed by the Surveyor General under section 39 together with the accompanying declaration referred to in paragraph 38(3)(b),
	- **(b)** the plan confirmed by the Surveyor General under section 42 together with the accompanying notice of decision referred to in subsection 41(2),
	- **(c)** the plan confirmed by the Surveyor General under section 43 together with the accompanying notice of decision referred to in subsection 41(2), or
	- **(d)** the plan as confirmed, amended, altered or varied by the Surveyor General pursuant to the judgment on appeal under section 44 together with the accompanying certified copy of the judgment,
as the case may require.

**Effect of registration**

- **(2)** On filing in the appropriate land titles office, the plan and accompanying documents referred to in subsection (1) shall be deemed to be substituted for all, or corresponding portions of all, former surveys or plans of the lands thereby affected that have been theretofore registered and shall govern all boundaries of the lands thereby affected.
> R.S., 1985, c. L-6, s. 45; 1994, c. 41, s. 37; 1998, c. 14, s. 98(F)

**Return of documents to Surveyor General**

**46** All original plans, field notes or other documents relating to special surveys sent by the Surveyor General to the Minister or the Commissioner for his decision or used in evidence on appeal or otherwise leaving the custody of the Surveyor General shall be returned to his custody.
> R.S., 1985, c. L-6, s. 46; 1998, c. 14, s. 98(F)

**PART IV**
## General

### General Power to Survey

**General power to survey**

**47**

- **(1)** Subject to this Act, the Minister may, if in his opinion a survey thereof under the management of the Surveyor General is required, cause a survey to be made of any lands belonging to Her Majesty in right of Canada or of which the Government of Canada has power to dispose, but where surveys of the lands affect or are likely to affect the rights of landowners of adjoining lands, the surveys shall be made by a surveyor who holds a valid and subsisting certificate, diploma, commission or other document entitling him to survey lands in the province in which the surveys are made.

**Survey provisions**

- **(2)** The provisions of this Act relating to surveys apply, with such modifications as the circumstances require, to surveys made under subsection (1).
> R.S., 1985, c. L-6, s. 47; 1998, c. 14, s. 98(F)

### Evidence

**Certified copies as evidence**

**48**

- **(1)** A copy certified by the Minister, the Surveyor General or any person authorized to do so by either of them as a true copy of any record, document, plan, book or paper belonging to or deposited with the Surveyor General with respect to a survey of lands made under this Act shall in all actions or other legal proceedings involving those lands be given the same effect as evidence as the original record, document, plan, book or paper would be given.

**Lithographed maps, etc., as evidence**

- **(2)** Lithographed or other copies of maps or plans purporting to be issued or published by the Department of Natural Resources and to bear a lithographed or copied signature of the Minister or the Surveyor General are, in all actions or other legal proceedings involving lands surveyed under this Act, evidence of the original map or plan and its contents.
> R.S., 1985, c. L-6, s. 48; 1994, c. 41, s. 38; 1998, c. 14, s. 98(F)

**Who may take affidavits, etc.**

**49** Unless otherwise provided in this Act, any oath, affidavit, declaration or solemn affirmation required to be taken under this Act may be taken before any judicial officer, notary public, commissioner for taking affidavits or Canada Lands Surveyor or before any other person thereunto authorized by the Minister.
> R.S., 1985, c. L-6, s. 49; 1998, c. 14, s. 99(F)

**Minister may require sworn statements**

**50** The Minister may require any statement made in respect of surveys under this Act to be verified by oath, affidavit, declaration or solemn affirmation.
> R.S., c. L-5, s. 64

### Offences and Punishment

**51 and 52** [Repealed, 1998, c. 14, s. 96]

**Defacing monuments**

**53**

- **(1)** Every person who, knowingly and wilfully, pulls down, alters, defaces or removes any monument erected, planted or placed by a surveyor in carrying out his duties under this Act or the Dominion Lands Surveys Act
	- **(a)** is guilty of an indictable offence and liable to imprisonment for a term not exceeding seven years, or
	- **(b)** is guilty of an offence punishable on summary conviction
and, in addition, is liable to payment of all costs in connection with the restoration or re-establishment of the monument by a surveyor under instructions from the Surveyor General.

**Defacing monuments inadvertently**

- **(2)** Every person who inadvertently pulls down, alters, defaces or removes any monument erected, planted or placed by a surveyor in carrying out his duties under this Act or the Dominion Lands Surveys Act is liable to payment of all costs in connection with the restoration or re-establishment of the monument by a surveyor under instructions from the Surveyor General.

**Unlawful possession of monuments**

- **(3)** Every person who, knowingly and wilfully, has in his possession or custody any monument is guilty of an offence punishable on summary conviction.

**Exception**

- **(4)** This section does not apply to the alteration, removal, possession and custody of monuments by any surveyor authorized to carry out surveys under this Act or by other persons with the permission of such surveyor or who otherwise necessarily handle such monuments in connection with surveys under this Act.
> R.S., 1985, c. L-6, s. 53; 1998, c. 14, s. 98(F)

**54** [Repealed, 1998, c. 14, s. 97]

repository: TravisMadill/CanadianLaws

path: /en/Acts/Revised Statutes of Canada/L/L-6.md

repo_name: TravisMadill/CanadianLaws


text:
# Conference-Management

Design solution for Conference scheduling problem where multiple conference rooms are available which has to be assigned based on scheduled events.

**Solution:**

Refer conference.management package for all the classes

**Note for other Enthusiastic Contributor:**

Most welcome to improve the design and make it more comprihensive.

**Queries?...Connect with me at:**

1) LinkedIn: https://linkedin.com/in/prakash-chandra-chhipa
2) Email<EMAIL_ADDRESS>

repository: prakashchhipa/Conference-Management-

repo_name: prakashchhipa/Conference-Management-


text:
# peermaps

peer to peer cartography

This tool streams raw OpenStreetMap data from p2p networks so that you can
perform ad-hoc extracts for arbitrary bounding boxes. Because you are pulling
the data from a p2p network (and helping to host it), you also don't need to
worry about http quotas or rate limiting.

# example

Stream data inside arbitrary WSEN extents from the network:

```
$ peermaps data -155.064270 18.9136925 -154.8093872 19.9 | head
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="osmconvert 0.8.4" timestamp="2016-11-28T01:59:58Z">
  <bounds minlat="18.9136925" minlon="-155.06427" maxlat="19.9" maxlon="-154.8093872"/>
  <node id="88994815" lat="19.7317131" lon="-155.0533157" version="3" timestamp="2012-01-19T21:23:51Z" changeset="10441415" uid="574654" user="Tom_Holland"/>
  <node id="88994817" lat="19.7312758" lon="-155.0533179" version="3" timestamp="2012-01-19T21:23:51Z" changeset="10441415" uid="574654" user="Tom_Holland"/>
  <node id="88994826" lat="19.7319167" lon="-155.0460457" version="3" timestamp="2012-01-19T21:23:51Z" changeset="10441415" uid="574654" user="Tom_Holland"/>
  <node id="88994829" lat="19.7329599" lon="-155.0463189" version="3" timestamp="2012-01-19T21:23:51Z" changeset="10441415" uid="574654" user="Tom_Holland"/>
  <node id="88994832" lat="19.7333033" lon="-155.0454221" version="3" timestamp="2012-01-19T21:23:51Z" changeset="10441415" uid="574654" user="Tom_Holland"/>
  <node id="88994836" lat="19.7336513" lon="-155.0450981" version="4" timestamp="2012-01-20T23:02:03Z" changeset="10451586" uid="574654" user="Tom_Holland"/>
  <node id="88994868" lat="19.7341231" lon="-155.0447835" version="3" timestamp="2012-01-20T23:02:03Z" changeset="10451586" uid="574654" user="Tom_Holland"/>
```

# install

requirements:

* [ipfs](https://dist.ipfs.io/#go-ipfs)
* [nodejs + npm](https://nodejs.org)
* [osmconvert](https://wiki.openstreetmap.org/wiki/Osmconvert#Download)
* bash (for the `peermaps data` command)

Install the prerequisites, then install the `peermaps` command:

```
npm install -g peermaps
```

Run the ipfs daemon somewhere (in a `screen` for example):

```
ipfs daemon
```

Now you can use the `peermaps` command.

# usage

```
peermaps data W,S,E,N {OPTIONS}

  Print all data inside the W,S,E,N extents.

  -f      Output format: osm (default), o5m, pbf, csv.
  -n      Network: ipfs (default)
  --show  Print the generated command instead of running it.

peermaps files W,S,E,N

  Print the files from the archive that overlap with the W,S,E,N extents.

  -n      Network: ipfs (default)

peermaps read FILE

  Print the content of FILE from the archive.

  -n      Network: ipfs (default)

peermaps address

  Print the address of the peermaps archive for the given network.

  -n      Network: ipfs (default)

peermaps generate INFILE {OPTIONS}

  Generate a peermaps archive at OUTDIR for INFILE.

  -o OUTDIR   Default: ./mapdata
  -t MAXSIZE  Files must be no greater than MAXSIZE. Default: 1M
  --xmin      Minimum longitude (west). Default: -180
  --xmax      Maximum longitude (east). Default: 180
  --ymin      Minimum latitude (south). Default: -90
  --ymin      Maximum latitude (north). Default: 90
  --xcount    Number of longitude divisions per branch. Default: 4
  --ycount    Number of latitude divisions per branch. Default: 4
  --nproc     Number of converter processes to spawn. Default: (`nproc`-1)

  Example:
    peermaps generate planet-latest.osm.pbf -o ~/data/planet -t 5M

  Note: this operation may take days for planet-sized inputs.

```

# mirror

Help us mirror the archive! If you have a computer with ~38G and network to
spare, you can run:

```
ipfs pin add QmXJ8KkgKyjRxTrEDvmZWZMNGq1dk3t97AVhF1Xeov3kB4
```

For now there is only one archive hash. In the future, there will be more
archives and an update mechanism.

# todo

* generate and host vector tiles on p2p networks
* dat/hyperdrive support
* archive update mechanism
* torrent/webtorrent support?
* p2p web tile viewer
* make the generate step much faster by patching osmconvert.c

repository: opencollective/peermaps

gha_license_id: NOASSERTION

repo_name: opencollective/peermaps


text:
---
originalname: "<IP_ADDRESS>"
category: orders
year: 2014
layout: order
date: "2014-02-11"
title: "Authorizing executive branch agency heads to close offices in counties included in the State of Emergency"
---
<pre>
I‘! .1
‘*\ I7 7 6 /'

\.
\\,‘—‘__,

THE STATE OF GEORGIA

EXECUTIVE ORDER

BY THE GOVERNOR:

IT IS HEREBY ORDERED:

In response to the severe winter storm that is currently impacting
the state, for Wednesday, February 12, 2014, all executive branch
agency heads have it within their’ discretion to close all or certain
offices within their agency that are located in counties included
Within the State of Emergency declared February 10 and 11, 2014.
This order shall not apply to any state employees involved in
disaster preparation and/ or response.

75-
This  " day of February, 2014.

{\01za~\9eo..C

GOVERNOR

</pre>

repository: gaodp/executive-orders

branch_name: refs/heads/gh-pages

gha_language: JavaScript

repo_name: gaodp/executive-orders


text:
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

FlexSpot Fantasy Community

    Website for FlexSpot Fantasy Community.

    Explore the docs »

    View Demo
    ·
    Report Bug
    ·
    Request Feature

Table of Contents

      About The Project

Built With

      Getting Started

Prerequisites

Installation

Usage

Roadmap

Contributing

License

Contact

Acknowledgements

## About The Project

This is the website for the FlexSpot Fantasy Football community.

### Built With

- [Fastify](https://www.fastify.io/)
- [MikroORM](https://www.mikro-orm.io/)
- [NextJS](https://nextjs.org/)

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

This is an example of how to list things you need to use the software and how to install them.

- npm
  ```sh
  npm install npm@latest -g
  ```
- Optional: docker and docker-compose.

### Installation

1. Clone the repo
   ```sh
   git clone https://github.com/chrisparsons83/flexspotff.com.git
   ```
2. Switch to working directory, and install NPM packages for both frontend and backend. (This probably should be wrapped in an npm script)
   ```sh
   npm install
   npm run install:frontend
   npm run install:backend
   ```
3. Run the database. You can get a sql dump and put it in .db-load before running.
   ```sh
   docker-compose -d up
   ```
4. Set your environmental variables. For dev, you'll likely just want to use the .env setup.
   ```sh
   cp ./backend/.env.sample ./backend/.env
   ```
   - Update the following variables when you make this copy:
     - DISCORD_CLIENT_ID
     - DISCORD_CLIENT_SECRET
     - FASTIFY_COOKIE_KEY: any random string
     - JWT_KEY: any other random string
5. If you want to start from a clean database, you can run migrate:up using Mikro ORM.
   ```sh
   cd backend
   npx mikro-orm migration:up
   ```
6. To run the front end website:
   ```sh
   cd frontend && npm run dev
   ```

## Usage

TODO: Update this copy.

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

Changes to the database schema are done via [MikroORM Migrations](https://mikro-orm.io/docs/migrations/).

## Roadmap

See the [open issues](https://github.com/chrisparsons83/flexspotff.com/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Chris Parsons - [Personal Website](https://www.chris-parsons.com)

Project Link: [https://github.com/chrisparsons83/flexspotff.com](https://github.com/chrisparsons83/flexspotff.com)

[contributors-shield]: https://img.shields.io/github/contributors/chrisparsons83/flexspotff.com.svg?style=for-the-badge
[contributors-url]: https://github.com/chrisparsons83/flexspotff.com/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/chrisparsons83/flexspotff.com.svg?style=for-the-badge
[forks-url]: https://github.com/chrisparsons83/flexspotff.com/network/members
[stars-shield]: https://img.shields.io/github/stars/chrisparsons83/flexspotff.com.svg?style=for-the-badge
[stars-url]: https://github.com/chrisparsons83/flexspotff.com/stargazers
[issues-shield]: https://img.shields.io/github/issues/chrisparsons83/flexspotff.com.svg?style=for-the-badge
[issues-url]: https://github.com/chrisparsons83/flexspotff.com/issues
[license-shield]: https://img.shields.io/github/license/chrisparsons83/flexspotff.com.svg?style=for-the-badge
[license-url]: https://github.com/chrisparsons83/flexspotff.com/blob/master/LICENSE.md


text:
# Message Publisher

Message Publisher Simulator is an application that helps in simulating a single device communication with IoT Hub, or any other message publisher that sends messages/events to Azure EventGrid and/or Azure  ServiceBus. It is possible to define JSON payload, and trigger message sending. Message sending can be also time triggered.

# IoT Hub Device Simulator

Message Publisher Simulator can work as the device simulator. It supports device-to-cloud communication, direct-method communication, and cloud-to-device communication. In order to enable communication, the connection string needs to be provided.

# Event Grid Publisher

Message Publisher Simulator can send events to the event grid topic. In order to enable communication, the following parameters need to be provided:
* endpoint URL
* access key
* topic name
* subject
* data version
* event type.

Currently, it works only with Event Grid schema.

# Service Bus Queue/Topic message publisher

Message Publisher Simulator can send events to the service bus queue/topic. In order to enable communication, the following parameters need to be provided:
* connection string
* queue/topic name
* select if the target is either queue or topic.

## Expressions
It is possible to use the expression for generating random value(double or int). It is necessary to include the keyword "rnd" followed by min and max value separated with ":". For example:
```
{
   "Name":"Temperature",
   "Timestamp":"2016-12-31T01:00:03",
   "Value":"rnd:25.0:30"
}
```

If min or max value contains a comma, the randomly generated value will be double, otherwise int.

## Technical overview
Message Publisher Simulator is UWP(min version 1809, build 17763) application based on MVVMCross 6.x. The intention with cross-platform development is to offer simulator for MAC OS, iOS and Android in the near future.

## Next Steps
* MAC OS version of the application
* Extend the expression to support adding timestamp instead of hardcoding in the message payload

repository: Prov-Matthias/DeviceSimulator

repo_name: Prov-Matthias/DeviceSimulator


text:
# MvcBloggy

This is an unprofessional blog engine created with ASP.NET MVC.

> Honest to say, I am developing this to use it myself but who knows,
> maybe it will be something that lots of people can benefit from and use.

The code under the master branch is unstable for now. You can also find the up-to-date (and the latest unstable) code under [develop](https://github.com/tugberkugurlu/MvcBloggy/tree/develop "https://github.com/tugberkugurlu/MvcBloggy/tree/develop") branch.

repository: ryuji-konishi/MvcBloggy

repo_name: ryuji-konishi/MvcBloggy


text:
# react-native-softmesh-button

A really nice button with loading

## Installation

```sh
npm install react-native-softmesh-button
```

## Usage

```js
import SoftmeshButton from "react-native-softmesh-button";

// ...

const result = await SoftmeshButton.multiply(3, 7);
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT


text:
# Role saver for [werewolf telegram bot](https://github.com/GreyWolfDev/Werewolf)

this version is based on dictionary and support multi groups like [@role_ww_bot](http://t.me/role_ww_bot)

change `MY_AWESOME_TOKEN` and run it
>python3 role_Saver_v1.py

## options

* save players role with `/sn <role>`
* ask role from players, who has not saved any role `/saveYourRole`
* block list and used message list to have a better experience :)

### todo
* convert dict base to DB base
* add stats of group and player
* add leader options


text:
---
title: Count the number of characters of a textarea
category: Basic
tags:
  - posts
layout: layouts/post.njk
metadata:
  keywords: display number of characters, maxlength attribute
---

Assume that we have a `textarea` and a normal `div` elements for showing how many characters user has been entering:

```html
<textarea id="message"></textarea>
<div id="counter"></div>
```

## Use the `maxlength` attribute

The `maxlength` attribute sets the maximum number of characters that user can put in the textarea.

```html
<textarea maxlength="200" id="message"></textarea>
```

## Count the number of characters

Handle the `input` event which is triggered if the value of element is changed:

```js
const messageEle = document.getElementById('message');
const counterEle = document.getElementById('counter');

messageEle.addEventListener('input', function(e) {
    const target = e.target;

    // Get the `maxlength` attribute
    const maxLength = target.getAttribute('maxlength');

    // Count the current number of characters
    const currentLength = target.value.length;

    counterEle.innerHTML = `${currentLength}/${maxLength}`;
});
```

{% callout %}
### Good to know

The common mistake is to capture the `keyup` event. It doesn't work in some cases such as:
* User drags a text into the textarea
* User right-clicks in the textarea and chooses _Paste_ from the context menu
{% endcallout %}

## Demo

<iframe src='/demo/count-the-number-of-characters-of-a-textarea/index.html'></iframe>

## More

* [Attach or detach an event handler](/attach-or-detach-an-event-handler)
* [Get or set the html of an element](/get-or-set-the-html-of-an-element)
* [Get set and remove attributes](/get-set-and-remove-attributes)


text:
# Restaurant Automation
## WINDOWS installation: Setup a server on localhost

Setting up Windows to run [MEAN Stack](https://en.wikipedia.org/wiki/MEAN_(software_bundle)) (which includes Angular) applications require a couple of things to be installed - `NodeJS` and `MongoDB`.
1. Install Node: https://nodejs.org/ any version. Once node is installed, from a command prompt or PowerShell `node -v` will display the version. The node command can run/execute `.js` javascript files and functions.

2. Install Mongo: https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.6-signed.msi Do Complete install. Run service as network service. I made my `data directory` at `C:\data\db` install mongodb compass, but you can put it anywhere.

#### MongoDB Compass on a Node server is the equivalent of phpmyadmin on an xampp server.

3. Some packages are required. Open up a shell and use the node package manager, npm command, to download these packages.

+ `npm install`

## Runnning the App

+ `node server.js`