text:
to an act of unlawful interference with civil aviation and involves the persons and organizations referred to in the plan; and
	- **(b)** tests the effectiveness of additional safeguards that the operator chooses from its menu of additional safeguards.

**Exception**

- **(2)** Despite subsection (1), the operator of an aerodrome is not required to carry out a discussion-based security exercise in any year in which it carries out an operations-based security exercise.
> SOR/2012-48, s. 33; SOR/2014-153, s. 35

**Notice**

**477** The operator of an aerodrome must give the Minister 60 days’ notice of any security exercise that the operator plans to carry out.
> SOR/2014-153, s. 35

#### Records

**Additional safeguards**

**478**

- **(1)** Each time additional safeguards are implemented at an aerodrome in order to mitigate heightened risk conditions related to aviation security, the operator of the aerodrome must create a record that includes
	- **(a)** a description of the additional safeguards that were implemented;
	- **(b)** an evaluation of the effectiveness of those additional safeguards; and
	- **(c)** a description of any actions that are planned in order to address deficiencies identified during the implementation of those additional safeguards.

**Emergencies**

- **(2)** Each time an emergency referred to in subsection 474(1) occurs at an aerodrome, the operator of the aerodrome must create a record that includes
	- **(a)** a description of the emergency;
	- **(b)** an evaluation of the effectiveness of the operator’s emergency plan; and
	- **(c)** a description of any actions that are planned in order to address deficiencies identified during the emergency.

**Exercises**

- **(3)** Each time a security exercise is carried out at an aerodrome, the operator of the aerodrome must create a record that includes
	- **(a)** an outline of the exercise scenario;
	- **(b)** an evaluation of the effectiveness of the exercise; and
	- **(c)** a description of any actions that are planned in order to address deficiencies identified during the exercise.
> SOR/2012-48, s. 33; SOR/2014-153, s. 35

#### Corrective Actions

**Corrective actions**

**479** Subject to section 480, the operator of an aerodrome must immediately take corrective actions to address a vulnerability that contributes to a heightened aviation security risk at the aerodrome and that
- **(a)** is identified to the operator by the Minister; or
- **(b)** is identified by the operator.
> SOR/2014-153, s. 35

**Corrective action plan**

**480** If a corrective action to be taken by the operator of an aerodrome under section 479 involves a phased approach, the operator must include in its airport security program a corrective action plan that sets out
- **(a)** the nature of the vulnerability to be addressed;
- **(b)** a rationale for the phased approach; and
- **(c)** a timetable setting out when each phase of the corrective action plan will be completed.
> SOR/2014-153, s. 35

#### Primary Security Line Partners

**Provision of information to operator of aerodrome**

**481**

- **(1)** For the purpose of supporting the establishment and implementation of an airport security program by the operator of an aerodrome, a primary security line partner at the aerodrome must, on reasonable notice given by the operator, provide the operator with
	- **(a)** information respecting the measures, procedures and processes that the partner has in place at the aerodrome to protect the security of restricted areas and to prevent breaches of the primary security line; and
	- **(b)** a document that
		- **(i)** describes each area on the aerodrome’s primary security line that is occupied by the partner,
		- **(ii)** indicates the location of each restricted area access point in those areas, and
		- **(iii)** describes those restricted area access points.

**Provision of information to Minister**

- **(2)** The primary security line partner must provide the Minister with the information and the document on reasonable notice given by the Minister.
> SOR/2014-153, s. 35

[**482** and **483** reserved]

#### Disclosure of Information

**Prohibition**

**484** A person other than the Minister must not disclose security-sensitive information that is created or used under this Division unless the disclosure is required by law or is necessary to comply or facilitate compliance with the aviation security provisions of the Act, regulatory requirements or the requirements of an emergency direction.
> SOR/2014-153, s. 35

**DIVISION 9**
### Reserved

[**485** to **494** reserved]

**DIVISION 10**
### Other Aerodrome Operations

#### Overview

**Division overview**

**495** This Division sets out requirements respecting aerodrome operations that are not dealt with in any other Division of this Part.
> SOR/2012-48, s. 34

#### Construction Plans

**Requirement to notify Minister**

**496**

- **(1)** The operator of an aerodrome must notify the Minister of all plans to begin new construction or to make a change to the physical security of the aerodrome, if the construction or change relates to regulatory requirements respecting passengers, aircraft, baggage, cargo or mail.

**Notice requirements**

- **(2)** The notice must
	- **(a)** be in writing;
	- **(b)** state the date on which the construction will begin or the change will be made; and
	- **(c)** set out a description of the construction or change and the safeguards that will be implemented to maintain security in the areas of the aerodrome that will be affected by the construction activities.
> SOR/2012-48, s. 34

[**497** to **504** reserved]

**PART 7**
## Other Aerodromes

### Overview

**Part overview**

**505** This Part sets out the basic regulatory framework for security at aerodromes. However, this framework is not applicable in respect of aerodromes listed in Schedule 1, 2 or 3 or in respect of any other place designated by the Minister under subsection 6(1) of the [Canadian Air Transport Security Authority Act](/en/Acts/Statutes%20of%20Canada/2002/c.%209,%20s.%202.md).
> SOR/2015-196, s. 6

**DIVISION 1**
### Authorization for Carriage of or Access to Explosive Substances and Incendiary Devices

**Application**

**506** This Division applies in respect of aerodromes. However, this Division does not apply in respect of aerodromes listed in Schedule 1, 2 or 3 or in respect of any other place designated by the Minister under subsection 6(1) of the [Canadian Air Transport Security Authority Act](/en/Acts/Statutes%20of%20Canada/2002/c.%209,%20s.%202.md).
> SOR/2015-196, s. 7

**Authorization**

**507** The operator of an aerodrome may authorize a person to carry or have access to an explosive substance or an incendiary device at the aerodrome if
- **(a)** the explosive substance or incendiary device is to be used at the aerodrome
	- **(i)** for excavation, demolition or construction work,
	- **(ii)** in fireworks displays,
	- **(iii)** by persons operating explosives detection equipment or handling explosives detection dogs,
	- **(iv)** by a police service, or
	- **(v)** by military personnel; and
- **(b)** the operator has reasonable grounds to believe that the safety of the aerodrome and the safety of persons and aircraft at the aerodrome will not be jeopardized by the presence of the explosive substance or incendiary device.

**DIVISION 2**
### Threats and Incidents

#### Application

**Application**

**508** This Division applies in respect of aerodromes that are not listed in Schedule 1, 2 or 3 and that serve air carriers. This Division does not apply in respect of any other place designated by the Minister under subsection 6(1) of the [Canadian Air Transport Security Authority Act](/en/Acts/Statutes%20of%20Canada/2002/c.%209,%20s.%202.md).
> SOR/2014-153, s. 36; SOR/2015-196, s. 8

#### Threat Response

**Area under operator’s control**

**509** The operator of an aerodrome who is made aware of a threat against an aviation facility, or a part of the aerodrome, that is under the operator’s control must immediately determine whether there is a threat that jeopardizes the security of the facility or that part of the aerodrome.
> SOR/2019-149, s. 3

**Area under control of other person**

**510** The operator of an aerodrome who is made aware of a threat against an aviation facility, or a part of the aerodrome, that is under the control of a person carrying on any activity at the aerodrome, other than the operator, must immediately
- **(a)** notify the person of the nature of the threat; and
- **(b)** determine whether there is a threat that jeopardizes the security of the aerodrome.
> SOR/2019-149, s. 3

**Threats**

**511** The operator of an aerodrome who determines that there is a threat that jeopardizes the security of the aerodrome must immediately take all of the measures necessary to ensure the safety of the aerodrome and persons at the aerodrome, including informing the appropriate police service of the nature of the threat.
> SOR/2019-149, s. 3

**Duties of other person**

**512** A person, other than a screening authority, who is carrying on any activity at an aerodrome and who is made aware of a threat against the aerodrome must
- **(a)** immediately notify the operator of the aerodrome of the nature of the threat; and
- **(b)** assist the operator of the aerodrome in determining whether there is a threat that jeopardizes the security of the aerodrome.
> SOR/2019-149, s. 3

**Threats identified by other person**

**513** If it is determined under paragraph 15(b), 510(b) or 512(b) that there is a threat that jeopardizes the security of an aerodrome, the operator of the aerodrome must immediately take all of the measures necessary to ensure the safety of the aerodrome and persons at the aerodrome, including informing the appropriate police service of the nature of the threat.
> SOR/2019-149, s. 3

#### Information Reporting

**Security incidents**

**514** The operator of an aerodrome must immediately notify the Minister when any of the following incidents occur:
- **(a)** the discovery, at the aerodrome, of a weapon, explosive substance or incendiary device that is not permitted under subsection 78(2);
- **(b)** an explosion at the aerodrome, unless the explosion is known to be the result of an accident, excavation, demolition, or construction work, or the use of fireworks displays;
- **(c)** a threat against the aerodrome; and
- **(d)** an aviation security incident that involves a peace officer anywhere at the aerodrome other than areas under an air carrier’s control.
> SOR/2019-149, s. 3

**Commercial air service information**

**515** The operator of an aerodrome must provide the Minister with written notice of any new commercial air service that is to begin at an air terminal building.

**DIVISION 3**
### Emergency Planning

#### Application

**Application**

**516**

- **(1)** This Division applies in respect of aerodromes that are not listed in Schedule 1, 2 or 3 and that serve
	- **(a)** air carriers that conduct scheduled or non-scheduled services to or from an air terminal building at any of those aerodromes; or
	- **(b)** air carriers that conduct scheduled international services from any of those aerodromes.

**Application**

- **(2)** This Division does not apply in respect of any other place designated by the Minister under subsection 6(1) of the [Canadian Air Transport Security Authority Act](/en/Acts/Statutes%20of%20Canada/2002/c.%209,%20s.%202.md).
> SOR/2012-48, s. 35; SOR/2014-153, s. 37; SOR/2015-196, s. 9

#### Emergency Plans and Security Exercises

**Plan requirements**

**517**

- **(1)** The operator of an aerodrome must establish an emergency plan that sets out the response procedures to be followed at the aerodrome for coordinated responses to the following emergencies:
	- **(a)** bomb threats; and
	- **(b)** hijackings of aircraft.

**Response procedures**

- **(2)** The response procedures must
	- **(a)** set out in detail the actions to be taken by the employees and contractors of the operator of the aerodrome and identify the responsibilities of all other persons or organizations involved, including, as applicable, the police, emergency response providers, air carriers, emergency coordination centre personnel and control tower or flight service station personnel;
	- **(b)** include, if applicable, detailed procedures for the evacuation of air terminal buildings;
	- **(c)** include, if applicable, detailed procedures for the search of air terminal buildings;
	- **(d)** include detailed procedures for the handling and disposal of a suspected bomb; and
	- **(e)** include detailed procedures for the detention on the ground of any aircraft involved in a bomb threat or hijacking.
> SOR/2012-48, s. 35; SOR/2014-153, s. 37

**Discussion-based security exercise**

**518** The operator of an aerodrome must, at least once a year, carry out a discussion-based security exercise that tests the effectiveness of the operator’s emergency plan in response to a bomb threat or a hijacking of an aircraft and involves the persons and organizations referred to in the plan.
> SOR/2012-48, s. 35; SOR/2014-153, s. 37

**Record of emergencies**

**519**

- **(1)** Each time an emergency referred to in subsection 517(1) occurs at an aerodrome, the operator of the aerodrome must create a record that includes
	- **(a)** a description of the emergency;
	- **(b)** an evaluation of the effectiveness of the operator’s emergency plan; and
	- **(c)** a description of any actions that are planned in order to address deficiencies identified during the emergency.

**Record of exercises**

- **(2)** Each time a security exercise is carried out at an aerodrome, the operator of the aerodrome must create a record that includes
	- **(a)** an outline of the exercise scenario;
	- **(b)** an evaluation of the effectiveness of the exercise; and
	- **(c)** a description of any actions that are planned in order to address deficiencies identified during the exercise.

**Ministerial access**

- **(3)** The operator of an aerodrome must make the records referred to in subsections (1) and (2) available to the Minister on reasonable notice given by the Minister.
> SOR/2012-48, s. 35; SOR/2014-153, s. 37

[**520** to **524** reserved]

**PART 8**
## Aircraft Security

### Overview

**Part overview**

**525** This Part sets out requirements for air carriers, other operators of aircraft and persons on board aircraft.

### Weapons, Explosive Substances and Incendiary Devices

**Weapons**

**526**

- **(1)** An air carrier must not allow a person who is on board an aircraft to carry or have access to a weapon unless the air carrier has authorized the person to do so under section 531 or 533.

**Explosive substances and incendiary devices**

- **(2)** An air carrier must not allow a person who is on board an aircraft to carry or have access to an explosive substance or an incendiary device.

**Transport of loaded firearms**

**527**

- **(1)** An air carrier must not knowingly allow a person, other than a Canadian in-flight security officer who is acting in the course of their duties, to transport a loaded firearm on board an aircraft.

**Transport of explosive substances and incendiary devices**

- **(2)** An air carrier must not knowingly allow a person to transport an explosive substance, other than ammunition, or an incendiary device on board an aircraft unless the person notifies the air carrier before the explosive substance or incendiary device arrives at the aerodrome where it is to be accepted by the air carrier for transportation.
> SOR/2014-153, s. 38

**Transport of unloaded firearms**

**528** An air carrier must not knowingly allow a person to transport an unloaded firearm on board an aircraft unless the person has declared to the air carrier that the firearm is unloaded.

**Storage of unloaded firearms**

**529** An air carrier that transports an unloaded firearm on board an aircraft must store the firearm so that it is not accessible to any person on board the aircraft other than crew members.

**Prohibition — alcoholic beverages**

**530** An air carrier must not provide a person who carries or has access to a firearm on board an aircraft with any alcoholic beverage.

**Authorizations for peace officers**

**531** An air carrier may authorize a peace officer to carry or have access to an unloaded firearm on board an aircraft if
- **(a)** the peace officer, while acting in the course of their duties, requires access to the firearm immediately before, during or immediately after the flight;
- **(b)** the peace officer informs the air carrier, at least two hours before the aircraft leaves the aerodrome or, in an emergency, as soon as feasible before the departure of the flight, that a firearm will be on board;
- **(c)** the peace officer shows a representative of the air carrier identification, issued by the organization employing the officer, that displays a photograph depicting a frontal view of the officer’s face, the signature of the officer and the signature of an authorized representative of the organization employing the officer;
- **(d)** the peace officer completes the form used by the air carrier to authorize the carriage of a firearm on board an aircraft;
- **(e)** the air carrier verifies the identification referred to in paragraph (c)
	- **(i)** before the peace officer enters a restricted area from which the officer may board the aircraft, or
	- **(ii)** before the peace officer boards the aircraft, if the aerodrome does not have a restricted area from which the officer may board the aircraft; and
- **(f)** the air carrier provides the peace officer with the original or a copy of the completed form referred to in paragraph (d).
> SOR/2014-153, s. 39

**Requirement to inform**

**532**

- **(1)** If a peace officer needs to carry or have access to a firearm on board an aircraft, the air carrier must, before the departure of the flight,
	- **(a)** inform the pilot-in-command of the aircraft by means of the original or a copy of the completed form referred to in paragraph 531(d); and
	- **(b)** subject to subsection (2), inform the crew members assigned to the flight or the aircraft and any other peace officer on board the aircraft.

**Undercover operations**

- **(2)** If a peace officer who is carrying or has access to a firearm on board an aircraft is engaged in an undercover operation and requests that the air carrier not reveal the officer’s presence to any person on board the aircraft other than the pilot-in-command, the air carrier must comply with that request.
> SOR/2014-153, s. 40

**Unloaded firearm authorizations — air carriers**

**533**

- **(1)** An air carrier may authorize the following persons to carry or have access to an unloaded firearm on board an aircraft if the firearm is necessary for survival purposes:
	- **(a)** the pilot-in-command of the aircraft; and
	- **(b)** an employee of a federal or provincial department or agency who is engaged in wildlife control.

**Unloaded firearm authorizations — other operators**

- **(2)** An operator of an aircraft, other than an air carrier, may authorize the pilot-in-command of the aircraft to carry or have access to an unloaded firearm and ammunition on board the aircraft if the firearm and ammunition are necessary for survival purposes.

### Persons in the Custody of an Escort Officer

**Definition of organization responsible for the person in custody**

**534**

- **(1)** In this section, ***organization responsible for the person in custody*** does not include a person or an organization that provides escort officer services under a contract for remuneration.

**Air carrier conditions**

- **(2)** An air carrier must not transport a person in the custody of an escort officer on board an aircraft unless
	- **(a)** the organization responsible for the person in custody has provided the air carrier with a written confirmation that the organization has assessed the pertinent facts and determined whether the person in custody is a maximum, medium or minimum risk to the safety of the travelling public and the operations of the air carrier and aerodrome;
	- **(b)** the air carrier and the organization responsible for escorting the person in custody have agreed on the number of escort officers necessary to escort that person, which number must be at least
		- **(i)** two escort officers to escort each person who is a maximum risk,
		- **(ii)** one escort officer to escort each person who is a medium risk, and
		- **(iii)** one escort officer to escort not more than two persons who are a minimum risk;
	- **(c)** the person in custody is escorted by the agreed number of escort officers;
	- **(d)** the organization responsible for the person in custody has given a written notice to the air carrier at least two hours or, in an emergency, as soon as feasible before the departure of the flight, stating
		- **(i)** the identity of each escort officer and the person in custody and the reasons why the person requires an escort,
		- **(ii)** the level of risk that the person in custody represents to the safety of the public, and
		- **(iii)** the flight on which the person in custody will be transported;
	- **(e)** each escort officer shows a representative of the air carrier identification, issued by the organization responsible for the person in custody or the organization employing the officer, that displays a photograph depicting a frontal view of the officer’s face, the signature of the officer and the signature of an authorized representative of the organization employing the officer;
	- **(f)** an escort officer completes the form used by the air carrier to authorize the transportation of a person in custody; and
	- **(g)** the air carrier verifies the identification referred to in paragraph (e)
		- **(i)** before the escort officer enters a restricted area from which the escort officer may board the aircraft, or
		- **(ii)** before the escort officer boards the aircraft, if the aerodrome does not have a restricted area from which the escort officer may board the aircraft.

**Escort officer conditions**

- **(3)** An escort officer must not escort a person in custody on board an aircraft unless the escort officer
	- **(a)** provides the operator of the aerodrome with a copy of the written notice referred to in paragraph (2)(d) at least two hours or, in an emergency, as soon as feasible before the departure of the flight; and
	- **(b)** shows a representative of the air carrier the identification referred to in paragraph (2)(e).

**Transport of more than one person in custody**

- **(4)** An air carrier that transports a person in custody who is a maximum risk to the public must not transport any other person in custody on board the aircraft.

**Peace officer duties**

**535**

- **(1)** An escort officer who is a peace officer and who escorts a person in custody during a flight must
	- **(a)** remain with the person at all times;
	- **(b)** immediately before boarding the aircraft, search the person and the person’s carry-on baggage for weapons or other items that could be used to jeopardize flight safety;
	- **(c)** search the area surrounding the aircraft seat assigned to the person for weapons or other items that could be used to jeopardize flight safety; and
	- **(d)** carry restraining devices that can be used to restrain the person, if necessary.

**Air carrier duties**

- **(2)** If an escort officer who is not a peace officer escorts a person in custody, the air carrier must, immediately before the person boards the aircraft, cause the person and the person’s carry-on baggage to be screened for weapons or other items that could be used to jeopardize flight safety.

**Escort officer duties**

- **(3)** An escort officer who is not a peace officer and who escorts a person in custody during a flight must
	- **(a)** remain with the person at all times;
	- **(b)** ensure that a screening of the person and the person’s carry-on baggage for weapons or other items that could be used to jeopardize flight safety is carried out
		- **(i)** before the escort officer and the person enter a restricted area from which they may board the aircraft, or
		- **(ii)** before the escort officer and the person board the aircraft, if the aerodrome does not have a restricted area from which they may board the aircraft;
	- **(c)** search the area surrounding the aircraft seat assigned to the person for weapons or other items that could be used to jeopardize flight safety; and
	- **(d)** carry restraining devices that can be used to restrain the person, if necessary.

**Consumption of alcoholic beverages**

**536** A person in custody and the escort officer who is escorting the person must not consume any alcoholic beverage on board an aircraft.

**Prohibition — alcoholic beverages**

**537** An air carrier must not provide a person in custody or an escort officer who is escorting the person on board an aircraft with any alcoholic beverage.

**Seating of persons in custody**

**538** An air carrier must not allow a person in custody on board an aircraft to be seated next to an exit.

### Threat Response and Information Reporting

#### Threat Response

**Threat to aircraft — air carriers**

**539**

- **(1)** An air carrier that is made aware of a threat against an aircraft or a flight must immediately determine whether there is a threat that jeopardizes the security of the aircraft or flight.

**Threat to aircraft — other operators**

- **(2)** An operator of an aircraft, other than an air carrier, who is made aware of a threat against an aircraft or a flight must immediately determine whether the threat jeopardizes the security of the aircraft or flight.
> SOR/2019-149, s. 3

**Threat to aircraft — air carriers**

**540**

- **(1)** An air carrier that determines that there is a threat that jeopardizes the security of an aircraft or flight must immediately take all of the measures necessary to ensure the safety of the aircraft and the passengers and crew on board the aircraft, including
	- **(a)** informing the pilot-in-command, the crew members assigned to the aircraft or flight, the operator of the aerodrome and the appropriate police service of the nature of the threat;
	- **(b)** if the aircraft is on the ground, moving it to a place of safety at the aerodrome according to the directions of the operator of the aerodrome; and
	- **(c)** inspecting the aircraft and causing a screening of the passengers and goods on board the aircraft to be carried out, unless the inspection and screening are likely to jeopardize the safety of the passengers and crew members.

**Threat to aircraft — other operators**

- **(2)** An operator of an aircraft, other than an air carrier, who determines that there is a threat that jeopardizes the security of an aircraft or flight must immediately take all of the measures necessary to ensure the safety of the aircraft and the passengers and crew on board the aircraft, including
	- **(a)** informing the pilot-in-command, the crew members assigned to the aircraft or flight, the operator of the aerodrome and the appropriate police service of the nature of the threat;
	- **(b)** if the aircraft is on the ground, moving it to a place of safety at the aerodrome according to the directions of the operator of the aerodrome; and
	- **(c)** inspecting the aircraft and causing a search of the passengers and goods on board the aircraft to be carried out, unless the inspection and search are likely to jeopardize the safety of the passengers and crew members.

**Aircraft on ground**

- **(3)** If the aircraft is on the ground, the pilot-in-command must comply with any direction given by the operator of the aerodrome under paragraph (1)(b) or (2)(b) or by a member of the appropriate police service, unless complying with the direction is likely to jeopardize the safety of the passengers and crew members.
> SOR/2019-149, s. 3

**Threat to facility or aerodrome — air carriers**

**541**

- **(1)** An air carrier that is made aware of a threat against an aviation facility, or a part of an aerodrome, that is under the air carrier’s control must immediately determine whether there is a threat that jeopardizes the security of the facility or that part of the aerodrome.

**Threat to facility or aerodrome — other operators**

- **(2)** An operator of an aircraft, other than an air carrier, who is made aware of a threat against an aviation facility, or a part of an aerodrome, that is under the operator’s control must immediately determine whether the threat jeopardizes the security of the facility or that part of the aerodrome.
> SOR/2019-149, s. 3

**Threat to facility or aerodrome — air carriers**

**542**

- **(1)** An air carrier that determines that there is a threat that jeopardizes the security of an aviation facility, or a part of an aerodrome, that is under the air carrier’s control must immediately take all of the measures necessary to ensure the safety of the facility or that part of the aerodrome and the safety of persons at the facility or that part of the aerodrome, including informing the operator of the aerodrome and the appropriate police service of the nature of the threat.

**Threat to facility or aerodrome — other operators**

- **(2)** An operator of an aircraft, other than an air carrier, who determines that there is a threat that jeopardizes the security of an aviation facility, or a part of an aerodrome, that is under the operator’s control must immediately take all of the measures necessary to ensure the safety of the facility or that part of the aerodrome and the safety of persons at the facility or that part of the aerodrome, including informing the operator of the aerodrome and the appropriate police service of the threat.
> SOR/2019-149, s. 3

#### Reporting of Security Incidents

**Notification of Minister**

**543**

- **(1)** An air carrier must immediately notify the Minister when any of the following incidents occur:
	- **(a)** the hijacking or attempted hijacking of an aircraft;
	- **(b)** the discovery, on board an aircraft, of a weapon, other than an unloaded firearm that the air carrier authorized under section 531 or subsection 533(1);
	- **(c)** the discovery, on board an aircraft, of an explosive substance or an incendiary device in respect of which the air carrier was not notified in accordance with subsection 80(3);
	- **(d)** an explosion on an aircraft, unless the explosion is known to be the result of an accident;
	- **(e)** a threat against an aircraft, flight, or part of an aerodrome or other aviation facility, that is under the air carrier’s control; and
	- **(f)** an aviation security incident that involves a peace officer in any part of an aerodrome that is under the air carrier’s control.

**Notification of operators of aerodromes**

- **(2)** An air carrier must immediately notify the operator of an aerodrome when a weapon, other than a firearm permitted under subsection 78(2), is detected in any part of the aerodrome that is under the air carrier’s control.
> SOR/2019-149, s. 3

#### Security Information

**Provision to Minister**

**544** An air carrier must provide the Minister, on reasonable notice given by the Minister, with written or electronic records or any other information relevant to the security of the air carrier’s operations, including
- **(a)** information concerning the method of implementing a security measure, emergency direction or interim order that applies to the air carrier; and
- **(b)** a description of the nature of the operations related to a particular flight and the services provided in respect of the flight.

**Duty of service providers**

**545** A person who provides an air carrier with a service and a person who provides a service related to the transportation of accepted cargo or mail by air must provide the Minister, on reasonable notice given by the Minister, with written or electronic records or any other information relevant to the security of the air carrier’s operations, including
- **(a)** information concerning the method of implementing a security measure, emergency direction or interim order that applies to that person; and
- **(b)** a description of the nature of the operations related to a particular flight and the services provided in respect of the flight.

[**546** to **616** reserved]

**PART 9**
## Reserved

[**617** to **626** reserved]

**PART 10**
## Reserved

[**627** to **667** reserved]

**PART 11**
## Air Cargo and Mail

### Overview

**Part overview**

**668** This Part sets out requirements for cargo and mail on passenger flights and all-cargo flights and supplements subsections 4.85(3) and (4) of the Act.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**DIVISION 1**
### Air Cargo

#### Application

**Application**

**668.1**

- **(1)** Section 669 applies to air carriers who transport cargo on a flight that is carrying passengers or on an all-cargo flight.

- **(2)** Sections 670 to 686 apply to the following members of the air cargo security program who screen cargo or store, tender or transport secure cargo:
	- **(a)** regulated agents;
	- **(b)** certified agents; and
	- **(c)** known consignors.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

#### Transporting Cargo by Air and Tendering Cargo for Transportation by Air

**Requirement to screen cargo**

**669** Cargo that is to be transported by an air carrier on a flight that is carrying passengers or on an all-cargo flight must be screened by the air carrier for threat items in accordance with a security measure, unless the cargo was tendered to the air carrier for transportation by air as secure cargo.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Tendering of secure cargo — regulated agents and certified agents**

**670** A regulated agent or certified agent must not tender cargo for transportation by air as secure cargo unless
- **(a)** the regulated agent
	- **(i)** has screened the cargo for threat items in accordance with a security measure,
	- **(ii)** has restricted access to the cargo in accordance with sections 675 to 677, and
	- **(iii)** has ensured that the cargo was not tampered with after it was screened for threat items; or
- **(b)** the regulated agent or certified agent has screened it in order to verify that
	- **(i)** the cargo was screened for threat items in accordance with a security measure,
	- **(ii)** access to the cargo was restricted in accordance with sections 675 to 677, and
	- **(iii)** the cargo was not tampered with after it was screened for threat items.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Tendering of secure cargo — known consignors**

**671** A known consignor must not tender cargo for transportation by air as secure cargo unless the known consignor
- **(a)** has screened the cargo for threat items in accordance with a security measure;
- **(b)** has restricted access to the cargo in accordance with sections 675 to 677; and
- **(c)** has ensured that the cargo was not tampered with after it was screened for threat items.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Cargo security information**

**672**

- **(1)** A regulated agent, certified agent or known consignor must not tender cargo for transportation by air as secure cargo unless the cargo is accompanied by the information referred to in subsection (2), (3) or (4), as applicable, in paper or electronic format.

**Tendering by regulated agents**

- **(2)** If the cargo is tendered by a regulated agent referred to in paragraph 670(a), the information that accompanies the cargo must include
	- **(a)** in the case of non-consolidated cargo
		- **(i)** the air waybill number or the number of a similar control document,
		- **(ii)** the regulated agent’s name,
		- **(iii)** the regulated agent’s air cargo security program number,
		- **(iv)** the name of the original shipper of the cargo, and
		- **(v)** a declaration by one of the regulated agent’s authorized cargo representatives stating that
			- **(A)** an authorized cargo representative has screened the cargo for threat items in accordance with a security measure and no threat items were found in the cargo,
			- **(B)** access to the cargo was restricted in accordance with sections 675 to 677, and
			- **(C)** the cargo was not tampered with between the time it was screened for threat items and the time it was tendered; and
	- **(b)** in the case of consolidated cargo
		- **(i)** the air waybill number or the number of a similar control document,
		- **(ii)** the regulated agent’s name,
		- **(iii)** the regulated agent’s air cargo security program number, and
		- **(iv)** a declaration by one of the regulated agent’s authorized cargo representatives stating that
			- **(A)** an authorized cargo representative has screened the cargo for threat items in accordance with a security measure and no threat items were found in the cargo,
			- **(B)** access to the cargo was restricted in accordance with sections 675 to 677, and
			- **(C)** the cargo was not tampered with between the time it was screened for threat items and the time it was tendered.

**Tendering by regulated agents or certified agents**

- **(3)** If the cargo is tendered by a regulated agent or certified agent referred to in paragraph 670(b), the information that accompanies the cargo must include
	- **(a)** in the case of non-consolidated cargo
		- **(i)** the information that accompanied the cargo when the cargo was accepted by the regulated agent or certified agent,
		- **(ii)** the air waybill number or the number of a similar control document, and
		- **(iii)** the regulated agent’s or certified agent’s name,
		- **(iv)** the regulated agent’s or certified agent’s air cargo security program number, and
		- **(v)** a declaration by one of the regulated agent’s or certified agent’s authorized cargo representatives stating that
			- **(A)** access to the cargo was restricted in accordance with sections 675 to 677, and
			- **(B)** the cargo was not tampered with between the time it was screened for threat items and the time it was tendered;
	- **(b)** in the case of consolidated cargo
		- **(i)** the air waybill number or the number of a similar control document,
		- **(ii)** the regulated agent’s or certified agent’s name,
		- **(iii)** the regulated agent’s or certified agent’s air cargo security program number, and
		- **(iv)** a declaration by one of the regulated agent’s or certified agent’s authorized cargo representatives stating that
			- **(A)** access to the cargo was restricted in accordance with sections 675 to 677, and
			- **(B)** the cargo was not tampered with between the time it was screened for threat items and the time it was tendered.

**Tendering by known consignors**

- **(4)** If the cargo is tendered by a known consignor referred to in section 671, the information that accompanies the cargo must include
	- **(a)** the air waybill number or the number of a similar control document,
	- **(b)** the known consignor’s name,
	- **(c)** the known consignor’s air cargo security program number, and
	- **(d)** a declaration by one of the known consignor’s authorized cargo representatives stating that
		- **(i)** an authorized cargo representative has screened the cargo for threat items in accordance with a security measure and no threat items were found in the cargo,
		- **(ii)** access to the cargo was restricted in accordance with sections 675 to 677, and
		- **(iii)** the cargo was not tampered with between the time it was screened for threat items and the time it was tendered.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Accurate and complete information**

**673** A regulated agent, certified agent or known consignor who provides any of the information required under section 672 must ensure that the information is accurate and complete.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

#### Screenings

**Authority to screen**

**674** A person must not screen cargo unless the person is designated by the Minister or is an authorized cargo representative of the designated person.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Screening for threat items**

**675**

- **(1)** If a regulated agent or known consignor screens cargo for threat items in order for it to be tendered for transportation by air as secure cargo, the regulated agent or known consignor must
	- **(a)** conduct the screening in accordance with a security measure;
	- **(b)** conduct the screening in an area that the regulated agent or known consignor has designated for that purpose;
	- **(c)** ensure that, while the screening is being conducted, signs are in place at or near the designated area that state, in both official languages, that unauthorized access to the area is prohibited;
	- **(d)** control access to the designated area while the screening is being conducted to ensure that, subject to subsection (2), only an authorized cargo representative of the regulated agent or known consignor has access to the area;
	- **(e)** take measures to detect unauthorized individuals in the designated area while the screening is being conducted;
	- **(f)** ensure that, while the screening is being conducted, individuals other than an authorized cargo representative of the regulated agent or known consignor do not have access to cargo in the designated area; and
	- **(g)** ensure that, while the screening is being conducted, cargo in the designated area is not tampered with.

**Authorized access**

- **(2)** An individual who is not an authorized cargo representative of the regulated agent or known consignor is permitted in the designated area if
	- **(a)** the individual is acting in the course of their employment and requires access to the designated area while screenings are being conducted;
	- **(b)** the individual has the prior approval of the cargo security coordinator of the regulated agent or known consignor;
	- **(c)** the cargo security coordinator or one of the regulated agent’s or known consignor’s authorized cargo representatives verifies the identity of the individual by means of government-issued photo identification provided by the individual; and
	- **(d)** the individual is, while in the designated area, escorted and kept under surveillance by an authorized cargo representative who has been assigned to that task by the regulated agent or known consignor.

**Escort limit**

- **(3)** For the purposes of paragraph (2)(d), the regulated agent or known consignor must ensure that the authorized cargo representative does not escort more than 10 individuals at one time.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

#### Storage and Transport Requirements

**Storage requirements**

**676**

- **(1)** If cargo is screened in order for it to be tendered for transportation by air as secure cargo, a regulated agent, certified agent or known consignor who stores the cargo must
	- **(a)** store the cargo in an area that they have designated for that purpose;
	- **(b)** ensure that, while the cargo is stored in the designated area, signs are in place at or near the area that state, in both official languages, that unauthorized access to the area is prohibited;
	- **(c)** control access to the designated area while the cargo is stored in the area to ensure that, subject to subsection (2), only an authorized cargo representative of the regulated agent, certified agent or known consignor has access to the area;
	- **(d)** take measures to detect unauthorized individuals in the designated area while the cargo is stored in the area;
	- **(e)** ensure that, while the cargo is stored in the designated area, individuals other than an authorized cargo representative of the regulated agent, certified agent or known consignor do not have access to cargo in the designated area; and
	- **(f)** ensure that the cargo is not tampered with while it is stored in the designated area.

**Authorized access**

- **(2)** An individual who is not an authorized cargo representative of the regulated agent, certified agent or known consignor is permitted in the designated area if
	- **(a)** the individual is acting in the course of their employment and requires access to the designated area while cargo, which has been screened in order that it may be tendered for transportation by air as secure cargo, is stored in the area;
	- **(b)** the individual has the prior approval of the cargo security coordinator of the regulated agent, certified agent or known consignor;
	- **(c)** the cargo security coordinator, or one of the authorized cargo representatives of the regulated agent, certified agent or known consignor, verifies the identity of the individual by means of government-issued photo identification provided by the individual; and
	- **(d)** the individual is, while in the designated area, escorted and kept under surveillance by an authorized cargo representative who has been assigned to that task by the regulated agent, certified agent or known consignor.

**Escort limit**

- **(3)** For the purposes of paragraph (2)(d), the regulated agent, certified agent or known consignor must ensure that the authorized cargo representative does not escort more than 10 individuals at one time.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Transport requirements**

**677** If cargo is screened in order for it to be tendered for transportation by air as secure cargo, the regulated agent, certified agent or known consignor who transports the cargo must, in accordance with a security measure,
- **(a)** ensure that the cargo is transported by one or more of their authorized cargo representatives; and
- **(b)** ensure that there is no unauthorized access to the cargo during transport.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**678** [Reserved, SOR/2019-149, s. 2]

[**678** reserved]

#### Cargo Security Coordinators and Authorized Cargo Representatives

**Cargo security coordinator — designation**

**679**

- **(1)** A regulated agent, certified agent or known consignor must designate a cargo security coordinator who is responsible for coordinating and overseeing compliance with the regulatory requirements that apply to the regulated agent, certified agent or known consignor and for acting as the principal contact between the regulated agent, certified agent or known consignor and the Minister with respect to aviation security matters.

**Cargo security coordinator — restriction**

- **(2)** The regulated agent, certified agent or known consignor must not designate an individual as cargo security coordinator unless that individual is an authorized cargo representative and a senior manager or supervisor.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Authorized cargo representative**

**680**

- **(1)** A regulated agent, certified agent or known consignor must not designate an individual as an authorized cargo representative unless the individual
	- **(a)** is employed by the regulated agent, certified agent or known consignor;
	- **(b)** has a security clearance or has undergone a background check that indicates that the individual does not pose a risk to aviation security; and
	- **(c)** has been trained in relation to their duties as an authorized cargo representative.

**Background check**

- **(2)** If the individual undergoes a background check for the purposes of paragraph (1)(b), the regulated agent, certified agent or known consignor must ensure that the background check includes
	- **(a)** a Canadian criminal record check;
	- **(b)** a check of the individual’s home addresses for the five years preceding the date of the background check; and
	- **(c)** a check of the individual’s work history for the five years preceding the date of the background check.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Canadian criminal record check**

**681** A regulated agent, certified agent or known consignor must, at least once every five years, conduct a Canadian criminal record check on any of their authorized cargo representatives that do not have a security clearance.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

#### Reporting of Security Incidents

**Reporting of security incidents**

**682** A regulated agent, certified agent or known consignor must immediately notify the Minister if they
- **(a)** detect a threat item in cargo while screening it in order for it to be tendered for transportation by air as secure cargo;
- **(b)** detect unauthorized access to cargo in their possession that is being screened or has been screened in order that it may be tendered for transportation by air as secure cargo;
- **(c)** detect signs of tampering with cargo in their possession that is being screened or has been screened in order that it may be tendered for transportion by air as secure cargo; or
- **(d)** become aware of any other aviation security incident involving cargo that is or was in their possession.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

#### Record Keeping

**Cargo security information**

**683** A regulated agent, certified agent or known consignor who tenders cargo for transportation by air as secure cargo must keep a copy of the information referred to in subsection 672(2), (3) or (4), as applicable, for at least 90 days after the day on which they cease to be in possession of the cargo.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Training record**

**684**

- **(1)** A regulated agent, certified agent or known consignor must keep a training record, in paper or electronic format, for each authorized cargo representative.

**Required information**

- **(2)** A training record for an authorized cargo representative must include
	- **(a)** the name of the authorized cargo representative;
	- **(b)** their position title;
	- **(c)** the dates on which they received training in relation to their duties as an authorized cargo representative;
	- **(d)** a description of those duties; and
	- **(e)** the name of the trainer.

**Retention period — cessation of duties**

- **(3)** The regulated agent, certified agent or known consignor must keep the training record for at least 90 days after the day on which the authorized cargo representative ceases to act in that capacity.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Background check record**

**685**

- **(1)** If an individual undergoes a background check for the purposes of paragraph 680(1)(b) and is designated as an authorized cargo representative, the regulated agent, certified agent or known consignor must keep a record in respect of the background check that contains
	- **(a)** the name of the individual;
	- **(b)** the date of the background check; and
	- **(c)** the name of the person or organization that conducted the background check.

**Retention period**

- **(2)** If the individual ceases to act as an authorized cargo representative, the regulated agent, certified agent or known consignor must keep the record for at least 90 days after the day on which the authorized cargo representative ceases to act in that capacity.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

**Ministerial access**

**686** A regulated agent, certified agent or known consignor who keeps a record or information under this Part must make the record or information available to the Minister on reasonable notice given by the Minister.
> SOR/2015-163, s. 3SOR/2019-149, s. 2

[**687** to **719** reserved]

**DIVISION 2**
### Mail

**Requirement to screen mail**

**720** Mail that is to be transported by an air carrier on a flight that is carrying passengers or on an all-cargo flight must be screened by the air carrier for threat items in accordance with a security measure.
> SOR/2019-149, s. 2

[**721** to **738** reserved]

**PART 12**
## Reserved

[**739** to **764** reserved]

**PART 13**
## Ministerial Powers and Duties

### Overview

**Part overview**

**765** This Part sets out ministerial powers and duties that are not set out in any other part.

**DIVISION 1**
### Identity Verification System
> SOR/2014-153, s. 41

**Disclosure of information**

**766** The Minister is authorized to disclose to CATSA or the operator of an aerodrome any information that is necessary for the proper operation of the identity verification system referred to in section 56.

**Deactivation request**

**767**

- **(1)** The Minister must ask CATSA to deactivate a restricted area identity card if
	- **(a)** the Minister is notified under section 156 or 312; or
	- **(b)** the security clearance of the person to whom the card has been issued is suspended or cancelled.

**Prohibition**

- **(2)** The Minister must not ask CATSA to deactivate a restricted area identity card for a reason other than a reason set out in subsection (1).

[**768** to **777** reserved]

**DIVISION 2**
### AVSEC Levels

**Application**

**778** This Division applies in respect of aerodromes listed in Schedules 1 to 3, or any part of those aerodromes, and in respect of any other place designated by the Minister under subsection 6(1) of the [Canadian Air Transport Security Authority Act](/en/Acts/Statutes%20of%20Canada/2002/c.%209,%20s.%202.md).
> SOR/2014-153, s. 42; SOR/2015-196, s. 10

**Level 1**

**779** Unless it is raised, lowered or maintained in accordance with this Division, the AVSEC level for an aerodrome or any part of an aerodrome is level 1. At that level, normal operating conditions apply.
> SOR/2014-153, s. 42

**Level 2**

**780** The Minister must raise or lower to level 2 the AVSEC level for an aerodrome or any part of an aerodrome if
- **(a)** the Minister is made aware of a heightened risk condition related to an elevated risk; and
- **(b)** it is likely, based on available information, that additional safeguards at the aerodrome or a part of the aerodrome will mitigate the heightened risk condition.
> SOR/2014-153, s. 42

**Level 3**

**781** The Minister must raise to level 3 the AVSEC level for an aerodrome or any part of an aerodrome if
- **(a)** the Minister is made aware of a heightened risk condition related to a critical or imminent risk; and
- **(b)** it is likely, based on available information, that additional safeguards at the aerodrome or a part of the aerodrome will mitigate the heightened risk condition.
> SOR/2014-153, s. 42

**Requirement to lower level**

**782** The Minister must, as soon as a heightened risk condition no longer applies, lower to level 1 an AVSEC level that has been raised for an aerodrome or any part of an aerodrome.
> SOR/2014-153, s. 42

**Maintaining a level**

**783** The Minister is authorized to maintain an AVSEC level that has been raised for an aerodrome or any part of an aerodrome if the criteria for raising the AVSEC level continue to apply.
> SOR/2014-153, s. 42

**Notification**

**784** If the Minister raises, lowers or maintains the AVSEC level for an aerodrome or any part of an aerodrome, the Minister must immediately notify the operator of the aerodrome. The notice must
- **(a)** include information about the heightened risk condition; and
- **(b)** specify a date on which the AVSEC level is likely to return to level 1.
> SOR/2014-153, s. 42

**Multiple aerodromes**

**785** For greater certainty, nothing in this Division prohibits the Minister from raising, lowering or maintaining the AVSEC level for more than one aerodrome at a time.
> SOR/2014-153, s. 42

[**786** to **796** reserved]

**PART 14**
## Designated Provisions

### Overview

**Part overview**

**797**

- **(1)** This Part allows the enforcement, by means of administrative monetary penalties, of the provisions of these Regulations that are set out in Schedule 4 and the provisions of any security measure.

**Designated provisions of the Act**

- **(2)** The [Designated Provisions Regulations](/en/Regulations/Statutory%20Orders%20and%20Regulations/2000/112.md) allow the enforcement, by means of administrative monetary penalties, of the provisions of the Act that are set out in Schedule 4 to those Regulations.

### Designated Provisions

**Designated provisions**

**798**

- **(1)** A provision set out in column 1 of Schedule 4 is designated as a provision the contravention of which may be dealt with under and in accordance with the procedure set out in sections 7.7 to 8.2 of the Act.

**Maximum amounts**

- **(2)** The amount set out in column 2 or column 3 of Schedule 4 is prescribed as the maximum amount payable by an individual or corporation, as the case may be, in respect of a contravention of the provision set out in column 1.

**Designation of security measure provisions**

**799**

- **(1)** The provisions of a security measure are designated as provisions the contravention of which may be dealt with under and in accordance with the procedure set out in sections 7.7 to 8.2 of the Act.

**Maximum amounts**

- **(2)** The maximum amount payable in respect of a contravention of a designated provision referred to in subsection (1) is
	- **(a)** $5,000, in the case of an individual; and
	- **(b)** $25,000, in the case of a corporation.

### Notice of Contravention

**Notice requirements**

**800** A notice referred to in subsection 7.7(1) of the Act must
- **(a)** be in writing;
- **(b)** set out the particulars of the alleged contravention;
- **(c)** state that the person on whom the notice is served or to whom it is sent has the option of paying the amount specified in the notice or filing with the Tribunal a request for a review of the alleged contravention or the amount of the penalty;
- **(d)** state that payment of the amount specified in the notice will be accepted by the Minister in satisfaction of the amount of the penalty for the alleged contravention and that no further proceedings under Part I of the Act will be taken against the person on whom the notice in respect of that contravention is served or to whom it is sent;
- **(e)** state that the person on whom the notice is served or to whom it is sent will be provided with an opportunity consistent with procedural fairness and natural justice to present evidence before the Tribunal and make representations in relation to the alleged contravention if the person files a request for a review with the Tribunal; and
- **(f)** state that the person on whom the notice is served or to whom it is sent will be deemed to have committed the contravention set out in the notice if the person fails to pay the amount specified in the notice and fails to file a request for a review with the Tribunal within the prescribed period.
> SOR/2014-153, s. 43

**PART 15**
## Transitional Provisions

### Class 1 Aerodromes

**Operators**

**801**

- **(1)** Sections 196 and 199 do not apply to the operator of an aerodrome until December 15, 2014.

**Operators**

- **(2)** Sections 197 and 198 do not apply to the operator of an aerodrome until March 15, 2015.

**Operators**

- **(3)** The following provisions do not apply to the operator of an aerodrome until April 15, 2015:
	- **(a)** sections 115 to 118; and
	- **(b)** paragraph  206(1)(c).

**Operators**

- **(4)** Sections 202 and 204 do not apply to the operator of an aerodrome until February 15, 2016.

**Operators**

- **(5)** The following provisions do not apply to the operator of an aerodrome until May 15, 2016:
	- **(a)** sections 97 and 98;
	- **(b)** section 205;
	- **(c)** paragraph 207(1)(b); and
	- **(d)** paragraph 208(1)(b).
> SOR/2014-153, s. 44

### Class 2 Aerodromes

**Operators**

**802**

- **(1)** The following provisions do not apply to the operator of an aerodrome until April 15, 2015:
	- **(a)** sections 271 to 274; and
	- **(b)** paragraph 367(1)(c).

**Operators**

- **(2)** Sections 365 and 366 do not apply to the operator of an aerodrome until April 15, 2016.

**Operators**

- **(3)** The following provisions do not apply to the operator of an aerodrome until September 15, 2016:
	- **(a)** sections 261 and 262;
	- **(b)** paragraph 368(1)(b); and
	- **(c)** paragraph 369(1)(b).
> SOR/2014-153, s. 44

### Class 3 Aerodromes

**Operators**

**803**

- **(1)** The following provisions do not apply to the operator of an aerodrome until April 15, 2015:
	- **(a)** sections 426 to 429; and
	- **(b)** paragraph 474(1)(c).

**Operators**

- **(2)** Sections 472 and 473 do not apply to the operator of an aerodrome until September 15, 2016.

**Operators**

- **(3)** The following provisions do not apply to the operator of an aerodrome until March 15, 2017:
	- **(a)** sections 416 and 417;
	- **(b)** paragraph 475(1)(b); and
	- **(c)** paragraph 476(1)(b).
> SOR/2014-153, s. 44

**804** [Repealed, SOR/2014-153, s. 44]

**805** [Repealed, SOR/2014-153, s. 44]

**806** [Repealed, SOR/2014-153, s. 44]

**807** [Repealed, SOR/2014-153, s. 44]

### **SCHEDULE 1**
**(Paragraph 2(d), sections 3, 6, 82, 83, 117, 273, 428, 505, 506 and 508, subsection 516(1) and section 778)**
<table>
<h4>Class 1 Aerodromes</h4>
<tr>
<th>Name</th>
<th>ICAO Location Indicator</th>
</tr>
<tr>
<td>Calgary International</td>
<td>CYYC</td>
</tr>
<tr>
<td>Edmonton International</td>
<td>CYEG</td>
</tr>
<tr>
<td>Halifax (Robert L. Stanfield International)</td>
<td>CYHZ</td>
</tr>
<tr>
<td>Montréal International (Mirabel)</td>
<td>CYMX</td>
</tr>
<tr>
<td>Montréal (Montréal — Pierre Elliott Trudeau International)</td>
<td>CYUL</td>
</tr>
<tr>
<td>Ottawa (Macdonald-Cartier International)</td>
<td>CYOW</td>
</tr>
<tr>
<td>Toronto (Lester B. Pearson International)</td>
<td>CYYZ</td>
</tr>
<tr>
<td>Vancouver International</td>
<td>CYVR</td>
</tr>
<tr>
<td>Winnipeg (James Armstrong Richardson International)</td>
<td>CYWG</td>
</tr>
</table>

> SOR/2012-48, s. 36; SOR/2014-153, s. 45; SOR/2015-196, s. 11

### **SCHEDULE 2**
**(Paragraph 2(e), sections 3, 246, 247 and 273, paragraph 351(1)(a), subsection 351(2), paragraphs 352(1)(a), (2)(a) and 3(a), sections 428, 505, 506 and 508, subsection 516(1) and section 778)**
<table>
<h4>Class 2 Aerodromes</h4>
<tr>
<th>Name</th>
<th>ICAO Location Indicator</th>
</tr>
<tr>
<td>Charlottetown</td>
<td>CYYG</td>
</tr>
<tr>
<td>Fredericton International</td>
<td>CYFC</td>
</tr>
<tr>
<td>Gander International</td>
<td>CYQX</td>
</tr>
<tr>
<td>Greater Moncton International</td>
<td>CYQM</td>
</tr>
<tr>
<td>Iqaluit</td>
<td>CYFB</td>
</tr>
<tr>
<td>Kelowna</td>
<td>CYLW</td>
</tr>
<tr>
<td>London</td>
<td>CYXU</td>
</tr>
<tr>
<td>Prince George</td>
<td>CYXS</td>
</tr>
<tr>
<td>Québec (Jean Lesage International)</td>
<td>CYQB</td>
</tr>
<tr>
<td>Regina International</td>
<td>CYQR</td>
</tr>
<tr>
<td>Saint John</td>
<td>CYSJ</td>
</tr>
<tr>
<td>St.

repository: TravisMadill/CanadianLaws

path: /en/Regulations/Statutory Orders and Regulations/2011/318.md

repo_name: TravisMadill/CanadianLaws


text:
---
title: User Agent | SIP.js
description: Create a SIP user agent using SIP.js so your WebRTC application can send and receive calls and messages.
---

# User Agent

This guide uses the full [SIP.js API](https://github.com/onsip/SIP.js/blob/master/docs/api/sip.js.md). The [Simple User](./simple) is intended to help get beginners up and running quickly. This guide is adopted from the [SIP.js Github API documentation](https://github.com/onsip/SIP.js/blob/master/docs/api.md).

### Transport Options

The first thing SIP.js needs to know is where it will connect to. This guide assumes that you are using the default WebSocket Transport that is included with SIP.js. The only parameter that is required is a Websocket URL for your SIP Websocket server.

~~~javascript
const transportOptions = {
  server: "wss://example.com:8443"
};
~~~

### Anonymous User Agent

In order to make calls and send messages you must create a SIP user agent.  In this example, we will create an anonymous user agent.  To do this, call the `new UserAgent(userAgentOptions)` constructor. No options are required by the library, but it is recommended that you pass `transportOptions` to indicate where SIP.js should connect to. An anonymous user agent can make calls and send messages to SIP endpoints.  It cannot receive calls or messages.

~~~javascript
const userAgent = new UserAgent({transportOptions});
userAgent.start();
~~~

### Authenticated User Agent

To create an authenticated user agent add a `URI`, `authorizationUsername`, `authorizationPassword` to the configuration option passed to the `new UserAgent(userAgentOptions)` constructor. The `URI` option is specifically typed as a `URI` type and not a string. There is a static helper function `makeURI(uri: string)` on the `UserAgent` that can help create this type.

~~~javascript
const uri = UserAgent.makeURI("sip:alice@example.com");
~~~

Once a URI is created the rest of the [user agent options](https://github.com/onsip/SIP.js/blob/master/docs/api/sip.js.useragentoptions.md) can be added to the options object. The Most platforms will require and `authorizationUsername` and `authorizationPassword` to authorize your user.

~~~javascript
const userAgentOptions: UserAgentOptions = {
  authorizationPassword: 'secretPassword',
  authorizationUsername: 'authorizationUsername',
  transportOptions,
  uri
};
const userAgent = new UserAgent(userAgentOptions);
~~~

After the User Agent is created it will need to Register in order to authenticate with the server and receive messages. To do this a `new Registerer(userAgent: UserAgent)` needs to be created. A [`Registerer`](https://github.com/onsip/SIP.js/blob/master/docs/api/sip.js.registerer.md) will register and automatically handle re-registrations when required.

~~~javascript
const registerer = new Registerer(userAgent);
~~~

Now that everything is created it can all be started. First the `UserAgent` must be started. This tells the user agent to connect to the Transport. Once the user agent is started then the `Registerer` can be told to `register()` the user agent.

~~~javascript
userAgent.start().then(() => {
  registerer.register();
});
~~~

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

license_type: permissive


text:
cjsxhtmlify
====

In .babelrc

~~~json
"plugins": [
  ["transform-react-jsx", { "pragma": "jsxhtml" }]
]
~~~

---

Browserify args in gulpfile

~~~javascript
transform: [ 'cjsxhtmlify', 'babelify' ],
extensions: ['.coffee','.js']
~~~

---

In application

~~~coffee
require('cjsxhtmlify').pragma
~~~

This is only necessary once. It makes *jsxhtml* available as a global function. The transformer takes inline JSX and converts it to *jsxhtml* function calls, which then returns an HTML string.

---

Use

~~~coffee
template =

    Yey

~~~

---

In retrospect, it may keep things simpler to have the template in a separate HTML file, and require it directly using [stringify](https://github.com/JohnPostlethwait/stringify).

repository: eliot-akira/cjsxhtmlify

repo_name: eliot-akira/cjsxhtmlify


text:
# learning-kafka
Just an attempt to learn kafka and its integration with Spark

### Installation Notes

Python libraries required
* [kafka-python](https://github.com/mumrah/kafka-python) *version 0.9.4-dev used for this project*
* [requests](https://pypi.python.org/pypi/requests/2.7.0)
* [uritools](https://pypi.python.org/pypi/uritools/0.12.0)
* pyspark comes bundled with spark.
* *optional* [simplejson](https://pypi.python.org/pypi/simplejson/3.7.2)

#### How to run spark kafka integration directly from PyCharm.
**`<SPARK-HOME>` refers to the directory where you extracted spark.**

1. Download http://search.maven.org/remotecontent?filepath=org/apache/spark/spark-streaming-kafka-assembly_2.10/1.4.0/spark-streaming-kafka-assembly_2.10-1.4.0.jar
2. Copy it to `<SPARK-HOME>/lib`
3. edit `<SPARK-HOME>/conf/spark-defaults.conf` (if doesn't exist, create file or rename `spark-defaults.conf.template` to `spark-defaults.conf` in the same directory)
4. add the following line to the end of the
  * `spark.driver.extraClassPath      <SPARK-HOME>/lib/spark-streaming-kafka-assembly_2.10-1.4.0.jar`
  * eg. `spark.driver.extraClassPath      /usr/spark/lib/spark-streaming-kafka-assembly_2.10-1.4.0.jar`

5. to your ~/.bashrc append the following lines
  * `export SPARK_HOME=<SPARK-HOME>`
  * eg. `export SPARK_HOME=/usr/spark`
  * save and exit
  * OR in your IDE add this to your runtime environment variables
  * OR when you create spark-context pass this path as an argument.

6. add `pyspark` module (`<SPARK-HOME>/python` to PYTHONPATH There are may ways to do it. I personally like this http://stackoverflow.com/a/12311321

You can just run your program straight from command line no need to reach out to spark-submit for your development code.
`python my_kafka_spark_example.py`
:)

repository: joychugh/learning-kafka

repo_name: joychugh/learning-kafka


text:
# Scheduled Jobs

- [Scheduled Jobs](#scheduled-jobs)
	- [1. Creating a Scheduled Job](#1-creating-a-scheduled-job)
	- [2. Viewing Scheduled Jobs](#2-viewing-scheduled-jobs)
	- [3. Deleting a Scheduled Job](#3-deleting-a-scheduled-job)
	- [4. Access Control](#4-access-control)
	- [5. Serialization and Deserialization](#5-serialization-and-deserialization)
		- [5.1 Compiled Functions](#51-compiled-functions)
		- [5.2 Script Functions](#52-script-functions)
	- [6. Executing Scripts with Scheduled Jobs](#6-executing-scripts-with-scheduled-jobs)
	- [7. Troubleshooting](#7-troubleshooting)

Scheduled Jobs are automated pieces of work that can be performed at a specific time or on a recurring schedule. Scheduled jobs are widely used for performing data analysis on a regular basis (e.g., monthly reports or daily 1-minute OHLC after market close), database administration (e.g., backup, synchronization), operating system management (e.g., log cleanup), and many other scenarios.

## 1. Creating a Scheduled Job

Create a scheduled job with the [scheduleJob](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/s/scheduleJob.html) function. The job definition will be serialized and saved to file `<homeDir>/sysmgmt/jobEditlog.meta`.

```
scheduleJob(jobId, jobDesc, jobFunc, scheduledTime, startDate, endDate, frequency, [days],[onComplete])
```

Note:

1. *jobFunc* is a function with no parameters, usually a [partial application](https://dolphindb.com/help/Functionalprogramming/PartialApplication.html). It can be a user-defined function, built-in function, function view, or function in a module or plugin. This means scheduling jobs in DolphinDB is very flexible - you can schedule any job that can be represented by a function. For example, you can use a user-defined function or a plugin function to perform recurring data analysis, use the `run` function to execute script automatically, or `shell` to run operating system commands.
2. The function returns the ID of the scheduled job. If the specified *jobId* is the same as the ID of an existing scheduled job, the system appends a suffix of the current date, or “000”, “001”, ….. or both to the specified *jobId* to generate a unique scheduled job ID.
3. The scheduled job will run in the background at the scheduled time.

- Example 1. The scheduled job calls the user-defined function `getMaxTemperature` to get the maximum temperature of a device in the previous day. The job is scheduled at 00:00 every day.

```
def getMaxTemperature(deviceID){
    maxTemp=exec max(temperature) from loadTable("dfs://dolphindb","sensor")
            where ID=deviceID ,ts between (today()-1).datetime():(today().datetime()-1)
    return  maxTemp
}
scheduleJob(`testJob, "getMaxTemperature", getMaxTemperature{1}, 00:00m, today(), today()+30, 'D');
```

Note: With the job function specified as `getMaxTemperature{1}`, the argument *deviceID* is fixed to "1" in the scheduled job.

- Example 2. The scheduled job calls the `run` function to execute the script file *monthlyJob.dos* at 00:00 on the first day of each month. Please note that the full path of the script file is specified as the parameter of `run`.

```
scheduleJob(`monthlyJob, "Monthly Job 1", run{"/home/DolphinDB/script/monthlyJob.dos"}, 00:00m, 2020.01.01, 2020.12.31, 'M', 1);
```

- Example 3. The scheduled job calls the `shell` function to remove log files at 01:00 on Sundays. The operating system command `rm/home/DolphinDB/server/dolphindb.log` is passed in as the argument to `shell`.

```
scheduleJob(`weeklyjob, "rm log", shell{"rm /home/DolphinDB/server/dolphindb.log"}, 01:00m, 2020.01.01, 2021.12.31, 'W', 0);
```

In many cases, it is a common practice to retrieve data from a database and pass it to the job function, and save the execution result to a database. The more common In the following example, the user-defined function `computeK` fetches market data from the DFS table “trades” for calculation and saves the results to the DFS table “OHLC“.

- Example 4. Calculate 1 minute OHLC at 15:00 on weekdays.

```
def computeK(){
	barMinutes = 7
	sessionsStart=09:30:00.000 13:00:00.000
	OHLC =  select first(price) as open, max(price) as high, min(price) as low,last(price) as close, sum(volume) as volume
		from loadTable("dfs://stock","trades")
		where time > today() and time < now()
		group by symbol, dailyAlignedBar(timestamp, sessionsStart, barMinutes*60*1000) as barStart
	append!(loadTable("dfs://stock","OHLC"),OHLC)
}
scheduleJob(`kJob, "7 Minutes", computeK, 15:00m, 2020.01.01, 2021.12.31, 'W', [1,2,3,4,5]);
```

<!-- 记得改之后例子的标序- Example 5.  After each execution of the scheduled job, you can send an email to notify specific users of the result. *onComplete* is a callback function with 4 arguments, which gets executed upon the completion (with errors or not) of each job execution.

Note: Installation of the [HttpClient plugin](上线加教程链接) is required to run the following script.

def sendEmail(jobId, jobDesc, success, result){
desc = "jobId=" + jobId + " jobDesc=" + jobDesc
if(success){
desc += " successful " + result
res = httpClient::sendEmail('patrick.mahomes@dolphindb.com','password','andy.reid@dolphindb.com','This is a subject',desc)
}
else{
desc += " with error: " + result
res = httpClient::sendEmail('patrick.mahomes@dolphindb.com','password','andy.reid@dolphindb.com','This is a subject',desc)
}
}
scheduleJob(jobId=`PnL, jobDesc="Calculate Profit & Loss", jobFunc=run{"PnL.dos"}, scheduleTime=[12:00m, 02:00m, 14:50m], startDate=2018.01.01, endDate=2018.12.31, frequency='W', days=[1,2,3,4,5], onComplete=sendEmail);
-->

## 2. Viewing Scheduled Jobs

Use [getScheduledJobs](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/g/getScheduledJobs.html) to check the definitions of scheduled jobs:

```
getScheduledJobs([jobIdPattern])
```

Note:

1. *jobIdPattern* is a string indicating a job ID or a pattern of job ID. It supports wildcard characters “%” and “?”.
2. Return a table of scheduled jobs. If *jobIdPattern* is not specified, return all scheduled jobs.
3. To view all scheduled jobs in a cluster, call `pnodeRun(getScheduledJobs)`, or log in to the web-based cluster manager and go to the “Job“ tab > “Scheduled Jobs“ table.

The execution log of a scheduled job are saved in *<jobId>.msg*; the result of a scheduled job is saved in <*jobId>.object*. Both files are saved under `<homeDir>/batchJobs`. Use functions [getJobMessage](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/g/getJobMessage.html) and [getJobReturn](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/g/getJobReturn.html) to view these 2 files.

About the job ID of a scheduled job:

1. When creating a scheduled job, if the specified jobId is the same as the ID of an existing scheduled job, a suffix will be added to generate a unique ID. (see section 1 Creating a Scheduled Job](#1-creating-a-scheduled-job)).
2. For recurring jobs, the job ID is different in each execution. Use the function `getRecentJobs` to check the job ID of the recently finished scheduled jobs.

- Example 5. Schedule a recurring job and check the executions.

```
def foo(){
	print "test scheduled job at"+ now()
	return now()
}
scheduleJob(`testJob, "foo", foo, 17:00m+0..2*30, today(), today(), 'D');
```

After several executions, call `getRecentJobs`. The result is as follows:

```
jobId	            jobDesc	startTime	            endTime
------              ------- ----------------------- ----------------------
testJob	            foo1	2020.02.14T17:00:23.636	2020.02.14T17:00:23.639
testJob20200214	    foo1	2020.02.14T17:30:23.908	2020.02.14T17:30:23.910
testJob20200214000  foo1	2020.02.14T18:00:23.148	2020.02.14T18:00:26.749
```

We can see that the *jobId* is different in each execution: “testJob“, “testJob20200214“, “testJob20200214000”, and so on.

```
>getJobMessage(`testJob20200214000);
2020-02-14 18:00:23.148629 Start the job [testJob20200214000]: foo
2020-02-14 18:00:23.148721 test the scheduled job at 2020.02.14T18:00:23.148
2020-02-14 18:00:26.749111 The job is done.

>getJobReturn(`testJob20200214000);
2020.02.14T18:00:23.148
```

## 3. Deleting a Scheduled Job

Delete a scheduled job with function [deleteScheduledJob](https://dolphindb.com/help/FunctionsandCommands/CommandsReferences/d/deleteScheduledJob.html):

```
deleteScheduledJob(jobId)
```

Note:

- Use [getScheduledJobs](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/g/getScheduledJobs.html) to get the ID of the job you want to delete.
- With this command, administrators can delete all scheduled jobs; users can only delete the scheduled jobs created by themselves.

## 4. Access Control

When creating a scheduled job, make sure you have the access required by the job. For example, if a job scheduled to read a DFS table is created by a user without access to the table, the execution would fail.

- Example 6. Log in as “guestUser1“ to create a scheduled job. “guestUser1” does not have the access to read the specified DFS table.

```
def foo1(){
	print "Test scheduled job "+ now()
	cnt=exec count(*) from loadTable("dfs://FuturesContract","tb")
	print "The count of table is "+cnt
	return cnt
}
login("guestUser1","123456")
scheduleJob(`guestGetDfsjob, "dfs read", foo1, [12:00m, 21:03m, 21:45m], 2020.01.01, 2021.12.31, "D");
```

After the job has been executed, call `getJobMessage("guestGetDfsjob")` to check the execution log. The result shows the job does not have the access to read the DFS table:

```
2020-02-14 21:03:23.193039 Start the job [guestGetDfsjob]: dfs read
2020-02-14 21:03:23.193092 Test the scheduled job at 2020.02.14T21:03:23.193
2020-02-14 21:03:23.194914 Not granted to read table dfs://FuturesContract/tb
```

## 5. Serialization and Deserialization

When a scheduled job is created, the job ID,  job description, job function, scheduled time, frequency, and user ID of the creator are serialized and persisted to `<homeDir>/sysmgmt/jobEditlog.meta` on the local disk. When the node restarts, all scheduled jobs will be deserialized and loaded.

Specifically, the job function is a set of statements which may reference other functions or global objects (e.g., shared variables). As shared variables are serialized by name, when the system deserializes and loads scheduled jobs when starting up, the referenced shared variables must exist in the memory.

Job functions (including the functions that are referenced) can be divided into 2 categories based on whether they are compiled:

1. Compiled functions, including built-in functions and functions in plugins (plugin functions)
2. Script functions, including user-defined functions, function views and functions in modules

The two categories of functions are serialized differently, which affects how the corresponding scheduled jobs are deserialized and loaded on system startup.

### 5.1 Compiled Functions

For compiled functions, only the function names and module names are serialized. When the system deserializes the scheduled jobs, it searches for these functions and modules by name. If the functions or modules are not found, the deserialization fails.

When the system is starting up, the resources related to scheduled jobs are loaded in the following order: *dolphindb.dos*, function views, *startup.dos*, and scheduled jobs. If a scheduled job references a plugin function, the plugin must be loaded before the scheduled job.

- Example 7. The job function `jobDemo` of the scheduled job calls a function in the plugin “odbc“.

```
use odbc
def jobDemo(){
	conn = odbc::connect("dsn=mysql_factorDBURL");
}
scheduleJob("job demo","example of init",jobDemo,15:48m, 2019.01.01, 2020.12.31, 'D')
```

If the plugin “odbc“ is not loaded when the system starts, the system does not recognize the plugin function when loading the scheduled job and exits with the following message:

```
<ERROR>:Failed to unmarshall the job [job demo]. Failed to deserialize assign statement. Invalid message format
```

 To start the system properly, add the following line to *startup.dos* to load the plugin “odbc“.

```
loadPlugin("plugins/odbc/odbc.cfg")
```

### 5.2 Script Functions

For script functions, all parameters and statements in the function definition are serialized. If the statements reference other script functions, the definition of the referenced functions is also serialized.

Once a scheduled job is created, it will run as scheduled even if the job function or the script functions referenced by the job function are deleted or modified. The scheduled job will execute the original functions as they have been serialized when the job is created. To implement the changes in the scheduled job, you must delete the scheduled job and create a new one. Make sure you also redefine the referenced functions before creating the new job.

- Example 8. After creating a scheduled job, modify the job function `f`.

```
def f(){
	print "The old function is called "
}
scheduleJob(`test, "f", f, 11:05m, today(), today(), 'D');
go
def f(){
	print "The new function is called "
}
```

After the scheduled job is executed, call `getJobMessage("test")`. We can see that the scheduled job executed the old function:

```
2020-02-14 11:05:53.382225 Start the job [test]: f
2020-02-14 11:05:53.382267 The old function is called
2020-02-14 11:05:53.382277 The job is done.
```

- Example 9. The function view `fv` is the job function of the scheduled job and it references the function view `foo`. After creating the scheduled job, modify the definition of `foo` and generate a new function view with the same name `fv`.

```
def foo(){
	print "The old function is called "
}
def fv(){
	foo()
}
addFunctionView(fv)

scheduleJob(`testFvJob, "fv", fv, 11:36m, today(), today(), 'D');
go
def foo(){
	print "The new function is called "
}
dropFunctionView(`fv)
addFunctionView(fv)
```

After the scheduled job is executed, call `getJobMessage("testFvJob")`. We can see that the scheduled job executed the old function:

```
2020-02-14 11:36:23.069892 Start the job [testFvJob]: fv
2020-02-14 11:36:23.069939 The old function is called
2020-02-14 11:36:23.069951 The job is done.
```

- Example 10. Create a module *printLog.dos*:

```
module printLog
def printLogs(logText){
	writeLog(string(now()) + " : " + logText)
	print "The old function is called"
}
```

Then create a scheduled job to call the function `printLog::printLogs`:

```
use printLog
def f5(){
	printLogs("test my log")
}
scheduleJob(`testModule, "f5", f5, 13:32m, today(), today(), 'D');
```

Before the scheduled job is executed, modify the module:

```
module printLog
def printLogs(logText){
	writeLog(string(now()) + " : " + logText)
	print "The new function is called"
}
```

After the scheduled job is executed, call `getJobMessage("testModule")`. We can see that the scheduled job executed the old function:

```
2020-02-14 13:32:22.870855 Start the job [testModule]: f5
2020-02-14 13:32:22.871097 The old function is called
2020-02-14 13:32:22.871106 The job is done.
```

## 6. Executing Scripts with Scheduled Jobs

When serializing a scheduled job that runs script file with the `run` function, the system saves the name of the script file rather than the file content. Therefore, please make sure the script file contains the definitions of all the user-defined functions that are referenced by the scheduled job. Otherwise the job would fail as it cannot find these functions.

- Example 11. Create a script file *testjob.dos*:

```
foo()
```

Execute the following script in DolphinDB GUI:

```
def foo(){
	print ("Hello world!")
}
run "/home/user/testjob.dos"
```

The execution is successful:

```
2020.02.14 13:47:00.992: executing code (line 104-108)...
Hello world!
```

Then schedule a job to run the script file:

```
scheduleJob(`dailyfoofile1, "Daily Job 1", run {"/home/user/testjob.dos"}, 16:14m, 2020.01.01, 2020.12.31, `D`);
```

The following exception is thrown during execution:

```
Exception was raised when running the script [/home/user/testjob.dos]:Syntax Error: [line #3] Cannot recognize the token foo
```

This is because the function `foo` and the scheduled job are not in the same session and the job could not find the function definition of `foo`.

Add the definition of `foo` to the script file *testjob.dos*.

```
def foo(){
	print ("Hello world!")
}
foo()
```

Delete the current scheduled job and create a new one to run the script file. The new job is successfully executed.

## 7. Troubleshooting

| **Issue**                                                    | **Solution**                                                 |
| :----------------------------------------------------------- | :----------------------------------------------------------- |
| The job function references a shared variable. When loading the scheduled job, the system cannot find the shared variable. | Define the referenced shared variables in the startup script *startup.dos*. |
| The job function references a plugin function. When loading the scheduled job, the system cannot find the plugin function. | Load the plugin in the startup script *startup.dos*.         |
| Schedule a job to run a script file. The job cannot find the referenced functions in the script file during execution. | The script file specified in the scheduled job must contain the definition of all the functions referenced by the job. |
| The scheduled job involves accessing a DFS table but its creator doesn’t have the required privileges. | Grant the required privileges to the user.                   |
| The startup script *startup.dos* contains functions [scheduleJob](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/s/scheduleJob.html), [getScheduledJobs](https://dolphindb.com/help/FunctionsandCommands/FunctionReferences/g/getScheduledJobs.html) or [deleteScheduledJob](https://dolphindb.com/help/FunctionsandCommands/CommandsReferences/d/deleteScheduledJob.html). An exception is thrown when the startup script is loaded. | When the system is starting up, the startup script is loaded before the job manager (which manages scheduled jobs and the related functions), so the script must not contain any functions related to scheduled jobs, including `scheduleJob`, `getScheduledJobs` and `deleteScheduledJob`. To load scheduled job-related tasks on startup, add the tasks to the script file *postStart.dos*, which is loaded after the scheduled jobs.  The file path of *postStartup.dos* is specified by the parameter *postStart*. (See example below*) |

Example*

```
if(getScheduledJobs().jobDesc.find("daily resub") == -1){
	scheduleJob(jobId=`daily, jobDesc="daily resub", jobFunc=run{"/home/appadmin/server/resubJob.dos"}, scheduleTime=08:30m, startDate=2021.08.30, endDate=2023.12.01, frequency='D')
}
```

On very rare occasions, scheduled jobs may fail to load, which may cause server startup failure. Particularly during a version upgrade, changes in the APIs for built-in functions and plugin functions may cause failure to load scheduled jobs, and compatibility issues may lead to system restart failure. Therefore, it is recommended to save the scripts you use when defining the scheduled jobs. When the system fails to start due to scheduled jobs, delete `<homeDir>/sysmgmt/jobEditlog.meta` (the file storing the serialized data of scheduled jobs) and try again. After the system is restarted, create the scheduled jobs again.


text:
# AdvancedCommandExecutor
Starts multiple processes with a single spintax command that works with 2 arguments.

*If there is a single argument that means you have chosen the permutation operation by default*

Usage:
```
AdvancedCommandExecutor.exe "echo Hello {world|humans|coders} !!!"
```
Output:

```
echo Hello world !!!
echo Hello humans !!!
echo Hello coders !!!

These commands will be executed. Do you want to start the processes.(y/n)

```

There are 2 possible commands: --sequential | --permutation

*Nested spintax can only be used for permutation option.*

Examples:
```
.\AdvancedCommandExecutor.exe --seq "echo {hello|world} {1|2} example"

echo hello 1 example
echo world 2 example
These commands will be executed. Do you want to start the processes.(y/n)
```
```
.\AdvancedCommandExecutor.exe --perm "echo {hello|world} {1|2} example"
echo hello 1 example
echo hello 2 example
echo world 1 example
echo world 2 example

These commands will be executed. Do you want to start the processes.(y/n)
```

repository: aironglilu/AdvancedCommandExecutor

repo_name: aironglilu/AdvancedCommandExecutor


text:
# coding-project-template

## Step 1 of 8

Project - Simple Interest Calculator

## Step 2 of 8

Objectives

Clone the project repo.
Modify the html file as per requirements.
Modify the css file as per requirements.
Modify the javascript file as per requirements.
Verify if the app is working properly.
Upload to GitHub and submit the github pages URL for peer review.

## Step 3 of 8

Exercise 1 : Clone the project repo.

In the project prepration phase you have forked the project into your GitHub Account.
Clone the project repository onto your local machine or the Theia environment from the github fork.

## Step 4 of 8

Exercise 2 : Modify the html file.

In this exercise, you will correct any mistakes in the existing code and also add any missing tags.

Doctype is missing. Add the doctype.
Add "Simple Interest Calculator" as title.
Move all the content which currently is in the  to a
 tag.
Set the class attribute of this div to 'maindiv'.
Modify the input text box for interest rate to a slider using the <range> tag.
For the <range> tag set the attributes min to 1, max to 20 and step to 0.25 and the value to 10.25.
Range is an elegant way to input numeric input. But the drawback is that it does not visually show value the user has selected.
To show the value selected by the <range>, create a  element right after the range.
Inside the '` tag add the text "10.25 %".
Modify the input text box for "No of years" into a dropdown box with options 1 to 10.
Change the "Compute" button to "Compute Interest".
Below the "Compute Interest" button create an empty  and set its id to 'result'.
Add a copyright message using the  tag.

## Step 5 of 8

Exercise 3 : Modify the css file.

In this exercise, you will correct the look and feel of the web page.

Set the body color to 'black', font to arial and font color to white.
Set the h1 color to 'grey' and font to verdana.
Create an entry for class 'maindiv'.
Set the background color to white, font color to black, width to 300 pixels, and padding to 20px in the newly created maindiv class.
Set the border radius to 25 px.
Align the div to the center of the page.
Visualize your html file in the browser and make sure that you have not missed anything.

## Step 6 of 8

Exercise 4 : Modify the javascript file.

In this exercise, you will write the javascript code to implement the simple interest calculation logic.

Before we start writing any javascript, make sure that the button in html file has the onclick attribute set to "compute()"
Create a variable called 'principal' and assign to it the value of the input element "principal"
Create a variable called rate and assign to it the value of the input element "rate"
Create a variable called years and assign to it the value of the input element "years"
Create a variable called interest and assign to it the value of principal * years * rate / 100
Write the logic to convert the 'No of Years' into the actual year in the future.
Write a function that reads the value of the range slider and displays it the adjacent to the slider.
Link this function with an "onchange" event on the range.
Change the slider, and test if the display in the span is being updated dynamically.
Get the reference to the element named 'result'
When "Compute Interest" is clicked, set its inner html property to the below text.
If you deposit 1000000,
at an interest rate of 3.5%.
You will receive an amount of 175000,
in the year 2025

The number above are for indication only. Make sure the output contains the relevant values by using the correct variables.
Make sure that the input you have taken as "No of Years" is converted into an actual year.
Make sure the numbers in the result are highlighted.
Add validation for "Principal" input box. If the user enters zero or negative values, show an alert "Enter a positive number"
Once the user clicks on the alert "OK" button, take the user back to the "Principal" input box, by setting the focus on this box. You can refer to the Javascript Form Validation lab.
 Let us proceed to next exercise where we test the code.
Write comments in your code. They not only help you score more marks in the project, but also help you to debug and maintain the code in the long term.

## Step 7 of 8

Exercise 5 : Test the app.

Now that you have finished coding your app. Let us do some basic testing, before we release it.

Enter these values in the form.
Amount = 0

Rate = 1

No. of Years = 1

Click on Compute button.

You should see an alert "Enter a positive number”.

Enter these values in the form.
Amount = 99999
Rate = 9
No. of Years = 9
Click on Compute button. You should see the following output.

If you deposit 99999,

at an interest rate of 9.

You will receive an amount of 80999.19,

in the year 2029

As I write this, the year is 2020, so 2029 is correct.
If you app has passed both the test cases, it is time to go to the next excercise.
Otherwise, start debugging your code to see where you went wrong.

## Step 8 of 8

Exercise 6 : Upload to GitHub and submit the github pages URL for peer review.

When you are done with all the changes in the project, commit and push to GitHub.
Open the URL of your project in a browser. (You created this URL in Exercise 1)
You should see your completed project.
Submit this URL for peer review.


text:
+++
title = "Cross-Origin-Resource-Policy"
description = ""
date = "2020-10-01"
category = [
    "Defense",
]
menu = "main"
+++

Cross-Origin Resource Policy (CORP) is a web platform security feature that allows websites to prevent certain resources from being loaded by other origins. This protection complements CORB since it is an opt-in defense, whereas CORB blocks some cross-origin reads by default. CORP is designed to protect against both speculative execution attacks and XS-Leaks by allowing developers to ensure that sensitive resources cannot end up in attacker-controlled processes. Unlike CORB, this protection is enforced in the browser only if an application opts in to the protection. Applications can define which groups of origins ('same-site', 'same-origin', 'cross-site') are allowed to read their resources.

If an application sets a certain resource CORP header as 'same-site' or 'same-origin', an attacker is incapable of reading that resource. This is a very strong and highly encouraged protection.

When using CORP, be aware of the following facts:

* CORP does not protect against navigational requests. This means that in browsers that do not support out-of-process iframes, a CORP-protected resource may still end up in another origin's process if [framing protections]({{< ref "../opt-in/xfo.md" >}}) are not used.
* The use of CORP introduces [a new XS-Leak]({{< ref "../../attacks/browser-features/corp.md" >}}), which allows attackers to detect whether CORP was enforced in a certain request.

## References

[^1]: Cross-Origin Resource Policy (CORP), [link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cross-Origin_Resource_Policy_(CORP))

repository: Brasco/wiki

gha_language: HTML

repo_name: Brasco/wiki


text:
---
name: planning-computer-build
layout: post
title: Planning the Computer Build
time: 2007-10-09 21:44:00 +01:00
---

Planning to build a computer can be fun also. Researching parts, making
sure they work well together (if they are on Manufacturers QVL). Making
a list of all the parts you need is the beginning of the purchasing,
assembly and then seeing your machine in action! Lots of guides online
help with the planning stage; but nearly all are advice and tips. How do
you know which is biased? Are the benchmarks relevant to what you are
building your machine for? Probably not most of the time. If you're not
a hardcore gamer like myself, your machine can mid-range and cheaper
than a pre-built solution, saving you money. I am using my machine as a
long term investment: I plan to have it long into the future and just
replace components. I think that could save me at least €3000 over ten
years (two €1,500 machines every 5 years, not beyond possibility) if not
more. I can also re-use perfectly good parts when my other machines have
departed to that big waste recycling plant in the sky.

One tool besides lots of online-based computer review reading is a
custom made spreadsheet I created for the job. It allows me to see Part
name, Quantity, Unit Price, Delivery Cost, Part Description, Link to
Manufacturers site and best of all: it's easily modified for other
items. I coloured it real nice too; so its easy to read and understand.
I hope it's useful to anyone out there, so I am making it available
under CC-BY-NC-SA. Here is a screenshot of it:

[![image](http://1.bp.blogspot.com/_4VvLQrhTX4I/Rwvt5cvqN1I/AAAAAAAABIY/L62kInnmE2E/s320/Picture+1.png)](http://1.bp.blogspot.com/_4VvLQrhTX4I/Rwvt5cvqN1I/AAAAAAAABIY/L62kInnmE2E/s1600-h/Picture+1.png)
-   Here is the [Microsoft Excel (97/2000/XP/2003) Template For Computer
    Parts](http://web.dueyfinster.com-a.googlepages.com/ComputerParts.xlt)
-   Here is the [Open Document Template for Computer
    Parts](http://web.dueyfinster.com-a.googlepages.com/ComputerParts.ots)


text:
---
title: "Evaluating Cell/B.E software cache for ClustalW"
date: 2010-01-01
publishDate: 2019-09-10T12:18:35.105832Z
authors: ["Vipin Sachdeva", "Michael Kistler", "David A. Bader"]
publication_types: ["1"]
abstract: "This paper evaluates the performance of the bioinformatics application ClustalW developed on Cell Broadband Engine(TM) (Cell/B.E.) using a software data cache for SPEs, instead of explicit DMA transfers. The software cache of the SPEs, once it has been configured, provides the capability to access main memory with data-transfer functions that override the need for DMA commands. ClustalW exhibits high spatial locality but little temporal locality. We compare performance of ClustalW with a previous version that uses explicit DMA transfers as a means of communication with the system memory, and provide analysis and results of our comparison"
featured: false
publication: "*International Symposium on Circuits and Systems (ISCAS 2010), May 30 - June 2, 2010, Paris, France*"
url_pdf: "https://doi.org/10.1109/ISCAS.2010.5537720"
doi: "10.1109/ISCAS.2010.5537720"
---

gha_language: Shell

gha_license_id: MIT