text:
---
title: Stop shipping logs to the client
date: "2019-10-10T22:40:32.169Z"
description: No one wants to see them
---

![](./log-browser.jpg)

In case you missed the memo, developer tools are available to everyone.

Do you want people to notice that you don't know how to use a JS debugger ?

Do you want them to notice that you consider your work done, as soon as the string `"lezkhbflzhrgb"` shows up in the console ?

repository: marcpicaud/blog

repo_name: marcpicaud/blog


text:
# How to use the Randomize

In case you want to implement a random function or give a random number value **The Random module** contains some very useful functions.

So first of all **Make Sure To Import** `random` **Before The Code** in order to use it

**Randint:** This will generate a value between 2 numbers given Ex:

`print(random.randint(10,25))`

This will give you a random integer between

**Choice** Generate a random value from a sequence Ex:

`colors = ['red', 'black', 'green']`
`random.choice(colors)`

**Shuffle** shuffles the elements in list in place, so they are in a random order Ex:

`x = [[i] for i in range(10)]`
`random.shuffle(x)`

**Randrange** Generate a randomly selected element from range(start, stop, step) Ex:

`for i in range(3):`
    `print random.randrange(0, 101, 5)`

## Risk Analysis

> The probability of any unwanted incident is defined as Risk

> risk analysis is the process of identifying the risks in applications or software that you built and prioritizing them to test.

### Why use Risk Analysis

- highlights the potential problem areas
- helps the developers and managers to mitigate the risks

risks that you could encounter list:
- Use of new hardware
- Use of new technology
- Use of new automation tool
- The sequence of code
- Availability of test resources for the application

there are certain risks that are unavoidable such as:
- The time that you allocated for testing
- A defect leakage due to the complexity or size of the application
- Urgency from the clients to deliver the project
- Incomplete requirements

### Risk Identification

There are different sets of risks:

- **Business Risks:** It is the risk that may come from your company or your customer, not from your project
- **Testing Risks:** You should be well acquainted with the platform you are working on, along with the software testing tools being used.
- **Premature Release Risk:** a fair amount of knowledge to analyze the risk associated with releasing unsatisfactory or untested software is required
- **Software Risks:** You should be well versed with the risks associated with the software development process.

### Risk Assessment

![image](assets/Read06.png)

#### The perspective of Risk Assessment

**Effect:** To assess risk by Effect. In case you identify a condition, event or action and try to determine its impact.

**Cause:** To assess risk by Cause is opposite of by Effect. Initialize scanning the problem and reach to the point that could be the most probable reason behind that.

**Likelihood:** To assess risk by Likelihood is to say that there is a probability that a requirement won’t be satisfied.

license: MIT

repository: Hadeaji/reading-notes

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: Hadeaji/reading-notes


text:
# Control Hooks

Beyond the top-level grammar rule, which *has* to be supplied to a parsing run, and an action class template, which *can* be supplied to a parsing run, a third customisation point within the PEGTL allows the user to provide a *control* class (template) to a parsing run.

The control class must implement a set of static hook functions that are called by the PEGTL in order to

1. customise which exceptions are thrown in case of errors, and

2. add custom debug logging to follow the details of a parsing run.

## Contents

* [Normal Control](#normal-control)
* [Debug Functions](#debug-functions)
* [Exception Throwing](#exception-throwing)
* [Debugging and Tracing](#debugging-and-tracing)
* [Advanced Control](#advanced-control)
* [Changing Control](#changing-control)

## Normal Control

The `normal` control class template included with the PEGTL is used by default and shows which hook functions there are.

```c++
template< typename Rule >
struct normal
{
   template< typename Input, typename ... States >
   static void start( const Input &, States && ... )
   { }

   template< typename Input, typename ... States >
   static void success( const Input &, States && ... )
   { }

   template< typename Input, typename ... States >
   static void failure( const Input &, States && ... )
   { }

   template< typename Input, typename ... States >
   static void raise( const Input & in, States && ... )
   {
      throw parse_error( "parse error matching " +
                         internal::demangle< Rule >(), in );
   }

   template< apply_mode A,
             marker_mode M,
             template< typename ... > class Action,
             template< typename ... > class Control,
             typename Input,
             typename ... States >
   static bool match( Input & in, States && ... st )
   {
      return internal::rule_match_one< Rule,
                                       A, M,
                                       Action,
                                       Control >( in, st ... );
   }
};
```

All control functions are called with the current input and all additional state arguments.

## Debug Functions

Before attempting to match a rule `R`, the PEGTL calls `C< R >::start()` where `C` is the current control class template.

Depending on what happens during the attempt to match `R`, one of the other three functions might be called.

- If `R` succeeds, then `C< R >::success()` is called; compared to the call to `C< R >::start()`, the input will have consumed whatever the successful match of `R` consumed.

- If `R` finishes with a failure, i.e. a return value of `false` from its `match()`-function, then `C< R >::failure()` is called; a failed match is not allowed to consume input.

- If `R` is wrapped in `must< R >`, a global failure is generated by calling `C< R >::raise()` to throw some exception as is expected by the PEGTL in this case.

- If a sub-rule of `R` finishes with a global failure, and the exception is not caught by a `try_catch` or similar combinator, then no other function of `C< R >` is called after `C< R >::start()`.

## Exception Throwing

The `raise()`-control-hook-function *must* throw an exception.
For most parts of the PEGTL the exception class is irrelevant and any user-defined data type can be thrown by a user-defined control hook.

The `try_catch` rule only catches exceptions of type `pegtl::parse_error`!

When custom exception types are used then `try_catch_type` must be used with the custom exception class that they are supposed to catch as first template argument.

## Debugging and Tracing

For debugging a grammar and tracing exactly what happens during a parsing run, the control class methods `start()`, `success()` and `failure()` can be used.
A minimal example of how this can be done is included with the PEGTL in the `pegtl/trace.hh` header file.

```c++
template< typename Rule >
struct tracer
      : normal< Rule >
{
   template< typename Input, typename ... States >
   static void start( const Input & in, States && ... )
   {
      std::cerr << position_info( in )
                << "  start  "
                << internal::demangle< Rule >()
                << std::endl;
   }

   template< typename Input, typename ... States >
   static void success( const Input & in, States && ... )
   {
      std::cerr << position_info( in )
                << " success "
                << internal::demangle< Rule >()
                << std::endl;
   }

   template< typename Input, typename ... States >
   static void failure( const Input & in, States && ... st )
   {
      std::cerr << position_info( in )
                << " failure "
                << internal::demangle< Rule >()
                << std::endl;
   }
};
```

## Advanced Control

The control template's `match()`-function is the first or outside-most function that is called in the flow that eventually leads to calling a rule's `match()`-function.

The normal implementation simply forwards all template parameters and function arguments unchanged.

For advanced use cases it is however possible to create a custom control class with a custom `match()`-function that can change "everything" before forwarding as needed.

## Changing Control

Just like the action class template, a custom control class template can be used by either

1. supplying it as explicit template argument to the `parse()`-functions, or

2. setting it for a portion of the grammar with the `pegtl::control` combinator.

Copyright (c) 2014-2016 Dr. Colin Hirsch and Daniel Frey

repository: kneth/PEGTL

branch_name: refs/heads/master

repo_name: kneth/PEGTL


text:
---
title: JavaScript30
description: My progress through Wes Bos' JavaScript30 course
author: Phil Baker
date: 2017-02-14
dateModified: 2017-02-14
---

[JavaScript30](https://javascript30.com/) is a fun series of tutorials. It introduced me to modern JavaScript after a couple of years of over-relying on jQuery.

## Day 1: Drum kit

The goal for day one was to make a drum kit that responds to the keydown event. It was a simple introduction to vanilla JavaScript but there were a few takeaways for me:

- Focus on data attributes rather than hooking onto CSS class names or ids.
- ```element.classList.add('class')``` is equivalent to the jQuery: ````$('element').addClass('class');````
- There's a handy [transitionend](https://developer.mozilla.org/en-US/docs/Web/Events/transitionend) event that fires as soon as a CSS transition ends. This means the CSS can transition length can be changed without the JavaScript going out of sync.

My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/01%20-%20JavaScript%20Drum%20Kit).

## Day 2: CSS and JS clock

Today's task was to make the clock show the correct time. I actually found the CSS part most interesting and discovered a couple of things that I didn't know there:

- ````transform-origin```` is used with CSS transforms and allows you to change the point of origin of a transform. By default it is set to 50%.
- There's a cubic bezier editor in Chrome dev tools that allows you to play around with transitions! You can access it by clicking the purple icon next to the transition name.

My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/02%20-%20JS%20%2B%20CSS%20Clock).

## Day 3: CSS Variables

The third challenge was to use JavaScript to change the value of CSS Variables creating a spacing, blur and colour mixer in the process.

So far I've learnt more about modern CSS than JavaScript! I've generally stayed away from CSS variables and stuck with Sass but it's nice seeing the benefits of using the real thing.

- ````querySelectorAll```` returns a node list rather than an array. There are fewer methods you can use on a node list than an array.
- ````forEach()```` has recently been added to node lists. In order to work with other methods you can convert a node list to an array.
- ````dataset```` is an object that will contain all of the data elements from the element you are targeting
- CSS variables can be updated with JavaScript.
- CSS variables can be scoped e.g. ````--base: #000;```` on the html tag will be overwritten by ````--base: #3A3A3A;```` on the body tag.

My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/03%20-%20CSS%20Variables).

## Day 4: Array cardio part 1

The first day of pure JavaScript exercises focused on working with Arrays and there were plenty of lessons learned:

-  Array.prototype.map takes in an array and returns a new array of the same length.
-  map will always return the same number of items you give it (as opposed to filter which can return as little as you like).
-  querySelectorAll can be called on any element - not just document.
-  map is not available on a NodeList. A node list can be converted to an array in two ways:
-  Wrap in Array.from() e.g. ```Array.from(category.querySelectorAll('a'));```
-  Use an ES6 spread e.g. ```[...category.querySelectorAll('a')];```

A theme that is emerging over this course is the usefulness of ES6. Template literals, while seemingly a slight change, are a joy to work with.

This video highlighted the benefits of arrow functions and how much more readable ES6 can be:

#### The old way

```javascript
const fifteen = inventors.filter(function(inventor) {
	if(inventor.year >= 1500 && inventor.year < 1600) {
		return true;
	}
});
```

#### ES6

```javascript
const fifteen = inventors.filter(inventor => (inventor.year >= 1500 && inventor.year < 1600));
```

My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/04%20-%20Array%20Cardio%20Day%201).

## Day 5: Flexbox image gallery

This lesson reinforced the value of Flexbox to me. It's something I'd like to use a lot more of on future projects.

- An element in CSS can be a flex item as well as a flex container.
- CSS transitions can be used to animate flex-grow.
- Using flex-grow means there is no need to specify a width.

My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/05%20-%20Flex%20Panel%20Gallery).

## Day 6: Ajax type-ahead

Challenge six was to build a search of places with autocomplete and highlighting. The fetch API and promises got their first usage. It's great to see these kind of affects achieved without relying on a third-party library!

My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/06%20-%20Type%20Ahead).

## Day 7: Array cardio part 2

Another exercise looking at JavaScript's array methods. I'm finding refactoring ES5 to ES6 to be a really effective way of learning the new syntax. It's impressive how many things can become a one-liners.

- The array method ```Array.prototype.some()``` will check if at least one thing in the array meets what you're looking for.
- Chrome dev tools -  wrapping a variable in curly braces inside ```console.log``` shows the name of the variable as well as its value.
- ```Array.prototype.find()``` returns the first item it finds.

 My latest progress is on [github](https://github.com/philbaker/JavaScript30/tree/master/07%20-%20Array%20Cardio%20Day%202)

## Day 8: Canvas

Today's creation was an MS paint-like drawing board using HTML5 canvas. I don't usually build this kind of thing but it was lots of fun. It's given me some ideas for some more creative side-projects.

- ES6 allows you to declare multiple variables and their values on one line (by destructuring an array) e.g. ```[lastX, lastY] = [e.offsetX, e.offsetY];```
- HSL is good colour notation  manipulate with JavaScript - see [mother-effing hsl](http://mothereffinghsl.com/).

The source is on [github](https://github.com/philbaker/JavaScript30/tree/master/08%20-%20Fun%20with%20HTML5%20Canvas).

## Day 9: Dev tool tricks

This was a really useful overview of the Chrome developer tools and how they can help with JavaScript.

- Setting a breakpoint: Right click an element in the elements panel > ```Break on``` > ```Attributes modification```. With this option selected, as soon as an attribute (e.g. colour or font size) changes, it will will pause the debugger and JavaScript causing the change..
- Interpolation with ```%s``` - I'd seen this in Python before and never realised it could be used in JS. It's maybe not that useful now that we have template literals in ES6.
- ```console.dir()``` shows a dropdown with properties and methods availble on an element whereas ```console.log()``` will just show the element itself.

The source is on [github](https://github.com/philbaker/JavaScript30/tree/master/09%20-%20Dev%20Tools%20Domination).

## Day 10: Checklist

Today's challenge was to add Gmail like functionality to a checklist - if you select one box and then shift-click another it should check the boxes in between.

- I've always used for loops for similar tasks but Wes's use of ```forEach``` is much easier to read.
- ```MouseEvent.shiftKey``` tells you if the shift key was pressed when an event occurs.

The source is on [github](https://github.com/philbaker/JavaScript30/tree/master/10%20-%20Hold%20Shift%20and%20Check%20Checkboxes).

## Day 11: Video player

Today's task was to implement custom controls on an HTML5 video player and add a full screen toggle button.

Working with ```play```, ```pause``` and ```timeupdate``` events meant a lot could be achieved with little code.
The source is on [github](https://github.com/philbaker/JavaScript30/tree/master/11%20-%20Custom%20Video%20Player).

## Day 12: Key sequence detection

Today's exercise allows the user to unlock something by entering a specific key sequence.

This works by using the ```keyup``` event listener, storing pressed keys in an array and using ```Array.prototype.includes()``` to check if it matches a secret code (a string stored in a variable).

The source is on [github](https://github.com/philbaker/JavaScript30/tree/master/12%20-%20Key%20Sequence%20Detection).

<small>The secret code may be a mythical animal with a horn on it's head…</small>

## Day 13: Slide in on scroll

Ah scroll events. Not great for performance but people seem to like them! Today's challenge was to animate images into place as the page is scrolled down. There's a bit of maths based on screen position and image position but with some logging to console it soon makes sense.

One new thing I learnt about was ```console.count()``` which can be used to log the number of times an event is fired. Quite useful to demonstrate the importance of debouncing scroll events!

The source is on [github](https://github.com/philbaker/JavaScript30/tree/master/13%20-%20Slide%20in%20on%20Scroll).

## Day 14: Objects and arrays - reference vs copy

Updating a reference to an array/object will update the values in the original array/object. A way around this is to make a copy - there are a few of ways to do this:

#### Make a copy of an array
1. ```Array.prototype.slice()```
2. ```[].concat(array)```
3. ```[...arrayName]```
4. ```Array.from(array)```

#### Make a copy of an object
- ```Object.assign({}, obj);``` - This will only clone the object one level deep.
- There is a proposal for an object spread operator but it is not yet implemented.

The file for this exercise is on [github](https://github.com/philbaker/JavaScript30/tree/master/14%20-%20JavaScript%20References%20VS%20Copying).

## Day 15: Local storage and event delegation

Today's goal was to persist the state of a todo list using local storage.

- 'Preserve log' in Chrome's console is handy. It keeps messages that may flash on the screen too quickly and lets you know if the page has been refreshed/changed.
- Event delegation is where you listen for events an element that will exist at page load. It is useful because the element can pass events to future child items - in our case a checkbox on a list item that has been dynamically added.

The source is available at [github](https://github.com/philbaker/JavaScript30/tree/master/15%20-%20LocalStorage).

## Day 16: CSS text shadow mouse move effect

Today's challenge was to animate the text-shadow of a word. ```offsetX```, ```affsetY``` and a bit of maths was all that was needed.

- ```offsetX``` and ```offsetY``` give you the position of your cursor on screen.
- Template literals are a huge improvement over concatenation of variables.
- Object desctructuring reduces the amount of code you need to write:

```
const width = hero.offSetWidth;
const height = hero.offsetHeight;
```

becomes:

```
const { offsetWidth: width, offsetHeight: height } = hero;
```

The source is available at [github](https://github.com/philbaker/JavaScript30/tree/master/16%20-%20Mouse%20Move%20Shadow).

## Day 17: Sort

Today's challenge was to use of ```Array.prototype.sort()``` to sort a list of band names alphabetically. The challenging part was to ignore the articles _A_, _An_ or _The_ at the start of a name.

My initial solution was quite long and I didn't think to use a regular expression to find the article - something to bear in mind for next time!

The source is available at [github](https://github.com/philbaker/JavaScript30/tree/master/17%20-%20Sort%20Without%20Articles).

## Day 18: Reduce

Challenge: Add up a list of times stored in list item data attributes. To do this we need to get minutes and seconds separately, store in an array, convert to seconds and add them together.

I've done something similar before and took a more long-winded ```for``` loop approach. It turns out that ```map``` and ```reduce``` can be combined to do the same thing.

- ```Array.prototype.map()``` takes in an array and returns an array
- ```Array.prototype.reduce()``` takes in an array and returns anything you want

The source is available at [github](https://github.com/philbaker/JavaScript30/tree/master/18%20-%20Adding%20Up%20Times%20with%20Reduce).

## Day 19: Webcam

It was quite fun accessing my webcam and playing around with RGB filters - all with HTML, CSS and JavaScript!

I discovered a new event: ```canplay``` which fires when a video is detected and has buffered enough to begin.

The source for this one is available at [github](https://github.com/philbaker/JavaScript30/tree/master/19%20-%20Webcam%20Fun).

## Day 20: Native speech recognition

```window.SpeechRecognition``` opens up a world of possibilites in the browser!

This tutorial put spoken words on screen and hints at what else could be built - you can have keywords that call specific functions (e.g. asking for the weather).

The source is available at [github](https://github.com/philbaker/JavaScript30/tree/master/20%20-%20Speech%20Detection).

## Day 21: Geolocation

In this challenge I used the Geolocation API to show a user's speed/direction on screen. Playing around with the iOS emulator was a bit fiddly but I managed to get something working.

One cool thing I learnt: ```navigator.geolocation.watchPosition();``` can be used to listen for the user's position.

The source is available at [github](https://github.com/philbaker/JavaScript30/tree/master/21%20-%20Geolocation).
## Day 22: Follow-along links

The goal for this challenge was to create a hover state that follows the cursor.

There's some interesting things going on to get the dimensions of the element and to work out the cursor position on screen.

Today's useful method that I'd never heard of is ```Element.getBoundingClientRect()``` which returns the size of an element and its position relative to the viewport.

The files for this project are on [github](https://github.com/philbaker/JavaScript30/tree/master/22%20-%20Follow%20Along%20Link%20Highlighter).

## Day 23: Speech synthesis

We looked at the Web Speech API in my favourite challenge so far.

One thing I've noticed throughout the challenges is that Wes chains methods together. This is something I've started to do a lot more on projects.

The file s are on
[github](https://github.com/philbaker/JavaScript30/tree/master/23%20-%20Speech%20Synthesis).

## Day 24: Sticky nav on scroll

I've done this many times but never using vanilla JavaScript so it's good to see it done as plainly as possible.

The files are on
[github](https://github.com/philbaker/JavaScript30/tree/master/24%20-%20Sticky%20Nav).

## Day 25: Event capturing, Propagation, Bubbling and Once

Bubbling is where an event triggers on the lowest element in the DOM and then moves up triggering parents in nested order.

```event.stopPropagation()``` _Prevents further propagation of the current event in the capturing and bubbling phases_.

Event capturing works down through the DOM. Once events have been captured they are triggered and bubble back up.

```capture: true``` Can be passed to an event handler. It runs the function on the way down rather than on the way up.

The ```once``` function  listens for a click once and unbinds the element for future clicks. A good usecase would be on a store checkout button where you want to prevent the user from checking out twice.

The files are on
[github](https://github.com/philbaker/JavaScript30/tree/master/25%20-%20Event%20Capture%2C%20Propagation%2C%20Bubbling%20and%20Once).

### Some useful links
- [Bubbling and capturing](https://javascript.info/tutorial/bubbling-and-capturing)
- [Event.stopPropagation()](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation)

## Day 26: Follow-along dropdown

Today's challenge built on day 22 - create a set of navigation menus that transform in width and height as you move from one to another.

The final code is on [github](https://github.com/philbaker/JavaScript30/tree/master/26%20-%20Stripe%20Follow%20Along%20Nav).

## Day 27: Click and drag to scroll

Today I learned that it's suprisingly difficult to create a horizontal drag and scroll menu! A bit of maths with ```pageX```, ```offsetLeft``` and ```scrollLeft``` is how you achieve the end result.

The final code is on [github](https://github.com/philbaker/JavaScript30/tree/master/27%20-%20Click%20and%20Drag).

## Day 28: Video speed controller UI

This challenge was to add a speed controller to a video. I've not seen a video UI control quite like this so it was interesting to build.

The final code is on [github](https://github.com/philbaker/JavaScript30/tree/master/28%20-%20Video%20Speed%20Controller).

## Day 29: Countdown timer

This task was to build a countdown clock with pre-set timer buttons. I tweaked it to use [pomodoro](https://en.wikipedia.org/wiki/Pomodoro_Technique) times.

- ```Date.now()``` is a new static method that returns the current timestamp in miliseconds.
- You can select a form element directly if it has a name attribute e.g. ```Document.formName```

The code is on [github](https://github.com/philbaker/JavaScript30/tree/master/29%20-%20Countdown%20Timer).

## Day 30: Whack-a-mole

That's it - day 30 and I've finished! The final challenge was to build a whack-a-mole game. It seems complex but breaking it down into a handful of small functions really helps.

- ```Event.isTrusted``` is true if an event was generated by a user action and false when it was created by a script. This is useful here because it would prevent a user from cheating!

The code for the game is on [github](https://github.com/philbaker/JavaScript30/tree/master/30%20-%20Whack%20A%20Mole).

## Conclusion

I had fun working with the various web APIs: speech synthesis, geolocation, HTML5 audio and video etc, however it was the everyday things that impressed me the most:

- ```forEach``` is more readable than a for loop.
- The array methods ```map```, ```filter``` and ```reduce``` are incredibly useful and encourage a jQuery-like chaining of methods.
- Arrow functions cut down on code length and aid readability.
- Promises provide a robust way to manage asynchronous operations.
- Template literals are a joy to work with - no more concatenating strings and variables or escaping quotes.

Here's to another 970 projects!

branch_name: refs/heads/source

gha_language: JavaScript


text:
# Hebeloma pseudoamarescens (Kühner & Romagn.) P. Collin, 1988 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Docums Mycol. 19(no. 74): 61 (1988)

#### Original name
Alnicola pseudoamarescens Kühner & Romagn., 1947

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Podosordaria filiformis (Alb. & Schwein.) P.M.D. Martin, 1976 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Jl S. Afr. Bot. 42(1): 79 (1976)

#### Original name
Sphaeria filiformis Alb. & Schwein., 1805

### Remarks
null

path: /life/Fungi/Ascomycota/Sordariomycetes/Xylariales/Xylariaceae/Xylaria/Xylaria filiformis/ Syn. Podosordaria filiformis/README.md


text:
# Semantic Image Synthesis with Score-Based Generative Models

This repo contains the implementation for my Bachelor thesis [Semantic Image Synthesis with Score-Based Generative Models](https://github.com/TimK1998/Bachelorarbeit)

by [Tim<EMAIL_ADDRESS>
Please find my thesis (english) following this link: https://github.com/TimK1998/Bachelor-Thesis/blob/main/Bachelorarbeit.pdf

--------------------

Note: This README is work in progress!

# How to run the code

## Dependencies

First install PyTorch 1.8, then run ```setup.py``` with the command
```sh
python setup.py install
```

## Usage
Train or sample from models trough ```main.py```:
```sh
main.py:
  workdir: Working directory
  config: Name of the config
  mode: <train|sample>: Running mode: train or sample
  --sample_mode: Sampling mode
```

* ```workdir``` is the path where all checkpoints and samples should be saved. The path you specify gets appended to ```./output``` so you might want to specify the working directory with only one word.
* ```config``` is the name of the config to use. Refer to ```configs/ve``` for examples.
* ```mode``` is either "train" or "sample". When set to train is starts the training pipeline for a new model, or continues training if workdir already contains a valid checkpoint. When set to sample it loads the latest checkpoint in ```./output/workdir/checkpoints``` and starts sampling with the sampling mode specified.
* ```sample_mode```: The mode for the sampling procedure. Already implemented are ```uncond``` for unconditional samples and ```cond``` for conditional samples. Feel free to add modes by implementing them in the ```sample(...)``` function in ```run.py```.

## Train

For example to train a Score-Based Generative Model on the Cityscapes dataset run
```sh
python main.py cityscapes_workdir cityscapes256_ve train
```

## Sample

For example to conditinally sample from a trained Score-Based Generative Model on the Cityscapes dataset run
```sh
python main.py cityscapes_workdir cityscapes256_ve sample cond
```

# References

If you find the code useful for your research, please consider citing
```bib
@unpublished{kuechler_sem_synth_score_based,
    author="Tim Küchler",
    title={Semantic Image Synthesis with Score-Based Generative Models},
    year={2021}
    howpublished={\url{https://github.com/TimK1998/SemanticSynthesisForScoreBasedModels}}
}
```

This work is built upon previous papers which might also interest you:

* Yang Song and Jascha Sohl-Dickstein and Diederik P Kingma and Abhishek Kumar and Stefano Ermon and Ben Poole. "Score-Based Generative Modeling through Stochastic Differential Equations." *International Conference on Learning Representations*. 2021.
* Yang Song and Stefano Ermon. "Generative Modeling by Estimating Gradients of the Data Distribution." *Proceedings of the 33rd Annual Conference on Neural Information Processing Systems*. 2019.
* Yang Song and Stefano Ermon. "Improved techniques for training score-based generative models." *Proceedings of the 34th Annual Conference on Neural Information Processing Systems*. 2020.

The code heavily borrows from https://github.com/yang-song/score_sde_pytorch

# License

This implementation is licensed under the Apache License 2.0.


text:
---
layout: tutorial_page
title: "OpenMP Directives: Synchronization Constructs: TASKWAIT Directive"
release_number: UCRL-MI-133316
author: Blaise Barney, Lawrence Livermore National Laboratory
tutorial: "OpenMP"
---

## Purpose:

* New with OpenMP 3.1

* The TASKWAIT construct specifies a wait on the completion of child tasks generated since the beginning of the current task.

## Format:

### Fortran
```
!$OMP TASKWAIT
```

### C/C++

#pragma omp taskwait  newline

## Restrictions:

Because the taskwait construct does not have a C language statement as part of its syntax, there are some restrictions on its placement within a program. The taskwait directive may be placed only at a point where a base language statement is allowed. The taskwait directive may not be used in place of the statement following an if, while, do, switch, or label. See the OpenMP 3.1 specifications document for details.

repository: nicolae-stroncea/HPC-Tutorials

gha_license_id: MIT

repo_name: nicolae-stroncea/HPC-Tutorials


text:
---
kind: '📌 Docs/Architecture Decision Records'
---
# ADR 0016: Embracing Custom Elements Manifest

🗓 2021-06-29 · ✍ Hubert Sablonnière

## The context

We've been using [Web Component Analyzer (WCA)](https://github.com/runem/web-component-analyzer) for a while now.
This awesome tool by [Rune Mehlsen](https://github.com/runem) helped us a lot to document our Web Components.
With one command, WCA can scan and parse all our components' source code (with their JSDoc comments) and generate some documentation.

This documentation features the description of the component extracted from the JSDoc, but also the list of the different inputs/outputs that compose the API of a Web Component:

* Attributes
* Properties
* Methods
* Events
* Slots
* CSS custom properties
* CSS parts

At first, we were using WCA's Markdown output.
This output contained the title, the description and then a series of tables featuring the different parts of a Web Component API mentioned above.
Using Storybook's [notes addon](https://storybook.js.org/addons/@storybook/addon-notes), we were able to display this Markdown document directly in our Storybook.

Some time later, we switched to WCA's JSON output (see ADR #0009).
This output contained the same kind of details the Markdown output had, but in a machine-readable format.
This format is specific to WCA, but the Web Component version of Storybook's [docs addon](https://storybook.js.org/addons/@storybook/addon-docs/) is compatible with it.
Thanks to this integration, we decided to replace Storybook's notes addon with Storybook's docs addon.
We also decided to stop using WCA's Markdown output and only generate the single JSON file containing the documentation for all our components.

## The problem

### Customization

We wanted to customize the documentation of our components with some additionnal information:

* Link to GitHub source file
* CSS default display of the custom element
* List of images used by the component
* Describe the types of our APIs

WCA's behaviour and JSON output were not really meant to be customized.
This why we started to put those custom information manually in the description part of the JSDoc.
This is cumbersome and error prone.

### Performance

Another (small) limitation is performance.
It takes 8 seconds for WCA to generate the documentation for all our components.
Because of this, we decided not to run this task in watch mode.
During dev, when we updated the source and/or JSDoc of a component, we had to manually run WCA to see the up-to-date docs in Storybook.

## The solution

### The new CEM standard format

Following WCA's JSON custom format, a group of wonderful people started some discussions to create a standard format called [Custom Elements Manifest (CEM)](https://github.com/webcomponents/custom-elements-manifest).
In june 2021, the first version of this format was released.

Some details are still under discussion but this first version is a strong fondation.
As you can see in the [schema](https://github.com/webcomponents/custom-elements-manifest/blob/master/schema.d.ts), it already handles most of the cases we need to describe and document a library of Web Components.

You can find more information about it in [Pascal Schilp's blog post](https://dev.to/open-wc/introducing-custom-elements-manifest-gkk).

### The new analyzer

Along with this new format, the brillant folks behind [Open Web Components](https://open-wc.org/) released a new tool: [Custom Elements Manifest analyzer (CEM analyzer)](https://github.com/open-wc/custom-elements-manifest/tree/master/packages/analyzer).
This new analyzer serves the same purpose as WCA.
It scans and parses your Web Component's source code and produces a `custom-elements.json` following the new standard CEM format.
On top of vanilla Web Components written with JavaScript, this new analyzer also handles TypeScript and the following libraries: [Lit](https://lit.dev/), [Fast](https://github.com/microsoft/fast), [Stencil](https://stenciljs.com/), [Catalyst](https://github.github.io/catalyst/).

CEM analyzer features a powerful plugin system:

* OPINIONATED: It is very easy to write a plugin if you're familiar with ASTs or other plugin systems like ESLint or Rollup.
* It has [very good documentation](https://github.com/open-wc/custom-elements-manifest/blob/master/packages/analyzer/docs/plugins.md).
* It has a [plugin template](https://github.com/open-wc/cem-plugin-template) to get started easily.
* It has an [online playground](https://custom-elements-manifest.netlify.app) to easily try and share a plugin idea.

👍 This should allow us to customize the documentation of our components with some additionnal information.

CEM analyzer is faster than WCA:

* WCA takes around 8 seconds to generate the JSON.
* CEM analyzer takes around 2 seconds to generate the JSON.

👍 This should allow us to run this in watch mode on each modification.

### Generating the manifest

We tried to run CEM analyzer on our component's library, and the first try was very promising.
Thanks to the plugin system, we were able to adjust a few details and to customize the documentation with some additionnal information.
Here's a list of the plugins we wrote so far:

* `sort-items`: sorts all items alphabetically by their name (attributes, properties...)
  * This really helps when doing some diffs to see what changed between versions.
* `remove-private-members`: removes private members (attributes, properties and methods) identified with a `_` name prefix
  * We use the `_` private prefix convention a lot for our properties and methods. We don't want to document those publicly.
* `identify-readonly-members`: identifies properties with a getter but no setter as readonly
  * Our two map marker components expose some properties for the `≤cc-map>` component, with this plugin we can identify this implicit pattern.
* `support-cssdisplay-jsdoc`: adds support for a @cssdisplay JSDoc custom tag.
  * We used to add this manually in the description, now we have a proper tag to document this aspect.
* `add-github-source-in-description`: adds a link to source file on GitHub in the description
  * We used to add this manually in the description, this is now automagic!
* `list-images`: adds a list of images used by the component to the description
  * This is a nice bonus as a user of the component to see this.

Those plugins were really fun to create.
You can see the source in the `cem` folder.

With this new analyzer and those custom plugins, we can now generate a `custom-elements.json` that follows the new CEM format.
It will be released along the components on npm with the next version.

### Integrating the manifest with Storybook

Our Storybook setup is not yet compatible with this new CEM format.
While we wait for support, we wrote a simple transformer.
It takes the `custom-elements.json` generated by CEM analyzer and produces a JSON using WCA's custom format that our Storybook understands.
This allowed us to remove WCA from the project and only rely on CEM analyzer.

The speed bump from 8 seconds to 2 seconds was also a good reason to enable the manifest generation in watch mode.
Now during dev, the docs in Storybook is always up-to-date.

## What's next?

Right now, we're documenting the types of our properties and events in the description.
This includes a lot of duplication and manual steps.
We would really like to create a common `d.ts` file with our interfaces that CEM analyzer could understand and use.

We'll be following the evolution of this format.
We're very interested in a few discussions:

* [Add readonly flag to properties](https://github.com/webcomponents/custom-elements-manifest/issues/34)
* [Add a field for "elementVersion"?](https://github.com/webcomponents/custom-elements-manifest/issues/47)
* [Add support for custom data](https://github.com/webcomponents/custom-elements-manifest/issues/38)
* [Add support for typed Custom CSS Properties](https://github.com/webcomponents/custom-elements-manifest/issues/68)
* [Allowed children for slots](https://github.com/webcomponents/custom-elements-manifest/issues/46)
* [Add recommended JSDoc tags](https://github.com/webcomponents/custom-elements-manifest/issues/42)

We'll also be watching the support for this format in standard Storybook and in the prebuilt version we're currently using.

FYI, we have an experiment in branch to automatically extract the default CSS display but it's still WIP.

repository: CleverCloud/clever-components

repo_name: CleverCloud/clever-components


text:
# NOTE: Implementation hidden due to Coursera Terms of Service.

# Emojify
Have you ever wanted to make your text messages more expressive? Your emojifier app will help you do that. So rather than writing "Congratulations on the promotion! Lets get coffee and talk. Love you!" the emojifier can automatically turn this into "Congratulations on the promotion! 👍 Lets get coffee and talk. ☕ Love you! ❤"

The model takes as input a sentence (such as "Let's go see the baseball game tonight!") and finds the most appropriate emoji to be used with this sentence (⚾). In many emoji interfaces, you need to remember that  ❤  is the "heart" symbol rather than the "love" symbol. But using word vectors, the training set explicitly relates only a few words to a particular emoji, the algorithm will be able to generalize and associate words in the test set to the same emoji even if those words don't even appear in the training set. This allows you to build an accurate classifier mapping from sentences to emojis, even using a small training set.

Start of the notebook is a baseline model (Emojifier-V1) using word embeddings, then later a more sophisticated model (Emojifier-V2) that further incorporates an LSTM.

# Examples of Model Successes:
Input: i adore you              Output: i adore you ❤
Input: i love you               Output: i love you ❤
Input: funny lol                Output: funny lol 😄
Input: let's play with a ball   Output: let's play with a ball ⚾
Input: food is ready            Output: food is ready 🍴
Input: not feeling happy        Output: not feeling happy 😄

# Examples of Model Failure:
Both versions of the emoji prediction model fail to predict the correct emoji in certain cases such as negation due to the small training set size. If we train on a larger dataset then the LSTM model (V2) will handle negation better than V1 which doesn't worry about word ordering.

Expected emoji:😄   Prediction: she got me a nice present	❤
Expected emoji:😞   Prediction: yesterday we lost again	⚾
Expected emoji:😞   Prediction: not feeling happy 😄

# Conclusion
Model needs a larger training dataset to handle negations and other word combinations that are currently failing. LSTM is the clear winner because it handles word ordering unlike the V1 model. Possible extensions/modifications of this project are:
1) convert an input sentence into a emoji output sentence
   Input: i adore you    Output: ❤
2) or replace phrases with emojis throughout a sentence instead of adding an emoji at the end.
   Input: Lets get coffee and talk.  Output: Lets get ☕ and talk.


text:
> [Go to French version](/fr/Règlements/Décrets,%20ordonnances%20et%20règlements%20statutaires/2019/131.md)

# Black Lake First Nation Water Power Regulations

**SOR/2019-131**

Enabling authorities:
- [FIRST NATIONS COMMERCIAL AND INDUSTRIAL DEVELOPMENT ACT](/en/Acts/Statutes%20of%20Canada/2005/c.%2053.md)

- [DOMINION WATER POWER ACT](/en/Acts/Revised%20Statutes%20of%20Canada/W/W-4.md)

Date registered: 10 May 2019

----------

Whereas the Black Lake First Nation has requested by resolution of its council that the Minister of Indian Affairs and Northern Development recommend to the Governor in Council the making of the annexed Regulations and, in accordance with paragraph 5(1)(a) of the [First Nations Commercial and Industrial Development Act](/en/Acts/Statutes%20of%20Canada/2005/c.%2053.md)[a], the Minister has received that resolution;

a: S.C. 2005, c. 53

Whereas the Black Lake First Nation is a first nation within the meaning of the [First Nations Commercial and Industrial Development Act](/en/Acts/Statutes%20of%20Canada/2005/c.%2053.md)[a];

Whereas the purpose of the annexed Regulations is to ensure that the laws set out in Schedule 2 to the annexed Regulations apply as federal law to the project, within the limits of federal constitutional authority;

Whereas the annexed Regulations specify provincial officials by whom, and provincial bodies by which, powers may be exercised or duties are to be performed;

And whereas, in accordance with paragraph 5(1)(b) of the [First Nations Commercial and Industrial Development Act](/en/Acts/Statutes%20of%20Canada/2005/c.%2053.md)[a], an agreement has been concluded between the Minister of Indian Affairs and Northern Development, the Province of Saskatchewan and the council of the Black Lake First Nation for the administration and enforcement of the annexed Regulations by those provincial officials and bodies;

Therefore, Her Excellency the Governor General in Council, on the recommendation of the Minister of Indian Affairs and Northern Development, pursuant to section 3[b] of the [First Nations Commercial and Industrial Development Act](/en/Acts/Statutes%20of%20Canada/2005/c.%2053.md)[a] and paragraph 15(d) of the [Dominion Water Power Act](/en/Acts/Revised%20Statutes%20of%20Canada/W/W-4.md)[c], makes the annexed Black Lake First Nation Water Power Regulations.

b: S.C. 2012, c. 19, s. 63

c: R.S., c. W-4

## Interpretation

**Definitions**

**1** The following definitions apply in these Regulations.

***incorporated laws*** means the statutes and regulations of Saskatchewan, or the portions of them, that are set out in Schedule 2, as amended from time to time and as adapted by sections 13 to 34. (*texte législatif incorporé*)

***project*** means the construction, modification, operation, decommissioning, reclamation and abandonment of hydroelectric facilities on the project lands and the generation of electricity from the water power available within those lands. (*projet*)

***project lands*** means the lands of the Black Lake First Nation Chicken Reserve No. 224 that are set out in Schedule 1. (*terres du projet*)

**Provincial – The Interpretation Act, 1995**

**2** The incorporated laws are to be interpreted in accordance with the Saskatchewan statute The Interpretation Act, 1995, S.S. 1995, c. I-11.2, as amended from time to time, and, for that purpose, references to “enactment” in that Act are to be read to include the incorporated laws.

**Other expressions**

**3** For greater certainty, the adaptations in sections 13 to 34 are to be interpreted to be part of the incorporated laws to which they apply.

## Application of Laws

**Incorporation by reference**

**4** Subject to section 5, the incorporated laws apply to the project.

**Restriction – laws in force**

**5**

- **(1)** A provision of an incorporated law applies only if the provision of the law of Saskatchewan that it incorporates is in force.

**Restriction – limits of authority**

- **(2)** For greater certainty, an incorporated law applies only to the extent that it is within the limits of federal constitutional authority.

**Incorporation of procedural matters**

**6**

- **(1)** Unless otherwise provided and subject to any adaptations set out in sections 13 to 34, the following are to conform to the laws of Saskatchewan, whether or not those laws have been set out in Schedule 2:
	- **(a)** the enforcement of incorporated laws;
	- **(b)** the prosecution of an offence, or any other proceedings, in relation to the contravention of an incorporated law;
	- **(c)** the review or appeal of an action or decision taken, or of a failure to take an action that could have been taken, under an incorporated law; and
	- **(d)** the delivery of notices or the service of documents in relation to an action to be taken under an incorporated law.

**Related powers**

- **(2)** For the purposes of subsection (1), a person or body that has a power, duty or function under a law of Saskatchewan has the same power, duty or function in respect of any actions taken under that subsection.

**Offences and penalties**

**7**

- **(1)** If contravention of a law of Saskatchewan that is incorporated in these Regulations is an offence under the laws of Saskatchewan, contravention of the incorporated law is also an offence and is subject to the same penalties as under the laws of Saskatchewan.

**Violations and administrative monetary penalties**

- **(2)** If contravention of a law of Saskatchewan that is incorporated in these Regulations is a violation under the laws of Saskatchewan, contravention of the incorporated law is also a violation and is subject to the same administrative monetary penalties as under the laws of Saskatchewan.

**Financial requirements under lease**

**8** If the incorporated laws require a cash deposit or other financial security to be given, those requirements do not displace, but instead apply in addition to, the requirements of any lease of the project lands in relation to cash deposits or other financial security.

## Inapplicable Federal Regulations

**Exclusion**

**9** The [Dominion Water Power Regulations](/en/Regulations/Consolidated%20Regulations%20of%20Canada/1601-1700/C.R.C.,%20c.%201603.md), the [Indian Reserve Waste Disposal Regulations](/en/Regulations/Consolidated%20Regulations%20of%20Canada/901-1000/C.R.C.,%20c.%20960.md) and the [Indian Timber Regulations](/en/Regulations/Consolidated%20Regulations%20of%20Canada/901-1000/C.R.C.,%20c.%20961.md) do not apply to the project.

## Use and Occupation of Land

**Lease, permit or easement**

**10** The Minister of Indian Affairs and Northern Development may issue leases or permits or grant easements for the purpose of carrying out the project.

## Water Rental

**Payment**

**11**

- **(1)** The water rentals required to be paid in respect of the project under The Water Power Rental Regulations, as incorporated and adapted by these Regulations, are to be paid in the following proportions:
	- **(a)** 50% to the Water Security Agency or its successor; and
	- **(b)** 50% to Her Majesty in right of Canada.

**Use and benefit**

- **(2)** The water rentals paid to Her Majesty in right of Canada are to be for the use and benefit of the Black Lake First Nation.

## Transitional Provision

**Survival of rights**

**12** Any licences, permits, authorizations, orders or exemptions — including any amendments to them — issued by a provincial official in relation to the project before the day on which these Regulations come into force are to be considered to have been issued under these Regulations and to be valid for the purposes of these Regulations.

## Adaptations Applicable to Incorporated Laws

**Statutes and regulations of Saskatchewan**

**13** Unless otherwise indicated, the statutes and regulations referred to in sections 18 to 34 are statutes and regulations of Saskatchewan.

**Reference to Crown**

**14** For greater certainty, in the incorporated laws,
- **(a)** “Crown” does not include Her Majesty in right of Canada;
- **(b)** “Crown lands” and “Crown mineral lands” do not include the project lands; and
- **(c)** a “Crown disposition” does not include a disposition by Her Majesty in right of Canada.

**Interpretation of incorporated laws**

**15**

- **(1)** Incorporated laws are to be read without reference to any of the following:
	- **(a)** spent provisions;
	- **(b)** provisions appointing a person, providing for the remuneration of a person, or establishing or continuing a provincial body, program, fund or registry;
	- **(c)** provisions relating to the internal management of a provincial body;
	- **(d)** provisions requiring or authorizing money to be spent from the General Revenue Fund of Saskatchewan or from other funds administered by Saskatchewan;
	- **(e)** provisions authorizing the Lieutenant-Governor in Council, a provincial Minister or a provincial body to make regulations of general application except to the extent required to make the regulations set out in Schedule 2;
	- **(f)** provisions authorizing any person or provincial official or body to expropriate any interest in lands; and
	- **(g)** provisions authorizing or imposing a tax or granting or authorizing a tax credit.

**Interpretation of incorporated laws**

- **(2)** Despite paragraph (1)(b),
	- **(a)** a person appointed to a position under a law of Saskatchewan that has been incorporated by reference in these Regulations is considered to have been appointed to the same position for the purposes of these Regulations for as long as that person remains in that position under the law of Saskatchewan; and
	- **(b)** a provincial body, program, fund or registry established or continued under a law of Saskatchewan that has been incorporated by reference in these Regulations is considered to have been established or continued for the purposes of these Regulations.

**Specified persons, officials and bodies**

- **(3)** For greater certainty, a person, provincial official or provincial body that has a power, duty or function under a law of Saskatchewan incorporated by reference in these Regulations has the same power, duty or function under these Regulations, subject to the adaptations set out in sections 18 to 34.

**Interpretation of incorporated laws**

- **(4)** For greater certainty, if a law of Saskatchewan is adapted by these Regulations, a reference to that law in an incorporated law, or in any notice, form, instrument or other document issued under an incorporated law, is to be read as a reference to that law as adapted by these Regulations.

**Limitation on searches and inspections**

**16** A power to conduct searches or inspections under an incorporated law, including the power to enter a place, does not include a power to enter or search, or to inspect anything in, a federal government office, without the consent of the person who is or appears to be in charge of that office.

**Limitation on production of documents**

**17** A power to seize, remove or compel the production of documents under an incorporated law does not include a power to seize, remove or compel the production of a document in the possession of the federal government, without the consent of the person in possession of the document.

## Adaptations to Incorporated Laws

### The Environmental Management and Protection Act, 2010

**Adaptation to subsection 13(2)**

**18** In subsection 13(2) of The Environmental Management and Protection Act, 2010, a reference to “owner” is to be read as a reference to Her Majesty in right of Canada and the Black Lake First Nation.

**Adaptation to subsection 34(2)**

**19**

- **(1)** Subsection 34(2) of the Act is to be read as follows:

- **(2)** If the minister is satisfied that any sewage works will adversely affect any land other than the project lands, the minister shall provide a written request to the permit holder requiring the permit holder to:
	- **(a)** in respect of lands other than reserve lands,
		- **(i)** obtain from the registered owner of the other land, an easement, in the prescribed form,
		- **(ii)** obtain from any other person having a registered interest in the land mentioned in subclause (i) a consent to the granting of the easement,
		- **(iii)** apply to the Registrar of Titles to register the easement against the titles to the affected lands; and
	- **(b)** in respect of reserve lands situated outside the project lands, obtain an easement pursuant to the [Indian Act](/en/Acts/Revised%20Statutes%20of%20Canada/I/I-5.md).

**Adaptation to subsection 34(4)**

- **(2)** In subsection 34(4) of the Act, a reference to “subsection (2)” is to be read as a reference to “clause (2)(a)”.

**Adaptation to paragraph 50(1)(a)**

**20** Paragraph 50(1)(a) of the Act is to be read as follows:

- **(a)** on any land that is owned by another person or the Crown or on the project lands or any other Black Lake reserve lands; or

### The Environmental Management and Protection (Saskatchewan Environmental Code Adoption) Regulations

**Adaptation to paragraph 1-7(1)(a)**

**21**

- **(1)** In paragraph 1-7(1)(a) of Chapter B.1.1 of the Appendix to The Environmental Management and Protection (Saskatchewan Environmental Code Adoption) Regulations, a reference to “owner ” is to be read as a reference to Her Majesty in right of Canada and the Black Lake First Nation.

**Adaptation to paragraph 1-7(2)(a)**

- **(2)** In paragraph 1-7(2)(a) of Chapter B.1.1 of the Appendix to the Regulations, a reference to “owner of adjacent land” is to be read as a reference to Her Majesty in right of Canada and the Black Lake First Nation.

**Adaptation to paragraph 1-8(2)(a)**

**22** In paragraph 1-8(2)(a) of Part 1 of Chapter B.1.2 of the Appendix to the Regulations, a reference to “owner” is to be read to include Her Majesty in right of Canada and the Black Lake First Nation.

**Adaptation to paragraphs 3-2(a) and 3-3(b)**

**23** In paragraphs 3-2(a) and 3-3(b) of Part 3 of Chapter C.3.1 of the Appendix to the Regulations, a reference to “landowner” is to be read to include Her Majesty in right of Canada and the Black Lake First Nation.

### The Ground Water Regulations

**Adaptation to subsection 26(1)**

**24** In subsection 26(1) of The Ground Water Regulations, a reference to “landowner” is to be read to include Her Majesty in right of Canada.

### The Hazardous Substances and Waste Dangerous Goods Regulations

**Adaptation to subparagraph 15(1)(b)(i)**

**25** In subparagraph 15(1)(b)(i) of The Hazardous Substances and Waste Dangerous Goods Regulations, the reference to the ““National Fire Code of Canada, 1990”, as revised, amended or substituted at the date of the coming into force of this subclause” is to be read as a reference to the ““National Fire Code of Canada, 2010”, as amended from time to time”.

### The Saskatchewan Employment Act

**Adaptation to paragraph 3-1(1)(t)**

**26** The definition owner in paragraph 3-1(1)(t) of The Saskatchewan Employment Act is to be read as follows:

***“owner”*** means:
- **(i)** any person to whom Her Majesty the Queen in right of Canada has granted a right in relation to the project, and includes any continuation of that person resulting from one or more amalgamations or reorganizations and any successor to that person; and
- **(ii)** any delegate, assignee, partnership, agent, sub-lessor, receiver, mortgagee or person who acts for or on behalf of a person mentioned in subclause (i).

### The Uniform Building and Accessibility Standards Act

**Adaptation to paragraph 2(1)(j.1)**

**27**

- **(1)** The definition land surveyor in paragraph 2(1)(j.1) of The Uniform Building and Accessibility Standards Act is to be read as follows:

- **(j.1)** ***“land surveyor”*** means a Canada Lands Surveyor within the meaning of section 2 of the [Canada Lands Surveyors Act](/en/Acts/Statutes%20of%20Canada/1998/c.%2014.md);

**Adaptation to paragraph 2(1)(k)**

- **(2)** The definition local authority in paragraph 2(1)(k) of the Act is to be read without reference to “or” at the end of subparagraph (ii), with reference to “or” at the end of subparagraph (iii) and with reference to the following after subparagraph (iii):

	- **(iv)** the Black Lake First Nation;

**Adaptation to subsection 21(3)**

**28** Subsection 21(3) of the Act is to be read without reference to “and may be added to the tax payable on the property and collected in the same manner as taxes on the property”.

### The Uniform Building and Accessibility Standards Regulations

**Adaptation to subsection 11(1)**

**29** Subsection 11(1) of The Uniform Building and Accessibility Standards Regulations is to be read without paragraph (c).

### The Water Power Regulations

**Adaptation to section 11**

**30**

- **(1)** Section 11 of The Water Power Regulations is to be read with the following after subsection (1):

- **(1.1)** The corporation shall provide a copy of the notice to Her Majesty in right of Canada.

**Adaptation to subsection 11(3)**

- **(2)** Subsection 11(3) of the Regulations is to be read as follows:

- **(3)** After considering the representations mentioned in subsection (1), the corporation shall issue a written decision, serve a copy of the decision on the applicant or licensee and provide a copy of the decision to Her Majesty in right of Canada.

**Adaptation to section 11**

- **(3)** Section 11 of the Regulations is to be read with the following after subsection (5):

- **(6)** Nothing in this section shall be interpreted so as to limit the ability of Her Majesty in right of Canada to bring a proceeding or take any enforcement measures that Her Majesty in right of Canada is entitled to bring or to take under federal legislation.

### The Water Power Rental Regulations

**Adaptation to subsection 3(1)**

**31**

- **(1)** Subsection 3(1) of The Water Power Rental Regulations is to be read as follows:
**3**

- **(1)** Every person who uses water for the purpose of producing water power using works, including persons who store water for the purpose of producing water power, shall pay the water rental calculated in accordance with these regulations of which 50% shall be paid to the corporation and 50% to Her Majesty in right of Canada.

**Adaptation to subsection 3(4)**

- **(2)** Subsection 3(4) of the Regulations is to be read as follows:

- **(4)** Every licensee shall submit to the corporation and to Her Majesty in right of Canada all data required to calculate the water rental payable pursuant to these regulations.

**Adaptation to subsection 3(8)**

- **(3)** The portion of subsection 3(8) of the Regulations before paragraph (a) is to be read as follows:

- **(8)** The corporation and Her Majesty in right of Canada may charge and collect interest on any water rental due to the corporation or Her Majesty in right of Canada, as the case may be, not paid in full by the date it is payable pursuant to these regulations at a rate equal to:

**Adaptation to subsection 3(9)**

- **(4)** Subsection 3(9) of the Regulations is to be read as follows:

- **(9)** Any water rental not paid in full by the date on which it is payable, together with any interest payable pursuant to subsection (8), is a debt due and owing to the corporation or Her Majesty in right of Canada, as the case may be, by the persons from whom it is payable, and the corporation or Her Majesty in right of Canada, as the case may be, may recover that debt in any manner allowed by law for the recovery of debts due to the Crown and Her Majesty in right of Canada.

**Adaptation to section 3**

- **(5)** Section 3 of the Regulations is to be read with the following after subsection (12):

- **(13)** All payments made to and interest collected by Her Majesty in right of Canada under this section shall be for the use and benefit of the Black Lake First Nation and shall be made payable and remitted to the Receiver General of Canada.

### The Waterworks and Sewage Works Regulations

**Adaptation to section 72**

**32** In section 72 of The Waterworks and Sewage Works Regulations, a reference to “clause 34(2)(a)” is to be read as a reference to “subclause 34(2)(a)(i)”.

## Coming into Force

**Registration**

**33** These Regulations come into force on the day on which they are registered.

### **SCHEDULE 1**
**(Section 1)**
## Project Lands
All surface lands within Chicken Indian Reserve No. 224, Province of Saskatchewan, depicted as Surface Zone A on Administrative Area Plan 104899 filed in the Canada Lands Surveys Records.

### **SCHEDULE 2**
**(Section 1, subsection 6(1) and paragraph 15(1)(e))**
## Incorporated Laws
- The Environmental Management and Protection Act, 2010, S.S. 2010, c. E-10.22, other than subsections 13(3) and (4) and Division 1 of Part VI
- The Environmental Management and Protection (General) Regulations, R.R.S. c. E-10.22 Reg. 1, other than Part V
- The Environmental Management and Protection (Saskatchewan Environmental Code Adoption) Regulations, R.R.S. c. E-10.22 Reg. 2
- The Fire Safety Act, S.S. 2015, c. F-15.11, other than section 34
- The Ground Water Regulations, Sask. Reg. 172/66
- The Hazardous Substances and Waste Dangerous Goods Regulations, R.R.S. c. E-10.2 Reg. 3
- The Occupational Health and Safety Regulations, 1996, R.R.S. c. O-1.1 Reg. 1
- The Saskatchewan Employment Act, S.S. 2013, c. S-15.1, other than Parts II and V to VIII
- The Uniform Building and Accessibility Standards Act, S.S. 1983-84, c. U-1.2
- The Uniform Building and Accessibility Standards Regulations, R.R.S. c. U-1.2 Reg. 5
- The Water Power Regulations, R.R.S. c. W-6 Reg. 3
- The Water Power Rental Regulations, R.R.S. c. W-6 Reg. 2
- The Water Security Agency Act, S.S. 2005, c. W-8.1, other than sections 23 and 24, subsection 38(1), sections 39 to 42 and 64 to 66 and subsections 83(2) and (3)
- The Water Security Agency Regulations, R.R.S. c. W-8.1 Reg. 1
- The Waterworks and Sewage Works Regulations, R.R.S. c. E-10.22 Reg. 3
- The Workers’ Compensation Act, 2013, S.S. 2013, c. W-17.11, other than section 157 and subsection 159(1)

repository: TravisMadill/CanadianLaws

path: /en/Regulations/Statutory Orders and Regulations/2019/131.md

repo_name: TravisMadill/CanadianLaws


text:
# Log17
Log17 is a small C++17 header for static logging.

**Static logging** is when you associate a singleton `Log` class with some set of message-generating code,
  typically a single module or a set of grouped modules which share this `Log`.
It is *static* because the number of `Log`s doesn't change and hence the class can use static methods
  for dispatching messages.
No object instantiation is necessary.
This library uses partial template specialization of a single class template to provide both logs and sinks.

The API comes with a built-in `FILE*` sink, but customizing it for other i/o (e.g. `std::iostream`) is rudimentary.
The `FILE*` sink is enough to pass in stdio, file, and `popen()` handles.

You can then instantiate a singleton `Log` classes which accept any number of other
  singleton `Log` classes as template parameters.
These parameters act as sinks for the prior `Log`, allowing you to construct entire graphs
  of `Log` objects.

For example, you can have a main application `Log` that's tied to a `FILE*`-based `Log` acting as a sink,
  and another `FILE*`-based `Log` which writes to a file.
When you write to the application `Log`, it writes to both of its underlying sinks.
On top of that, you can have feature or module Log which uses the main application `Log` as *its* sink.

Each `Log` comes with nine levels of verbosity and can be configured by a
  template parameter (and hence via preprocessor macro) or at runtime.
Using preprocessor macros as template arguments allows you to tune the verbosity of logging code
  at compile time.
If you configure your Logger's verbosity at compile time, then messages that exceed its threshold
  are nooped, resulting in very fast code.

Just put them in a "feature" `Log` and turn that log's verbosity down when you don't need it.


text:
Peast
==========

[![Latest Stable Version](https://poser.pugx.org/mck89/peast/v/stable)](https://packagist.org/packages/mck89/peast)
[![Total Downloads](https://poser.pugx.org/mck89/peast/downloads)](https://packagist.org/packages/mck89/peast)
[![License](https://poser.pugx.org/mck89/peast/license)](https://packagist.org/packages/mck89/peast)
[![Build Status](https://github.com/mck89/peast/actions/workflows/test.yml/badge.svg)](https://github.com/mck89/peast/actions/workflows/test.yml)

**Peast** _(PHP ECMAScript Abstract Syntax Tree)_ is a PHP 5.4+ library that parses JavaScript code, according to [ECMAScript specification](http://www.ecma-international.org/publications/standards/Ecma-262.htm), and generates an abstract syntax tree following the [ESTree standard](https://github.com/estree/estree).

Installation
-------------
Include the following requirement to your composer.json:
```
{
	"require": {
		"mck89/peast": "dev-master"
	}
}
```

Run `composer install` to install the package.

Then in your script include the autoloader and you can start using Peast:

```php
require_once "vendor/autoload.php";

$source = "var a = 1"; //Your JavaScript code
$ast = Peast\Peast::latest($source, $options)->parse(); //Parse it!
```

Known issues
-------------
When Xdebug is enabled and Peast is used to scan code that contains deeply nested functions, this fatal error can appear:
```
PHP Fatal error:  Maximum function nesting level of '512' reached, aborting!
```
or
```
PHP Warning:  Uncaught Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '256' frames
```
To prevent this you can set `xdebug.max_nesting_level` to a higher value, such as 512.

Documentation
-------------
Read the documentation for more examples and explanations:

 1. [AST generation and tokenization](doc/ast-and-tokenization.md)
 2. [Tree Traversing](doc/tree-traversing.md)
 3. [Querying By Selector](doc/querying-by-selector.md)
 4. [Rendering](doc/rendering.md)

[Changelog](doc/changelog.md)

gha_language: PHP


text:
# linting

Installs linter dependencies and creates lint configuration files.

## Usage

Run generator from root of the project that needs linting.

```
$ yo springworks:linting
```

## Result

NPM modules will be installed and `.eslintrc` created in `.` and `./test` dir.

repository: Springworks/generator-springworks

repo_name: Springworks/generator-springworks


text:
# label-process-output
Annotate process outputs

## Install
```
npm i -g @profiprog/label-process-output@latest
```

## Usage

```
Usage: node label-process-output.js [OPTONS] COMMAND [...ARGS]
Options:
    +<splitchar><args> split <args> by <splitchar> into multiple arguments
    -l alias of --label
    --label prefix of output.
        For example: --label backup create prefix:
        backup> for stdout
        and
        backup> for stderr
        Default is base name of command.
        Labels can also contains special placeholders:
                %t will be expanded to timestamp (like 2019-05-15 17:44:25.748)
                %T will be expanded to time (like 17:44:25.748)
                %% will be replaced single '%'
    -e Print prefixed stdout to stderr and print stdout normally.
        It's handy if stdout is captured like: VAL="$(label-process-output.js md5 "$FILE")"
    -0 Do not print stdout, neither to stdout or stderr
    -s Do not prefixed stdout, just pass it thru.
```

repository: profiprog/label-process-output

repo_name: profiprog/label-process-output


text:
# Feedback

This is the section concerning how we manage feedbacks.

## Save a feedback

Takes a review score between 1 and 5, the comment left by the customer and the customer messenger's id and stores in the table `Feedback`. This table is
analysed later for more insights on customer's appreciation of the application.

### HTTP Request

> To test  :

```ruby
require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
```

```python
import kittn

api = kittn.authorize('meowmeowmeow')
```

```shell
# With shell, you can just pass the correct header with each request
curl
	-d
	"{"review_score=5&review_comment='GOOD'&customer_id=43219XDF"
	-X POST
	 "http://3islabs.com/everyprint/api/feedback/save"

```

```javascript
$.POST{}

let api = kittn.authorize('meowmeowmeow');
```

`POST http://3islabs.com/everyprint/api/feedback/save`

### Query Parameters

Parameter | Validation | Description
--------- | ------- | -----------
review_score | Between 1 and 5 | The rating given by the customer
review_comment | Trim with no special char | Additional comment done by the customer
customer_id | Series of char and int | The customer messenger's id

### Return Code

> The above command should return :

```json
{
  "return_code" : "111"
}
```

Code | Meaning
-----| -------
111 | Feedback saved successfully
222 | Parameters validation failed
333 | Error with the backend. Just wait and retry

<aside class="warning">
Not yet implemented !!!!!
</aside>

## Average feedback score

In order to get the overall feeback rating, the customers issued us. In order to achieve that, we make an `average operation` on the overall ratings we obtained and process it back to the endpoint who issued the command. We also return the `date and time` in order to indicate the period where we achieved the retrieved average score.

### HTTP Request
> To test  :

```ruby
require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
```

```python
import kittn

api = kittn.authorize('meowmeowmeow')
```

```shell
# With shell, you can just pass the correct header with each request
curl
	"http://3islabs.com/everyprint/api/feedback/average"

```

```javascript
$.POST{}

let api = kittn.authorize('meowmeowmeow');
```

`GET http://3islabs.com/everyprint/api/feedback/average`

### Return Code

> The above command should return the average score in a json and a code to process backend return message :

```json
{
  "average_score" : "4.44",
  "datetime" : "21/04/2018 18:00:00",
  "return_code" : "111"
}
```

Code | Meaning
-----| -------
111 | Information retrieval successful
222 | Bad endpoint or untrested request
333 | The backend didn't respond. Try later

<aside class="warning">
Not yet implemented !!!!!
</aside>


text:
# Image Classification with Distributed Training Demo

[Overview](#overview) | [Running the Demo](#demo-run) | [Demo Flow](#demo-flow) | [Pipeline Output](#pipeline-output)

## Overview

This demo demonstrates an end-to-end image-classification solution using [TensorFlow](https://www.tensorflow.org/) (versions 1 or 2), [Keras](https://keras.io/), [Horovod](https://eng.uber.com/horovod/), and [Nuclio](https://nuclio.io/).

You'll learn how to take a deep-learning Python code and run it as a distributed process using Horovod, with minimal code changes and no DevOps.

When the model is ready, you'll create a Nuclio function that runs in the inference layer.
The function requests and retrieves images and sends back a reply according to the results of the image-classification model.

## Running the Demo

To run the demo and generate an automated ML pipeline with source control, open the [**horovod-project.ipynb**](./horovod-project.ipynb) notebook and run the code cells according to the instructions in the notebook.

## Demo Flow

The demo consists of four MLRun and Nuclio functions and a Kubeflow Pipelines orchestration:

1. **Download** — import an image archive from AWS S3 to your cluster's data store.
2. **Label** — tag the images based on their name structure.
3. **Training** — perform distributed training using TensorFlow, Keras, and Horovod.
4. **Inference** — automate deployment of a Nuclio model-serving function.
5. **Pipelines** — create an automated pipeline.

> **Note:** The demo supports both TensorFlow versions 1 and 2.
> There's one shared notebook and two code files — one for each TensorFlow version.

The following image demonstrates the demo's workflow:

## Pipeline Output

The following image illustrates the generated pipeline:

repository: Hedingber/demos

repo_name: Hedingber/demos