text:
---
title: Role-Based Access Control
summary: This document introduces TiDB RBAC operations and implementation.
aliases: ['/docs/dev/role-based-access-control/','/docs/dev/reference/security/role-based-access-control/']
---

# Role-Based Access Control

The implementation of TiDB's role-based access control (RBAC) system is similar to that of MySQL 8.0. TiDB is compatible with most RBAC syntax of MySQL.

This document introduces TiDB RBAC-related operations and implementation.

## RBAC operations

A role is a collection of a series of privileges. You can do the following operations:

- Create a role.
- Delete a role.
- Grant a privilege to a role.
- Grant a role to another user. That user can obtain the privileges involved in the role, after enabling the role.

### Create a role

For example, you can use the following statement to create roles `r_1` and `r_2`:

{{< copyable "sql" >}}

```sql
CREATE ROLE `r_1`@`%`, `r_2`@`%`;
```

For the role naming format and rule, see [TiDB User Account Management](/user-account-management.md).

Roles are stored in the `mysql.user` table. The name of the role you are trying to create must be unique; otherwise, an error is reported.

To create a role, you need the `CREATE ROLE` or `CREATE USER` privilege.

### Delete a role

For example, you can use the following statement to delete roles `r_1` and `r_2`:

{{< copyable "sql" >}}

```sql
DROP ROLE `r_1`@`%`, `r_2`@`%`;
```

This operation deletes role records in the `mysql.user` table, removes related records in the authorization table, and terminates role-related authorization relationship.

To delete a role, you need the `DROP ROLE` or `DROP USER` privilege.

### Grant a privilege to a role

The operation of granting a privilege to a role is the same with that of granting a privilege to a user. For details, see [TiDB Privilege Management](/privilege-management.md).

For example, you can use the following statement to grant the `analyst` role the privilege to read the `test` database:

{{< copyable "sql" >}}

```sql
GRANT SELECT ON test.* TO 'analyst'@'%';
```

You can use the following statement to grant the `analyst` role all privileges on all databases:

{{< copyable "sql" >}}

```sql
GRANT ALL PRIVILEGES ON *.* TO 'analyst'@'%';
```

### Revoke a privilege

For example, you can use the following statement to revoke all privileges on the `test` database granted to the `analyst` role:

{{< copyable "sql" >}}

```sql
REVOKE ALL PRIVILEGES ON `test`.* FROM 'analyst'@'%';
```

For details, see [TiDB Privilege Management](/privilege-management.md).

### Grant a role to a user

For example, you can use the following statement to grant both roles `role1` and `role2` to users `user1@localhost` and `user2@localhost`:

{{< copyable "sql" >}}

```sql
GRANT 'role1', 'role2' TO 'user1'@'localhost', 'user2'@'localhost';
```

To grant a role to another user or revoke a role, you need the `SUPER` privilege.

Granting a role to a user does not mean enabling the role immediately. Enabling a role is another operation.

The following operations might form a "relation loop:"

```sql
CREATE USER 'u1', 'u2';
CREATE ROLE 'r1', 'r2';

GRANT 'u1' TO 'u1';
GRANT 'r1' TO 'r1';

GRANT 'r2' TO 'u2';
GRANT 'u2' TO 'r2';
```

TiDB supports this multi-level authorization relationship. You can use it to implement privilege inheritance.

### Revoke a role

Revoke roles `role1` and `role2` from users `user1@localhost` and `user2@localhost`.

{{< copyable "sql" >}}

```sql
REVOKE 'role1', 'role2' FROM 'user1'@'localhost', 'user2'@'localhost';
```

The operation of revoking a role from a user is atomic. If you fail to revoke a role, this operation rolls back.

### Set the default role

After a role is granted to a user, it does not take effect immediately. Only after the user enables this role, he can use the privilege the role owns.

You can set default roles for a user. When the user logs in, the default roles are automatically enabled.

{{< copyable "sql" >}}

```sql
SET DEFAULT ROLE
    {NONE | ALL | role [, role ] ...}
    TO user [, user ]
```

For example, you can use the following statement to set default roles of `test@localhost` to `administrator` and `developer`:

{{< copyable "sql" >}}

```sql
SET DEFAULT ROLE administrator, developer TO 'test'@'localhost';
```

You can use the following statement to set default roles of `test@localhost` to all roles:

{{< copyable "sql" >}}

```sql
SET DEFAULT ROLE ALL TO 'test'@'localhost';
```

You can use the following statement to disable all default roles of `test@localhost`:

{{< copyable "sql" >}}

```sql
SET DEFAULT ROLE NONE TO 'test'@'localhost';
```

> **Note:**
>
> You need to grant the role to the user before you set the default role to this role.

### Enable a role in the current session

You can enable some role(s) in the current session.

```sql
SET ROLE {
    DEFAULT
  | NONE
  | ALL
  | ALL EXCEPT role [, role ] ...
  | role [, role ] ...
}
```

For example, you can use the following statement to enable roles `role1` and `role2` that are valid only in the current session:

{{< copyable "sql" >}}

```sql
SET ROLE 'role1', 'role2';
```

You can use the following statement to enable the default role of the current user:

{{< copyable "sql" >}}

```sql
SET ROLE DEFAULT
```

You can use the following statement to enable all roles granted to the current user:

{{< copyable "sql" >}}

```sql
SET ROLE ALL
```

You can use the following statement to disable all roles:

{{< copyable "sql" >}}

```sql
SET ROLE NONE
```

You can use the following statement to enable roles except `role1` and `role2`:

{{< copyable "sql" >}}

```sql
SET ROLE ALL EXCEPT 'role1', 'role2' --
```

> **Note:**
>
> If you use `SET ROLE` to enable a role, this role is valid only in the current session.

### Check the current enabled role

The current user can use the `CURRENT_ROLE()` function to check which role has been enabled by the current user.

For example:

1. You can grant roles to `u1'@'localhost`:

    {{< copyable "sql" >}}

    ```sql
    GRANT 'r1', 'r2' TO 'u1'@'localhost';
    ```

    {{< copyable "sql" >}}

    ```sql
    SET DEFAULT ROLE ALL TO 'u1'@'localhost';
    ```

2. After `u1` logs in, you can execute the following statement:

    {{< copyable "sql" >}}

    ```sql
    SELECT CURRENT_ROLE();
    ```

    ```
    +-------------------+
    | CURRENT_ROLE()    |
    +-------------------+
    | `r1`@`%`,`r2`@`%` |
    +-------------------+
    ```

    {{< copyable "sql" >}}

    ```sql
    SET ROLE 'r1'; SELECT CURRENT_ROLE();
    ```

    ```
    +----------------+
    | CURRENT_ROLE() |
    +----------------+
    | `r1`@`%`       |
    +----------------+
    ```

### Check a role's privileges

You can use the `SHOW GRANTS` statement to check which role has been granted to the user.

To check privilege-related information of another user, you need the `SELECT` privilege on the `mysql` database.

{{< copyable "sql" >}}

```sql
SHOW GRANTS FOR 'u1'@'localhost';
```

```
+---------------------------------------------+
| Grants for u1@localhost                     |
+---------------------------------------------+
| GRANT USAGE ON *.* TO `u1`@`localhost`      |
| GRANT `r1`@`%`,`r2`@`%` TO `u1`@`localhost` |
+---------------------------------------------+
```

You can use the `USING` option of `SHOW GRANTS` to check a role's privileges:

{{< copyable "sql" >}}

```sql
SHOW GRANTS FOR 'u1'@'localhost' USING 'r1';
```

```
+---------------------------------------------+
| Grants for u1@localhost                     |
+---------------------------------------------+
| GRANT USAGE ON *.* TO `u1`@`localhost`      |
| GRANT Select ON `db1`.* TO `u1`@`localhost` |
| GRANT `r1`@`%`,`r2`@`%` TO `u1`@`localhost` |
+---------------------------------------------+
```

{{< copyable "sql" >}}

```sql
SHOW GRANTS FOR 'u1'@'localhost' USING 'r2';
```

```
+-------------------------------------------------------------+
| Grants for u1@localhost                                     |
+-------------------------------------------------------------+
| GRANT USAGE ON *.* TO `u1`@`localhost`                      |
| GRANT Insert, Update, Delete ON `db1`.* TO `u1`@`localhost` |
| GRANT `r1`@`%`,`r2`@`%` TO `u1`@`localhost`                 |
+-------------------------------------------------------------+
```

{{< copyable "sql" >}}

```sql
SHOW GRANTS FOR 'u1'@'localhost' USING 'r1', 'r2';
```

```
+---------------------------------------------------------------------+
| Grants for u1@localhost                                             |
+---------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `u1`@`localhost`                              |
| GRANT Select, Insert, Update, Delete ON `db1`.* TO `u1`@`localhost` |
| GRANT `r1`@`%`,`r2`@`%` TO `u1`@`localhost`                         |
+---------------------------------------------------------------------+
```

You can use `SHOW GRANTS` or `SHOW GRANTS FOR CURRENT_USER()` to check the current user's privileges. There is a difference between these two statements:

- `SHOW GRANTS` shows the privilege of the enabled role for the current user.
- `SHOW GRANTS FOR CURRENT_USER()` does not show the enabled role's privilege.

### Authorization table

In addition to four system [privilege tables](/privilege-management.md#privilege-table), the RBAC system introduces two new system privilege tables:

- `mysql.role_edges`: records the authorization relationship of the role and user.
- `mysql.default_roles`: records default roles of each user.

#### `mysql.role_edges`

`mysql.role_edges` contains the following data:

{{< copyable "sql" >}}

```sql
select * from mysql.role_edges;
```

```
+-----------+-----------+---------+---------+-------------------+
| FROM_HOST | FROM_USER | TO_HOST | TO_USER | WITH_ADMIN_OPTION |
+-----------+-----------+---------+---------+-------------------+
| %         | r_1       | %       | u_1     | N                 |
+-----------+-----------+---------+---------+-------------------+
1 row in set (0.00 sec)
```

- `FROM_HOST` and `FROM_USER` indicate the role's host name and user name respectively.
- `TO_HOST` and `TO_USER` indicate the host name and user name of the user to which a role is granted.

#### `mysql.default_roles`

`mysql.default_roles` shows which roles have been enabled by default for each user.

{{< copyable "sql" >}}

```sql
select * from mysql.default_roles;
```

```
+------+------+-------------------+-------------------+
| HOST | USER | DEFAULT_ROLE_HOST | DEFAULT_ROLE_USER |
+------+------+-------------------+-------------------+
| %    | u_1  | %                 | r_1               |
| %    | u_1  | %                 | r_2               |
+------+------+-------------------+-------------------+
2 rows in set (0.00 sec)
```

- `HOST` and `USER` indicate the user's host name and user name respectively.
- `DEFAULT_ROLE_HOST` and `DEFAULT_ROLE_USER` indicate the host name and user name of the default role respectively.

### References

Because RBAC, user management, and privilege management are closely related, you can refer to operation details in the following resources:

- [TiDB Privilege Management](/privilege-management.md)
- [TiDB User Account Management](/user-account-management.md)

repository: mmyj/docs

repo_name: mmyj/docs


text:
---
title: " Residual Water Suppression Using the Squared Eigenfunctions of the Schrodinger Operator"
authors:
- admin
- Sourav Bhaduri
- Mohamed Maoui
- Eric Achten
- Hacene Serrai
- Taous-Meriem Laleg-Kirati

date: "2019-12-01T00:00:00Z"
doi: ""

# Schedule page publish date (NOT publication's date).
publishDate: "2020-01-01T00:00:00Z"

# Publication type.
# Legend: 0 = Uncategorized; 1 = Conference paper; 2 = Journal article;
# 3 = Preprint / Working Paper; 4 = Report; 5 = Book; 6 = Book section;
# 7 = Thesis; 8 = Patent
publication_types: ["2"]

# Publication name and optional abbreviated publication name.
publication: "*IEEE Access Journal*"
publication_short: "IEEE-Access"

abstract: Water suppression, in proton magnetic resonance spectroscopy (MRS) using post-processing techniques, is very challenging due to the large amplitude of the water line, which shadows the metabolic peaks with small amplitudes and complicates their quantification. In addition, the peak-shaped structure of these spectra and the relatively small number of data points representing them makes the suppression process more cumbersome. In this paper, a post-processing water suppression technique based on the Schrodinger operator is proposed. The method is based on the decomposition of the input MRS spectrum, using the squared eigenfunctions of a semi-classical Schrodinger operator.

# Summary. An optional shortened abstract.
summary: We developed a post-processing water suppression technique based on the squared eigenfunctions of the Schrodinger operator.

tags:
- MRS
- SCSA
- Diagnosis

featured: false

links:
- icon: twitter
  icon_pack: fab
  name: Follow
  url: https://twitter.com/Chahid_Abderraz

- icon: facebook
  icon_pack: fab
  name: Follow
  url: https://www.facebook.com/abderrazak.chahid.714

- icon: linkedin-in
  icon_pack: fab
  name: Follow
  url: https://www.linkedin.com/in/abderrazak-chahid-09b65948/

url_pdf: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=8720157

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
image:
  caption: Illustration of the brain abnormal activities for different types of epileptic seizure
  focal_point: Smart

# Associated Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `internal-project` references `content/project/internal-project/index.md`.
#   Otherwise, set `projects: []`.
projects:
- SCSA-project

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
#slides: example
---

Research reported in this publication was supported by King Abdullah University of Science and Technology (KAUST) in collaboration with  Ghent university. The authors would like to thank Dr. Sabine Van Huffel from the University of Leuven for the use of the HLSVD software, Ms. Patricia Clement and Ghent Institute for Functional and Metabolic Imaging (GIfMI) team for their help in the in vivo data acquisition.

license: MIT

repository: ChahidAbderrazak/academic-website

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: ChahidAbderrazak/academic-website


text:
# Propylean.h
Propylean means Process/Production + Python + lean programming
## Objective
The objective of the project is to create a C/C++ header file which will help engineers simulate production plants focusing on chemical and related process industries.
By coupling this library with available data analysis/machine learning frameworks, engineers will be able to enhace operations of their plants. Ultimate aspiration of this project is to enable process industries transit to zero carbon operation.

Futher documentation will be created on how to utilize this library as project takes shape.

NOTE: This project follows Propylean python library project. For further details please visit Propylean github page https://github.com/abhishekvraman/Propylean.

branch_name: refs/heads/main


text:
---
layout: default
---

# 1996-05-18 - key signing at cyberpayments?

## Header Data

From: "P.J. Ponder"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 6f4394ea18cc27951049cd6d2b3626da2dd9cc74555388974f08935265c58442

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-05-18 20:15:55 UTC

Raw Date: Sun, 19 May 1996 04:15:55 +0800

## Raw message

```
{% raw  %}From: "P.J. Ponder"<EMAIL_ADDRESS>Date: Sun, 19 May 1996 04:15:55 +0800
To<EMAIL_ADDRESS>Subject: key signing at cyberpayments?
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

if anyone is attending the cyberpayments conference in Dallas
June 17th or so and is interested in PGP key signing, please
advise in private mail or to the list.  Thank you.
--
pj ponder

{% endraw %}
```

## Thread

+ Return to [May 1996](/archive/1996/05)

+ Return to "["P.J. Ponder" <ponder@wane-leon-mail.scri.fsu.edu>](/authors/p_j_ponder_ponder_at_waneleonmail_scri_fsu_edu_)"

+ 1996-05-18 (Sun, 19 May 1996 04:15:55 +0800) - key signing at cyberpayments? - _"P.J. Ponder"<EMAIL_ADDRESS>

gha_license_id: MIT


text:
---
layout: post
title: Our paper "Can learned frame prediction compete with block motion compensation for video coding?"
style: wide
---

Our paper titled "Can learned frame prediction compete with block motion compensation for video coding?" is published on Springer Journal of Signal, Image and Video Processing. The supplementary material is presented at the bottom of this page.

The paper is available on [Springer Link](https://link.springer.com/article/10.1007%2Fs11760-020-01751-y) and on [ArXiv](https://arxiv.org/abs/2007.08922). Our paper can be cited as:

    @article{sulun2021can,
        title={Can learned frame prediction compete with block motion compensation for video coding?},
        author={Sulun, Serkan and Tekalp, A Murat},
        journal={Signal, Image and Video Processing},
        publisher={Springer Science and Business Media LLC},
        volume={15},
        number={2},
        pages={401--410},
        year={2021}}

# ABSTRACT

Given recent advances in learned video prediction, we investigate whether a simple video codec using a pre-trained deep model for next frame prediction based on previously encoded/decoded frames without sending any motion side information can compete with standard video codecs based on block-motion compensation. Frame differences given learned frame predictions are encoded by a standard still-image (intra) codec. Experimental results show that the rate-distortion performance of the simple codec with symmetric complexity is on average better than that of x264 codec on 10 MPEG test videos, but does not yet reach the level of x265 codec. This result demonstrates the power of learned frame prediction (LFP), since unlike motion compensation, LFP does not use information from the current picture. The implications of training with L1, L2, or combined L2 and adversarial loss on prediction performance and compression efficiency are analyzed.

# SUPPLEMENTARY MATERIAL

Here are the qualitative results for our learned video prediction models. In particular, we compare the performance of two models, one trained with L2 loss (L2) and the other with adversarial loss and L2 loss combined (GAN). All results belong to the 9th frames of each video. The slideshow provides an easy way to compare images, enabling navigation using the arrow keys of the keyboard. Below the slideshow, ground-truth and prediction images are available at their original size.

# City - Frame 9

## Ground-truth

![](../images/lfp/gt_city_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_city_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_city_009.png)

# Coastguard - Frame 9

## Ground-truth

![](../images/lfp/gt_coastguard_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_coastguard_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_coastguard_009.png)

# Container - Frame 9

## Ground-truth

![](../images/lfp/gt_container_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_container_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_container_009.png)

# Football - Frame 9

## Ground-truth

![](../images/lfp/gt_football_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_football_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_football_009.png)

# Foreman - Frame 9

## Ground-truth

![](../images/lfp/gt_foreman_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_foreman_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_foreman_009.png)

# Garden - Frame 9

## Ground-truth

![](../images/lfp/gt_garden_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_garden_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_garden_009.png)

# Hall monitor - Frame 9

## Ground-truth

![](../images/lfp/gt_hall_monitor_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_hall_monitor_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_hall_monitor_009.png)

# Harbour - Frame 9

## Ground-truth

![](../images/lfp/gt_harbour_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_harbour_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_harbour_009.png)

# Mobile - Frame 9

## Ground-truth

![](../images/lfp/gt_mobile_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_mobile_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_mobile_009.png)

# Tennis - Frame 9

## Ground-truth

![](../images/lfp/gt_tennis_009.png)

## Prediction of L2 model

![](../images/lfp/pred_L2_tennis_009.png)

## Prediction of GAN model

![](../images/lfp/pred_GAN_tennis_009.png)

gha_language: HTML


text:
# Cycle Sort

#### Problem Statement

Given an unsorted array of n elements, write a function to sort the array

#### Approach

- If the element is already at its correct position do nothing
- Otherwise, find the correct position of a by counting the total number of elements that are less than current element
- Insert current element into its correct position
- Set replaced element as new current element and find its correct position
- Continue process until array is sorted

#### Time Complexity

`O(n^2)` Worst case performance

`O(n^2)` Best-case performance

`O(n^2)` Average performance

#### Space Complexity

`O(n)` Worst case

#### Application of algorithm

- Cycle sort algorithm is useful for situations where memory write or element swap operations are costly.

#### Example

A single cycle of sorting array | b | d | e | a | c |

```
1. Select element for which the cycle is run, i.e. "b".

|b|d|e|a|c|

b - current element

2. Find correct location for current element and update current element.

|b|b|e|a|c|

d - current element

3. One more time, find correct location for current element and update current element.

|b|b|e|d|c|

a - current element

4. Current element is inserted into position of initial element "b" which ends the cycle.

|a|b|e|d|c|

a - current element

5. New cycle should be started for next element.
```

#### Video Explanation

[A video explaining the Cycle Sort Algorithm](https://www.youtube.com/watch?v=gZNOM_yMdSQ)

#### The Algorithms Page

[Cycle Sort](https://the-algorithms.com/algorithm/cycle-sort)

repository: TheAlgorithms/Algorithms-Explanation

path: /en/Sorting Algorithms/Cycle Sort.md

filename: Cycle Sort.md

repo_name: TheAlgorithms/Algorithms-Explanation


text:
---
hrs_structure:
  division: '1'
  volume: '3'
  title: '12'
  chapter: '200'
  section: 200-25
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0200-0025
    parent: HRS0200
    name: 200-25 Fines and penalties
weight: 114165
title: Fines and penalties
full_title: 200-25 Fines and penalties
---
**§200-25** **Fines and penalties.** Any person violating this part, or any rule adopted pursuant to this part, shall be fined not less than $50 and not more than $1,000 or sentenced to a term of imprisonment of not more than thirty days, or both, for each violation; provided that in addition to, or as a condition to the suspension of, the fines and penalties, the environmental court may deprive the offender of the privilege of operating any vessel, including but not limited to any thrill craft or vessel engaged in parasailing or water sledding, in the waters of the State for a period of not more than thirty days. [L 1991, c 272, pt of §2; am L 1997, c 204, §2; am L 2014, c 218, §8]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
{title: sw_fsub, link: sw_fsub, summary: simple graph vertex coloring, keywords: sample,
  sidebar: sw_sidebar, permalink: sw_fsub, folder: swfiles, mathjax: true}

---

### Syntax

`cgraph = sw_fsub(conn, next)`

### Description

`cgraph = sw_fsub(conn, next)` creates a simple graph vertex coloring,
determines non-connected sublattices for Monte-Carlo calculation.

### Input Arguments

`conn`
: Contains edge indices which are connected
  `conn(1,idx)-->conn(2,idx)` stored in a matrix with dimensions of $$[2times n_{conn}]$$.

`nExt`
: Size of the magnetic supercell in a row vector with 3 integers.

### Output Arguments

`cGraph`
: Vector, that assigns every magnetic moment to a sublattice.

### See Also

[spinw.anneal](spinw_anneal)

{% include links.html %}


text:
# NW4Mac Builder

#### Easily build and deploy NW.js-based OSX apps

![Screenshot](http://s8.postimg.org/rurqjrn0l/Screen_Shot_2015_07_04_at_14_18_05.png)

**The package includes:**

- An easy compiler & runner
- Nw.js
- AngularJS
- Twitter Bootstrap
- Handlebars

**How to use it:**

- Download the .zip archive with all sources
- Go into /app and edit any files you need (index.html and core/main.coffee are your entry points)
- Run `./compile.sh` *(to compile)* or `./run.sh` *(to build and execute)*, on the root directory

**Prerequisites:**

- Before trying to compile/run any project, you must first download Nw.js from [here](http://dl.nwjs.io/v0.12.2/nwjs-v0.12.2-osx-x64.zip), unzip the archive and copy all of its contents (mainly `nwjs.app`) in here (in the `/bin` folder).

- Install CoffeeScript (`sudo npm install -g coffee-script`)

- Install LESS (`sudo npm install -g less`)

-----

##### Issue Tracker

Bug reports about all aspects of the tool are welcome. To let me know about anything, just use the Issues page here on GitHub.

##### Copyright and License Information

Copyright (c) 2015 Ioannis Zafeiropoulos (aka Dr.Kameleon).
All rights reserved.

See the file "LICENSE" for information on the history of this software, terms &
conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

All trademarks referenced herein are property of their respective holders.


text:
# Frontend Mentor - Interactive pricing component solution

This is a solution to the [Interactive pricing component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/interactive-pricing-component-t0m8PIyY8). Frontend Mentor challenges help you improve your coding skills by building realistic projects.

## Table of contents

- [Overview](#overview)
  - [The challenge](#the-challenge)
  - [Screenshots](#screenshots)
  - [Links](#links)
- [My process](#my-process)
  - [Built with](#built-with)
  - [What I learned](#what-i-learned)
  - [Continued development](#continued-development)
  - [Useful resources](#useful-resources)
- [Author](#author)

## Overview

### The challenge

Users should be able to:

- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Use the slider and toggle to see prices for different page view numbers

### Screenshots

Desktop version

![desktop version](./screenshots/desktop-version.png)

Tablet version

![tablet version](./screenshots/tablet-version.png)

Mobile version

![mobile version](./screenshots/mobile-version.png)

### Links

- Solution URL: [Code on GitHub](https://github.com/santu369/frontendmentor-interactive-pricing-component)
- Live Site URL: [Netlify Live URL](https://santu369-frontendmentor-interactive-pricing-component.netlify.app/)

## My process

Worked on Mobile first approach, then added media queries, adjusting the layout.
Used Bootstrap and clamp to set font sizes.
Implemented webpack bundler in this project.
Used different configs for dev and prod builds.

### Built with

- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- Mobile-first workflow
- BEM Methodology
- SASS
- CSS Animations
- Bootstrap
- Webpack Bundler

### What I learned

Learned to implement webpack bundler and creating toggle and slider components.
Understanding the concept of shadow dom which we can see in different browsers which are implemented differently. So we need to target them with different selectors specific for each of them. These are supposedly experimental features and not consistent across browers.

Webpack bundler is used for bundling the build files and we can use content hash to make sure our deployment works on a normal reload for the user since content hash changes for deployments based on the content it holds.

Whlie working with Webpack, we need to use a lot of loaders and plugins based on our requirement. I have used a couple of loaders for css and js to be added to the build, some plugins for adding the linking the final html page with css and js fiels.

### Continued development

Will experiment with Gulp task runner and implement it in next project.
Webpack seems to be a little too much for a small project like this one.

### Useful resources

- [Sass](https://sass-lang.com/) - Installing and Learning Sass.
- [BEM](https://en.bem.info/methodology/quick-start/) - Quick Start with BEM.
- [W3C Markup Validation Service](https://validator.w3.org/) - Validator for checking the markup validity of Web documents in HTML, XHTML, SMIL, MathML, etc.
- [W3C CSS Validation Service](https://jigsaw.w3.org/css-validator/) - Check Cascading Style Sheets (CSS) and (X)HTML documents with style sheets.
- [Reset CSS](https://meyerweb.com/eric/tools/css/reset/) - Strips away all the default browser styling.
- [@media>prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) - CSS media feature is used to detect if the user has requested that the system minimize the amount of non-essential motion it uses.
- [Bootstrap CSS](https://getbootstrap.com/docs/5.0/getting-started/introduction/) - Getting started with Bootstrap.
- [Webpack Module Bundler](https://webpack.js.org/) - Static module bundler for modern JavaScript applications.

  - [Webpack loaders](https://webpack.js.org/loaders/) - Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or “load” them.

    - [svgo-loader](https://www.npmjs.com/package/svgo-loader) - A loader for webpack to pass your SVG files through svgo optimizer. It needs to work with either file-loader or url-loader.
    - [url-loader](https://www.npmjs.com/package/url-loader) - Lets you import arbitrary files, like images.
    - [mini-css-extract-plugin](https://webpack.js.org/plugins/mini-css-extract-plugin/) - Extracts CSS into separate files.
    - [css-loader](https://www.npmjs.com/package/css-loader) - Handles bundling CSS assets.
    - [postcss-loader](https://www.npmjs.com/package/postcss-loader) - tool for transforming styles with JS plugins. These plugins can lint your CSS, support variables and mixins, transpile future CSS syntax (adding vendor prefixes), inline images, and more.
    - [sass-loader](https://www.npmjs.com/package/sass-loader) - Used for compiling SCSS/Sass files.
    - [babel-loader](https://www.npmjs.com/package/babel-loader) - A tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain features natively, Babel will help you compile those features down to a supported version.

  - [Webpack plugins](https://webpack.js.org/concepts/plugins/) - Plugins can be leveraged to perform a wider range of tasks like bundle optimization, asset management and injection of environment variables.

    - [clean-webpack-plugin](https://www.npmjs.com/package/clean-webpack-plugin) - Plugin to remove/clean your build folder(s).
    - [html-webpack-plugin](https://www.npmjs.com/package/html-webpack-plugin) - Simplifies creation of HTML files to serve your webpack bundles.
    - [mini-css-extract-plugin](https://www.npmjs.com/package/mini-css-extract-plugin) - Extracts CSS into separate files.
    - [HotModuleReplacementPlugin](https://webpack.js.org/plugins/hot-module-replacement-plugin/) - Enables Hot Module Replacement, otherwise known as HMR.

## Author

- Website - [Shiva Santosh Jana](https://santu369.github.io/FreeCodeCamp-PersonalPortfolioWebpage)
- Frontend Mentor - [@santu369](https://www.frontendmentor.io/profile/santu369)
- Twitter - [@santu69](https://www.twitter.com/santu69)


text:
---
layout: page
permalink: /agda-installation/
title: "Agda Installation"
---

#### Installation instructions for Linux

Install the latest versions of `cabal-install` and of `emacs` via your
package manager, then open a
terminal and run the commands

```
cabal update
cabal install alex happy Agda
agda-mode setup
```

Note that even if your Linux distribution has an `agda` package
available it might not be recent
enough, so you should use the instructions above (in particular
Debian, Ubuntu, and Fedora all seem
to have outdated versions of Agda in their repositories).

#### Installation instructions for Mac OS X

Homebrew provides prebuilt packages for OS X. Install Homebrew and then run

```
brew install agda
agda-mode setup
```

Hopefully this should be all that is needed.

#### Installation instructions for Windows

Download emacs from
[http://ftpmirror.gnu.org/emacs/windows/emacs-26/emacs-26.2-x86_64.zip]
and
unzip it somewhere (preserving the directory structure). You can now
run emacs with the
`bin\runemacs.exe` executable. Feel free to create a desktop shortcut to it.

Download and install the Haskell Platform from
[https://www.haskell.org/platform/windows].

Open the Windows command prompt and run the following two commands.
The second command will take a
rather long time as it will compile Agda from scratch together will
all of its dependencies.

```
cabal update
cabal install Agda
```

Create a file called `.emacs` (with the leading period) in the directory
`C:\Users\##yourusername##\AppData\Roaming` containing the following two lines

```
(load-file (let ((coding-system-for-read 'utf-8))
                (shell-command-to-string "agda-mode locate")))
```

#### Testing

You can test your installation as follows.

Open Emacs and create a new file (File > Visit New File…) that you
name `test.agda`. You should see
`(Agda)` on the bottom of the window.

Type the text below in the file (type! do not copy-paste!).

```
postulate \bN : Set
```

As you type, the `\bN` should automatically change to a blackboard
bold `N`. If it turns to a box or
to something weird, there is something wrong with your fonts. Type
`Ctrl-C` followed by `Ctrl-L`, it
should now show `(Agda:Checked)` at the bottom of the buffer.

gha_language: CSS


text:
# Commandline Password Manager
A Simple commandline password manager written in ruby

It encrypts the passwords with a masterkey and stores it in file for
easy acess. Store the file in your google drive folder for backup and to make it
accessible from any machine.

Each password entry has a username-password combination along with the
name and url for the service.

# Requirements
* ruby
* gem highline
* pbcopy (so this currently only works in osx)

# Usage
* ruby ./passman.rb add|get|delete|edit|generate

* add an alias in your bash/zshrc file for easy access
i.e. alias passman="ruby path_to_passmanrb"

repository: dipil-saud/passman

repo_name: dipil-saud/passman


text:
# pass chrome extension

`pass chrome extension` is a Google Chrome extension for
[zx2c4's pass](http://www.passwordstore.org/). It's based on
[dotjs](https://github.com/defunkt/dotjs).

## Things pass chrome extension does

* Retrieves passwords for the current tab website
* Fills in username/password and submits the login form (auto login)

## Things pass chrome extension does not

* Manage passwords

## Requirements

* `pass`. Obviously, `pass` must be installed and working.
`pass chrome extension` need `pass` to have a certain format:

```
Password Store
├── facebook.com
│   └──<EMAIL_ADDRESS>```

* Ruby. Any vendored ruby would be fine since it doesn't use any gem.
* Google Chrome

## How it works

* `pass` runs a tiny webserver on port 3131.
* When you click on the `pass` icon, it will query for passwords for the
current tab domain. For example, if you visit `http://www.facebook.com`, it
will query for passwords for `facebook.com`.
* If one or more passwords match the domain, it will let you choose which one
you'd like to use.
* Once you click on the desired option, it will fill in username and password
into the sign in box (if any).

## Installing

```bash
$ git clone git@github.com:patriciomacadden/pass-chrome-extension.git
$ cd pass-chrome-extension
$ rake install
```

Then, manually install `pass-chrome-extension.crx` by dropping it in
`chrome://extensions` page.

## Uninstalling

```bash
$ rake uninstall
```

Then, manually uninstall `pass-chrome-extension` from the `chrome://extensions`
page.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## License

See the [LICENSE](https://github.com/patriciomacadden/pass-chrome-extension/blob/master/LICENSE).

repository: andrey-str/pass-chrome-extension

repo_name: andrey-str/pass-chrome-extension


text:
SmsBiuras Notifier
==================

Provides [SmsBiuras](https://www.smsbiuras.lt) integration for Symfony Notifier.

DSN example
-----------

```
SMSBIURAS_DSN=smsbiuras://UID:API_KEY@default?from=FROM&test_mode=0
```

where:
 - `UID` is your client code
 - `API_KEY` is your SmsBiuras api key
 - `FROM` is your sender
 - `TEST_MODE` the test parameter is used during system connection testing.
   Possible values: 0 (real SMS sent), 1 (test SMS, will not be delivered to the phone and will not be charged)

Resources
---------

 * [Contributing](https://symfony.com/doc/current/contributing/index.html)
 * [Report issues](https://github.com/symfony/symfony/issues) and
   [send Pull Requests](https://github.com/symfony/symfony/pulls)
   in the [main Symfony repository](https://github.com/symfony/symfony)

repository: symfony/symfony

gha_language: PHP

repo_name: symfony/symfony


text:
---
layout: post
title: Testing model validations with RSpec 3+
tags: ["rails", "rspec"]
excerpt: "There are certainly many ways that Rails model validations can be tested. You can find three of them in this article."
tweet: "Three ways to test your Rails model validations."
---

There are many ways of testing a Rails model validations. Let's explore a few of them. We will test a very simple `Books` model, that requires to have a title:

```ruby
class Book < ActiveRecord::Base
  validates :title, presence: true
end
```
Before we start testing, plese consider that the RSpec version used for the following tests is 3.1.0.

Ok, now let's begin the tests. First you'll want to make sure that we can create the a book, and we have no errors in our code, so in our `book_spec.rb` we can test with:

```ruby
describe "book" do
    it 'creates a new book with valid info' do
      Book.create(title: "Test Book")
      expect(Book.last.title).to eq("Test Book")
    end
  end
```

Now we can think about a few methods to test our `title` validation:

### The `invalid` method

```ruby
describe "title" do
  it "is required" do
    book = Book.new(title: "")
    expect(book).to be_invalid
    # also working with:
    # expect(book).not_to be_valid
  end
end
```

While this will pass, verifying that our title is indeed needed in order to create a book, the test itself. For example, if we have more validators for the Book, we are not sure that our `book` is invalid because of the `title`.

### The `error_on` method

The `error_on` will solve the above issue:

```ruby
describe "title" do
  it "is required" do
    book = Book.new(title: "")
    expect(book).to have(1).error_on(:title)
  end
end
```

This way we are targeting the attribute `title` as well as the number of errors generated. Please mind that this test uses the `collection_matchers` module that is now separated of RSpec core. You will need to add the `gem 'rspec-collection_matchers'` in the **Gemfile** and `require 'rspec/collection_matchers'` in the **spec_helper.rb**.

### The `shoulda` gem
Add `gem 'shoulda'` in the **Gemfile**, `require 'shoulda'` in the **spec_helper.rb**, and then write your shoulda test:

```ruby
describe "title" do
  it { should validate_presence_of(:title) }
end
```
And that's it. The test will pass.

Personally I like the shoulda gem, but considering it was created for Rails 3 and not updated in years, maybe the 2nd option is safer.


text:
# Terragrunt Setup

[Terragrunt](https://terragrunt.gruntwork.io/)

- Move to terraform directory
- `terraform login`
- enter `yes`
- paste in the tfc secret provided by your tfc owner
- `terragrunt init`

# How env mapping works in pathfinder

- Locals will typically be set in the top-most hcl file
- Notice the funcs used for the environment key; this parses the pwd to get the closest dir name, which is usually dev/prod/test/sandbox
- So you want to `cd` to the workspace directory to "switch workspaces" i.e. be in `terraform/dev/` to apply changes to your dev workspace
- Common workspace configuration values (eg: ram) can created for access in the `terraform/config.yaml` file
- You can also provision per-workspace S3 buckets in the `terraform/config.yaml` configuration file

# Sandbox difference

Sandbox points directly to the pathfinder team's modules. it can be used to create shared services like ECR and is similar to the tools namespace of Openshift.
Note that in the case of ECR, an output will be produced showing a link to the registry.

The sandbox workspace is version controlled but currently does not have drift detected during deploys.
This is because sandbox contains business critical data. eg: If the ECR is deleted, all images are deleted.

# How terragrunt and the modules relate to the pipeline

- The AWS pipeline runs on PR and detects drift via `terragrunt` which does passthrough of to `terraform`
- `terraform` connects to `terraform cloud` and checks it's state file, which is maintained in the pathfinder team's `terraform cloud` account
- This state file is compared to current cloud resources and drift is displayed in the `plan`
- following a successful check via `terragrunt plan` (equivalent to `terraform plan`) the pipeline runs a `terragrunt apply`
- the `terragrunt apply` updates the cloud resources and state file to be equivalent based on the terraform module code.

# How to test

- `cd` to the workspace of your choice, usualy `dev` so `terraform/dev`. This will make terragrunt target the workspace based on your `pwd`
- `terragrunt plan` and then `terragrunt apply` if successful

`Note:` a successful plan does not guarantee a successful apply. Provider issues such as race conditions, or cyclical dependencies can occur, especially with security groups.

- `terragrunt state list` to fetch the list of currently provisioned cloud resources
- `terragrunt taint <state.name>` to mark a resource as faulty, it will be destroyed at next apply
- `terragrunt destroy` tear down all cloud resources in the workspace

# Tidbits

- [Terragrunt Example](https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example)

# discord_sysdig_webhook - Discord Webhook service for Sysdig

discord_sysdig_webhook.tf contains the resources for the web service used to connect
Sysdig to Discord. At the time of writing, Sysdig's webhook messages are not in the
format required for Discord's webhook API, thus, we created this service to format the
messages properly so that we can get infrastructure monitoring and alerting to our Discord server.

## Gotchas

The key "prod/mds/discord-webhook-link" is the webhook link for the #alerts channel in the Discord server. This secret was added manually and is required for the service to work. If it is removed, be sure to create a new secret in AWS Secrets Manager that contains a working webhook link to the #alerts or your desired text channel.

This project is run with terragrunt using Terraform Cloud as the backend to store its state. This project is currently deployed in prod and we only need ONE copy of this. To rebuild/deploy/redeploy this project, navigate to the prod directory and run:

`terragrunt apply`

There are AWS Cloudwatch log groups attached to the lambda function and the API gateway resources for this project. If you need to check the logs on either service, login to AWS and check for their log groups or navigate to each resource and check their logs.

To see the names of the log groups, you should be able to get the information from running:

`terragrunt show`

# Sysdig Alerts

This section covers the Sysdig Alerts that are sourced / deployed / provisioned with Terraform.

## Gotchas

As of September 15th, 2022, the notification channel  id for Discord notifications
is 77077. If you need to create a new channel, use the following request

` curl -X GET https://app.sysdigcloud.com/api/notificationChannels -H 'Authorization: Bearer <sysdig_api_token>' `

to get the notification channel id and use that id for each of the alerts here.

- [Refer here for severity and status codes](https://docs.sysdig.com/en/docs/sysdig-monitor/events/severity-and-status/)

The key ____ is the Sysdig Monitor API token This secret was added manually and is required to successfully deploy/redeploy the alerts. If it is changed, update the secret within AWS Secrets Manager (currently prod).

repository: bcgov/mds

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: bcgov/mds


text:
# LM1117-3.3

Linear regulator from 3.6V to 3.3V (current of 0.8A), developed to be used in Ground Station Mobile "Alcântara".

# Schematic

![LM1117-3.3](https://github.com/MarcusMoraisEpifane/Design-Blocks/blob/master/KiCad/LM1117-3.3/Esquem%C3%A1tico_LM1117-3.3.png)

# Layout

![LM1117-3.3](https://github.com/MarcusMoraisEpifane/Design-Blocks/blob/master/KiCad/LM1117-3.3/Layout_LM1117-3.3.png)

# Tests

## Validation

Circuit awaiting manufacture.

# B.O.M.
|Component|Amount|Description|
|--|--|--|
|LM1117-3.3|1|3.3V Voltage Regulator 800-mA|
|Capacitor|2|10 uF SMD 1206 Tantalum|

repository: zenitheesc/Design-Blocks

repo_name: zenitheesc/Design-Blocks


text:
# Contributing CoderDojo Twin Cities Arduino Resources

We are an all-volunteer group of mentors, teachers and programmers that love the help children learn about the wonders of computer science.  We think that
Arduino programming is one of the best ways to keep our students engaged in STEM programs.

But we can't do this without your help!

We need a variety of people with many different skills and interests.  If you are not a programmer, that is OK.  We still have many tasks you can help us with.

Here are just a few items we need help with:

1. **Organizing special events**  Are you good at organizing?  We need you!  For example every year we teach girls how to use Arduino to create colorful Arduino costumes.
2. **Reviewing Content**  Got a knack for grammar?  We can always use help editing our growing library of Arduino materials.
3. **Course Design**  Are you good at designing courses for students?  We have many groups that would like to repackage our Arduino materials for specific groups such as girls in scouts, local programming clubs, environmental organizations, or schools that have specific curriculum needs.
4.  Just try to go through our labs and see what you like or don't like.  The tell us what we can improve.
5. **Mentoring Students** Every year CoderDojo is flooded with students that would like to learn coding.  We never have enough mentors.  Even if you don't have strong computer programming skills we think you can be a great mentor for our students.

## Volunteer Now!

Click here to sign up as a volunteer or mentor:
[https://coderdojotc.org/mentor_signup/](https://coderdojotc.org/mentor_signup/)

For questions just send email to ```hello [at] coderdojotc dot org```

repository: CoderDojoTC/arduino

repo_name: CoderDojoTC/arduino


text:
# dnd-assistant
A Discord bot that offers a lot of neat features for your D&D server

# Desired Features
- Dice Rolling
  - Any sided dice
  - Arbitrary amounts of die
  - Arbitrary number of rolls given a dice expression
- Histogram generator for arbitrary dice expressions
- Quote features
  - Save Quotes
  - Export Quotes (as a DM)
- Support for rolling on specific tables (BS table, madness table, etc)
- Macros

# Implemented Features

repository: emberian/dice-wench

repo_name: emberian/dice-wench


text:
# 65C02 CPU emulator written in Go

Writing this just for fun and to clear out some of the cob-webs.

Intended to support the full 65C02 instruction set and provide an interface allowing the implementation of a "bus emulator" for memory and device I/O, allowing external implementation of ROM/RAM and peripherals e.g. UART.


text:
Translator: Andrea McDonough

Reviewer: Bedirhan Cinar
You know what the greatest secret of history is?
It's that history can be changed.
And, yeah, yeah, I know,
everyone says history can't be changed,
but it can.
And today we're going to talk about
how history isn't just something that goes backwards,
history goes forward too.
And all those great things that haven't happened yet,
that's history that's just waiting to be written.
So how do you change history?

It's true.
I stole the idea from a friend of mine
who told me what his father used to share with him.
Every single night, when I tuck my kids into bed,

I tell them these three things:
dream big,
work hard,
and stay humble.
So let's look at them all.
First, dream big.
You know who has the biggest, best dreams of all?
You, young people.
You know how old Martin Luther King, Jr. was
when he became the leader
of the most famous bus boycott in history?
He was 26.
You know how old Amelia Earhart was
when she broke her first world record?
25
You know how old Steve Jobs was
when he co-founded Apple Computer?
21
And you know how old Jerry Siegel and Joe Shuster were
when they came up with their idea for the greatest superhero of all time,
the first one, that they named "Superman"?
These guys were 17 years old!
Two 17-year-old kids created Superman.
They weren't good looking.
(Look at the picture, right?)
They weren't popular.
They had no money,
but they were two best friends with one dream.
And with just their imaginations,
they gave the world Superman.
And I know, creating Superman is a once-in-a-lifetime big dream,
so I want to tell you about Alexandra Scott.
She goes by Alex.
Alex was diagnosed with cancer
before she was even a year old,

and that was the only life she knew:
sickness, chemotherapy, and surgery.
When she was four, Alex asked her parents
could she put a lemonade stand in the front yard?
She didn't want to buy anything for herself,
she wanted to use the money
to give it to doctors to help other kids with cancer.
OK, in a single day, Alex's lemonade stand raised $2,000!

But, here's what I love:
soon after that, other lemonade stands started popping up,
all with Alex's name on it.
Eventually, they raised $200,000.
And then Alex had a new goal.
She said let's raise $1,000,000.
On June 12, 2004,
hundreds of lemonade stands started opening up
in every state in the country.
Ordinary people selling water and sugar and lemons
to help kids with cancer.
Nearly two months later,
Alex died while her parents were holding her hands.
She was 8 years old.
But before she died, Alex said that next year's goal
should be $5,000,000.
Today, her dream has raised over $45,000,000
and it is still going strong!
One idea, one girl, one big dream.
And you know what she said?
This is a direct quote before she died.
She said, "Oh, we can do it!
If other people will help me, I think we can do it.

And that leads me to the second thing I tell my kids:
work hard.
Such a simple one, everyone knows this one.
Work hard.
I saw this one for my father
and my father died a few months ago.
When I was growing up in Brooklyn,
ok, my father, he worked hard.
He had no money, we had, no money growing up.
He worked every Saturday, every Sunday.
I watched first-hand every weekend what hard work was.
And I saw that the hardest work of all
is being resilient when you're facing failure.
When I started writing my first book,
my first book got me 24 rejection letters.
To be clear, there are only 20 publishers,
I got 24 rejection letters, OK?
That means that some people were writing me twice
to make sure I got the point.
But it wasn't until I was writing my ninth book,
a book of heroes for my son,
that I found my favorite story of working hard through failure.
It was a story that a friend told me about the Wright brothers.
That every time the Wright brothers went out to fly their plane,
they would bring enough extra materials for multiple crashes.
That means for every time they went out,
they knew they would fail.
And they would crash and rebuild,
and crash and rebuild,
and that's why they took off.
I love that story.
I wanted my son to hear that story,
I wanted my daughter to hear that story,
I wanted everyone to know that if you dream big
and you work hard and you fight failure,
you will change history
and do what no one on this planet has ever done before.

And that leads me to the final thing I tell them:
stay humble.

Here's the thing:
if you invent the world's first airplane,
or Superman,
or a multi-million dollar lemonade stand,
you don't need to be humble.
You can get a tattoo on your face that says, "I'm the best!"
Right?

In fact, the world needs fewer loudmouths,
so stay humble!
When Thomas Jefferson wrote the Declaration of Independence,
you know he never took credit for writing it while he was alive?
It wasn't until he died and it was in his obituary
that the average American found out that he was the author.
That's humble.

So how do you change history?

OK? No, I'm serious, this is it.

The only question is, do you hear the call?

And that leads me to the most important thing I'm going to tell you here:
you will change history.
Some of you will change it in big ways,
affecting millions of people.
Others of you will do it in more personal ways,
helping a family member or someone who needs it.
But let me tell you right now,
one is not more important than the other.
If you help people in mass or one-by-one,
that's how history gets changed,
when you take action.
But when you start writing your story
and you get scared, as we all inevitably do,

I want you to know one thing:
no one is born a hero.

They had moments where they worried about school
and friendships
and would they be accepted by others,
like you, like me.
They had moments where they worried about loneliness and failure
and would they ever succeed,
like you, like me.
But the best part is, you don't have to start
a multi-million dollar lemonade stand to change the world,
all you got to do is help one person,
be kind to one person, that's the answer.
It's my core belief,
it is in every story I just told you.
I believe ordinary people change the world.

I believe in regular people and their ability to affect change in this world.
I believe in my father,
and a 25 year old daredevil named Amelia,
and a little girl who sells lemonade like nobody's business.
And it's why I believe in that very first hero we were talking about today, Superman.
To me, the most important part of the story isn't Superman.
The most important part of the story is Clark Kent.
And you want to know why?
Because we're all Clark Kent.
We all know what it's like to be boring and ordinary
and wish we could do something incredibly beyond ourselves.

But here's the real news:
we all can do something incredibly beyond ourselves.
I got 24 rejection letters on my first book,
24 people who told me to give it up,
and I don't look back on the experience and say,
"I was right, and they were wrong, and haha on them."
What I look back and realize is that every single one of those rejection letters
told me to work harder, to dream bigger,
and you better believe it,
made me more humble,
but it also made me want it more than anything.
So whatever it is you dream big about,
whatever it is you work hard for,
don't let anyone tell you,
you're too young
and don't let anyone tell you no.
Every life makes history.
And every life is a story.
Thank you.

repository: prewittdavon/TEDVis

gha_language: Python

repo_name: prewittdavon/TEDVis


text:
# GitLab CI

Below are some example GitLab CI jobs that use GoReleaser to release a project.

> If you are using private hosted or Enterprise version of GitLab, please follow this [guide](/scm/gitlab/) before diving into the details.

## Basic Releasing

You can easily run GoReleaser in GitLab CI using its Docker container.

In the repository's GitLab CI settings, add a `GITLAB_TOKEN` variable. The value should
be an API token with `api` scope for a user that has access to the project. This
variable should be masked and optionally protected if the job will only run on
protected branches and tags.

!!! warning
    If you use a project access token, make sure to set `use_package_registry`
    to `true` as well, otherwise it might not work.

!!! warning
    If you are using a [protected variable](https://docs.gitlab.com/ee/ci/variables/#protected-cicd-variables)
    to store any of the values needed by goreleaser, ensure that you are protecting the tags as CI jobs in
    Gitlab only may access protected variables if the job is run for protected refs
    ([branches](https://docs.gitlab.com/ee/user/project/protected_branches.html),
    [tags](https://docs.gitlab.com/ee/user/project/protected_tags.html)).

See [Quick Start](https://goreleaser.com/quick-start/) for more information on
GoReleaser's environment variables.

Add a `.gitlab-ci.yml` file to the root of the project:

```yaml
stages:
  - release

release:
  stage: release
  image:
    name: goreleaser/goreleaser
    entrypoint: ['']
  only:
    - tags
  variables:
    # Disable shallow cloning so that goreleaser can diff between tags to
    # generate a changelog.
    GIT_DEPTH: 0
  script:
    - goreleaser release --clean
```

Notice that `entrypoint` is intentionally blank. See the
[GitLab documentation on entrypoints](https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#overriding-the-entrypoint-of-an-image)
for more information.

When tags are pushed to the repository,
an available GitLab Runner with the Docker executor will pick up the release job.
`goreleaser/goreleaser` will start in a container, and the repository will be mounted inside.
Finally, the `script` section will run within the container starting in your project's directory.

## Releasing Archives and Pushing Images

Pushing images to a registry requires using Docker-in-Docker. To create GitLab releases and push
images to a Docker registry, add a file `.gitlab-ci.yml` to the root of the project:

```yaml
stages:
  - release

release:
  stage: release
  image: docker:stable
  services:
    - docker:dind

  variables:
    # Optionally use GitLab's built-in image registry.
    # DOCKER_REGISTRY: $CI_REGISTRY
    # DOCKER_USERNAME: $CI_REGISTRY_USER
    # DOCKER_PASSWORD: $CI_REGISTRY_PASSWORD

    # Or, use any registry, including the official one.
    DOCKER_REGISTRY: https://index.docker.io/v1/

    # Disable shallow cloning so that goreleaser can diff between tags to
    # generate a changelog.
    GIT_DEPTH: 0

  # Only run this release job for tags, not every commit (for example).
  only:
    refs:
      - tags

  script: |
    # GITLAB_TOKEN is needed to create GitLab releases.
    # DOCKER_* are needed to push Docker images.
    docker run --rm --privileged \
      -v $PWD:/go/src/gitlab.com/YourGitLabUser/YourGitLabRepo \
      -w /go/src/gitlab.com/YourGitLabUser/YourGitLabRepo \
      -v /var/run/docker.sock:/var/run/docker.sock \
      -e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY  \
      -e GITLAB_TOKEN \
      goreleaser/goreleaser release --clean
```

In GitLab CI settings, add variables for `DOCKER_REGISTRY`, `DOCKER_USERNAME`,
and `DOCKER_PASSWORD` if you aren't using the GitLab image registry. If you are
using the GitLab image registry, you don't need to set these.

Add a variable `GITLAB_TOKEN` if you are using [GitLab
releases](https://docs.gitlab.com/ce/user/project/releases/). The value should
be an API token with `api` scope for a user that has access to the project.

Alternatively, you can provide the gitlab token in a file. GoReleaser will check
`~/.config/goreleaser/gitlab_token` by default, but you can change that in the
`.goreleaser.yaml` file:

```yaml
# .goreleaser.yaml
env_files:
  gitlab_token: ~/.path/to/my/gitlab_token
```

Note that the environment variable will be used if available, regardless of the
`gitlab_token` file.

The secret variables, `DOCKER_PASSWORD` and `GITLAB_TOKEN`, should be masked.
Optionally, you might want to protect them if the job that uses them will only
be run on protected branches or tags.

Make sure the `image_templates` in the file `.goreleaser.yaml` reflect that
custom registry!

Example:

```yaml
dockers:
-
  goos: linux
  goarch: amd64
  image_templates:
  - 'registry.gitlab.com/Group/Project:{{ .Tag }}'
  - 'registry.gitlab.com/Group/Project:latest'
```

## Example Repository

You can check [this example repository](https://gitlab.com/goreleaser/example) for a real world example.

Example release on GitLab.

repository: goreleaser/goreleaser

gha_language: Go

repo_name: goreleaser/goreleaser


text:
# FOCUS mobile application demonstrator

Demonstrator for the LIGNA 2015 fair. Only the minimal requirements for this
event have been implemented.

There are still probably many bugs, but due to the short life time of this
demonstrator, we didn't put too much effort in finalizing everything. However,
it is ready to accept other scenarios quite easily.

## Build process

````
$ cd focus-app-demonstrator
$ npm install
$ ./grunt build-dev
````

See `Gruntfile.js` for other possible build tasks.

## License

This software is released under the commercial-friendly and open-source MIT license.

````
The MIT License (MIT)

Copyright (c) 2015 Berner Fachhochschule (BFH) - www.bfh.ch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````

repository: focusnet/focus-app-demonstrator

repo_name: focusnet/focus-app-demonstrator


text:
# PredatorControl

Teaches a policy for controlling a toy ecosystem simulation with a population of lions and gazelles.
Created as an exercise for learning Bonsai. This is based on the [cartpole-py](https://github.com/microsoft/cartpole-py) sample.

# How to Run

* Run tests by installing and executing `pytest`.
* Run locally by setting the environment variables `SIM_ACCESS_KEY` and `SIM_WORKSPACE`. Then execute `python __main__.py`.
* Build and push a simulator container by executing `BuildAndPushContainer.bat`.
* Train the simulation using the online Bonsai workspace, creating a Brain and pasting the contents of [predator_control.ink](/predator_control.ink) into the Train tab.

repository: ForrestTrepte/BonsaiPredatorControl

repo_name: ForrestTrepte/BonsaiPredatorControl


text:
# BIDS_spm_preprocessing

Group SPM preprocessing script for longitudinal data in BIDS (Brain Imaging Data Structure)

Script and functions are prepared for preprocessing of fMRI data obtained for my research project:
"Temporal dynamics of functional connectivity changes induced by cognitive training",
in which participants were fMRI scanned four time during intensive working memory training.

Script iterates over all subjects, 4 scanning sessions and selected tasks.

SPM12 batch functions perform a standard fMRI data preprocessing
pipeline (slice-timing, head motion correction, coregistration functional data to structural,
new unified segmentation-normalization, and smoothing (8x8x8).

repository: kfinc/bids-spm-preprocessing

repo_name: kfinc/bids-spm-preprocessing


text:
---
title: Local files to Github - No problem
layout: post
author: sahil.gupta
permalink: /local-files-to-github-no-problem/
source-id: 1Kuowyt-vMIDxBPgmubYR6ZiqZ4RCt420QPhbebMT8WM
published: true
---

    Title:
    Getting local files stored on drive to github for usage.

    Date:
    28/6/17

    Starting point:
    I had no idea how to complete this task.

    Target for this lesson?
    To finish the task and find how to create a link from an image stored in drive.

    Did I reach my target?
(add details to "Lesson Review")
    Yes, I managed to complete the task but it took a long time.

    Lesson Review

    How did I learn? What strategies were effective?

    I tried many different methods and eventually I reached the correct one. I got my teacher to help me as well as we both didn't know. Researching also came in handy.

    What limited my learning? Which habits do I need to work on?

    I found it hard to focus on it because I ran out of ways to try. I need to give a problem my full attention.

    What will I change for next time? How will I improve my learning?

    I will use logical thinking to solve such problems in the future.


text:
# Docker Web Development Stack (DWDS)

Docker Containers (as microservice approach), which are executed with `docker-compose` as a multi-container application (stack).

> Develop only through the container.

> Each container should have only one concern.

## Images and Containers

- **Persistent storage** (Application and Data Volume Container).
  - `./src/frontend`
  - `./src/backend`
  - `./storage/db.data`
  - `./storage/gitea.data`
- [**NGINX**](https://www.nginx.com/) Web server. Deliver the frontend `./application/frontend/dist` and provide API access via proxy forwarder.
- **PHP 7.4.x (CLI)** with Composer, PHP CodeSniffer, phpDocumentor, phpunit and XDebug (Multi Stage) for development.
- [**MariaDB**](https://mariadb.org/) SQL database.
- [**Adminer**](https://www.adminer.org/) for database administration.
- [**Grafana**](https://grafana.com/) logging.
  - Loki: log aggregator
  - Promtail: Agent which will read up the contents of the log file/files and ship those logs to Loki
- [**Gitea**](https://gitea.io/) Repository and Issue tracker.
- [**MailDev**](https://github.com/maildev/maildev) SMTP Server + Web Interface for viewing and testing emails during development.

## Initial services configuration

### Gitea

- To access gitea from your development environment you should set `SSH-Server-Domain` and `Gitea-Base-URL` to an appropriate resolvable name or IP address.
- Add the administration user on setup or the first user registered will be the admin
- Gitea supports Git over SSH. You might be familiar with this when you work with GitHub repositories. You need to create a key pair on your computer and add the public key under _Your Settings_ -> _SSH / GPG Keys_ . Copy and paste the public key into the Content text field then click the green Add Key button.

### Logging

The Docker plugin must be installed on each Docker host that will be running containers you want to collect logs from. [Read Docker Driver Client](https://grafana.com/docs/loki/latest/clients/docker-driver/)

```bash
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
```

Add loki to docker container:

```byaml
    logging:
      driver: loki
      options:
        loki-url: "http://loki:3100/loki/api/v1/push"
      driver: "json-file"
      options:
        tag: "{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}"
```

* [Check loki URL: http://<ip_address>:7431/metrics](http://localhost:7431/metrics)
* [Check promtail URL: http://<ip_address>:9080](http://localhost:7431/metrics)

Additional setup steps and informations:

* [Monitoring your docker container’s logs the Loki way](https://itnext.io/monitoring-your-docker-containers-logs-the-loki-way-e9fdbae6bafd) and [Log Aggregation With Grafana+Loki+Promtail](https://cloudsbaba.com/log-aggregation-with-grafanalokipromtail/)
* [Loki Syslog All-In-One example](https://computingforgeeks.com/forward-logs-to-grafana-loki-using-promtail/)
* [Running loki and grafana on docker swarm](https://drailing.net/2020/06/running-loki-and-grafana-on-docker-swarm/)

## .env Environment

Environment variables allow us to manage the configuration of our applications separate from our codebase. Separating configurations make it easier for our application to be deployed in different environments. **Note:** Values in the shell take precedence over those specified in the `.env` file.

- **Docker Node.js** contains [`dotenv`](https://www.npmjs.com/package/dotenv). We [start the node app with `dotenv` preloaded](https://dev.to/getd/how-to-manage-secrets-and-configs-using-dotenv-in-node-js-and-docker-2214)
- **Docker PHP** contains [`PHP dotenv`](https://github.com/vlucas/phpdotenv), while using `getenv()` and `putenv()` is strongly discouraged due to the fact that these functions are not thread safe.

## Command line usage

**Since everything that has to do with the stack, only runs in the container, you have to put the commands into the corresponding container.**

To start/stop the stack, enter the following command in the terminal:

```bash
docker-compose -f "docker-compose.yml" up -d
docker-compose -f "docker-compose.yml" down
```

To open a shell in the application's container, use:

```bash
docker exec -it <container> /bin/bash
```

To execute a PHP script:

```bash
docker exec php /usr/local/bin/php /var/www/backend/public/index.php
```

Creating database dumps:

```bash
docker exec db sh -c 'exec mysqldump --all-databases -uroot -p"$MARIADB_ROOT_PASSWORD"' > /some/path/on/your/host/all-databases.sql
```

Restoring data from dump files

```bash
docker exec -i db sh -c 'exec mysql -uroot -p"$MARIADB_ROOT_PASSWORD"' < /some/path/on/your/host/all-databases.sql
```

Start node development mode

```bash
docker exec -it nodejs npm run serve
```

Build Frontend

```bash
docker exec -it nodejs npm run build`
```

Add packages to node.js

```bash
docker exec -it nodejs npm install dotenv --save
```

Add packages to php

```bash
docker exec -it php composer require vlucas/phpdotenv
```

## License

MIT © Fabian Dennler

repository: foxfabi/docker-webdev

repo_name: foxfabi/docker-webdev


text:
#### Parser Content
```Java
{
Name = s-cyberark-tpm-activity
    Vendor = CyberArk
    Product = Privileged Session Manager
    Lms = Splunk
    DataType = "app-activity"
    TimeFormat = "yyyy-MM-dd HH:mm:ss"
    Conditions = [ """Operation:""", """ObjectType:""", """OtherInfo:""" ]
    Fields = [
		"""Operation: ({activity}.*?) ObjectType""",
                """:\d\d\s({host}[^=]{1,2000})\sPAR""",
		"""({time}\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)""",
                """(AdminName|UserName): ({user}[^\s].+)\sOperation""",
                """Failed\?\s({event_subtype}\d)\s""",
		"""Target: ({app}[^\s].+)\sRole""",
		"""OtherInfo:\s({additional_info}.+)\s""",
		"""Role:\s({app_group}.+?)\s"""
    ]

}
```


text:
---
title: Non-CITES Certificate
permalink: /browse-all-licences/National-Parks-Board-(NPARKS)/Non-CITES-Certificate
third_nav_title: National Parks Board (NPARKS)
---

## Apply for Non-CITES Certificate

National Parks Board (NPARKS)

{% include button.html text="Apply on GoBusiness Licensing" src="https://licence1.business.gov.sg/licence1/neweadvisor/showSelectedLicence.action?redirection=true&selectedLicenceIds=201301090000181" type="primary" %}

Application Details

The Non-CITES Certificate allows commercial re-exporters to get National Parks Board approval for commercial re-export of non-CITES wildlife such as non-CITES ostrich skins and its manufactured products and non-CITES rep

FAQs

Where can I get the FAQ for Non-CITES Certificate?
You can get the FAQ on this link: NParks FAQ website at http://www.ifaq.gov.sg/NPARKS/apps/fcd_faqmain.aspx

Additional Information

Fee
Reexport Ostrich parts/products(BM,BC)
Licence Fees: $29.40
Express Fees: $58.80
Reexport Non-ostrich parts/products(BC)
Licence Fees: $22.00
Express Fees: $44.00

Documents Needed

Any Supporting Documents
File Format: DOC,DOCX,GIF,JPEG,JPG,PDF,PPT,PPTX,XLS,XLSX
Maximum upload per application: 2MB

Requirements

Prerequisite Licence(s)

ACRA - Registration for Companies / Business

repository: isomerpages/govtech-gobusiness

branch_name: refs/heads/staging

gha_license_id: NOASSERTION

repo_name: isomerpages/govtech-gobusiness


text:
# LAB 1 - Using Tests
[![Build Status](https://travis-ci.com/liz-kavalski-401-advanced-javascript/lab-01.svg?branch=master)](https://travis-ci.com/liz-kavalski-401-advanced-javascript/lab-01)

### Author: Liz Kavalski

### Links and Resources
* [submission PR](https://github.com/liz-kavalski-401-advanced-javascript/lab-01/pull/7
* [travis] (https://travis-ci.com/liz-kavalski-401-advanced-javascript/lab-01.svg?branch=master)](https://travis-ci.com/liz-kavalski-401-advanced-javascript/lab-01)

### Modules
#### `arithmetic.js`
a set of functions that dose add,subtract, mulitbly and divide
#### `greet.js`
a function that replys a simple greeting.
### Setup
Run a `npm i` to install dependices.
#### Running the app
* `npm test`

#### Tests
* Run `npm test`
* The assertions made was mostly on the arthmetic side which includes making the function in the `arithmetic.js` that have add, subract, mulitbly, and divide. Then making the test to see if the functions works and at this time the testes are passing.
* The assertions that still need to be make a function in the `greet.js` and the test to see if it works.


text:
# AGRG Core Template

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

A core template for ESRI JavaScript web map applications made by the Applied Geomatics Research Group of the Nova Scotia Community College.

## Table of Contents

- [Quickstart](#quickstart)
- [Usage](#usage)
- [Resources](#resources)
- [Todo](#todo)
- [Support](#support)

## Quickstart

## Usage

## Resources

- [ArcGIS API for JavaScript 3.25](https://developers.arcgis.com/javascript/3/)

## TODO

## Support

Please [open an issue](https://github.com/fireballburning/AGRG_Core/issues) for support.

### Author

David Kristiansen of the Applied Geomatics Research Group of the Nova Scotia Community College.

### License

Copyright ©2018, [Nova Scotia Community College](https://www.nscc.ca/).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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


text:
# Welcome to the OpenGraph.Net documentation site

A simple .net assembly to use to parse Open Graph information from either a URL or an HTML snippet. You can read more about the Open Graph protocol @ <http://ogp.me>.

[![Build](https://github.com/ghorsey/OpenGraph-Net/actions/workflows/main.yml/badge.svg)](https://github.com/ghorsey/OpenGraph-Net/actions/workflows/main.yml)
[![Nuget V](https://img.shields.io/nuget/v/OpenGraph-Net.svg)](http://www.nuget.org/packages/OpenGraph-Net/)
[![Nuget dl](https://img.shields.io/nuget/dt/OpenGraph-Net.svg)](http://www.nuget.org/packages/OpenGraph-Net/)
[![License](https://img.shields.io/badge/license-MIT-orange.svg)](https://github.com/ghorsey/OpenGraph-Net/blob/main/LICENSE)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/ghorsey/OpenGraph-Net/blob/main/CODE_OF_CONDUCT.md)
[![gitter](https://badges.gitter.im/webpack/webpack.svg)](https://gitter.im/OpenGraph-Net/OpenGraph-Net)

## Support the library

If you find this library useful, [buy me a coffee](https://www.buymeacoffee.com/ghorsey)!

## Installation

Use the following steps to install the library from Nuget:

### dotnet cli

```powershell
dotnet add package OpenGraph-Net --version 4.0.1
```

### Package Manager

```powershell
Install-Package OpenGraph-Net -Version 4.0.1
```

## Packet Cli

```powershell
paket add OpenGraph-Net --version 4.0.1
```

## Get Help/Report Issues

* [Repository](https://github.com/ghorsey/OpenGraph-Net)
* [Issues](https://github.com/ghorsey/OpenGraph-Net/issues)

## It's FOSS

So please don't be afraid to [fork me](https://github.com/ghorsey/OpenGraph-Net).

### Contribution Guide

1. Fork the OpenGraph-Net repository
1. Create a feature branch for the item you are going to add.
1. Add your awesome code and your unit tests to cover the new feature
1. Run all of the tests to ensure everything is still passing.
1. Create a pull request to our `develop` branch.

repository: ghorsey/OpenGraph-Net

gha_language: C#

repo_name: ghorsey/OpenGraph-Net


text:
# Multibreak.jl

Have you ever wanted a convenient way to break out of multiple nested
loops at once in your Julia code?

The Multibreak package provides the `@multibreak` macro, which allows
you to do exactly that. In this contrived but simple example, the
`break; break` line breaks out of both loops:

```
using Multibreak

@multibreak begin
    for i = 1:5
        if i % 3 > 0
            for j = 1:5
                @show i, j
                if (i + j^2) % 7 == 0
                    break; break
                end
            end
        end
    end
end
```

More generally the `@multibreak` macro allows you to `break` out of
any number of nested loops and optionally to `continue` the next
enclosing loop.

## Documentation

The tests are the documentation. The [tutorial](test/tutorial.jl) explores the
functionality provided by the `@multibreak` macro.

## Background

The `@multibreak` macro was first implemented as a
[gist](https://gist.github.com/GunnarFarneback/c970c9e63a33720bb71d0023f2c8a10f),
providing a proof of concept for a proposal in the Julia
[#5334](https://github.com/JuliaLang/julia/issues/5334#issuecomment-174475286)
issue. The proposed syntax differs by using comma instead of semicolon
between `break`/`continue`. The former is a syntax error in Julia 1.x,
whereas the latter is syntactically valid but semantically useless,
making it ideal for a macro implementation.


text:
# COWIN ViewPoint

 Automated COWIN Slots Availability Alerts on Email & Whatsapp

This is an automation to find detect free slots on COWIN and notify users through Whatsapp Message and Mail Alerts

* This can trigger alerts within around 2 seconds when an open slot is detected based on search critieria

* User should trigger this code from his computer and let it run as long as watchout for slots is required.

* Supports Twilio

* Creates HeartBeat file for run monitor from Android or Iphone by pointing to the sync folder

* Automated utilities are built for easy setup and quick start

* Python version greater than 3.8 is a minimum requirement

* Setup scripts will invoke pip wheel to download depedencies, if intended to download packages in anyother way - please make sure that all the packages in package_details.txt are installed

* To use this, either git clone or download the code manually using the download button

* support to windows, Mac and Linux (watchout for special instructions for windows)

### Before We Begin (Completly optional)

         Incase if you need any help on Python and Pip :

         pip : [pip wheel](https://pip.pypa.io/en/stable/installing/)

         Python Download : [Python download](https://www.python.org/downloads/)

         Ubuntu Users :
           [resolving python version conflicts](https://www.admindiary.com/os/linux/error-could-not-install-packages-due-to-an-environmenterror-errno-2-no-such-file-or-directory.html)

         Windows Users : [resolving python version conflicts](https://docs.python.org/3/using/windows.html#python-launcher-for-windows)

         MAC Users : You an alwys change symbolic link - [resolving python version conflicts](https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf)

      ** I recommend using Virtual Environment, use it if you already have one If you not aware, Never Mind ! **

### Quick & Easy steps

1. Verify if installed python version is 3.8+. If required, please use - https://python.org to download the latest version

2. use git clone or download the code manually using the download button

3. cd to the project location - ``` cd /code/path  |  Windows : cd C:\your\path```

4. run ``` pip install -r package_details.txt  ``` - you can copy and paste this command. Windows : If Twilio installation is failed, please refer : **[Basic Debugging](#basic-debugging)**

5. To verify if the installtion has completed succesfully:

    If you dont know or dont have any python virtual environments,

      Mac & Linux run : ``` ksh setup_check.sh ```

      Windows         :``` python3 setup_check.py ```

    If you have a Virtual Environment and intentd to use it for this, same as above but pass venv actiave
       Mac & Linux run : ``` ksh setup_check.sh <venv actiave location> ```

       Windows : Activate venv and run : :``` python3 setup_check.py ```

6. Open Browser (Chrome/Safari), Login to https://web.whatsapp.com/ and link to your whatsapp account and close the browser (**Only if you wish to get default whatsapp alerts - Not Email only or whatsapp alert with twilio**). Checkout : **[Alerts Priority](#quick-note-on-alert-priority)**
**

7. Input to the slot search is controlled by "cowin_user_config.json", just keyin values (self explanatory). Make sure you are in project folder (step 1)

    Mac & Linux :``` vi cowin_user_config.json ```
    edit details, review and save with ":wq!"

    windows : Edit in notepad or any editor and save

**Before proceeding, take a quick look at - A detailed guide on filling user config sheet : **[cowin_user_config.json](#simple-user-config-guide)**
**

 ----  SETUP Completed ----

 **Before proceeding, take a quick look at - **[execution shortcuts](#execution-shortcuts)**
**

## Quick note on Alert priority
1. If Email and Phone numbers are entered : Email alerts trigger first followed by Whatsapp Alerts
2. If None of Email and Phone numbers are entered : alerts are captured in logs for manual inspection
3. If Both Phone Number and Twilio connection details are entered : Twilio bot alerts will be triggered
4. Email alerts are triggered only if GMAIL connection string is added, else Email alerts are skipped
5. Alerts are restricted to one alert per center for a vaccine in a day to avoid spamming

 Now that setup is completed, you are good to start, its extreemly simple ! Make sure you are in project directory (Step 1 above)

 ## Invoke the main wrapper

  If you dont know or dont have any python **virtual environments**,

    **Mac & Linux run :** ``` ksh cowin_crawler_wrapper.ksh ```

    **Windows     run :** ```python3 cowin_clot_search.py "C:\\my\\log\\folder\\"  | note the ending \\```

  If you have a **Virtual Environment** and intentd to use it for this, same as above but pass venv actiave

    **Mac & Linux run :** ``` ksh setup_check.sh <venv actiave location> ```

    **Windows     run :Activate venv and run ** ```python3 cowin_clot_search.py "C:\\my\\log\\folder\\"  | make sure that the folder is created and do note the ending \\```

 **Mac & Linux : If you wish to stop the process**, you can either kill manually or use the utility. **Refer : [Shortcuts and Logs](#shortcuts-and-logs)**
 **Windows : If you wish to stop the process**, just press 'ctrl + c'

 As an alternate (Not recommended but default for Windows Users), you can always invoke script directly with your python intepreter in the code folder - please note that, log cleanup will not be done:
 ``` python3 cowin_slot_search.py | Mac nad Linux users : please make sure ~/log_dump/cowin/ folder is created```

 ## Simple user config guide

 * **State : Mandatry entry !** - Enter the state name in double quotes - Not Case sensitive but verify spelling

        Example : "Telangana"

 * **Districts : Mandatry entry !** - Enter one or more districts, each in double quotes seperated by comma - Not Case sensitive but verify spelling

        Example 1 : ["Hyderabad"]

        Example 2 : ["Hyderabad", "Rangareddy"]

* **Pincodes : Mandatry entry !** - Enter "all" if you want to search on all pincodes for the districts above in the state mentioned above. You can also add multiple pincodes in double quotes seperated by commas just like how you did for "Districts"

        Example 1 : ["all"]

        Example 2 : ["500001"]

        Example 3 : ["500001", "500002"]

 * **Dosage : Mandatry entry !** - The dosage which you are looking for. This is a number and cannot be less than 1 and greater than 2
         Example 1 : [1]
         Example 2 : [2]
         Example 3 : [1, 2]

 * **18_plus : Mandatory entry !** - set "True" if you want to search for 18 plus, "False" if you want to search for 45 plus
         Example 1 : "True"
         Example 2 : "False"

 * **Mobile_Numbers : Optional** - Enter mobile numbers to alert with country code, in double quotes, comma seperated - just like above

         Example 1 : ["+919999999999"]

         Example 2 : ["+919999999999", "+919111111111"]

 * **Gmail_Addresses : Optional** - Any mail address is supported but the user triggering must have a GMAIL account, , please add Email addresses to trigger alerts

          Example 1<EMAIL_ADDRESS>

          Example 2<EMAIL_ADDRESS><EMAIL_ADDRESS>

 * **source_gmail_address|source_gmail_password|gmail_smtp_port :  Optional  But Mandatory if Email Alerts are choosen (Gmail_Addresses)** - To be filled only if "Gmail_Addresses" values are set. This string will be used to trigger GMAIL alerts.

         This is a combination of : user gmail address, user gmail password, gmail smtp port

         If you are not sure of smtp port number : Example "465"

         alternatively You can also type any character for smtp port number to make code pick default 465 : Example : "I dont know"

         Example 1<EMAIL_ADDRESS>

         Example 2<EMAIL_ADDRESS>dont know"

         **Note :** When using this, login to Google Account page -> Security -> "Less Secure App Access" -> Turn it On. This is required for the code to trigger mail alerts.

* **twilio_account_sid|auth_token|source_number_with_countrycode :  Optional** - Use this option to configure you twilio account to send whatsapp messages. This will let you get super fast message alerts. Setup is super fast - **I Highly recommend using this for faster alerts**.

         Refer **[Quick and Simple twilio setup](#twilio-setup)**  to find out how you can use it

         you can get below details from you twilio console

         This is a combination of : twilio account sid, twilio account auth token, assigned twilio number

         Example 1 : "my_twilio_account_sid|my_twilio_account_auth_code|my_assigned_twilio_number"

 * **Drive_path_for_heartbeat :  Optional** - path to your google drive or icloud sync folder on desktop to create and refresh a zero byte heartbeat file - so that user can check process alive status from phone through "folders" app on iphone or "drive" app on android.

            **I highly recommend using this** as you will know if the process you triggered is running or not. If you see the trigger file from phone with timestamp of 20 - 25 minutes below you current time (provided you have propert internet connection) - indicates that your process triggered on your laptop might have aborted !

        Mac and Linux Example : "/google_drive/or/icloude/folder_location/"

        Windows Example : "C\\\google_drive\\\icloud\\\lder_location\\\\"

        Setting Icloud folder : [Icloud Desktop folder setup](https://support.apple.com/en-in/HT206985)

        Setting Gdrive folder : [GDrive Desktop folder setup](https://support.google.com/a/users/answer/9965580?hl=en)

Note : you are not expected to share the user config file

 ## Twilio Setup

 1. Signup for free Twilio trial account - you will get free credits of around 16 dollars - this credit is more than enough

 2. Open whatsapp sandbox : **[Twilio whatsapp sandbox](https://console.twilio.com/us1/develop/sms/try-it-out/whatsapp-learn?frameUrl=%2Fconsole%2Fsms%2Fwhatsapp%2Flearn%3Fx-target-region%3Dus1)**

 3. From you wahtsapp - send "join sing-run" to the number listed in the above URL. Done !

 4. your console home will have details on Account SID and Auth Key : **[Twilio console](https://console.twilio.com/?frameUrl=/console)**, keep a note of these two

 5. use the twilio account SID, auth key and assigned phone number with country key aquired in the above steps and pass to "twilio_account_sid|auth_token|source_number_with_countrycode" in the cowin_user_config.json as listed in **[cowin_user_config.json](#simple-user-config-guide)**

 6. Check twilio specific content in **[Basic Debugging](#basic-debugging)** before wrapping up Twilio Setup.

## Shortcuts and Logs

1. **If you wish to stop the running process**, you can simply run : ``` ksh kill_cowin_crawler.sh ``` from the folder where the clone/code is residing

2. I recommend to run main wrapper as mentioned **[Invoing Main Wrapper](#invoke-the-main-wrapper)** with nohup such that the process is not depedent on your teminal session

3. you can create an alias for this nohup in .profile or .bash_profile and use shortcut to run

4. Default log path is : ~/log_dump/cowin/  , so setting an alias for log will also help

5. When you run ubuntu shell for the first time, you will be prompted to set username and password, **please remember them to login again**
6. Windows Ubuntu subsytem : you can navigae to windows folders by prefixing your path with "mnt"
      Example : If you wish to go to 'Desktop' - ``` cd /mnt/c/users/<user name>/Desktop ```

## Basic Debugging

1. If wrapper is invoked with nohup and failed for some reason - please review the contents of nohup.out on your home directory or on the place of exeuction.
2. For Twilio users - **A reply to at least one message must be sent to the bot within 24 hours** to continue sending alerts beyond that
3. Twilio messages status can also be tracked from Twilio user console to understand the failure reason
4. If Phone number provided **without Twilio String**, code will attempt to trigger whatsapp alert by autmatially opening https://web.whatsapp.com/ and send a message.

           incase while you are using your computer and the process opened the browser and trying to send message - try not to click any buttons

           In anycase, if you observe "send message" not happening from an open https://web.whatsapp.com/ session automatically, you can manually click it and close the browser.

 Alerts through https://web.whatsapp.com/ will take around 40 to 50 seconds to trigger message alert

           Use only Chrome/Safari for basic whatsapp alerts (Not Twilio)
5. Windows Users : You may find log captured in the script folder, Check in that location once if you are looking for missing log file - Arument might have not properly passed when triggering the script

6. Windows : If Twilio package installation failed for "File Not Found error" when you run pip -r instal, you can use below steps to enable LongPaths and retry
   1. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
   2. Double click LongPathsEnabled.
   3. Set to 1 and click OK.

## Final Note :

I hope this will help you to find the slot and get yourself vaccinated.

Stay Home Stay Safe


text:
# Changelog

Data Layer Observer follows semantic versioning when releasing updates.

| Code status | Stage | Example version |
| ----------- | ----- | --------------- |
| Backward compatible bug fixes | Patch release | 1.0.1 |
| Backward compatible new features | Minor release| 1.1.0 |
| Changes that break backward compatibility | Major release | 2.0.0 |

## History

### 4.0.1

- Fixes an issue where the new `parse` operator was not properly registered to be available for use.

### 4.0.0

- Adds an `ignoreSuffixed` option to the `convert` operator which excludes properties with known type suffixes when specifying `enumerate: true`. This option defaults to `true`.
- Adds a `parse` operator which can parse out key/value pairs or an array from a string based on given delimeters.

### 3.0.0

- Adds an `ignore` option to the `convert` operator which excludes properties from conversion when specifying `enumerate: true`.
- `null` object values are now treated as empty objects which halt data handler pipeline processing and which are not processed by selectors. Fixes an issue with Google data layers where legitimate `null` events would cause errors to be logged.
- Removes the `record` log level.
- Removes the previously deprecated rule count telemetry type.

### 2.1.2

- Updating developement dependencies.

### 2.1.1

- Prevent the telemetry provider from sending a Rule Registration metric if there are no rules registered.
- Prevent the DefaultTelemetryProvider from exporting or sending negative or non number spans.

### 2.1.0

- Adds rule count attribute to rule registration span telemetry. Deprecates dedicated rule count telemetry type for removal in a future release.

### 2.0.1

- Fixed a bug where debounce time was included in measured event handling duration

### 2.0.0

- Changes telemetry collection interfaces from e.g. `Telemetry.getInstance().startSpan` to `Telemetry.startSpan`
- Instruments significant timing and count metrics

### 1.13.1

- Fixed an initialization bug which prevented configuring a log level of `0`

### 1.13.0

- Added telemetry provider and exporter concepts to measure timings, error counts, and other metrics. Telemetry is currently initialized but otherwise unused

### 1.12.1

- Change made to allow searching for empty strings with ```''``` or ```""```.  Technically any string comparison can be quoted, but this was specifically added for searching for empty string

### 1.12.0

- Rules can no longer be triggered by changes to properties which don't match a rule's selector

### 1.11.0

- Empty objects are no longer passed to rule operators. This prevents empty objects from being sent to configured rule destinations. Empty objects are defined as empty arrays or objects where all first-level child keys have `undefined` values

### 1.10.2

- Fixed `Object doesn't support property or method 'startsWith'` error in IE11

### 1.10.1

- `suffix` operator `maxProps` should not count properties with undefined values
- `suffix` operator explicitly stops processing if provided an undefined or null object to be suffixed

### 1.10.0

- Added rule options `waitUntil` and `maxRetry` related to scheduling rule registration
- Updated default behavior of rule registration: waiting for both a defined data layer object and at least one property defined
- Adjusted rule registration logic to schedule using exponential backoff times

### 1.9.0

- `suffix` operator limits number of properties in an object to `100` (configurable with `maxProps`)

### 1.8.0

- Performance improvement to prevent emitting change events for the same value
- Configurable `debounce` property for rules; allows waiting longer before handling data layer events
- Fix to prevent the `enumerate` option in the convert operator from converting empty strings to `0`

### 1.7.2

- Fix to allow rule-specific `readOnLoad` to override global `readOnLoad`

### 1.7.1

- Additional log messages when adding operators

### 1.7.0

- Updated `beforeDestination` to accept a list allowing multiple operators to execute
- Updated `convert` operator to accept negative `index` (read from end of a data list)

### 1.6.5

- Adjusted suffixing behavior for `pageName`, `displayName`, and `email` to support FS APIs

### 1.6.4

- Move `EmptyEvent` scenario from log level `warn` to `debug`

### 1.6.3

- Fix `flatten` operator bug related to mutating objects in list-based data layers

### 1.6.2

- Fix `console.error` messages related to logging appender

### 1.6.1

- Fix incorrect suffix behavior when using FS.event source parameter
- FullStoryAppender logger source updated to `dlo-log`

### 1.6.0

- `enumerate` option added to `convert` operator
- Tealium sample updated to use `enumerate` option
- Added `order_` property selector to Tealium sample

### 1.5.2

- Check if `push` and `unshift` exist in older browsers

### 1.5.1

- Fix `convert` operator to trim spaces if a space separated CSV is supplied

### 1.5.0

- Added `=` and `!=` `undefined` comparison for object properties

### 1.4.4

- Bug fix in string `!=` comparison

### 1.4.3

- Expose logging level as config option `_dlo_logLevel`

### 1.4.2

- Debouncing added to limit the number of log events for similar error messages

### 1.4.1

- Normalized numbers as `real` by default to prevent ambiguous `int` for numbers like `200.00`

### 1.4.0

- Monitoring properties is limited to only the properties in the object returned from the `source` selector, which may be a subset of all properties
- Added `!^` and `=^` comparison for query operator
- Updated Google rules to better ignore `gtm.*` events
- Added Google rule to support `gtg` `Arguments` object in the `dataLayer`

### 1.3.3

- Log message cleanup

### 1.3.2

- Fix bug related to usage of `globalThis` in older browsers

### 1.3.1

- Fix bug in query selector syntax that prevented parsing rules with `.` in the property or value
- Fix timing related issue with rule registration
- Add clarity around rule registration failure message

### 1.3.0

- Added `defaultValue` option for insert operator

### 1.2.1

- Addressed bug in convert operator where an undefined property is created and set to a value of `0`, `0.0`, or `false` depending on the conversion type

### 1.2.0

- Automatically monitor array `unshift` similar to existing `push` monitoring
- Performance benchmarks added to docs
- Convert operator supports arrays and reduces to a single value for single element arrays

### 1.1.0

- Monitor property changes on data layer objects
- Monitor function calls (e.g. dataLayer.push)
- Two new operators added: Rename and Fan-Out
- Google Analytics examples
- Updated packaging to support NPM and programmatic usage

### 1.0.0

- Initial release supporting static data layers
- CEDDL compatibility with examples

gha_language: TypeScript