Evaluating the Relevance of
Legislation
A. Check the list of topics and sub-topics provided by the client.
· We are looking for legislation related to health, safety, and environment, specifically legislation dealing with the matters listed as topics and sub-topics. Accordingly, we can use the topics and sub-topics as keywords to help assess the relevance of a particular legislation. However, do not rely solely on the keywords because the topics and sub-topics are general terms which may cover a myriad of related terms.
B. Consider the following questions to gauge relevance:
1. Does the legislation provide for regulations relating to/covering/affecting the topics and sub-topics in the context of environment, health, and safety?
2. Are the topics and sub-topics the subject matter of the legislation which impacts environment, health, and safety?
3. Does the legislation impose duties/obligations on persons, grant powers to regulators, establish offices etc. relating to/affecting the topics and sub-topics for the maintenance of the environment, health, and safety?
C. Examine and analyze all the following key elements (if applicable).
· In order to answer the questions, we must analyze the different parts of the legislation. Reading the entire text of the legislation is not required to evaluate relevance. Just scan all the key elements of the legislation that will give an idea as to its subject matter and purpose. Because we are dealing with different types of legislation from various jurisdictions, they may not contain the same parts or elements. Thus, it is good to note that most of the key information required to determine relevance are found either in the beginning or end part of the legislation (where analogous elements may also be found).
1. Table of Contents – this outlines the contents of the legislation.
2. Short Title – this expresses the general subject covered by the legislation, and all provisions of the legislation are connected to that subject; thus, the title is a good indicator of whether the legislation is appropriate or not.
3. Long Title – this sets out the subject, scope, and purpose of the legislation.
4. Headings – legislation is divided into different parts or sections with each subdivision identified by a heading or subheading that gives an idea as to the matters discussed in the particular part.
5. Schedules – some legislation have documents annexed at the end called schedules that add more details to the main text or provide examples of forms or rules to be used under the legislation.
6. Explanatory Notes – (found under the "Explanatory Notes" or "More Resources" tab) text created by the government department responsible for the subject matter of the legislation to explain what the legislation sets out to achieve. Legislation may also be accompanied by an Explanatory Memorandum, Executive Note, or Policy Note.
Appendix 1 – Guidance for when reviewing topics for relevance
Not Relevant
Nothing more local than region in terms of jurisdiction e.g. state not
city
Official legislation or standards only – not ‘locally produced’
policies.
No proposed or draft legislation, or EU decisions on approach to be
taken.
Specifics - nothing too geographically specific, (e.g. Dogger Bank Creyke Beck Offshore Wind Farm (Amendment) Order 2019)
or technically very specific (i.e. technical specifications for an industry, or
formulae)
Fishing – We do have some safety-related legislation in UK and
Ireland but generally don’t cover this. (Marine/Coastal conservation which
limits fishing is a separate topic and is relevant).
Review further for relevance
Aviation – not all relevant, but elements such as transport of dangerous
goods, environmental impact and occupational safety would be.
Agriculture – we would include things like oil storage
tanks and land-spreading of wastewater sludge, and intensive farming
(large number of animals) typically requires an environmental permit and
environmental impact assessment (EIA).
Drugs – we cover poison, drugs and explosives “precursors”.
Electricity/Energy-related topics – gauge relevance from safety /
environmental perspective e.g. incentives for green energy, safety of networks
etc.
Firearms – not personal use or armed forces - only when it relates to
business use/access (safety and security) in a particular jurisdiction – we
often have a checklist on Violence at Work to cover drivers and lone
workers (e.g. security or facilities staff).
Food - unless related to general canteen/on-site restaurant
(HACCP management system) – include some specifics of food safety
legislation.
Marine - limited to ship and offshore (oil rigs, wind farms, undersea
cables) pollution and general ship safety.
Medical products – would only include medical devices and radiation
instruments.
Mining - where it is health, safety or environment based
Planning – sometimes relevant – look at whether the detail impacts on
safety or environmental elements.
Plant health/Phytosanitary – only include if related to international
regulations around wooden packaging, pest controls & controlling timber
products (wood products only) or nature conservation &
biodiversity
Trapping/Hunting - we cover protection of animals in general from
an environmental perspective – e.g. trading in protected animals
(products) and protected species/habitats (birds, bats, whales, etc).


DEAR, I AM THE DIRECTOR OF BILLS AND EXCHANGE AT THE FOREIGN REMITTANCE DEPARTMENT OF OUR BANK HERE IN ABIDJAN COTE D’IVOIRE. IN MY DEPARTMENT WE DISCOVERED AN ABANDONED SUM OF US$12.500,000.00 (TWELEVE. FIVE MILLION USD ONLY) IN AN ACCOUNT THAT BELONGS TO ONE OF OUR FOREIGN CUSTOMERS WHO DIED ALONG WITH HIS ENTIRE FAMILY IN NOVEMBER 1999 IN A PLANE CRASH. SINCE WE GOT INFORMATION ABOUT HIS DEATH, WE HAVE BEEN EXPECTING HIS NEXT OF KIN TO COME OVER AND CLAIM HIS MONEY BECAUSE WE CANNOT RELEASE IT UNLESS SOMEBODY APPLIES FOR IT AS NEXT OF KIN OR RELATION TO THE DECEASED AS INDICATED IN OUR BANKING GUIDELINES.   THE BANKING LAW AND GUIDELINES HERE STIPULATED THAT IF SUCH MONEY REMAINED UNCLAIMED AFTER FOUR YEARS THE MONEY WILL BE TRANSFERRED INTO FEDERAL GOVERNMENT ACCOUNT AS UNCLAIMED FUND.  WE AGREE THAT 15% OF THIS MONEY WILL BE FOR YOU AS FOREIGN PARTNER AND 5% FOR EXPENSES INCURRED DURING THE COURSE OF REMITTANCE. THEREAFTER TO THE PERCENTAGES INDICATED. THEREFORE TO ENABLE THE IMMEDIATE TRANSFER OF THE FUND TO YOU AS ARRANGED. YOU MUST APPLY FIRST TO THE BANK AS A RELATION OR NEXT OF KIN OF THE DECEASED INDICATING YOUR BANK ACCOUNT NUMBER AND LOCATION WHERE IN THE MONEY WILL BE REMITTED .    YOURS FAITHFULLY, F. LAMINE DIRECTOR, FOREIGN OPERATIONS _________________________________________________________ Gagne une PS2 ! Envoie un SMS avec le code PS au 61166 (0,35€ Hors coût du SMS)


|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <px4_config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <semaphore.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <getopt.h>
#include <perf/perf_counter.h>
#include <systemlib/err.h>
#include <systemlib/conversions.h>
#include <nuttx/arch.h>
#include <nuttx/clock.h>
#include <board_config.h>
#include <drivers/drv_hrt.h>
#include <drivers/device/spi.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/device/integrator.h>
#include <drivers/drv_accel.h>
#include <drivers/drv_gyro.h>
#include <drivers/drv_mag.h>
#include <mathlib/math/filter/LowPassFilter2p.hpp>
#include <lib/conversion/rotation.h>
Go to the source code of this file.
Classes | |
| class | BMI160 |
| struct | BMI160::BMIReport |
| Report conversation within the BMI160, including command byte and interrupt status. More... | |
Macros | |
| #define | DIR_READ 0x80 |
| #define | DIR_WRITE 0x00 |
| #define | BMI160_DEVICE_PATH_ACCEL "/dev/bmi160_accel" |
| #define | BMI160_DEVICE_PATH_GYRO "/dev/bmi160_gyro" |
| #define | BMI160_DEVICE_PATH_MAG "/dev/bmi160_mag" |
| #define | BMI160_DEVICE_PATH_ACCEL_EXT "/dev/bmi160_accel_ext" |
| #define | BMI160_DEVICE_PATH_GYRO_EXT "/dev/bmi160_gyro_ext" |
| #define | BMI160_DEVICE_PATH_MAG_EXT "/dev/bmi160_mag_ext" |
| #define | BMIREG_CHIP_ID 0x00 |
| #define | BMIREG_ERR_REG 0x02 |
| #define | BMIREG_PMU_STATUS 0x03 |
| #define | BMIREG_DATA_0 0x04 |
| #define | BMIREG_DATA_1 0x05 |
| #define | BMIREG_DATA_2 0x06 |
| #define | BMIREG_DATA_3 0x07 |
| #define | BMIREG_DATA_4 0x08 |
| #define | BMIREG_DATA_5 0x09 |
| #define | BMIREG_DATA_6 0x0A |
| #define | BMIREG_DATA_7 0x0B |
| #define | BMIREG_GYR_X_L 0x0C |
| #define | BMIREG_GYR_X_H 0x0D |
| #define | BMIREG_GYR_Y_L 0x0E |
| #define | BMIREG_GYR_Y_H 0x0F |
| #define | BMIREG_GYR_Z_L 0x10 |
| #define | BMIREG_GYR_Z_H 0x11 |
| #define | BMIREG_ACC_X_L 0x12 |
| #define | BMIREG_ACC_X_H 0x13 |
| #define | BMIREG_ACC_Y_L 0x14 |
| #define | BMIREG_ACC_Y_H 0x15 |
| #define | BMIREG_ACC_Z_L 0x16 |
| #define | BMIREG_ACC_Z_H 0x17 |
| #define | BMIREG_SENSORTIME0 0x18 |
| #define | BMIREG_SENSORTIME1 0x19 |
| #define | BMIREG_SENSORTIME2 0x1A |
| #define | BMIREG_STATUS 0x1B |
| #define | BMIREG_INT_STATUS_0 0x1C |
| #define | BMIREG_INT_STATUS_1 0x1D |
| #define | BMIREG_INT_STATUS_2 0x1E |
| #define | BMIREG_INT_STATUS_3 0x1F |
| #define | BMIREG_TEMP_0 0x20 |
| #define | BMIREG_TEMP_1 0x21 |
| #define | BMIREG_FIFO_LEN_0 0x22 |
| #define | BMIREG_FIFO_LEN_1 0x23 |
| #define | BMIREG_FIFO_DATA 0x24 |
| #define | BMIREG_ACC_CONF 0x40 |
| #define | BMIREG_ACC_RANGE 0x41 |
| #define | BMIREG_GYR_CONF 0x42 |
| #define | BMIREG_GYR_RANGE 0x43 |
| #define | BMIREG_MAG_CONF 0x44 |
| #define | BMIREG_FIFO_DOWNS 0x45 |
| #define | BMIREG_FIFO_CONFIG_0 0x46 |
| #define | BMIREG_FIFO_CONFIG_1 0x47 |
| #define | BMIREG_MAG_IF_0 0x4B |
| #define | BMIREG_MAG_IF_1 0x4C |
| #define | BMIREG_MAG_IF_2 0x4D |
| #define | BMIREG_MAG_IF_3 0x4E |
| #define | BMIREG_MAG_IF_4 0x4F |
| #define | BMIREG_INT_EN_0 0x50 |
| #define | BMIREG_INT_EN_1 0x51 |
| #define | BMIREG_INT_EN_2 0x52 |
| #define | BMIREG_INT_OUT_CTRL 0x53 |
| #define | BMIREG_INT_LANTCH 0x54 |
| #define | BMIREG_INT_MAP_0 0x55 |
| #define | BMIREG_INT_MAP_1 0x56 |
| #define | BMIREG_INT_MAP_2 0x57 |
| #define | BMIREG_INT_DATA_0 0x58 |
| #define | BMIREG_INT_DATA_1 0x59 |
| #define | BMIREG_INT_LH_0 0x5A |
| #define | BMIREG_INT_LH_1 0x5B |
| #define | BMIREG_INT_LH_2 0x5C |
| #define | BMIREG_INT_LH_3 0x5D |
| #define | BMIREG_INT_LH_4 0x5E |
| #define | BMIREG_INT_MOT_0 0x5F |
| #define | BMIREG_INT_MOT_1 0x60 |
| #define | BMIREG_INT_MOT_2 0x61 |
| #define | BMIREG_INT_MOT_3 0x62 |
| #define | BMIREG_INT_TAP_0 0x63 |
| #define | BMIREG_INT_TAP_1 0x64 |
| #define | BMIREG_INT_ORIE_0 0x65 |
| #define | BMIREG_INT_ORIE_1 0x66 |
| #define | BMIREG_INT_FLAT_0 0x67 |
| #define | BMIREG_INT_FLAT_1 0x68 |
| #define | BMIREG_FOC_CONF 0x69 |
| #define | BMIREG_CONF 0x6A |
| #define | BMIREG_IF_CONF 0x6B |
| #define | BMIREG_PMU_TRIGGER 0x6C |
| #define | BMIREG_SELF_TEST 0x6D |
| #define | BMIREG_NV_CONF 0x70 |
| #define | BMIREG_OFFSET_ACC_X 0x71 |
| #define | BMIREG_OFFSET_ACC_Y 0x72 |
| #define | BMIREG_OFFSET_ACC_Z 0x73 |
| #define | BMIREG_OFFSET_GYR_X 0x74 |
| #define | BMIREG_OFFSET_GYR_Y 0x75 |
| #define | BMIREG_OFFSET_GYR_Z 0x76 |
| #define | BMIREG_OFFSET_EN 0x77 |
| #define | BMIREG_STEP_CONT_0 0x78 |
| #define | BMIREG_STEP_CONT_1 0x79 |
| #define | BMIREG_STEP_CONF_0 0x7A |
| #define | BMIREG_STEP_CONF_1 0x7B |
| #define | BMIREG_CMD 0x7E |
| #define | BMI160_WHO_AM_I 0xD1 |
| #define | BMI_DRDY_ACCEL (1<<7) |
| #define | BMI_DRDY_GYRO (1<<6) |
| #define | BMI_DRDY_MAG (1<<5) |
| #define | BMI_GYRO_SELF_TEST_OK (1<<1) |
| #define | BMI_DRDY_INT (1<<4) |
| #define | BMI_ACCEL_RATE_25_32 (0<<3) | (0<<2) | (0<<1) | (1<<0) |
| #define | BMI_ACCEL_RATE_25_16 (0<<3) | (0<<2) | (1<<1) | (0<<0) |
| #define | BMI_ACCEL_RATE_25_8 (0<<3) | (0<<2) | (1<<1) | (1<<0) |
| #define | BMI_ACCEL_RATE_25_4 (0<<3) | (1<<2) | (0<<1) | (0<<0) |
| #define | BMI_ACCEL_RATE_25_2 (0<<3) | (1<<2) | (0<<1) | (1<<0) |
| #define | BMI_ACCEL_RATE_25 (0<<3) | (1<<2) | (1<<1) | (0<<0) |
| #define | BMI_ACCEL_RATE_50 (0<<3) | (1<<2) | (1<<1) | (1<<0) |
| #define | BMI_ACCEL_RATE_100 (1<<3) | (0<<2) | (0<<1) | (0<<0) |
| #define | BMI_ACCEL_RATE_200 (1<<3) | (0<<2) | (0<<1) | (1<<0) |
| #define | BMI_ACCEL_RATE_400 (1<<3) | (0<<2) | (1<<1) | (0<<0) |
| #define | BMI_ACCEL_RATE_800 (1<<3) | (0<<2) | (1<<1) | (1<<0) |
| #define | BMI_ACCEL_RATE_1600 (1<<3) | (1<<2) | (0<<1) | (0<<0) |
| #define | BMI_ACCEL_US (0<<7) |
| #define | BMI_ACCEL_BWP_NORMAL (0<<6) | (1<<5) | (0<<4) |
| #define | BMI_ACCEL_BWP_OSR2 (0<<6) | (0<<5) | (1<<4) |
| #define | BMI_ACCEL_BWP_OSR4 (0<<6) | (0<<5) | (0<<4) |
| #define | BMI_ACCEL_RANGE_2_G (0<<3) | (0<<2) | (1<<1) | (1<<0) |
| #define | BMI_ACCEL_RANGE_4_G (0<<3) | (1<<2) | (0<<1) | (1<<0) |
| #define | BMI_ACCEL_RANGE_8_G (1<<3) | (0<<2) | (0<<1) | (0<<0) |
| #define | BMI_ACCEL_RANGE_16_G (1<<3) | (1<<2) | (0<<1) | (0<<0) |
| #define | BMI_GYRO_RATE_25 (0<<3) | (1<<2) | (1<<1) | (0<<0) |
| #define | BMI_GYRO_RATE_50 (0<<3) | (1<<2) | (1<<1) | (1<<0) |
| #define | BMI_GYRO_RATE_100 (1<<3) | (0<<2) | (0<<1) | (0<<0) |
| #define | BMI_GYRO_RATE_200 (1<<3) | (0<<2) | (0<<1) | (1<<0) |
| #define | BMI_GYRO_RATE_400 (1<<3) | (0<<2) | (1<<1) | (0<<0) |
| #define | BMI_GYRO_RATE_800 (1<<3) | (0<<2) | (1<<1) | (1<<0) |
| #define | BMI_GYRO_RATE_1600 (1<<3) | (1<<2) | (0<<1) | (0<<0) |
| #define | BMI_GYRO_RATE_3200 (1<<3) | (1<<2) | (0<<1) | (1<<0) |
| #define | BMI_GYRO_BWP_NORMAL (1<<5) | (0<<4) |
| #define | BMI_GYRO_BWP_OSR2 (0<<5) | (1<<4) |
| #define | BMI_GYRO_BWP_OSR4 (0<<5) | (0<<4) |
| #define | BMI_GYRO_RANGE_2000_DPS (0<<2) | (0<<1) | (0<<0) |
| #define | BMI_GYRO_RANGE_1000_DPS (0<<2) | (0<<1) | (1<<0) |
| #define | BMI_GYRO_RANGE_500_DPS (0<<2) | (1<<1) | (0<<0) |
| #define | BMI_GYRO_RANGE_250_DPS (0<<2) | (1<<1) | (1<<0) |
| #define | BMI_GYRO_RANGE_125_DPS (1<<2) | (0<<1) | (0<<0) |
| #define | BMI_DRDY_INT_EN (1<<4) |
| #define | BMI_INT1_EN (1<<3) | (0<<2) | (1<<1) |
| #define | BMI_DRDY_INT1 (1<<7) |
| #define | BMI_SPI_3_WIRE (1<<0) |
| #define | BMI_SPI_4_WIRE (0<<0) |
| #define | BMI_AUTO_DIS_SEC (0<<5) | (0<<4) |
| #define | BMI_I2C_OIS_SEC (0<<5) | (1<<4) |
| #define | BMI_AUTO_MAG_SEC (1<<5) | (0<<4) |
| #define | BMI_SPI (1<<0) |
| #define | BMI_ACCEL_NORMAL_MODE 0x11 |
| #define | BMI_GYRO_NORMAL_MODE 0x15 |
| #define | BMI160_SOFT_RESET 0xB6 |
| #define | BMI160_ACCEL_DEFAULT_RANGE_G 16 |
| #define | BMI160_GYRO_DEFAULT_RANGE_DPS 2000 |
| #define | BMI160_ACCEL_DEFAULT_RATE 800 |
| #define | BMI160_ACCEL_MAX_RATE 1600 |
| #define | BMI160_ACCEL_MAX_PUBLISH_RATE 280 |
| #define | BMI160_GYRO_DEFAULT_RATE 800 |
| #define | BMI160_GYRO_MAX_RATE 3200 |
| #define | BMI160_GYRO_MAX_PUBLISH_RATE BMI160_ACCEL_MAX_PUBLISH_RATE |
| #define | BMI160_ACCEL_DEFAULT_ONCHIP_FILTER_FREQ 324 |
| #define | BMI160_ACCEL_DEFAULT_DRIVER_FILTER_FREQ 50 |
| #define | BMI160_GYRO_DEFAULT_ONCHIP_FILTER_FREQ 254.6f |
| #define | BMI160_GYRO_DEFAULT_DRIVER_FILTER_FREQ 50 |
| #define | BMI160_BUS_SPEED 10*1000*1000 |
| #define | BMI160_TIMER_REDUCTION 200 |
| #define | BMI160_NUM_CHECKED_REGISTERS 10 |
| #define BMI160_ACCEL_DEFAULT_DRIVER_FILTER_FREQ 50 |
Definition at line 236 of file bmi160.hpp.
Referenced by BMI160::BMI160().
| #define BMI160_ACCEL_DEFAULT_ONCHIP_FILTER_FREQ 324 |
Definition at line 235 of file bmi160.hpp.
| #define BMI160_ACCEL_DEFAULT_RANGE_G 16 |
Definition at line 226 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI160_ACCEL_DEFAULT_RATE 800 |
Definition at line 228 of file bmi160.hpp.
Referenced by BMI160::BMI160(), BMI160::ioctl(), and BMI160::reset().
| #define BMI160_ACCEL_MAX_PUBLISH_RATE 280 |
Definition at line 230 of file bmi160.hpp.
Referenced by BMI160::BMI160().
| #define BMI160_ACCEL_MAX_RATE 1600 |
Definition at line 229 of file bmi160.hpp.
| #define BMI160_BUS_SPEED 10*1000*1000 |
Definition at line 241 of file bmi160.hpp.
| #define BMI160_DEVICE_PATH_ACCEL "/dev/bmi160_accel" |
Definition at line 43 of file bmi160.hpp.
Referenced by bmi160::reset(), bmi160::start(), and bmi160::test().
| #define BMI160_DEVICE_PATH_ACCEL_EXT "/dev/bmi160_accel_ext" |
Definition at line 46 of file bmi160.hpp.
Referenced by bmi160::reset(), bmi160::start(), and bmi160::test().
| #define BMI160_DEVICE_PATH_GYRO "/dev/bmi160_gyro" |
Definition at line 44 of file bmi160.hpp.
Referenced by bmi160::start(), and bmi160::test().
| #define BMI160_DEVICE_PATH_GYRO_EXT "/dev/bmi160_gyro_ext" |
Definition at line 47 of file bmi160.hpp.
Referenced by bmi160::start(), and bmi160::test().
| #define BMI160_DEVICE_PATH_MAG "/dev/bmi160_mag" |
Definition at line 45 of file bmi160.hpp.
| #define BMI160_DEVICE_PATH_MAG_EXT "/dev/bmi160_mag_ext" |
Definition at line 48 of file bmi160.hpp.
| #define BMI160_GYRO_DEFAULT_DRIVER_FILTER_FREQ 50 |
Definition at line 239 of file bmi160.hpp.
Referenced by BMI160::BMI160().
| #define BMI160_GYRO_DEFAULT_ONCHIP_FILTER_FREQ 254.6f |
Definition at line 238 of file bmi160.hpp.
| #define BMI160_GYRO_DEFAULT_RANGE_DPS 2000 |
Definition at line 227 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI160_GYRO_DEFAULT_RATE 800 |
Definition at line 231 of file bmi160.hpp.
Referenced by BMI160::BMI160(), BMI160::ioctl(), and BMI160::reset().
| #define BMI160_GYRO_MAX_PUBLISH_RATE BMI160_ACCEL_MAX_PUBLISH_RATE |
Definition at line 233 of file bmi160.hpp.
Referenced by BMI160::BMI160().
| #define BMI160_GYRO_MAX_RATE 3200 |
Definition at line 232 of file bmi160.hpp.
Referenced by BMI160::ioctl().
| #define BMI160_NUM_CHECKED_REGISTERS 10 |
Definition at line 329 of file bmi160.hpp.
Referenced by BMI160::check_registers(), BMI160::print_info(), BMI160::reset(), and BMI160::write_checked_reg().
| #define BMI160_SOFT_RESET 0xB6 |
Definition at line 224 of file bmi160.hpp.
Referenced by BMI160::check_registers(), and BMI160::test_error().
| #define BMI160_TIMER_REDUCTION 200 |
Definition at line 243 of file bmi160.hpp.
Referenced by BMI160::ioctl(), and BMI160::start().
| #define BMI160_WHO_AM_I 0xD1 |
Definition at line 147 of file bmi160.hpp.
Referenced by BMI160::probe().
| #define BMI_ACCEL_BWP_NORMAL (0<<6) | (1<<5) | (0<<4) |
Definition at line 172 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_ACCEL_BWP_OSR2 (0<<6) | (0<<5) | (1<<4) |
Definition at line 173 of file bmi160.hpp.
| #define BMI_ACCEL_BWP_OSR4 (0<<6) | (0<<5) | (0<<4) |
Definition at line 174 of file bmi160.hpp.
| #define BMI_ACCEL_NORMAL_MODE 0x11 |
Definition at line 222 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_ACCEL_RANGE_16_G (1<<3) | (1<<2) | (0<<1) | (0<<0) |
Definition at line 180 of file bmi160.hpp.
Referenced by BMI160::set_accel_range().
| #define BMI_ACCEL_RANGE_2_G (0<<3) | (0<<2) | (1<<1) | (1<<0) |
Definition at line 177 of file bmi160.hpp.
Referenced by BMI160::set_accel_range().
| #define BMI_ACCEL_RANGE_4_G (0<<3) | (1<<2) | (0<<1) | (1<<0) |
Definition at line 178 of file bmi160.hpp.
Referenced by BMI160::set_accel_range().
| #define BMI_ACCEL_RANGE_8_G (1<<3) | (0<<2) | (0<<1) | (0<<0) |
Definition at line 179 of file bmi160.hpp.
Referenced by BMI160::set_accel_range().
| #define BMI_ACCEL_RATE_100 (1<<3) | (0<<2) | (0<<1) | (0<<0) |
Definition at line 166 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_1600 (1<<3) | (1<<2) | (0<<1) | (0<<0) |
Definition at line 170 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_200 (1<<3) | (0<<2) | (0<<1) | (1<<0) |
Definition at line 167 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_25 (0<<3) | (1<<2) | (1<<1) | (0<<0) |
Definition at line 164 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_25_16 (0<<3) | (0<<2) | (1<<1) | (0<<0) |
Definition at line 160 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_25_2 (0<<3) | (1<<2) | (0<<1) | (1<<0) |
Definition at line 163 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_25_32 (0<<3) | (0<<2) | (0<<1) | (1<<0) |
Definition at line 159 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_25_4 (0<<3) | (1<<2) | (0<<1) | (0<<0) |
Definition at line 162 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_25_8 (0<<3) | (0<<2) | (1<<1) | (1<<0) |
Definition at line 161 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_400 (1<<3) | (0<<2) | (1<<1) | (0<<0) |
Definition at line 168 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_50 (0<<3) | (1<<2) | (1<<1) | (1<<0) |
Definition at line 165 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_RATE_800 (1<<3) | (0<<2) | (1<<1) | (1<<0) |
Definition at line 169 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate().
| #define BMI_ACCEL_US (0<<7) |
Definition at line 171 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_AUTO_DIS_SEC (0<<5) | (0<<4) |
Definition at line 214 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_AUTO_MAG_SEC (1<<5) | (0<<4) |
Definition at line 216 of file bmi160.hpp.
| #define BMI_DRDY_ACCEL (1<<7) |
Definition at line 150 of file bmi160.hpp.
| #define BMI_DRDY_GYRO (1<<6) |
Definition at line 151 of file bmi160.hpp.
| #define BMI_DRDY_INT (1<<4) |
Definition at line 156 of file bmi160.hpp.
| #define BMI_DRDY_INT1 (1<<7) |
Definition at line 209 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_DRDY_INT_EN (1<<4) |
Definition at line 203 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_DRDY_MAG (1<<5) |
Definition at line 152 of file bmi160.hpp.
| #define BMI_GYRO_BWP_NORMAL (1<<5) | (0<<4) |
Definition at line 191 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_GYRO_BWP_OSR2 (0<<5) | (1<<4) |
Definition at line 192 of file bmi160.hpp.
| #define BMI_GYRO_BWP_OSR4 (0<<5) | (0<<4) |
Definition at line 193 of file bmi160.hpp.
| #define BMI_GYRO_NORMAL_MODE 0x15 |
Definition at line 223 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_GYRO_RANGE_1000_DPS (0<<2) | (0<<1) | (1<<0) |
Definition at line 197 of file bmi160.hpp.
Referenced by BMI160::set_gyro_range().
| #define BMI_GYRO_RANGE_125_DPS (1<<2) | (0<<1) | (0<<0) |
Definition at line 200 of file bmi160.hpp.
Referenced by BMI160::set_gyro_range().
| #define BMI_GYRO_RANGE_2000_DPS (0<<2) | (0<<1) | (0<<0) |
Definition at line 196 of file bmi160.hpp.
Referenced by BMI160::set_gyro_range().
| #define BMI_GYRO_RANGE_250_DPS (0<<2) | (1<<1) | (1<<0) |
Definition at line 199 of file bmi160.hpp.
Referenced by BMI160::set_gyro_range().
| #define BMI_GYRO_RANGE_500_DPS (0<<2) | (1<<1) | (0<<0) |
Definition at line 198 of file bmi160.hpp.
Referenced by BMI160::set_gyro_range().
| #define BMI_GYRO_RATE_100 (1<<3) | (0<<2) | (0<<1) | (0<<0) |
Definition at line 185 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_1600 (1<<3) | (1<<2) | (0<<1) | (0<<0) |
Definition at line 189 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_200 (1<<3) | (0<<2) | (0<<1) | (1<<0) |
Definition at line 186 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_25 (0<<3) | (1<<2) | (1<<1) | (0<<0) |
Definition at line 183 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_3200 (1<<3) | (1<<2) | (0<<1) | (1<<0) |
Definition at line 190 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_400 (1<<3) | (0<<2) | (1<<1) | (0<<0) |
Definition at line 187 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_50 (0<<3) | (1<<2) | (1<<1) | (1<<0) |
Definition at line 184 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_RATE_800 (1<<3) | (0<<2) | (1<<1) | (1<<0) |
Definition at line 188 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate().
| #define BMI_GYRO_SELF_TEST_OK (1<<1) |
Definition at line 153 of file bmi160.hpp.
| #define BMI_I2C_OIS_SEC (0<<5) | (1<<4) |
Definition at line 215 of file bmi160.hpp.
| #define BMI_INT1_EN (1<<3) | (0<<2) | (1<<1) |
Definition at line 206 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_SPI (1<<0) |
Definition at line 219 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMI_SPI_3_WIRE (1<<0) |
Definition at line 212 of file bmi160.hpp.
| #define BMI_SPI_4_WIRE (0<<0) |
Definition at line 213 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_ACC_CONF 0x40 |
Definition at line 88 of file bmi160.hpp.
Referenced by BMI160::accel_set_sample_rate(), and BMI160::reset().
| #define BMIREG_ACC_RANGE 0x41 |
Definition at line 89 of file bmi160.hpp.
Referenced by BMI160::reset(), and BMI160::set_accel_range().
| #define BMIREG_ACC_X_H 0x13 |
Definition at line 70 of file bmi160.hpp.
| #define BMIREG_ACC_X_L 0x12 |
Definition at line 69 of file bmi160.hpp.
| #define BMIREG_ACC_Y_H 0x15 |
Definition at line 72 of file bmi160.hpp.
| #define BMIREG_ACC_Y_L 0x14 |
Definition at line 71 of file bmi160.hpp.
| #define BMIREG_ACC_Z_H 0x17 |
Definition at line 74 of file bmi160.hpp.
| #define BMIREG_ACC_Z_L 0x16 |
Definition at line 73 of file bmi160.hpp.
| #define BMIREG_CHIP_ID 0x00 |
Definition at line 52 of file bmi160.hpp.
Referenced by BMI160::probe().
| #define BMIREG_CMD 0x7E |
Definition at line 143 of file bmi160.hpp.
Referenced by BMI160::check_registers(), BMI160::reset(), and BMI160::test_error().
| #define BMIREG_CONF 0x6A |
Definition at line 127 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_DATA_0 0x04 |
Definition at line 55 of file bmi160.hpp.
| #define BMIREG_DATA_1 0x05 |
Definition at line 56 of file bmi160.hpp.
| #define BMIREG_DATA_2 0x06 |
Definition at line 57 of file bmi160.hpp.
| #define BMIREG_DATA_3 0x07 |
Definition at line 58 of file bmi160.hpp.
| #define BMIREG_DATA_4 0x08 |
Definition at line 59 of file bmi160.hpp.
| #define BMIREG_DATA_5 0x09 |
Definition at line 60 of file bmi160.hpp.
| #define BMIREG_DATA_6 0x0A |
Definition at line 61 of file bmi160.hpp.
| #define BMIREG_DATA_7 0x0B |
Definition at line 62 of file bmi160.hpp.
| #define BMIREG_ERR_REG 0x02 |
Definition at line 53 of file bmi160.hpp.
| #define BMIREG_FIFO_CONFIG_0 0x46 |
Definition at line 94 of file bmi160.hpp.
| #define BMIREG_FIFO_CONFIG_1 0x47 |
Definition at line 95 of file bmi160.hpp.
| #define BMIREG_FIFO_DATA 0x24 |
Definition at line 87 of file bmi160.hpp.
| #define BMIREG_FIFO_DOWNS 0x45 |
Definition at line 93 of file bmi160.hpp.
| #define BMIREG_FIFO_LEN_0 0x22 |
Definition at line 85 of file bmi160.hpp.
| #define BMIREG_FIFO_LEN_1 0x23 |
Definition at line 86 of file bmi160.hpp.
| #define BMIREG_FOC_CONF 0x69 |
Definition at line 126 of file bmi160.hpp.
| #define BMIREG_GYR_CONF 0x42 |
Definition at line 90 of file bmi160.hpp.
Referenced by BMI160::gyro_set_sample_rate(), and BMI160::reset().
| #define BMIREG_GYR_RANGE 0x43 |
Definition at line 91 of file bmi160.hpp.
Referenced by BMI160::reset(), and BMI160::set_gyro_range().
| #define BMIREG_GYR_X_H 0x0D |
Definition at line 64 of file bmi160.hpp.
| #define BMIREG_GYR_X_L 0x0C |
Definition at line 63 of file bmi160.hpp.
Referenced by BMI160::measure().
| #define BMIREG_GYR_Y_H 0x0F |
Definition at line 66 of file bmi160.hpp.
| #define BMIREG_GYR_Y_L 0x0E |
Definition at line 65 of file bmi160.hpp.
| #define BMIREG_GYR_Z_H 0x11 |
Definition at line 68 of file bmi160.hpp.
| #define BMIREG_GYR_Z_L 0x10 |
Definition at line 67 of file bmi160.hpp.
| #define BMIREG_IF_CONF 0x6B |
Definition at line 128 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_INT_DATA_0 0x58 |
Definition at line 109 of file bmi160.hpp.
| #define BMIREG_INT_DATA_1 0x59 |
Definition at line 110 of file bmi160.hpp.
| #define BMIREG_INT_EN_0 0x50 |
Definition at line 101 of file bmi160.hpp.
| #define BMIREG_INT_EN_1 0x51 |
Definition at line 102 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_INT_EN_2 0x52 |
Definition at line 103 of file bmi160.hpp.
| #define BMIREG_INT_FLAT_0 0x67 |
Definition at line 124 of file bmi160.hpp.
| #define BMIREG_INT_FLAT_1 0x68 |
Definition at line 125 of file bmi160.hpp.
| #define BMIREG_INT_LANTCH 0x54 |
Definition at line 105 of file bmi160.hpp.
| #define BMIREG_INT_LH_0 0x5A |
Definition at line 111 of file bmi160.hpp.
| #define BMIREG_INT_LH_1 0x5B |
Definition at line 112 of file bmi160.hpp.
| #define BMIREG_INT_LH_2 0x5C |
Definition at line 113 of file bmi160.hpp.
| #define BMIREG_INT_LH_3 0x5D |
Definition at line 114 of file bmi160.hpp.
| #define BMIREG_INT_LH_4 0x5E |
Definition at line 115 of file bmi160.hpp.
| #define BMIREG_INT_MAP_0 0x55 |
Definition at line 106 of file bmi160.hpp.
| #define BMIREG_INT_MAP_1 0x56 |
Definition at line 107 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_INT_MAP_2 0x57 |
Definition at line 108 of file bmi160.hpp.
| #define BMIREG_INT_MOT_0 0x5F |
Definition at line 116 of file bmi160.hpp.
| #define BMIREG_INT_MOT_1 0x60 |
Definition at line 117 of file bmi160.hpp.
| #define BMIREG_INT_MOT_2 0x61 |
Definition at line 118 of file bmi160.hpp.
| #define BMIREG_INT_MOT_3 0x62 |
Definition at line 119 of file bmi160.hpp.
| #define BMIREG_INT_ORIE_0 0x65 |
Definition at line 122 of file bmi160.hpp.
| #define BMIREG_INT_ORIE_1 0x66 |
Definition at line 123 of file bmi160.hpp.
| #define BMIREG_INT_OUT_CTRL 0x53 |
Definition at line 104 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_INT_STATUS_0 0x1C |
Definition at line 79 of file bmi160.hpp.
| #define BMIREG_INT_STATUS_1 0x1D |
Definition at line 80 of file bmi160.hpp.
| #define BMIREG_INT_STATUS_2 0x1E |
Definition at line 81 of file bmi160.hpp.
| #define BMIREG_INT_STATUS_3 0x1F |
Definition at line 82 of file bmi160.hpp.
| #define BMIREG_INT_TAP_0 0x63 |
Definition at line 120 of file bmi160.hpp.
| #define BMIREG_INT_TAP_1 0x64 |
Definition at line 121 of file bmi160.hpp.
| #define BMIREG_MAG_CONF 0x44 |
Definition at line 92 of file bmi160.hpp.
| #define BMIREG_MAG_IF_0 0x4B |
Definition at line 96 of file bmi160.hpp.
| #define BMIREG_MAG_IF_1 0x4C |
Definition at line 97 of file bmi160.hpp.
| #define BMIREG_MAG_IF_2 0x4D |
Definition at line 98 of file bmi160.hpp.
| #define BMIREG_MAG_IF_3 0x4E |
Definition at line 99 of file bmi160.hpp.
| #define BMIREG_MAG_IF_4 0x4F |
Definition at line 100 of file bmi160.hpp.
| #define BMIREG_NV_CONF 0x70 |
Definition at line 131 of file bmi160.hpp.
Referenced by BMI160::reset().
| #define BMIREG_OFFSET_ACC_X 0x71 |
Definition at line 132 of file bmi160.hpp.
| #define BMIREG_OFFSET_ACC_Y 0x72 |
Definition at line 133 of file bmi160.hpp.
| #define BMIREG_OFFSET_ACC_Z 0x73 |
Definition at line 134 of file bmi160.hpp.
| #define BMIREG_OFFSET_EN 0x77 |
Definition at line 138 of file bmi160.hpp.
| #define BMIREG_OFFSET_GYR_X 0x74 |
Definition at line 135 of file bmi160.hpp.
| #define BMIREG_OFFSET_GYR_Y 0x75 |
Definition at line 136 of file bmi160.hpp.
| #define BMIREG_OFFSET_GYR_Z 0x76 |
Definition at line 137 of file bmi160.hpp.
| #define BMIREG_PMU_STATUS 0x03 |
Definition at line 54 of file bmi160.hpp.
| #define BMIREG_PMU_TRIGGER 0x6C |
Definition at line 129 of file bmi160.hpp.
| #define BMIREG_SELF_TEST 0x6D |
Definition at line 130 of file bmi160.hpp.
| #define BMIREG_SENSORTIME0 0x18 |
Definition at line 75 of file bmi160.hpp.
| #define BMIREG_SENSORTIME1 0x19 |
Definition at line 76 of file bmi160.hpp.
| #define BMIREG_SENSORTIME2 0x1A |
Definition at line 77 of file bmi160.hpp.
| #define BMIREG_STATUS 0x1B |
Definition at line 78 of file bmi160.hpp.
Referenced by BMI160::measure().
| #define BMIREG_STEP_CONF_0 0x7A |
Definition at line 141 of file bmi160.hpp.
| #define BMIREG_STEP_CONF_1 0x7B |
Definition at line 142 of file bmi160.hpp.
| #define BMIREG_STEP_CONT_0 0x78 |
Definition at line 139 of file bmi160.hpp.
| #define BMIREG_STEP_CONT_1 0x79 |
Definition at line 140 of file bmi160.hpp.
| #define BMIREG_TEMP_0 0x20 |
Definition at line 83 of file bmi160.hpp.
Referenced by BMI160::measure().
| #define BMIREG_TEMP_1 0x21 |
Definition at line 84 of file bmi160.hpp.
Referenced by BMI160::measure().
| #define DIR_READ 0x80 |
Definition at line 40 of file bmi160.hpp.
| #define DIR_WRITE 0x00 |
Definition at line 41 of file bmi160.hpp.


Hatching plans for a regular meeting of friends - two fingers up to subjective alienation and a city that’ll have us split up, bi-annually meeting, almost always in twos.
Reality / £2.00
By Quiet Carriage and various ghosts
Design by Alistair Cartwright


Connect Four!
You will be implementing the game, Connect Four, to be played in the web browser. This assignment is to demonstrate an understanding of how to utilize JavaScript to collect, persist,
and manipulate data, and to respond to user interactions to dynamically change the DOM.
- For this version, you will assume that only one user is viewing the page that presents your game at a time (e.g., the two players are using a laptop that they pass back and forth between turns).
- Wikipedia’s Connect Four entry lays out the rules.
- Your game will be built on a 7x6 grids, with rows labeled 1-6 and columns labeled A-G.
- Each player has 21 tokens.
- Player one’s tokens are red.
- Player two’s tokens are black.
- The tokens cannot overlap.
- The game will have to be aware of how many tokens of the same color are touching, and how many remain to reach four.
- The player selects the column to drop the token. You do not need to animate the drop.
Specifications
These are the base requirements for making the page work. You can enhance. You cannot use external libraries like jQuery for this project.
- When the page is loaded, your game should begin by asking the first player for her name (for example, let's assume that the first player is Alice), and a string representing their birthday. The board should not be displayed.
- Your game should be flexible in accepting the multiple date formats.
MM/DD/YYYY
- i.e. 01/01/2019
M/D/YYYY
- i.e. 1/1/2019
MM-DD-YYYY
- i.e. 01-01-2019
M-D-YYYY
- i.e. 1-1-2019
MMM. DD, YYYY
- i.e. Jan. 01, 2019
MMM. D, YYYY
- i.e. Jan. 1, 2019
MMMMMM DD, YYYY
- i.e. January 01, 2019
MMMMMM D, YYYY
- i.e. January 1, 2019
- Use a regex function to validate the strings, and split the string into three variables representing Day, Month, and Year.
- Set the player’s birthday attribute as a JavaScript Date object constructed from the three variables.
- After gathering the first player’s name and birthday, your game should prompt the second player for their name and birthday (for example, lets assume the second player is Bob).
- The player who takes the first turn is the oldest.
- A timer should be displayed at the top of the page tracking the duration of the game. The timer does not start until the first player confirms the start of their first turn.
- With this starting information in hand, your game should begin the first player’s turn
- At the start of a turn, your game should use a dialog (you may use
alert()
, but you do not have to) indicating whose turn it is by name (e.g., “Click OK to begin Alice’s turn”).
- After the prompt is dismissed, your game should render one 7x6 grid created dynamically with JavaScript.
- The grid should have a yellow background and blue border.
- Empty cells should have a white circle using the image from the starter repo located at
/images/white-circle.png
.
- The count of remaining tokens for player one should be displayed on the left of the board.
- The count of remaining tokens for player two should be displayed on the right of the board.
- The player is then free to click a column to place their token.
- The token should occupy the lowest available cell in the column.
- When a player places a token, the cell the token occupies should contain a circle referencing the player’s token color:
/images/red-circle.png
and /images/black-circle.png
.
- If the player clicks on a column where no tokens can be placed, a dialog should tell them the column is full.
- Once a token is placed, the remaining tokens should be decremented by one.
- After the player has placed their token, the player’s turn is ended and the other player’s turn should begin with a dialog (e.g., “Click to begin Bob’s
turn”).
- The game continues until one player achieves a Connect Four. The player who achieves a Connect Four is alerted with a message that they won (i.e. “Congratulations! Alice won in
insert game duration here
!”).
- Your game should keep track of the names and game durations of the 10 fastest games in local storage.
- Consider using an
Array
of JavaScript Objects
(i.e. [ { key: value } ]
)
- Only update local storage if there are less than or equal to 10 entries, or the duration of the game beats any time currently tracked in local storage.
- When the game is over, remove the board and display the top 10 list.
- Empty values should render
--
in the listing.
- Include a button to start a new game.
- Starting a new game removes the score listing.
Submission Guidelines
- DO NOT SUBMIT any IDE package files.
- You must name the main page for your game
connect-four.html
, and place it in the root directory of your repository.
- Be sure to remember to push the latest copy of your code back to your GitHub repository before the the assignment is due. At the deadline, the repositories will automatically be copied for grading. Whatever is present in your GitHub
repository at that time will be considered your submission for this assignment.
- This should all be done with a single
connect-four.html
file. You may use multiple JavaScript files, but the entire application should work on a single html
file.
- Files included in the starter repo:
README.md
/css
directory
/js
directory
/images/white-circle.png
/images/red-circle.png
/images/black-circle.png
Grading Criteria
We will download a zip archive of the repo and run the HTML/JS file created locally in the Chrome browser.
- This project will require extensive manipulation of the DOM to enable the game to run as described.
- Your game does not need to persist across page refreshes. It is acceptable for a page refresh to restart the game.
- While you are not going to be heavily graded on the style and design of your game, * it should be presented in a clear and readable manner.
Breakdown
- Turns proceed as described: 20%
- Game board is displayed properly: 20%
- Event handling is processed as described: 15%
- Birthday strings are correctly validated using regex: 5%
- Birthday strings are correctly parsed with regex and date object created according to specification: 10%
- Score saving works appropriately: 15%
- Clear and readable presentation: 5%
- Utilization of Javascript topics covered in class: 10%
- i.e. Functions, Dynamic DOM manipulation, EventHandling, type checking, etc.
Late assignments will receive zero credit.


A very simple wrapper around variable_struct_ functions.
Returns a shallow copy of this structure.
Returns whether this structure contains no key-value pairs.
Returns the number of key-value pairs in this structure.
Returns whether the given key exists in this structure.
Retrieves a value for the specified key, or undefined if it did not exist.
Adds a new key-value pair of replaces an existing one.
Attempts to replace a value by a new one.
Returns true if the value was replaced or false if the key did not exist in this structure.
Returns an array of keys in this structure.
Not ordered in a specific way, but consistent with values.
Returns an array of values in this structure.
Not ordered in a specific way, but consistent with keys.
Returns a string representation of this structure.


We want to make sure you get the vital info for meals you join.
 So we'll never sell your info or annoy you with unnecessary emails.


$028F/655: Flag: Found in directory ROM-Reference: LDA $028F : $C478 $C485 $C4AA $C4C2 STA $028F : $C4A7 $C58B $C5A8 Previous Page / Next Page


--- layout: archive title: Zulip Chat Archive permalink: /stream/116395-maths/topic/Normed.20algebras.html ---
I started thinking about formalizing normed algebras. What is the best way to avoid diamonds to module
through algebra
(path 1) and normed_space
(path 2)? Extend algebra and define coercion to normed space? Something else?
Last updated: Apr 24 2020 at 19:02 UTC


--- title: "BOO-tanically Wicked Plants" layout: "default" published: true ---
Sassafras is a deciduous tree that can grow up to 60 feet tall. In the wild it spreads by root suckers to form large colonies. It is dioecious which means male and female flowers appear on separate plants. The tree produces attractive greenish-yellow flower clusters in spring. If the female flowers are pollinated, they form bluish-black drupes (a type of fruit like plums and cherries) that mature in September. All parts of the plant are spicy and aromatic.
The roots, bark, leaves, new shoots, and pith from the branches were used extensively for a wide variety of mainly medicinal purposes by Native Americans. Infusions were made from the outer and inner portions of the roots. The infusions were taken internally to treat many ailments such as fever, diarrhea, rheumatism, measles, scarlet fever, coughs, as well as to purify the blood, as a dietary aid, a mouthwash, and gargled for colds.
Sassafras was traditionally used as the main flavoring ingredient in Root Beer. Sassafras contains safrole, which the FDA banned in 1960 due to its carcinogenic effects. Safrole was found to contribute to liver cancer in rats when given in high doses, and thus Sassafras was banned, along with Sarsparilla, another safrole containing plant. Soon after the ban, companies developed artificial flavors to replace the forbidden ingredient.
Sassafras albidum Flowers
Sassafras albidum Habit


| label = any valid exisiting label |
|
This branches the flow of the program to a designated label. With the use of Functions inside of Blitz, it isn't very practical to use Gotos, but you may still find it useful. If you require the need to return execution back to the calling statement, you may use Gosub instead. See the example.
See also: Gosub, Function. |
|
Print "The program starts ..."
Goto label1 Print "This line never gets printed .." End .label1 Print "We just jumped here!" ; wait for ESC key before ending While Not KeyHit(1) Wend |


Silly game to guess the programming language a given developer uses most based on their GitHub profile picture. All in good fun, no malice intended. I love all developers! ;)
Authentication with GitHub below is required, which uses GitHub's OAuth Web Application Flow. Click here for details on how that works.


THE CELLULOID CLOSET A film review by James Berardinelli Copyright 1996 James Berardinelli
RATING (0 TO 10): 8.5 Alternative Scale: ***1/2 out of ****
United States, 1996 U.S. Release Date: 4/5/96 (limited) Running Length: 1:40 MPAA Classification: R (Mature themes, sexual situations, nudity, profanity) Theatrical Aspect Ratio: 1.85:1
Narrated by Lily Tomlin, and featuring Tony Curtis, Whoopi Goldberg, Gore Vidal, Armistead Maupin, Tom Hanks, Harvey Fierstein, Susan Sarandon, Harry Hamlin, and others Directors: Rob Epstein and Jeffrey Friedman Screenplay: Armistead Maupin based on the book by Victor Russo U.S. Distributor: Sony Pictures Classics
While it is commonly assumed, and is often true, that the motion picture industry mirrors real life, there are instances when Hollywood has had a marked influence on society. No more is this more apparent than in the case of homosexuality.  Unfortunately, most of those lessons have been negative.
THE CELLULOID CLOSET presents a fairly comprehensive overview of how the gay/lesbian community has been portrayed in American films. Clips from dozens of motion pictures are included -- everything from 1912's ALGIE, THE MINER to 1993's PHILADELPHIA.   These include Tom Hanks, Whoopi Goldberg, Susan Sarandon, Tony Curtis, and Harvey Fierstein.
In the silent era, gay characters were used for comic relief. With exaggeratedly effeminate gestures, these thinly-drawn caricatures were foils for numerous silent stars, including Charlie Chaplin, who kissed a cross-dresser in BEHIND THE SCREEN.  This cliched image of the gay man could be found in such films as THE GAY DIVORCEE and CALL HER SAVAGE.
In the 1930s, Hollywood decided to begin censoring its own films. The result was the infamous, and largely ineffective, Hays Code.  It was also during this time that homosexuals started to appear as villains. During the 1950s, with "masculinity" on the upswing, the vitriol against being gay grew more pronounced. It's ironic that one of the biggest stars of the era was Rock Hudson, a gay man impersonating a straight man.
It wasn't until the late '60s when a few films appeared that dealt intelligently and sympathetically with homosexuality. For most of the decade, characters of "questionable sexuality" were depressed, unhappy, and suicidal -- worthy only of pity and fear. Few survived the final reel. However, with the 1968 British film, THE DETECTIVE, and 1970's THE BOYS IN THE BAND, a slow change was initiated. The attitude shift took a long time to grow roots, however, as the '70s and '80s saw many more films with gays as victimizers than as genuine characters.
THE CELLULOID CLOSET is one of the most fascinating documentaries to put Hollywood under the microscope, standing alongside the THAT'S ENTERTAINMENT series and VISIONS OF LIGHT. In about one-hundred minutes, this film convincingly defends its thesis. Along the way, it uncovers some fascinating behind-the-scenes tidbits that few in the audience will be aware of (like the motivation for scenes between Masala and Ben-Hur in BEN HUR). THE CELLULOID CLOSET is top-notch entertainment, not only because it's enjoyable, but because it argues its case with an effectiveness that would impress even a top-notch, homophobic attorney. Now, as more and more men and women emerge from the closet, it appears that Hollywood may be taking steps in that direction, as well.
- James Berardinelli e-mail<EMAIL_ADDRESS>web: http://www.cybernex.net/~berardin
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Fund Data
This part of the schema was complete rewritten from scratch.
Prior to FunsdXML4 it was very hard to distinguish between Fund and Shareclass data.
FundsXML4 has a clear separation on Fund level data (LEI) and Shareclasse level Data (ISIN) -
covering the AssetManager (Fund) view and the Investor (Shareclass) view.
FundsXML3
Node translation from FundsXML3 perspective:
| FundsXML3 Node | FundsXML4 Node | Description |
|---|---|---|
| DataSupplier | DataSupplier | Name of the Asset Manager who manges the fund. |
| Name | Names | Official Fund Name as written in the Prospectus |
| CompanyID | FundStaticData/Administrator FundStaticData/Custodian FundStaticData/InvestmentCompany |
Company Data |
| SecurityCodes | Identifiers | Identifiers of fund |
| FundCurrency | Currency | Main currency of fund (typically used by custodian for calculation of total NAV) |
| FundFacts | FundStaticData | Main static data of fund (Fiscal Year, Custody, …) |
| ProcessData | FundDynamicData | Dynamic data of fund (total values, holdings, transactions, breakdowns, …) |
| CountrySpecificData | CountrySpecificData | no difference |
FundsXML4
Node translation from FundsXML4 perspective:
| FundsXML4 Node | FundsXML3 Node | Description |
|---|---|---|
| Identifiers | SecurityCodes | Identifiers of fund |
| Names | Name | Name of the Asset Manager who manges the fund. Multiple names can be provided. One Name “OfficialName” is mandatory. |
| Currency | FundCurrency | Main currency of fund (typically used by custodian for calculation of total NAV) |
| SingleFundFlag | none | Indicates if the fund is an umbrella - otherwise set to “true”. Note: Funds with multiple shareclasses are also SingleFunds in term of FundsXML4. |
| DataSupplier | DataSupplier | Name of the Asset Manager who manges the fund. Note: if multiple Funds are transported within a single file, the DataSupplier in the ControlData node contains the name of the sender (e.g. Service Provider) and the DataSupplier of the Funds contains the name of the Fund Management Company. |
| FundStaticData | FundFacts | Main static data of fund (Fiscal Year, Custody, …) |
| FundDynamicData | ProcessData | Dynamic data of fund (total values, holdings, transactions, breakdowns, …) |
| SingleFund / Subfunds | none | This is a choice element. That means that either the Node “SingleFund” OR “Subfunds” can be delivered. |
| CountrySpecificData | CountrySpecificData | no difference |
Identifiers (4) / SecurityCodes (3)
On Fund level a LEI or - if no LEI is available - an internal Fund Code has to be provided.
If an internal Fund Code is used, it must not change in future deliveries.
|
|
FundStaticData (4) / FundFacts (3)
This node contains all Fund Static Data like:
- Inception Date
- Legal Structure (AIF, …)
- Fund Administrator
- Publication Texts (Investement Strategie, Risk Description, etc.)
- Benchmark Information (Custom Benchmark, Market Index, Blended Benchmark, Benchmark composition, Index Constituents, etc.)
Unlike in FundsXML3 there is no “ShareClassSecurityType”, “MainShareClass”, “EarningUse”, etc. This information can be found in the corresponding ShareClass nodes.
FundDynamicData (4) / ProcessData (3)
This node contains all dynamic data (“data that change on a regular basis - e.g. daily”).
The main differences are:
- Fund Volume must be transported in TotalAssetValues/TotalAssetValue node. Note: this is not the Shareclass Volume.
- Different Fund Volume types “OFFICIAL”, “ESTIMATED” and “TECHNICAL” can be transported.
- Holdings are not split into Assets, Fees and Accounts. In FundsXML4 all holdings are transported in the Portfolios/Portfolio/Positions/Position node.
- Different Risk figures can be transported (on Fund Level, Shareclass Level and Asset Level).
- Positions do have a mandatory UniqueID. This ID must also appear in the AssetMasterData node. Otherwise, the Schema Validation will fail.
Positions (4)
Positions (former Assets + Fees + Accounts) must have a UniqueID. This ID must reflect exactly one UniqueID in the AssetMasterData.
The TotalValue contains the valuation (including accrued interests) of the instrument and can be provided in different currencies. The TotalValue must be provided at least in Funds Currency and Asset Currency.
|
|
In FundsXML3 only one level of Assets exists. This leads to fields that have a multiple meaning (depending on the asset class). E.g. the field “NominalOrUnit” that was filled different depending on the corresponding asset class.


% include _blocks/head %>
<% include _blocks/tongji %>
Brand
Slide 1
Slide 2
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9
Slide 10
AZ60


Tvheadend-Hostname or IP-Address:
HTTP-Port:
HTSP-Port:
User name:
Password:
Priority of recordings:
0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant
Profile for recordings:
Use this channel type for channels taged with 'Other':
TV
Radio
Ignore
Enable live TV subtitles and multiple audio tracks (EXPERIMENTAL)
Note: enabling this feature have security implications (TVH username and password will appear in Emby logs and will be transmitted in clear text on the network). Configuration change requires Emby server restart.
Force video deinterlacing for all channels and recordings (EXPERIMENTAL)
Note: Configuration change requires Emby server restart.
Save
Cancel


{% extends 'all_photos/base.html'%} {% block content %} {{block.super}}
{{location.country}}
Welcome to my gallery collection
Description:{{photos_item.description}}
Country:{{photos_item.location.country}}
City: {{photos_item.location.city}}


Please follow the instructions in the welcome letter you received by post, and do not enter any other commands.
Stuck? Select for help: >> 'echo "your_public_ssh_key_here" >> /home/ubuntu/.ssh/authorized_keys'


Seattle.gov: Reigning over Rain City
This page serves simply to confirm that the main index.html (the client app) can be embedded in other pages.


{% extends "_post.html" %} {%hyde title: "Chema" created: 2003-11-10 21:02:43 %} {% block article %} {%article%}
Wow, talk about some shocking news. Chema Celorio died last night after a skydiving accident.
Chema was the person who got me involved with GNOME. I saw his post to the gnome-love mailing list, and decided I wanted to help out. He was more than willing to guide me along, often sinking quite a bit of time into answering my questions, etc. I met him for the first time in real life this summer on my first trip to Boston after being hired. He was staying at the company apartment in between sales trips.  Chema lived life to the max, and he will certainly be missed.
{%endarticle%} {% endblock %}


Sorry, you can't select all of them. Please deselect one first
Sorry, but you must select at least one.
Length: Entity Count
Color:


Toggle first button
Toggle second button
Toggle third button
Click to open context menu
Some title
First action
Second action
Third action
Click to open context menu
Some title
First action
Second action
Third action


Preparation time
less than 30 mins
Cooking time
less than 10 mins
Serves
Serves 4
Thie delicious and moreish squid works wonders as a dinner party starter.
For the dipping sauce, put the sugar, 50ml/2fl oz water and one tablespoon of the vinegar in a small saucepan and gently heat until the sugar dissolves, stirring constantly. Bring to the boil and cook for one minute. Add the chilli, garlic and ginger and cook for a further minute, stirring occasionally. Remove from the heat, stir in the remaining vinegar and leave to cool.
Cut the squid pieces along one side and open out. Score the inside of the cone in a criss-cross pattern with the tip of a knife, working diagonally across the flesh. Cut the tentacles into quarters. Set aside.
Put the peppercorns, chilli flakes and salt in a small pan and heat gently until you can smell the peppery aromas. Tip into a pestle and mortar and pound hard until the texture of freshly ground black pepper. Transfer to a bowl and stir in the self-raising flour and cornflour.
Place the squid into the bowl and mix together until the squid is well coated with the spiced flour. Set aside while the oil is heating. Stir the coriander into the cooled dipping sauce and pour into a small bowl set on a large plate or small serving platter.
Pour 2cm/¼ion oil into a saucepan and place over a medium heat. Put a cooking thermometer in the pan and heat the oil to 180C/350F. (CAUTION: hot oil can be dangerous. Do not leave unattended.) Alternatively, use an electric deep fat fryer to cook the squid.
When the oil reaches the right temperature, use tongs to drop a few pieces of the squid into the pan. You will need to cook it in three or four batches. Add the squid a piece at a time, so it doesn’t immediately clump together, and fry for 1-2 minutes until pale golden-brown and crisp. As soon as one batch is cooked, wait for the oil to get back to the right temperature and cook the next.
When all the squid is fried, transfer to the platter with the dipping sauce and serve immediately.


Thank You {{ name }}
Would u like to make your own Slam Book and Add Pages Having same questions written by your friend! , Give it a try as there is nothing to lose in it and even its free.
{% load static %}
Would u like to make your own Slam Book and Add Pages Having same questions written by your friend! , Give it a try as there is nothing to lose in it and even its free.


Blade Templates
- Introduction
- Displaying Data
- Blade Directives
- Components
- Building Layouts
- Forms
- Stacks
- Service Injection
- Extending Blade
Introduction
Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates. In fact, all Blade templates are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application. Blade template files use the .blade.php
file extension and are typically stored in the resources/views
directory.
Blade views may be returned from routes or controller using the global view
helper. Of course, as mentioned in the documentation on views, data may be passed to the Blade view using the view
helper's second argument:
Route::get('/', function () {
return view('greeting', ['name' => 'Finn']);
});
{tip} Before digging deeper into Blade, make sure to read the Laravel view documentation.
Displaying Data
You may display data that is passed to your Blade views by wrapping the variable in curly braces. For example, given the following route:
Route::get('/', function () {
return view('welcome', ['name' => 'Samantha']);
});
You may display the contents of the name
variable like so:
Hello, {{ $name }}.
{tip} Blade's
{{ }}
echo statements are automatically sent through PHP'shtmlspecialchars
function to prevent XSS attacks.
You are not limited to displaying the contents of the variables passed to the view. You may also echo the results of any PHP function. In fact, you can put any PHP code you wish inside of a Blade echo statement:
The current UNIX timestamp is {{ time() }}.
Rendering JSON
Sometimes you may pass an array to your view with the intention of rendering it as JSON in order to initialize a JavaScript variable. For example:

However, instead of manually calling json_encode
, you may use the @json
Blade directive. The @json
directive accepts the same arguments as PHP's json_encode
function. By default, the @json
directive calls the json_encode
function with the JSON_HEX_TAG
, JSON_HEX_APOS
, JSON_HEX_AMP
, and JSON_HEX_QUOT
flags:

{note} You should only use the
@json
directive to render existing variables as JSON. The Blade templating is based on regular expressions and attempts to pass a complex expression to the directive may cause unexpected failures.
HTML Entity Encoding
By default, Blade (and the Laravel e
helper) will double encode HTML entities. If you would like to disable double encoding, call the Blade::withoutDoubleEncoding
method from the boot
method of your AppServiceProvider
:
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Blade::withoutDoubleEncoding();
}
}
Displaying Unescaped Data
By default, Blade {{ }}
statements are automatically sent through PHP's htmlspecialchars
function to prevent XSS attacks. If you do not want your data to be escaped, you may use the following syntax:
Hello, {!! $name !!}.
{note} Be very careful when echoing content that is supplied by users of your application. You should typically use the escaped, double curly brace syntax to prevent XSS attacks when displaying user supplied data.
Blade & JavaScript Frameworks
Since many JavaScript frameworks also use "curly" braces to indicate a given expression should be displayed in the browser, you may use the @
symbol to inform the Blade rendering engine an expression should remain untouched. For example:

Laravel

Hello, @{{ name }}.
In this example, the @
symbol will be removed by Blade; however, {{ name }}
expression will remain untouched by the Blade engine, allowing it to be rendered by your JavaScript framework.
The @
symbol may also be used to escape Blade directives:
{{-- Blade template --}}
@@json()

@json()
The @verbatim
Directive
If you are displaying JavaScript variables in a large portion of your template, you may wrap the HTML in the @verbatim
directive so that you do not have to prefix each Blade echo statement with an @
symbol:
@verbatim

Hello, {{ name }}.

@endverbatim
Blade Directives
In addition to template inheritance and displaying data, Blade also provides convenient shortcuts for common PHP control structures, such as conditional statements and loops. These shortcuts provide a very clean, terse way of working with PHP control structures while also remaining familiar to their PHP counterparts.
If Statements
You may construct if
statements using the @if
, @elseif
, @else
, and @endif
directives. These directives function identically to their PHP counterparts:
@if (count($records) === 1)
I have one record!
@elseif (count($records) > 1)
I have multiple records!
@else
I don't have any records!
@endif
For convenience, Blade also provides an @unless
directive:
@unless (Auth::check())
You are not signed in.
@endunless
In addition to the conditional directives already discussed, the @isset
and @empty
directives may be used as convenient shortcuts for their respective PHP functions:
@isset($records)
// $records is defined and is not null...
@endisset
@empty($records)
// $records is "empty"...
@endempty
Authentication Directives
The @auth
and @guest
directives may be used to quickly determine if the current user is authenticated or is a guest:
@auth
// The user is authenticated...
@endauth
@guest
// The user is not authenticated...
@endguest
If needed, you may specify the authentication guard that should be checked when using the @auth
and @guest
directives:
@auth('admin')
// The user is authenticated...
@endauth
@guest('admin')
// The user is not authenticated...
@endguest
Environment Directives
You may check if the application is running in the production environment using the @production
directive:
@production
// Production specific content...
@endproduction
Or, you may determine if the application is running in a specific environment using the @env
directive:
@env('staging')
// The application is running in "staging"...
@endenv
@env(['staging', 'production'])
// The application is running in "staging" or "production"...
@endenv
Section Directives
You may determine if a template inheritance section has content using the @hasSection
directive:
@hasSection('navigation')

@yield('navigation')

@endif
You may use the sectionMissing
directive to determine if a section does not have content:
@sectionMissing('navigation')

@include('default-navigation')

@endif
Switch Statements
Switch statements can be constructed using the @switch
, @case
, @break
, @default
and @endswitch
directives:
@switch($i)
@case(1)
First case...
@break
@case(2)
Second case...
@break
@default
Default case...
@endswitch
Loops
In addition to conditional statements, Blade provides simple directives for working with PHP's loop structures. Again, each of these directives functions identically to their PHP counterparts:
@for ($i = 0; $i < 10; $i++)
The current value is {{ $i }}
@endfor
@foreach ($users as $user)

This is user {{ $user->id }}

@endforeach
@forelse ($users as $user)

{{ $user->name }}

@empty

No users

@endforelse
@while (true)

I'm looping forever.

@endwhile
{tip} When looping, you may use the loop variable to gain valuable information about the loop, such as whether you are in the first or last iteration through the loop.
When using loops you may also end the loop or skip the current iteration using the @continue
and @break
directives:
@foreach ($users as $user)
@if ($user->type == 1)
@continue
@endif

{{ $user->name }}

@if ($user->number == 5)
@break
@endif
@endforeach
You may also include the continuation or break condition within the directive declaration:
@foreach ($users as $user)
@continue($user->type == 1)

{{ $user->name }}

@break($user->number == 5)
@endforeach
The Loop Variable
When looping, a $loop
variable will be available inside of your loop. This variable provides access to some useful bits of information such as the current loop index and whether this is the first or last iteration through the loop:
@foreach ($users as $user)
@if ($loop->first)
This is the first iteration.
@endif
@if ($loop->last)
This is the last iteration.
@endif

This is user {{ $user->id }}

@endforeach
If you are in a nested loop, you may access the parent loop's $loop
variable via the parent
property:
@foreach ($users as $user)
@foreach ($user->posts as $post)
@if ($loop->parent->first)
This is the first iteration of the parent loop.
@endif
@endforeach
@endforeach
The $loop
variable also contains a variety of other useful properties:
| Property | Description |
|---|---|
$loop->index |
The index of the current loop iteration (starts at 0). |
$loop->iteration |
The current loop iteration (starts at 1). |
$loop->remaining |
The iterations remaining in the loop. |
$loop->count |
The total number of items in the array being iterated. |
$loop->first |
Whether this is the first iteration through the loop. |
$loop->last |
Whether this is the last iteration through the loop. |
$loop->even |
Whether this is an even iteration through the loop. |
$loop->odd |
Whether this is an odd iteration through the loop. |
$loop->depth |
The nesting level of the current loop. |
$loop->parent |
When in a nested loop, the parent's loop variable. |
Comments
Blade also allows you to define comments in your views. However, unlike HTML comments, Blade comments are not included in the HTML returned by your application:
{{-- This comment will not be present in the rendered HTML --}}
Including Subviews
{tip} While you're free to use the
@include
directive, Blade components provide similar functionality and offer several benefits over the@include
directive such as data and attribute binding.
Blade's @include
directive allows you to include a Blade view from within another view. All variables that are available to the parent view will be made available to the included view:

@include('shared.errors')
<form>

</form>

Even though the included view will inherit all data available in the parent view, you may also pass an array of additional data that should be made available to the included view:
@include('view.name', ['status' => 'complete'])
If you attempt to @include
a view which does not exist, Laravel will throw an error. If you would like to include a view that may or may not be present, you should use the @includeIf
directive:
@includeIf('view.name', ['status' => 'complete'])
If you would like to @include
a view if a given boolean expression evaluates to true
or false
, you may use the @includeWhen
and @includeUnless
directives:
@includeWhen($boolean, 'view.name', ['status' => 'complete'])
@includeUnless($boolean, 'view.name', ['status' => 'complete'])
To include the first view that exists from a given array of views, you may use the includeFirst
directive:
@includeFirst(['custom.admin', 'admin'], ['status' => 'complete'])
{note} You should avoid using the
__DIR__
and__FILE__
constants in your Blade views, since they will refer to the location of the cached, compiled view.
Rendering Views For Collections
You may combine loops and includes into one line with Blade's @each
directive:
@each('view.name', $jobs, 'job')
The @each
directive's first argument is the view to render for each element in the array or collection. The second argument is the array or collection you wish to iterate over, while the third argument is the variable name that will be assigned to the current iteration within the view. So, for example, if you are iterating over an array of jobs
, typically you will want to access each job as a job
variable within the view. The array key for the current iteration will be available as the key
variable within the view.
You may also pass a fourth argument to the @each
directive. This argument determines the view that will be rendered if the given array is empty.
@each('view.name', $jobs, 'job', 'view.empty')
{note} Views rendered via
@each
do not inherit the variables from the parent view. If the child view requires these variables, you should use the@foreach
and@include
directives instead.
The @once
Directive
The @once
directive allows you to define a portion of the template that will only be evaluated once per rendering cycle. This may be useful for pushing a given piece of JavaScript into the page's header using stacks. For example, if you are rendering a given component within a loop, you may wish to only push the JavaScript to the header the first time the component is rendered:
@once
@push('scripts')

@endpush
@endonce
Raw PHP
In some situations, it's useful to embed PHP code into your views. You can use the Blade @php
directive to execute a block of plain PHP within your template:
@php
$counter = 1;
@endphp
Components
Components and slots provide similar benefits to sections, layouts, and includes; however, some may find the mental model of components and slots easier to understand. There are two approaches to writing components: class based components and anonymous components.
To create a class based component, you may use the make:component
Artisan command. To illustrate how to use components, we will create a simple Alert
component. The make:component
command will place the component in the App\View\Components
directory:
php artisan make:component Alert
The make:component
command will also create a view template for the component. The view will be placed in the resources/views/components
directory. When writing components for your own application, components are automatically discovered within the app/View/Components
directory and resources/views/components
directory, so no further component registration is typically required.
You may also create components within subdirectories:
php artisan make:component Forms/Input
The command above will create an Input
component in the App\View\Components\Forms
directory and the view will be placed in the resources/views/components/forms
directory.
Manually Registering Package Components
When writing components for your own application, components are automatically discovered within the app/View/Components
directory and resources/views/components
directory.
However, if you are building a package that utilizes Blade components, you will need to manually register your component class and its HTML tag alias. You should typically register your components in the boot
method of your package's service provider:
use Illuminate\Support\Facades\Blade;
/**
* Bootstrap your package's services.
*/
public function boot()
{
Blade::component('package-alert', Alert::class);
}
Once your component has been registered, it may be rendered using its tag alias:
<x-package-alert/>
Alternatively, you may use the componentNamespace
method to autoload component classes by convention. For example, a Nightshade
package might have Calendar
and ColorPicker
components that reside within the Package\Views\Components
namespace:
use Illuminate\Support\Facades\Blade;
/**
* Bootstrap your package's services.
*
* @return void
*/
public function boot()
{
Blade::componentNamespace('Nightshade\\Views\\Components', 'nightshade');
}
This will allow the usage of package components by their vendor namespace using the package-name::
syntax:
<x-nightshade::calendar />
<x-nightshade::color-picker />
Blade will automatically detect the class that's linked to this component by pascal-casing the component name. Subdirectories are also supported using "dot" notation.
Rendering Components
To display a component, you may use a Blade component tag within one of your Blade templates. Blade component tags start with the string x-
followed by the kebab case name of the component class:
<x-alert/>
<x-user-profile/>
If the component class is nested deeper within the App\View\Components
directory, you may use the .
character to indicate directory nesting. For example, if we assume a component is located at App\View\Components\Inputs\Button.php
, we may render it like so:
<x-inputs.button/>
Passing Data To Components
You may pass data to Blade components using HTML attributes. Hard-coded, primitive values may be passed to the component using simple HTML attribute strings. PHP expressions and variables should be passed to the component via attributes that use the :
character as a prefix:
<x-alert type="error" :message="$message"/>
You should define the component's required data in its class constructor. All public properties on a component will automatically be made available to the component's view. It is not necessary to pass the data to the view from the component's render
method:
<?php
namespace App\View\Components;
use Illuminate\View\Component;
class Alert extends Component
{
/**
* The alert type.
*
* @var string
*/
public $type;
/**
* The alert message.
*
* @var string
*/
public $message;
/**
* Create the component instance.
*
* @param string $type
* @param string $message
* @return void
*/
public function __construct($type, $message)
{
$this->type = $type;
$this->message = $message;
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|\Closure|string
*/
public function render()
{
return view('components.alert');
}
}
When your component is rendered, you may display the contents of your component's public variables by echoing the variables by name:

{{ $message }}

Casing
Component constructor arguments should be specified using camelCase
, while kebab-case
should be used when referencing the argument names in your HTML attributes. For example, given the following component constructor:
/**
* Create the component instance.
*
* @param string $alertType
* @return void
*/
public function __construct($alertType)
{
$this->alertType = $alertType;
}
The $alertType
argument may be provided to the component like so:
<x-alert alert-type="danger" />
Escaping Attribute Rendering
Since some JavaScript frameworks such as Alpine.js also use colon-prefixed attributes, you may use a double colon (::
) prefix to inform Blade that the attribute is not a PHP expression. For example, given the following component:
<x-button ::class="{ danger: isDeleting }">
Submit
</x-button>
The following HTML will be rendered by Blade:
<button :class="{ danger: isDeleting }">
Submit
</button>
Component Methods
In addition to public variables being available to your component template, any public methods on the component may be invoked. For example, imagine a component that has an isSelected
method:
/**
* Determine if the given option is the currently selected option.
*
* @param string $option
* @return bool
*/
public function isSelected($option)
{
return $option === $this->selected;
}
You may execute this method from your component template by invoking the variable matching the name of the method:
<option {{ $isSelected($value) ? 'selected="selected"' : '' }} value="{{ $value }}">
{{ $label }}
</option>
Accessing Attributes & Slots Within Component Classes
Blade components also allow you to access the component name, attributes, and slot inside the class's render method. However, in order to access this data, you should return a closure from your component's render
method. The closure will receive a $data
array as its only argument. This array will contain several elements that provide information about the component:
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|\Closure|string
*/
public function render()
{
return function (array $data) {
// $data['componentName'];
// $data['attributes'];
// $data['slot'];
return '
Components content
';
};
}
The componentName
is equal to the name used in the HTML tag after the x-
prefix. So <x-alert />
's componentName
will be alert
. The attributes
element will contain all of the attributes that were present on the HTML tag. The slot
element is an Illuminate\Support\HtmlString
instance with the contents of the component's slot.
The closure should return a string. If the returned string corresponds to an existing view, that view will be rendered; otherwise, the returned string will be evaluated as an inline Blade view.
Additional Dependencies
If your component requires dependencies from Laravel's service container, you may list them before any of the component's data attributes and they will automatically be injected by the container:
use App\Services\AlertCreator
/**
* Create the component instance.
*
* @param \App\Services\AlertCreator $creator
* @param string $type
* @param string $message
* @return void
*/
public function __construct(AlertCreator $creator, $type, $message)
{
$this->creator = $creator;
$this->type = $type;
$this->message = $message;
}
Hiding Attributes / Methods
If you would like to prevent some public methods or properties from being exposed as variables to your component template, you may add them to an $except
array property on your component:
<?php
namespace App\View\Components;
use Illuminate\View\Component;
class Alert extends Component
{
/**
* The alert type.
*
* @var string
*/
public $type;
/**
* The properties / methods that should not be exposed to the component template.
*
* @var array
*/
protected $except = ['type'];
}
Component Attributes
We've already examined how to pass data attributes to a component; however, sometimes you may need to specify additional HTML attributes, such as class
, that are not part of the data required for a component to function. Typically, you want to pass these additional attributes down to the root element of the component template. For example, imagine we want to render an alert
component like so:
<x-alert type="error" :message="$message" class="mt-4"/>
All of the attributes that are not part of the component's constructor will automatically be added to the component's "attribute bag". This attribute bag is automatically made available to the component via the $attributes
variable. All of the attributes may be rendered within the component by echoing this variable:

{note} Using directives such as
@env
within component tags is not supported at this time. For example,<x-alert :live="@env('production')"/>
will not be compiled.
Default / Merged Attributes
Sometimes you may need to specify default values for attributes or merge additional values into some of the component's attributes. To accomplish this, you may use the attribute bag's merge
method. This method is particularly useful for defining a set of default CSS classes that should always be applied to a component:

merge(['class' => 'alert alert-'.$type]) }}>
{{ $message }}

If we assume this component is utilized like so:
<x-alert type="error" :message="$message" class="mb-4"/>
The final, rendered HTML of the component will appear like the following:

Conditionally Merge Classes
Sometimes you may wish to merge classes if a given condition is true
. You can accomplish this via the class
method, which accepts an array of classes where the array key contains the class or classes you wish to add, while the value is a boolean expression. If the array element has a numeric key, it will always be included in the rendered class list:

class(['p-4', 'bg-red' => $hasError]) }}>
{{ $message }}

If you need to merge other attributes onto your component, you can chain the merge
method onto the class
method:
<button {{ $attributes->class(['p-4'])->merge(['type' => 'button']) }}>
{{ $slot }}
</button>
Non-Class Attribute Merging
When merging attributes that are not class
attributes, the values provided to the merge
method will be considered the "default" values of the attribute. However, unlike the class
attribute, these attributes will not be merged with injected attribute values. Instead, they will be overwritten. For example, a button
component's implementation may look like the following:
<button {{ $attributes->merge(['type' => 'button']) }}>
{{ $slot }}
</button>
To render the button component with a custom type
, it may be specified when consuming the component. If no type is specified, the button
type will be used:
<x-button type="submit">
Submit
</x-button>
The rendered HTML of the button
component in this example would be:
<button type="submit">
Submit
</button>
If you would like an attribute other than class
to have its default value and injected values joined together, you may use the prepends
method. In this example, the data-controller
attribute will always begin with profile-controller
and any additional injected data-controller
values will be placed after this default value:

merge(['data-controller' => $attributes->prepends('profile-controller')]) }}>
{{ $slot }}

Retrieving & Filtering Attributes
You may filter attributes using the filter
method. This method accepts a closure which should return true
if you wish to retain the attribute in the attribute bag:
{{ $attributes->filter(fn ($value, $key) => $key == 'foo') }}
For convenience, you may use the whereStartsWith
method to retrieve all attributes whose keys begin with a given string:
{{ $attributes->whereStartsWith('wire:model') }}
Conversely, the whereDoesntStartWith
method may be used to exclude all attributes whose keys begin with a given string:
{{ $attributes->whereDoesntStartWith('wire:model') }}
Using the first
method, you may render the first attribute in a given attribute bag:
{{ $attributes->whereStartsWith('wire:model')->first() }}
If you would like to check if an attribute is present on the component, you may use the has
method. This method accepts the attribute name as its only argument and returns a boolean indicating whether or not the attribute is present:
@if ($attributes->has('class'))

Class attribute is present

@endif
You may retrieve a specific attribute's value using the get
method:
{{ $attributes->get('class') }}
Reserved Keywords
By default, some keywords are reserved for Blade's internal use in order to render components. The following keywords cannot be defined as public properties or method names within your components:
Slots
You will often need to pass additional content to your component via "slots". Component slots are rendered by echoing the $slot
variable. To explore this concept, let's imagine that an alert
component has the following markup:

{{ $slot }}

We may pass content to the slot
by injecting content into the component:
<x-alert>
Whoops! Something went wrong!
</x-alert>
Sometimes a component may need to render multiple different slots in different locations within the component. Let's modify our alert component to allow for the injection of a "title" slot:

{{ $title }}

{{ $slot }}

You may define the content of the named slot using the x-slot
tag. Any content not within an explicit x-slot
tag will be passed to the component in the $slot
variable:
<x-alert>
<x-slot name="title">
Server Error
</x-slot>
Whoops! Something went wrong!
</x-alert>
Scoped Slots
If you have used a JavaScript framework such as Vue, you may be familiar with "scoped slots", which allow you to access data or methods from the component within your slot. You may achieve similar behavior in Laravel by defining public methods or properties on your component and accessing the component within your slot via the $component
variable. In this example, we will assume that the x-alert
component has a public formatAlert
method defined on its component class:
<x-alert>
<x-slot name="title">
{{ $component->formatAlert('Server Error') }}
</x-slot>
Whoops! Something went wrong!
</x-alert>
Inline Component Views
For very small components, it may feel cumbersome to manage both the component class and the component's view template. For this reason, you may return the component's markup directly from the render
method:
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|\Closure|string
*/
public function render()
{
return <<<'blade'

{{ $slot }}

blade;
}
Generating Inline View Components
To create a component that renders an inline view, you may use the inline
option when executing the make:component
command:
php artisan make:component Alert --inline
Anonymous Components
Similar to inline components, anonymous components provide a mechanism for managing a component via a single file. However, anonymous components utilize a single view file and have no associated class. To define an anonymous component, you only need to place a Blade template within your resources/views/components
directory. For example, assuming you have defined a component at resources/views/components/alert.blade.php
, you may simply render it like so:
<x-alert/>
You may use the .
character to indicate if a component is nested deeper inside the components
directory. For example, assuming the component is defined at resources/views/components/inputs/button.blade.php
, you may render it like so:
<x-inputs.button/>
Data Properties / Attributes
Since anonymous components do not have any associated class, you may wonder how you may differentiate which data should be passed to the component as variables and which attributes should be placed in the component's attribute bag.
You may specify which attributes should be considered data variables using the @props
directive at the top of your component's Blade template. All other attributes on the component will be available via the component's attribute bag. If you wish to give a data variable a default value, you may specify the variable's name as the array key and the default value as the array value:

@props(['type' => 'info', 'message'])

merge(['class' => 'alert alert-'.$type]) }}>
{{ $message }}

Given the component definition above, we may render the component like so:
<x-alert type="error" :message="$message" class="mb-4"/>
Dynamic Components
Sometimes you may need to render a component but not know which component should be rendered until runtime. In this situation, you may use Laravel's built-in dynamic-component
component to render the component based on a runtime value or variable:
<x-dynamic-component :component="$componentName" class="mt-4" />
Manually Registering Components
{note} The following documentation on manually registering components is primarily applicable to those who are writing Laravel packages that include view components. If you are not writing a package, this portion of the component documentation may not be relevant to you.
When writing components for your own application, components are automatically discovered within the app/View/Components
directory and resources/views/components
directory.
However, if you are building a package that utilizes Blade components or placing components in non-conventional directories, you will need to manually register your component class and its HTML tag alias so that Laravel knows where to find the component. You should typically register your components in the boot
method of your package's service provider:
use Illuminate\Support\Facades\Blade;
use VendorPackage\View\Components\AlertComponent;
/**
* Bootstrap your package's services.
*
* @return void
*/
public function boot()
{
Blade::component('package-alert', AlertComponent::class);
}
Once your component has been registered, it may be rendered using its tag alias:
<x-package-alert/>
Autoloading Package Components
Alternatively, you may use the componentNamespace
method to autoload component classes by convention. For example, a Nightshade
package might have Calendar
and ColorPicker
components that reside within the Package\Views\Components
namespace:
use Illuminate\Support\Facades\Blade;
/**
* Bootstrap your package's services.
*
* @return void
*/
public function boot()
{
Blade::componentNamespace('Nightshade\\Views\\Components', 'nightshade');
}
This will allow the usage of package components by their vendor namespace using the package-name::
syntax:
<x-nightshade::calendar />
<x-nightshade::color-picker />
Blade will automatically detect the class that's linked to this component by pascal-casing the component name. Subdirectories are also supported using "dot" notation.
Building Layouts
Layouts Using Components
Most web applications maintain the same general layout across various pages. It would be incredibly cumbersome and hard to maintain our application if we had to repeat the entire layout HTML in every view we create. Thankfully, it's convenient to define this layout as a single Blade component and then use it throughout our application.
Defining The Layout Component
For example, imagine we are building a "todo" list application. We might define a layout
component that looks like the following:

<title>{{ $title ?? 'Todo Manager' }}</title>

Todos

{{ $slot }}

Applying The Layout Component
Once the layout
component has been defined, we may create a Blade view that utilizes the component. In this example, we will define a simple view that displays our task list:

<x-layout>
@foreach ($tasks as $task)
{{ $task }}
@endforeach
</x-layout>
Remember, content that is injected into a component will be supplied to the default $slot
variable within our layout
component. As you may have noticed, our layout
also respects a $title
slot if one is provided; otherwise, a default title is shown. We may inject a custom title from our task list view using the standard slot syntax discussed in the component documentation:

<x-layout>
<x-slot name="title">
Custom Title
</x-slot>
@foreach ($tasks as $task)
{{ $task }}
@endforeach
</x-layout>
Now that we have defined our layout and task list views, we just need to return the task
view from a route:
use App\Models\Task;
Route::get('/tasks', function () {
return view('tasks', ['tasks' => Task::all()]);
});
Layouts Using Template Inheritance
Defining A Layout
Layouts may also be created via "template inheritance". This was the primary way of building applications prior to the introduction of components.
To get started, let's take a look at a simple example. First, we will examine a page layout. Since most web applications maintain the same general layout across various pages, it's convenient to define this layout as a single Blade view:

<title>App Name - @yield('title')</title>

@section('sidebar')
This is the master sidebar.
@show

@yield('content')

As you can see, this file contains typical HTML mark-up. However, take note of the @section
and @yield
directives. The @section
directive, as the name implies, defines a section of content, while the @yield
directive is used to display the contents of a given section.
Now that we have defined a layout for our application, let's define a child page that inherits the layout.
Extending A Layout
When defining a child view, use the @extends
Blade directive to specify which layout the child view should "inherit". Views which extend a Blade layout may inject content into the layout's sections using @section
directives. Remember, as seen in the example above, the contents of these sections will be displayed in the layout using @yield
:

@extends('layouts.app')
@section('title', 'Page Title')
@section('sidebar')
@@parent

This is appended to the master sidebar.

@endsection
@section('content')

This is my body content.

@endsection
In this example, the sidebar
section is utilizing the @@parent
directive to append (rather than overwriting) content to the layout's sidebar. The @@parent
directive will be replaced by the content of the layout when the view is rendered.
{tip} Contrary to the previous example, this
sidebar
section ends with@endsection
instead of@show
. The@endsection
directive will only define a section while@show
will define and immediately yield the section.
The @yield
directive also accepts a default value as its second parameter. This value will be rendered if the section being yielded is undefined:
@yield('content', 'Default content')
Forms
CSRF Field
Anytime you define an HTML form in your application, you should include a hidden CSRF token field in the form so that the CSRF protection middleware can validate the request. You may use the @csrf
Blade directive to generate the token field:
<form method="POST" action="/profile">
@csrf
...
</form>
Method Field
Since HTML forms can't make PUT
, PATCH
, or DELETE
requests, you will need to add a hidden _method
field to spoof these HTTP verbs. The @method
Blade directive can create this field for you:
<form action="/foo/bar" method="POST">
@method('PUT')
...
</form>
Validation Errors
The @error
directive may be used to quickly check if validation error messages exist for a given attribute. Within an @error
directive, you may echo the $message
variable to display the error message:

Post Title
<input id="title" type="text" class="@error('title') is-invalid @enderror">
@error('title')

{{ $message }}

@enderror
Since the @error
directive compiles to an "if" statement, you may use the @else
directive to render content when there is not an error for an attribute:

Email address
<input id="email" type="email" class="@error('email') is-invalid @else is-valid @enderror">
You may pass the name of a specific error bag as the second parameter to the @error
directive to retrieve validation error messages on pages containing multiple forms:

Email address
<input id="email" type="email" class="@error('email', 'login') is-invalid @enderror">
@error('email', 'login')

{{ $message }}

@enderror
Stacks
Blade allows you to push to named stacks which can be rendered somewhere else in another view or layout. This can be particularly useful for specifying any JavaScript libraries required by your child views:
@push('scripts')

@endpush
You may push to a stack as many times as needed. To render the complete stack contents, pass the name of the stack to the @stack
directive:

@stack('scripts')

If you would like to prepend content onto the beginning of a stack, you should use the @prepend
directive:
@push('scripts')
This will be second...
@endpush
// Later...
@prepend('scripts')
This will be first...
@endprepend
Service Injection
The @inject
directive may be used to retrieve a service from the Laravel service container. The first argument passed to @inject
is the name of the variable the service will be placed into, while the second argument is the class or interface name of the service you wish to resolve:
@inject('metrics', 'App\Services\MetricsService')

Monthly Revenue: {{ $metrics->monthlyRevenue() }}.

Extending Blade
Blade allows you to define your own custom directives using the directive
method. When the Blade compiler encounters the custom directive, it will call the provided callback with the expression that the directive contains.
The following example creates a @datetime($var)
directive which formats a given $var
, which should be an instance of DateTime
:
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Blade::directive('datetime', function ($expression) {
return "<?php echo ($expression)->format('m/d/Y H:i'); ?>";
});
}
}
As you can see, we will chain the format
method onto whatever expression is passed into the directive. So, in this example, the final PHP generated by this directive will be:
<?php echo ($var)->format('m/d/Y H:i'); ?>
{note} After updating the logic of a Blade directive, you will need to delete all of the cached Blade views. The cached Blade views may be removed using the
view:clear
Artisan command.
Custom If Statements
Programming a custom directive is sometimes more complex than necessary when defining simple, custom conditional statements. For that reason, Blade provides a Blade::if
method which allows you to quickly define custom conditional directives using closures. For example, let's define a custom conditional that checks the configured default "disk" for the application. We may do this in the boot
method of our AppServiceProvider
:
use Illuminate\Support\Facades\Blade;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Blade::if('disk', function ($value) {
return config('filesystems.default') === $value;
});
}
Once the custom conditional has been defined, you can use it within your templates:
@disk('local')

@elsedisk('s3')

@else

@enddisk
@unlessdisk('local')

@enddisk