text:
# PrivacyBlur

![Logo](./android/app/src/main/res/mipmap-hdpi/ic_launcher.png)

A cross-platform application to obfuscate sensitive data from images, targeting iOS and Android devices. Mainly written in [dart](https://dart.dev/) with the [Flutter](https://flutter.dev/) SDK.

The App is available on Google Playstore  and the the Appstore now!

        <object data="docs/assets/black.png" type="image/png">

        </object>

## Table of contents

- [Privacy Blur](#privacyblur)
  - [Table of contents](#table-of-contents)
  - [Project description](#what-does-the-app-do)
  - [Code style](#code-style)
  - [Internationalization](#internationalization)
  - [Features](#features)
  - [Setup](#flutter-sdk-setup)
    - [windows](#windows)
    - [macOS](#macos)
  - [Building](#Building)
    - [Flavors](#flavors)
    - [iOS](#ios-building)
    - [Android](#android-building)
  - [Structure](#structure)
  - [Architecture](#architecture)
    - [Navigation](#navigation)
    - [Dependency Injection](#dependency-injection)
    - [BloC](#bloc)
    - [Views](#views)
    - [Widgets](#widgets)
      - [Stateful Widgets](#stateful-widgets)
      - [Adaptive Widgets](#adaptive-widgets)
  - [Internationalization](#internationalization)
  - [Theme](#theme)
  - [Assets](#assetsresources)
    - [Icons](#icons)
    - [Images](#images)
    - [Strings](#strings)
  - [Image Manipulation Library](#imagefilter-library-description)
  - [Testing](#testing)
  - [Dependencies](#dependencies)
  - [License](#license)

## What does the app do?

The project is aiming to provide a free, clean and simple solution for users to manipulate image data.
No in-app purchases. No ads. No watermark. No hassle. Free forever because privacy shouldn't cost anything. Free because we care!

## Code style

We have some restrictions about the code style of this project.
You can find all requirements in the [CONTRIBUTING](CONTRIBUTING.md#code-style)

## Features

- Face detection
- Blur / Pixelate effect
- Fine / coarse grain effect
- Round / Square area
- Export to your camera roll

## Flutter SDK Setup

The app is running on Flutter SDK 2.2 and dart 2.13.
Before working with the project, please make sure to run ``flutter upgrade``.

### Windows
click here:
[Installation Guide on Windows](https://flutter.dev/docs/get-started/install/windows)

### macOS
click here:
[Installation Guide on MacOS](https://flutter.dev/docs/get-started/install/macos)

## Building
:warning: :bangbang:
### Flavors

In order to upload to different Platforms/Stores we implemented build flavors.

- foss (for FDroid)
- production (for all other Platforms)

#### Building with Flavors

**This section is very important if you´re trying to run the project on you own!**
The application is available in different flavors:

- foss (version without MLKit - FaceDetection)
- full (self-explanatory)

Running with default commands: ```flutter run``` and ```flutter build``` wont work anymore here.
Make sure to read this section and configure your build-types according to the flavors.

More on how to configure build-types in you IDE:

- Click in the top bar of your IDE on the corresponding Build-Configuration tile
- Click "Edit Configurations" (IntelliJ)
- Click "+"-Button to add a configuration
- Enter the entry point - e.g.: ``[PROJECT_PATH]/lib/main-[flavor_name].dart``
- Enter the build flavor

![Instructions](docs/assets/blur1633609294856.jpg)

For Debugging:
````bash
flutter run --flavor [flavor_name] -t lib/[entry_flavor_file].dart
````
For Deployment:
````bash
flutter build [platform] --flavor [flavor_name] -t lib/[entry_flavor_file].dart
````

The app is targeted for iOS and Android on Phones and Tablets.
Desktop and Web Platform may cause issues and are currently not planned.

It's recommended to run:
```bash
flutter clean
flutter pub get
```
as soon as building issues appear.

### iOS-Building

[Flutter guide for building on iOS](https://flutter.dev/docs/deployment/ios)

You will need an MacOS Machine to be able to run a Flutter iOS application.
Please also make sure you installed the correct version of cocoapods and Xcode on your machine.

For deployment information visit: [Deployment Guide iOS](https://flutter.dev/docs/deployment/ios)

### Android-Building

[Flutter guide for building on Android](https://flutter.dev/docs/deployment/android)

No further requirements for building an android version.

For deployment information visit: [Deployment Guide Android](https://flutter.dev/docs/deployment/android)

## Structure

```
lib/--+--main.dart (entry point)
      +--main_foss.dart (entry point for foss flavor)
      |
      +--resources/--- images, fonts, strings, etc...
      |
      +--------src/--+------app.dart (some inital code)
                     +------app_container.dart (app dependency initialization)
                     +------router.dart (navigation handling)
                     +------di.dart (dependency injection)
                     |
                     |
                     +--screens/--screen_name/
                     |                  +--helpers/-- (garbage place, like many events and states)
                     |                  +--widgets/-- (internal widgets for this screen)
                     |                  |
                     |                  +--repo.dart
                     |                  +--bloc.dart
                     |                  +--view.dart
                     |
                     |
                     +--widgets/-- (common widgets for application)
                     |
                     |
                     +----utils/-- (some utils for application if necessary)
```

## Architecture

In order to build a maintainable, scalable and testable project, the app is build with an architectural pattern and file structure.
For readability purposes we limited the file size to **300 lines**.

### Navigation

The navigation is kept relatively simple with Flutter Navigation v1.
The ``router.dart`` file includes all routing and navigation logic in 2 classes.

- ScreenNavigator: implements and provides methods to enable routing
- AppRouter: declares all routes and their configuration

To be able to test each route individually the AppRouter has multiple constructors. A constructor must also be defined for each route.
The constructor then overwrites what is the actual initial route and boots up at the specified location.

Each route receives the Dependency Injection instance, and the AppRouter instance itself. Optional arguments follow as 3rd parameter.

### Dependency Injection

The Dependency Injection Class is used to inject all testable parts of the application in the right order.
It holds the provider for different blocs and repositories. The instance of the class must be passed to the view, so that they can access all dependencies in the Provider/Consumer structure.

### BLoC

In dart its useful to work with Streams, and the Provider pattern. That's why we chose the popular [BLoC](https://bloclibrary.dev/#/) pattern.
It makes sense to implement a bloc for each screen, but only if it needs to hold and manage data. Usually the bloc receives the corresponding Repositories from the Dependency Injection.

The BLoC class file is located in the same directory as the screen view.
Each View is using ``events`` to trigger ``state`` updates inside the bloc, which are consumed by the view again.
Events and states are located inside the helpers' directory on the screens' folder.

To be able to decide which state should be emitted, the bloc consumes events and handles the decision based on that.
It's important to always yield something after each event, otherwise the UI won't be updated and blocked.

```dart
Stream<SampleState> mapEventToState(SampleEvent event) async* {
  if (event is EventOne) {
    yield* handleStateOneChange(event);
  } else if (event is EventTwo) {
    yield* handleStateTwoChange(event);
  } ...
}
```
**The bloc works as the logic component of the screen and separates all logic from the UI. Thus, the bloc also shouldn't handle any UI parts.**

### Views

Each View represents the widget, that is used as screen in the Navigation route. It should only define the UI and consume/use state.
Primarily it's better to implement screens as StatelessWidgets and only rerender the parts of the screen which really need to be rendered after state updates.

A Bloc-Screen is wrapped by a MultiBlocProvider, which gets the corresponding bloc from the Dependency Injection and makes it available through context for the nested BlocConsumer.
```dart
return MultiBlocProvider(
    providers: [_di.getSampleBloc()],
    child: BlocConsumer<SampleBloc, SampleState>(...)
```

On simple UI data changes as displaying a Toast Message we used the buildWhen condition of the bloc consumer to prevent a whole rerender. Only the MessageBar is drawn above the screen by the listener.
```dart
BlocConsumer<SampleBloc, SampleState>(
  listenWhen: (_, curState) => (curState is SimpleState),
  buildWhen: (_, curState) => !(curState is SimpleState),
  listener: (_, state) {
    showMessageOnSimpleState(...)
  }
  ...
```

Most parts of the views are separated in own methods. This improves readability and modularity. As soon the file size exceeds 300 lines or widgets grow to a huge size it makes sense to move the widgets them to another file.

### Widgets

Widgets exist on common and screen scope level. Common Widgets are located in ``src/widgets`` and screen widgets in ``src/screen_name/widgets``.
Widgets on common level shouldn't implement screen specific configurations and should be made reusable with minimal setup.
Widgets on screen scope are either only used in this place, or their usage is very specific to the screen.

#### Stateful Widgets
Best practise for Widgets which hold state is to also manage it internally. For example:

```dart
class WidgetState extends State<WidgetWithState> {
  late double _initialValue;

  @override
  void didUpdateWidget(covariant DeferredSlider oldWidget) {
    _initialValue = widget._initialValue;
    super.didUpdateWidget(oldWidget);
  }

  @override
  void initState() {
    _initialValue = widget._initialValue;
    super.initState();
  }

  ... Widget build ...

  void onChanged(doubleValue) {
    setState(() {
      _initialValue = doubleValue;
    });
    this.widget.onChanged(doubleValue);
  }
}
```

#### Adaptive Widgets

The app is targeted for iOS and Android, but needs to look different on each platform.
That's why we split platform specific code (iOS/Android) inside ```src/widgets/adaptive_widgets_builder.dart```.
We saw, that Flutter is starting to build adaptive versions of Widgets.
When they will complete with this, we can remove and replace "builders" inside this file with the adaptive version of Flutter widgets.

## Internationalization

The app is translated into:
- :us: English (default language)
- :de: German

Translations live inside the ``lib/resources/i18n`` directory.
To add new languages you need to do the following:

- add lang code to supported languages
````dart
  var delegate = await LocalizationDelegate.create(
      ...
      supportedLocales: [..., '<language_code>']);
````

- add json file for lang code in ```lib/resources/i18n/<lang_code>.json```
- copy structure from an existing .json file
- As soon as new texts are added, the new keys need to be generated. Run: flutter ``flutter pub run build_runner build --delete-conflicting-outputs``

## Theme

The Theme is split into different platforms and additionally themeModes for android.
``theme_provider.dart``
- iosTheme (providing themeMode split iOS ThemeData)
- light (providing light android ThemeData)
- dark (providing dark android ThemeData)

Dark and Light mode are supported and depend on the system preference.
```dart
// AppBuilder widget
themeMode: ThemeMode.system,
```

## Assets/Resources

All assets/resources can be found in ``lib/resouces``.
Images, icons and other common resources should be placed here.

### Icons
Currently, the app is using a custom icon font which includes 4 icons for the image editing tools in the toolbar selection.
Fonts can be generated here: [fluttericon.com](https://www.fluttericon.com/).

__Do only include icons that are used inside the project!__

Additional flutter provides default icons that can be used either from ``CupertinoIcons`` or ``Icons`` Class.
To handle icons from one place the project has the icons_provider class.
This is the place where one iconName can be defined and can have extra logic to split between platforms.

### Images

Images can be added here. To handle different screen resolutions with image sizes there is the possibility to add an image in x2 and x3 sizes for the referring screens.
On dart side its enough to load it like this: ``lib/resources/images/<image_name>``. Dart handles the split between the resolutions.

Currently, the app only uses the App logo which is essential on Launch-/Splash and Main-Screen. Its also recommended limiting the number of static image files, due to the fact that they extend the project size by a large amount.

### Strings

In this place all text strings that are used inside the application. It is planned to add i18n and i10n on a later stage of the project.
All strings inside here need to be moved to the translation .aab files then.

## ImageFilter library description
This library is a singleton. It uses very much memory while working, so its very bad idea to create few instances of this class.

Class can load and filter images.

Supported filters:
- Pixelate
- linear Blur (not Gaussian, too slow)

Class features:
- preview of changes before commit
- undo changes in some special area (erase tool)
- processing squared and rounded areas
- processing multiple areas in one transaction
- overriding processed pixels all together with selected filter

How to work with this class:
 ```dart
    import 'dart:ui' as img_tools;
            final file = File(filename);
            final imageFilter = ImageAppFilter();
            var completer = Completer<img_tools.Image>();
            img_tools.decodeImageFromList(file.readAsBytesSync(), (result) {
              completer.complete(result);
            });
            var image = await completer.future;

            /// VERY IMPORTANT TO USE AWAIT HERE!!!
            var filteredImage = await imageFilter.setImage(_blocState.image);
            imageFilter.transactionStart();
            imageFilter.setMatrix(MatrixAppPixelate(20));
            imageFilter.apply2CircleArea(200, 200, 150);
            /// for preview before saving (only changed area of image will be updated)
            filteredImage = await imageFilter.getImage();

            imageFilter.setMatrix(MatrixAppBlur(20));
            imageFilter.apply2CircleArea(400, 400, 250);

            /// save to cached image, after that you can not cancel changes
            /// only if you load image again.
            imageFilter.transactionCommit();

            /// get saved image after transaction completed (complete merged image without changed part)
            filteredImage = await imageFilter.getImage();
```
### Methods
- **static void setMaxProcessedWidth(int)** - default 1000 for blur speed optimization we need to know maximum processed area width
- **Future\<ImageFilterResult\> setImage(dart:ui.Image)** - set image for filtering.
- **Future\<ImageFilterResult\> getImage()** - if transactions is active, will return only changed area without background image. If transaction is closed - will return full updated images.
- **void transactionStart()** - open transaction for changes
- **void transactionCancel()** - reset changes and close transaction
- **void transactionCommit()** - apply changes from transaction and close transaction
- **void setFilter(ImageAppMatrix newMatrix)** - set current filter
- **void apply2SquareArea(int x1, int y1, double radius)** - apply selected filter to square area with center and radius
- **void apply2CircleArea(int x1, int y1, double radius)** - apply selected filter to circle area with center and radius
- **void cancelCurrent()** - cancel all current changes in active transaction
- **void cancelSquare(int, int, int, int)** - cancel changes in square area
- **void cancelCircle(int, int, int)** - cancel changes in circle area
### Filters
- MatrixAppPixelate(int blockSize)
- MatrixAppBlur(int blockSize) - Linear Blur

## Testing
run ``flutter test`` command in project root or test folder. All test-files must be ended with **_test.dart** suffix

## Dependencies

Do only add null-safety dependencies!
The application runs in sound null safety. Consequently, all dependencies added need to follow this restriction.

- flutter_styled_toast: used for alerts
- image_size_getter: get image sizes to decide if image should be rotated
- flutter_exif_rotation: used for initial rotation on image load
- url_launcher: used to open a link in main screen
- image_picker: used to get the access to the image library
- image: used for image file handling
- image_gallery_saver: used to save image to library
- permission_handler: used for accessing OS permission status
- path_provider: used to read OS image paths
- bloc: library for architectural pattern class
- flutter_bloc: flutter additional features for dart bloc library
- mockito: used for mocks in testing
- bloc_test: used for testing blocs
- flutter_translate: adding i18n to the app
- flutter_translate_gen: used to generate variables for static usage of translations

---

## License

MIT


text:
# DB API container

It's main purpose is to persist data transferred to and from the model from `model_api` for future use and to save some time on unnecessary multiple inferences on the same data.

 Now you can play with this redis container as usual. It is just a wrapper within current docker network bridge as said earlier.

To test it run `python ./tests/test_redis.py`. Can be run while `db_api` running separately or with `start_all.sh`

repository: gdroguski/MLServe

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: gdroguski/MLServe


text:
# Open Data Protocol
- https://www.odata.org/

![odatalogo](https://user-images.githubusercontent.com/54249736/107324045-61aa2780-6ab8-11eb-98c4-4a00b09f820d.png)

OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. OData helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc. OData also provides guidance for tracking changes, defining functions/actions for reusable procedures, and sending asynchronous/batch requests.

OData RESTful APIs are easy to consume. The OData metadata, a machine-readable description of the data model of the APIs, enables the creation of powerful generic client proxies and tools.

#### Installed Packages (OData.API)
 * Microsoft.AspNetCore.OData
 * Microsoft.EntityFrameworkCore
 * Microsoft.EntityFrameworkCore.SqlServer
 * Microsoft.EntityFrameworkCore.Tools

#### Contact Addresses
##### Linkedin: [Send a message on Linkedin](https://www.linkedin.com/in/cihatsolak/)
##### Twitter: [Go to @cihattsolak](https://twitter.com/cihattsolak)
##### Medium: [Read from medium](https://cihatsolak.medium.com/)

license: MIT

repository: cihatsolak/netcore-api-odata

repo_name: cihatsolak/netcore-api-odata


text:
Kitchen Example
------------------

<img src="demo_rooms.gif"
alt="Preview of some generated rooms" border="10" />

# Running a demo

In one terminal, run `meshcat-server`, and open a browser to the specified
meshcat view url (usually http://<IP_ADDRESS>:7000/static/).

In another terminal, invoke `python3 run_grammar.py` with no arguments. A scene
should be generated and visualized in the meshcat browser window.

# Grammar overview

- A single kitchen generates from a `Kitchen` node, with random
length and width.
- 4 `Wall` nodes and a `Floor` spawn deterministically in the
right locations (2 walls are currently disabled for visualization).
- The `Floor` produces a `Table` at [1., 0., 0.] and a `RobotSpawnLocation`
at [-1., 0., 0.].
- Each `Table` , creates a `PlanarObjectRegion` on its surface.
- Each `Wall` can spawn a geometric number of `Cabinets` on its surface.
- Each `Cabinet` spawns with its doors in random positions, and creates
3 levels of objects on each of its shelves, represented by `PlanarObjectRegion` nodes.
- Each `PlanarObjectRegion` can produce a geometric number of `Object`s (random
x, y, yaw; fixed z, roll, pitch) within the volume it was constructed with.
- Right now, `Object` is a terminal node with a box for geometry.
- `RobotSpawnLocation` is a terminal node (indicating where to put the robot).

All nodes have poses, and most (excluding `RobotSpawnLocation` and `PlanarObjectRegion`)
have visual and collision geometry as well. `Wall`, `Floor`, `Cabinet`, `Table`, and
`RobotSpawnLocation` have additional clearance geometry specifications so we can check
if the room configuration is feasible w.r.t. the furniture all having reasonable clearance.

# File overview
- `run_grammar.py`: Top-level / entrypoint. Currently contains a routine
for setting up rejection sampling kitchen scenes that satisfy some hand-written
nonpenetration and object count constraints; and code for setting up a
visualization of the scene with a PR2 inserted for scale.
- `grammar_room_layout.py`: Implements `Kitchen` (root), `Wall`, `Floor`, and `RobotSpawnLocation` nodes.
- `grammar_table.py`: Implemented `Table` node.
- `grammar_cabinet.py`: Implemented `Cabinet` node.
- `grammar_objects.py`:  Implements `Object` and `PlanarObjectRegion` nodes.

branch_name: refs/heads/main


text:
# IntoPoint Web App

## Keep everything interesting in one place

Don't keep secret information here :)

Application for storing links to sites, notes, code, and viewing news.

---

At this stage, the saving of bookmarks is implemented

---

### Firebase install

On site firebase.com create two projects for production and development.
In the folder /src/firebase/config replace the name of the files config.dev.example.js and config.prod.example.js
on the names config.dev.js and config.prod.js. Fill in the fields in both files.

```javascript
const prodConfig = {
  apiKey: YOUR_API_KEY,
  authDomain: YOUR_AUTH_DOMAIN,
  databaseURL: YOUR_DATABASE_URL,
  projectId: YOUR_PROJECT_ID,
  storageBucket: YOUR_PROJECT_STORAGE,
  messagingSenderId: YOUR_MESSAGING_SENDER_ID,
};

export default prodConfig;
```

### Install

```
git clone https://github.com/GrafSoul/IntoPoint.git
cd IntoPoint
yarn install
// or
npm install
```

### Using

```
yarn start
// or
npm start
```

### Build App

```
yarn build
// or
npm build
```

### License

© 2020 | IntoPoint Web App | [MIT licensed].

[mit licensed]: https://github.com/GrafSoul/IntoPoint/blob/master/LICENSE

repository: GrafSoul/IntoPoint

repo_name: GrafSoul/IntoPoint


text:
---
name: Submariner Committer Request
about: Request Submariner Committer rights on some files
title: 'REQUEST: New Committer rights request for <your-GH-handle>'
labels: committer-request
assignees: ''

---

### GitHub Username
e.g. (at)example_user

### Code you are requesting Committer rights for
e.g. submariner-operator/\* or submariner-operator/scripts/\*

### Requirements
- [ ] I have reviewed the contributor roles guidelines (https://submariner.io/community/contributor-roles/)
- [ ] I have enabled 2FA on my GitHub account (https://github.com/settings/security)
- [ ] I have subscribed to the submariner-dev e-mail list (https://groups.google.com/forum/#!forum/submariner-dev)
- [ ] I have been actively contributing to Submariner for at least 3 months
- [ ] I have two sponsors that meet the sponsor requirements listed in the community membership guidelines
- [ ] I have spoken to my sponsors ahead of this application, and they have agreed to sponsor my application

### Sponsors
- (at)sponsor-1
- (at)sponsor-2

### List of required reviews to Submariner project PRs
- At least 20 PRs to the relevant codebase that you reviewed, and at least 5 for which you were the primary reviewer
  - `https://github.com/submariner-io/<repo>/pulls?q=is%3Apr+reviewed-by%3A<your-GH-handle>+-author%3A<your-GH-handle>`

repository: skitt/submariner

branch_name: refs/heads/devel

gha_language: Go

repo_name: skitt/submariner


text:
# KMDP Bill of Materials (BOM) Release Notes

Please checkout the official [README](./README.md)!

## KMDP BOM Changelog

### Version (Future Enhancements)

>  Code changes not yet scheduled but on the horizon

- Upgrade OpenAPI spefication version from v2 to v3

### Version 8.X.X

- Added HAPI FHIR R4 Structures as managed dep
- Added Basic Support for BPMN2

### Versions 5.1.0 - 7.0.0

- Mainly transition states
- Not for use in production
- Merged kmdp-ext-bom

### Version 5.0.4

- Upgrade Dependencies (see changelog)
- Spring 5.2.1 / Spring Boot 2.2.1
- Junit 5.5.2 / Surefire 3.0.0-M1
- Do not use Xerces

### Version 5.1.0

- HAPI FHIR 3.8.0
- Add dependencies from deprecated kmdp-ext-bom
- Misc: CQL, Oak, Janino

branch_name: refs/heads/develop


text:
---
title: "Doraemon The Movie Nobita’s Dorabian Nights in Telugu"
date: "2019-05-27"
---

##

NAME: DORAEMON : NOBITA’S DORABIAN NIGHTS TAMIL

YEAR: 1991

LANGUAGE: TELUGU (Original Audio)

QUALITY: 480p

SIZE : 520MB

ENCODED BY: TOONWORLDTAMIL

## COMMENT BELOW IF YOU WANT MORE MOVIES IN TELUGU

## DORAEMON : DORABIAN NIGHTS (1991) – TELUGU DUBBED  – 480p – 520MB – FIRST ON NET

[![](https://1.bp.blogspot.com/-ffuHTaouC0k/XOuhrUI_XFI/AAAAAAAABX4/Ry510kgid7kiJWPatKybqq07XYBLgbCGgCLcBGAs/s320/Doraemon-The-Movie-Nobita%25E2%2580%2599s-Dorabian-Nights.jpg)](https://1.bp.blogspot.com/-ffuHTaouC0k/XOuhrUI_XFI/AAAAAAAABX4/Ry510kgid7kiJWPatKybqq07XYBLgbCGgCLcBGAs/s1600/Doraemon-The-Movie-Nobita%25E2%2580%2599s-Dorabian-Nights.jpg)

GOOGLE DRIVE SERVER 480p (520MB)

This article was Originally posted by [Tentrockers](https://tentrockers.blogspot.com/)


text:
---
seo:
  title: "You have used a reserved field name for your custom field"
  description: "You have used a reserved field name for your custom field"
  keywords: failed, create, upload, name, custom, created_at, updated_at, last_emailed, last_clicked, last_opened, field, reserved, unique, first_name, last_name
title: "You have used a reserved field name for your custom field"
weight: 0
layout: page
zendesk_id: 206923947
navigation:
  show: true
---

When creating Custom Fields, or uploading a list with customized headers in our Marketing Campaigns features, you may encounter the following error:

![]({{root_url}}/images/Cursor_and_customfeilduniqueerror_png.png)

**This is because you are attempting to use a Custom Field that is already reserved by Sendgrid for internal purposes.**

**These fields, with the exceptions of email, first\_name, and last\_name, can NOT be edited.**

Reserved fields are used to track useful metrics for your contacts by default. Trying to pass additional data into some of these field names can cause inaccuracies in your Contacts.

Here is a short list of the Reserved Custom Fields:

| **Field Name** | **Field Type** |
| **id** | **text** |
| **first\_name** | **text** |
| **last\_name** | **text** |
| **email** | **text** |
| **created\_at** | **date** |
| **updated\_at** | **date ** |
| **last\_emailed** | **date ** |
| **last\_clicked** | **date ** |
| **last\_opened** | **date ** |

![]({{root_url}}/images/SendGrid_Marketing_Campaigns.png)

repository: jstvz/docs

gha_language: HTML

gha_license_id: MIT

repo_name: jstvz/docs


text:
---
id: getting-started
title: Getting Started
description: Getting Started Guidelines
---

TechDocs functions as a plugin to Backstage, so you will need to use Backstage
to use TechDocs.

If you haven't setup Backstage already, start
[here](../../getting-started/index.md).

## Installing TechDocs

TechDocs is provided with the Backstage application by default. If you want to
set up TechDocs manually, keep follow the instructions below.

### Adding the package

The first step is to add the TechDocs plugin to your Backstage application.
Navigate to your new Backstage application folder:

```bash
cd hello-world/
```

Then navigate to your `packages/app` folder to install TechDocs:

```bash
cd packages/app
yarn add @backstage/plugin-techdocs
```

After a short while, the TechDocs plugin should be successfully installed.

Next, you need to set up some basic configuration. Enter the following command:

```bash
yarn install
```

Add this to `packages/app/src/plugins.ts`:

```typescript
export { plugin as TechDocs } from '@backstage/plugin-techdocs';
```

### Setting the configuration

TechDocs allows for configuration of the docs storage URL through your
`app-config.yaml` file. We provide two different values to be configured,
`requestUrl` and `storageUrl`. The `requestUrl` is what the reader will request
its data from, and `storageUrl` is where the backend can find the stored
documentation.

The default storage and request URLs:

```yaml
techdocs:
  storageUrl: http://localhost:7000/techdocs/static/docs
  requestUrl: http://localhost:7000/techdocs/docs
```

If you want `techdocs-backend` to manage building and publishing, you want
`requestUrl` to point to the default value (or wherever `techdocs-backend` is
hosted). `storageUrl` should be where your publisher publishes your docs. Using
the default `LocalPublish` that is the default value.

If you have a setup where you are not using `techdocs-backend` for managing
building and publishing of your documentation, you want to change the
`requestUrl` to point to your storage. In this case `storageUrl` is not
required.

## Run Backstage locally

Change folder to `<backstage-project-root>/packages/backend` and run the
following command:

```bash
yarn start
```

Open a new command line window. Change directory to your Backstage application
root and run the following command:

```bash
yarn start
```

Open your browser at [http://localhost:3000/docs/](http://localhost:3000/docs/).

## Additional reading

- [Creating and publishing your docs](creating-and-publishing.md)
- [Back to README](README.md)

repository: niccheww/backstage

repo_name: niccheww/backstage


text:
---
layout: default
---

# 1997-11-22 - Apology -- FBI abduction story

## Header Data

From<EMAIL_ADDRESS>(Igor Chudov @ home)

To<EMAIL_ADDRESS>Message Hash: 0c0034b8495a71048203353ad39195d12260b5ac02abf44f243531e318edad82

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-11-22 03:45:47 UTC

Raw Date: Sat, 22 Nov 1997 11:45:47 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Igor Chudov @ home)
Date: Sat, 22 Nov 1997 11:45:47 +0800
To<EMAIL_ADDRESS>Subject: Apology -- FBI abduction story
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

I am sorry for the recent interruption of the cypherpunks mailing list. I
was abducted by the FBI along with my computer. They are accusing me of
sponsoring seditious libel against the government.  I am sorry. It is not going to happen again in the near future.

igor

{% endraw %}
```

## Thread

+ Return to [November 1997](/archive/1997/11)

+ Return to "["(Igor Chudov @ home)" <ichudov@Algebra.COM>](/authors/_igor_chudov__at__home__ichudov_at_algebra_com_)"
+ Return to<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)](/authors/dlv_at_bwalk_dm_com_dr_dimitri_vulis_kotm_)"
+ Return to<EMAIL_ADDRESS>(Igor Chudov @ home)](/authors/ichudov_at_algebra_com_igor_chudov__at__home_)"

+ 1997-11-22 (Sat, 22 Nov 1997 11:45:47 +0800) - Apology -- FBI abduction story -<EMAIL_ADDRESS>(Igor Chudov @ home)_
  + 1997-11-22 (Sat, 22 Nov 1997 11:19:40 +0800) - [Alternative Apology](/archive/1997/11/79afec0f562dd9027a234f4f7ec1bcc8e85788a8debdd3208286d47d6ec6e325) - _"(Igor Chudov @ home)"<EMAIL_ADDRESS>    + 1997-11-22 (Sun, 23 Nov 1997 01:58:45 +0800) - [Re: Alternative Apology](/archive/1997/11/0ff19ca81ad83380d8798e95b8e68e58178d88fbe4e3c3380056398316506962) -<EMAIL_ADDRESS>(Dr.Dimitri Vulis KOTM)_


text:
# Snake
 This Repo is just for a snake game I made.

**PS:** To run the game, you need [Python3](https://www.python.org/) and [Pygame](https://www.pygame.org/)

repository: CaioVieiraF/Game

repo_name: CaioVieiraF/Game


text:
# **Advanced Lane Finding Project**

## Writeup

**Build an Advanced Lane Finding Project**

The goals / steps of this project are the following:

* Compute the camera calibration matrix and distortion coefficients given a set of chessboard images.
* Apply a distortion correction to raw images.
* Use color transforms, gradients, etc., to create a thresholded binary image.
* Apply a perspective transform to rectify binary image ("birds-eye view").
* Detect lane pixels and fit to find the lane boundary.
* Determine the curvature of the lane and vehicle position with respect to center.
* Warp the detected lane boundaries back onto the original image.
* Output visual display of the lane boundaries and numerical estimation of lane curvature and vehicle position.

[//]: # (Image References)

[image1]: ./examples/Calibration.png "Calibration"
[image2]: ./examples/UndistortComparison.png "Undistort Comparison"
[image3]: ./examples/UndistortComparisonTest.png "Undistort"
[image4]: ./examples/ColorThreshold.png "Color Threshold Comparison"
[image5]: ./examples/ColorThresholdInd.png "Color Threshold I"
[image6]: ./examples/ColorThresholdInd2.png "Color Threshold II"
[image7]: ./examples/ColorThresholdInd3.png "Color Threshold III"
[image8]: ./examples/ColorWarp.png "Color Warp"
[image9]: ./examples/FindLines.png "Find Lines"
[image10]: ./examples/FindLines2.png "Find Lines Using Previous Frame"
[image11]: ./examples/Collage.jpg "Final Output"
[image12]: ./examples/Curve.png "Curve"
[image13]: ./examples/Radius.png "Radius"
[video1]: ./project_video_output.mp4 "Video"

## [Rubric](https://review.udacity.com/#!/rubrics/571/view) Points

### Here I will consider the rubric points individually and describe how I addressed each point in my implementation.

---

### Writeup / README

#### 1. Provide a Writeup / README that includes all the rubric points and how you addressed each one.  You can submit your writeup as markdown or pdf.  [Here](https://github.com/udacity/CarND-Advanced-Lane-Lines/blob/master/writeup_template.md) is a template writeup for this project you can use as a guide and a starting point.

You're reading it!

### Camera Calibration

#### 1. Briefly state how you computed the camera matrix and distortion coefficients. Provide an example of a distortion corrected calibration image.

The code for this step is contained in the 1st code cell of the IPython notebook located in "./Project.ipynb" under section '***Compute the camera calibration matrix and distortion coefficients given a set of chessboard images***'.

I started by preparing "object points", which will be the (x, y, z) coordinates of the chessboard corners in the 3D world. Here I am assuming the chessboard is fixed on the (x, y) plane at z=0, such that the object points are the same for each calibration image.  Thus, `objp` is just a replicated array of coordinates, and `objpoints` will be appended with a copy of it every time I successfully detect all chessboard corners in a test image.  `imgpoints` will be appended with the (x, y) pixel position of each of the corners in the image plane with each successful chessboard detection.

I used `cv2.findChessboardCorners` to find the corners of the chessboard and `cv2.drawChessboardCorners` to draw the corners for visual verification as below. For some of the chessboard images the corners couldn't be found as the function couldn't detect the desired number of internal corners.

![alt text][image1]

I then used the output `objpoints` and `imgpoints` to compute the camera calibration and distortion coefficients using the `cv2.calibrateCamera()` function.  I applied this distortion correction to a sample chessboard image using the `cv2.undistort()` function and obtained this result:

![alt text][image2]

### Pipeline (single images)

#### 1. Provide an example of a distortion-corrected image.

I used the camera calibration matrix and distortion coefficients obtained during calibration step and applied it to an image using `cv2.undistort()`.

The code for this step is contained in the 4th code cell of the IPython notebook located in "./Project.ipynb" under section '***Apply a distortion correction to raw images***'.

Here is the example of before and after applying of `undistort` function on a test image.
![alt text][image3]

#### 2. Describe how (and identify where in your code) you used color transforms, gradients or other methods to create a thresholded binary image.  Provide an example of a binary image result.

I tried several combinations of color and gradient thresholds to generate a binary image (code cells 6 through 11 of the IPython notebook located in "./Project.ipynb" under the section '***Use color transforms, gradients, etc., to create a thresholded binary image***').

I started with calculating Sobel gradient in both 'x' and 'y' and also magnitude and direction. It fared well on normal roads but produced lots of noise or loss of details when road contrast was changing rapidly. Then I used 'B' channel in CIELAB color space which performed better at detecting Yellow color under high contrast/shadow conditions. I also explored color selection and thresholding of Yellow and White colors in HSV/RGB color spaces. Finally I picked the combination of L-channel threshold of HSL, B-channel threshold of CIELAB and Yellow and White color thresholdings of HSV/RGB respectively. You can clearly see the details are improved and loss got reduced. This produced better results on `challenge_video.mp4`

Here's a comparison example of some of the different thresholds I've tried.
![alt text][image4]

Here I created a Color representation of various threshold methods I have used and we can clearly see their contributions under different light conditions. (L-Channel : red, B-Channel : green, Yellow/White Color Selection: blue)
![alt text][image5]
![alt text][image6]
![alt text][image7]

#### 3. Describe how (and identify where in your code) you performed a perspective transform and provide an example of a transformed image.

The code for my perspective transform includes a function called `perspective_transform()` (which appears in the 15th code cell of the IPython notebook under the section '***Apply a perspective transform to rectify binary image***').  The `perspective_transform()` function takes an image (`img`) as input, as calculates the source (`src`) and destination (`dst`) points.  I chose the hardcode the source and destination points in the following manner:

```python
	# define source points
    src = np.float32([[0.455*img.shape[1],0.639*img.shape[0]],
                      [0.547*img.shape[1],0.639*img.shape[0]],
                      [0.815*img.shape[1],0.944*img.shape[0]],
                      [0.203*img.shape[1],0.944*img.shape[0]]])

    # define destination points
    offset = img_size[0]*.30
    dst = np.float32([[offset, 0],
                      [img_size[0]-offset, 0],
                      [img_size[0]-offset, img_size[1]],
                      [offset, img_size[1]]])
```

This resulted in the following source and destination points:

| Source        | Destination   |
|:-------------:|:-------------:|
| 582, 460      | 384, 0        |
| 700, 460      | 896, 0      |
| 1043, 680     | 896, 720      |
| 260, 680      | 384, 720        |

I verified that my perspective transform was working as expected by drawing the `src` and `dst` points onto a test image and its warped counterpart to verify that the lines appear parallel in the warped image.

![alt text][image8]

#### 4. Describe how (and identify where in your code) you identified lane-line pixels and fit their positions with a polynomial?

The two functions `find_lane_pixels()` and `search_around_poly()` performs all the necessary tasks to find and fit a polynomial to the lane lines in an image.

The first one  `find_lane_pixels()` can be found in the 19th code cell of the IPython notebook under the * **Find lane pixels using sliding windows method*** sub-section of '***Detect lane pixels and fit to find the lane boundary.***'

It takes a histogram of the bottom half of the image and tries to find the peak of the left and right halves of the histogram. These will be the starting points for the left and right lines. Then it uses nine windows of equal sizes for each lane, which can fit vertically in the image when they are placed on top of each other. These windows have fixed width to identify lane pixels and through iteration they are placed on top of each other (starting from bottom) such that each one is centered around the midpoint of the pixels from the window below. This effectively follows the lane lines up to the top of the image, and speeds up processing by searching only for activated pixels over a small portion of the image. Pixels belonging to each lane line are calculated and the Numpy library's polyfit() method is used to fit a second order polynomial to each set of pixels. Below is the example image which shows the above process as well the yellow colored representation of the calculated fit:
![alt text][image9]

The second one  `search_around_poly()` can be found in the 21st code cell of the IPython notebook under the * **Find lane pixels using margin from previous frame*** sub-section of '***Detect lane pixels and fit to find the lane boundary.***'

Repeatedly trying to find the lane pixels through sliding windows method for every single frame can be very non-effective while processing a video.
Instead of calculating the activated pixels in each window iteratively, this makes use of some pre-defined margin around the pixels found from a previous frame. Then it makes a highly targeted search in that area to determine the new lane pixels. This effectively speeds up processing by searching only for activated pixels over a predefined area. Pixels belonging to each lane line are identified and the Numpy polyfit() method is used to fit a second order polynomial to each set of pixels. Below is the example image which shows the above process as well the yellow colored representation of the calculated fit:
![alt text][image10]

Whenever the second method `search_around_poly()` doesn't yield any results we can always fallback to the first method `find_lane_pixels()` and repeat the process.

#### 5. Describe how (and identify where in your code) you calculated the radius of curvature of the lane and the position of the vehicle with respect to center.

Once we located the lane line pixels and used their x and y pixel positions to fit a second order polynomial curve which is as follows:
![alt text][image12]
The radius of curvature can be calculated by using the below formula:
![alt text][image13]
This can be found in the 25th code cell of the IPython notebook under the * **Determine the curvature of the lane and vehicle position with respect to center.***

The position of the vehicle with respect to center can be obtained by calculating the difference between lane center and the image center, assuming that the camera was mounted at the center point of the car's windshield.
This can be found in the 26th code cell of the IPython notebook under the * **Output visual display of the lane boundaries and numerical estimation of lane curvature and vehicle position.***

#### 6. Provide an example image of your result plotted back down onto the road such that the lane area is identified clearly.

The pipeline I've created is responsible for performing all the above steps as well as outputting the calculations back on the images in a visual manner.
I've implemented this step in the function `pipeline()` which can be found in the 29th code cell of the IPython notebook under the * **Create Final Image Pipeline*** .

Here is an example of my result for all test images:

![alt text][image11]

---

### Pipeline (video)
I have created a single pipeline for processing both image and video. It has optional parameters to display diagnostics using text and picture-in-picture. I have made use of the Line class to store each line pixel data between the frames individually. Also implemented a weighted mean of the position of the lines to avoid jitter in the output video.
#### 1. Provide a link to your final video output.  Your pipeline should perform reasonably well on the entire project video (wobbly lines are ok but no catastrophic failures that would cause the car to drive off the road!).

Here's a [link to my video result](./project_video_output.mp4)

 [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/uYHrckWvquI/0.jpg)](https://www.youtube.com/watch?v=uYHrckWvquI)

 ---
 Here's a [link to my challenge video result](./challenge_video_output.mp4)

 [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/i489vF7b6Vo/0.jpg)](https://youtu.be/i489vF7b6Vo)

---

### Discussion

#### 1. Briefly discuss any problems / issues you faced in your implementation of this project.  Where will your pipeline likely fail?  What could you do to make it more robust?

Many of the methods I used were taken straight from the classroom. They were pretty useful and helped me to understand the different approaches I have took while completing this project. One problem I faced was miscalculations due to RGB/BGR conversions while using `cv2.imread` in my pipeline until I found that the frames from video files in my pipeline were RGB.

Although my pipeline performed better on the project video, it fails to detect the lane lines under challenging conditions like changes in road color, poor road details, glare and shadows etc. To improve the algorithm may be we need to create different models for different road conditions and apply the appropriate model after determining the type of road image.

I found this project to be quite challenging and while the basic calculations for many color thresholdings which I've learned in the classroom worked well on the project video , they failed miserably on the challenge videos. Later I've started implementing multiple combinations after spending some time in research and was able to get good results atleast on the project video and the challenge video. My approach failed terribly on the harder challenge video and I couldn't succeed to learn to setup a robust model to identify lanes under challenging conditions. I wish to learn more advanced techniques and optimize this pipeline to make it robust in coming future.


text:
---
layout: page
title: About
---

Acne Cure Zone features a number of excellent resources that are curated and discussed in the Acne Cure Zone/Forum. Here you can find concise help and even cures written by people who have cured their own acne.

* Discuss cures and Acne in general at [here](http://discourse.acnecurezone.com).
* Go back to the ACZ (Acne Cure Zone) home page [here](http://acnecurezone/com).

These webpages were developed by Luke and Michael Aslanian.


text:
# Integrating Voice Gateway with SMS Gateway

You can configure IBM® Voice Gateway to integrate with SMS Gateway to enable SMS messaging between customers and a voice agent during a voice call.

To learn more about this topic click [here](https://www.ibm.com/support/knowledgecenter/SS4U29/sms_vgwintegrate.html).

gha_language: JavaScript


text:
# unity-fps-prototype

A simple fps game built on Unity for learning purposes.

## Controls

| Button        | Action        |
| :-----------: | ------------- |
| w             | move forward  |
| s             | move backward |
| a             | move left     |
| d             | move right    |
| Shift         | Run           |
| Space         | Jump          |

repository: madureira/unity-fps-prototype

repo_name: madureira/unity-fps-prototype


text:
# How to change email address for your repo locally

Setting your email for your current repository only from bash is done like this:

 ```bash
git config user.email<EMAIL_ADDRESS>git config user.name "John Doe"
 ```
If you would like to set this globally, so all your repos will use this from now then issue the following command bash command line:

 ```bash
git config --global user.email<EMAIL_ADDRESS>git config --global user.name "John Doe"
 ```

[Source](https://help.github.com/articles/setting-your-email-in-git/)

repository: gyurisc/til

repo_name: gyurisc/til


text:
# Exercise 13.20

Given the original version of the `HasPtr` class that relies on the default definitions for copy-control, describe what happens in the following code:

```cpp
int i = 42;
HasPtr p1(&i, 42);
HasPtr p2 = p1;
cout << p2.get_ptr_val() << endl; p1.set_ptr_val(0);
cout << p2.get_ptr_val() << endl;
```

**Answer**:

```cpp
int i = 42;
HasPtr p1(&i, 42); // p1's pointer member initialized to point to 42, and its int member is 42
HasPtr p2 = p1; // p2 is copied from p1 using the default copy constructor, p2's pointer member points to the same object ad p1's, and its int member is independent
cout << p2.get_ptr_val() << endl; // prints 42
p1.set_ptr_val(0);
cout << p2.get_ptr_val() << endl; // prints 0
```


text:
# Cucumber-Config

This library provides a flexible way for users to specify configuration values in various ways:
- YAML File
- Environment variables
- Java System properties (JVM only)

The library can be used by any program that needs external configuration.

## Keys

Let's assume the program needs to know the URL of a web server serving cat pictures, which can
be anywhere. We define a `key` for this called `album.cat.server`.

The program could then access the value of that key like this:

```java
String catServer = config.getString("album.cat.webserver");
```

## Assigning values to keys

The user has several options for assigning a value to this key:

### YAML file

```yaml
album:
  cat:
    webserver: http://www.infinitecat.com/
```

### Environment variable

```
# Linux / OS X
export ALBUM_CAT_WEBSERVER=http://www.infinitecat.com/

# Windows
SET ALBUM_CAT_WEBSERVER=http://www.infinitecat.com/
```

### Java System property

```
-Dalbum.cat.webserver=http://www.infinitecat.com/
```

## Case insensitivity and special characters

Keys are *case insensitive*. If a key contains a `_` character (common in environment variables),
it is converted to a `.`.

The internals of the `config` object stores keys and values in a tree, where the `.` characters
in the keys define the paths in the tree.

You *may* add additional `_` characters to key segments in your YAML documents, but keep in mind
that they will be removed from the key before the value in added to the config.

```yaml
# A slightly more legible way to define album.cat.webserver
album:
  cat:
    web_server: http://www.infinitecat.com/
```

## Defaults

Your program must define default values for all of the keys you look up. Looking
up the value for a key that doesn't have a (default) value will throw an error. This helps
you make sure you have defined default values for all the keys your program uses.

## Inspection

The `Config#toYAML` method returns a string representation of the config. This is useful for
showing the user what their current configuration is - it can sometimes be hard for them to know
when values are pulled from multiple sources.

repository: cucumber-ltd/cucumber-pro-plugin-jvm

gha_language: Java

repo_name: cucumber-ltd/cucumber-pro-plugin-jvm


text:
# Live Reload Middleware for ASP.NET Core

[![NuGet](https://img.shields.io/nuget/v/Westwind.AspnetCore.LiveReload.svg)](https://www.nuget.org/packages/Westwind.AspnetCore.LiveReload/)
[![](https://img.shields.io/nuget/dt/Westwind.AspnetCore.LiveReload.svg)](https://www.nuget.org/packages/Westwind.AspnetCore.LiveReload/)

* **Live Reload Middleware Component**
Add the middleware to an existing Web UI Project to provide Live Reload functionality that causes the active page to reload if a file is changed.

* **[Generic local Web Server as a Dotnet Tool](https://github.com/RickStrahl/LiveReloadServer)**
There's also a standalone, self-contained local Web Server using this Live Reload functionality available as [Dotnet Tool](https://www.nuget.org/packages/LiveReloadServer/) and [Chocolatey Package](https://chocolatey.org/packages/LiveReloadWebServer). The server optionally also supports loose Razor Pages and rendering of Markdown documents. Simply run `LiveReloadServer --WebRoot <folder>` to locally serve a Web site.

This middleware automatically reloads content on any active HTML page in the project, when monitored source files are changed. The middleware by default monitors and detects changes in:

* Razor Pages/Views
* Client source files (.html, .css, .js, .ts etc.)
* Server files (.cs, .json) using `dotnet watch`
* Limited Blazor Support ([see below](#blazor-support))

The middleware is configurable so you can fine tune what triggers updates and which requests are automatically live reloaded. It can configure:

* Which file extensions to monitor for changes
* An optional handler to determine whether a changed file should reload the browser
* An optional handler to decide whether a Web request url should live reload on change

Using these configuration options allow precise control over what triggers a refresh and which requests can be auto-refreshed.

> #### Partial Integration in .NET 5.0's `dotnet watch`
> .NET Core 5.0 and later integrates similar behavior based on this middleware directly in `dotnet watch run`. The advantage of built-in tooling is that it's external, and doesn't require any of the small code changes or additional library as this middleware does.
>
> Unfortunately, it seems this functionality is half-baked in .NET 5.0. I've never gotten it to work on any working projects, so it may take .NET 6.0 to get this actually working reliably.This middleware offers a bit more functionality and has much more control over what content is monitored and which requests should auto-refresh, which is not possible with the built-in tooling. This library is also useful if you need to build your own custom servers that include live reload functionality like our generic static file [Live Reload Web Server](https://github.com/RickStrahl/LiveReloadServer).

## Install the Live Reload Middleware
You can install the Live Reload middleware [from NuGet](https://www.nuget.org/packages/Westwind.AspNetCore.LiveReload):

```ps
PS> Install-Package Westwind.AspNetCore.LiveReload
```

or via the .NET Core CLI:

```bash
dotnet add package Westwind.AspNetCore.LiveReload
```
The Middleware is self-contained and has no external dependencies - there's nothing else to install or run. The best running environment for this middleware is to run with `dotnet watch run` to automatically reload server side code to reload the server. The middleware can then automatically refresh the browser for both client side, Razor and server side files. You can also run the application in debug mode and get all but the server side change detection/live reload.

* [Detailed blog post with Implementation Details](https://weblog.west-wind.com/posts/2019/Jun/03/Building-Live-Reload-Middleware-for-ASPNET-Core)
* [NuGet Package](https://www.nuget.org/packages/Westwind.AspNetCore.LiveReload)

#### Minimum Requirements:

* Works with ASP.NET Core 3.1, .NET 5.0

Here's a short video that demonstrates some of the functionality:

![](https://github.com/RickStrahl/Westwind.AspnetCore.LiveReload/blob/master/Westwind.AspNetCore.LiveReload.gif?raw=true)

This demonstrates updating Razor Views/Pages, static CSS and HTML content, and making a source code change in a controller that affects the UI. The only thing 'running' in this demo is `dotnet watch run` and all page refreshes occur automatically when a change is made.

## What does it do?
This middleware monitors for file changes in your project and tries to automatically refresh your browser when a change is detected. It uses a `FileWatcher` to monitor for file client file changes, and a `WebSocket` 'server' that client pages connect to refresh the page. The file watcher monitors client side files, while `dotnet watch run` is used for handling server side code change detection and server restart. The middleware automatically refreshes any active pages when the server is restarted.

The middleware intercepts all `Content-Type: text/html` page requests and injects a block of JavaScript code that hooks up the client WebSocket interface to support the 'remote' refresh operation. This includes both static pages as well as server generated pages and views. When file changes are detected, the server pushes a request to refresh the page to the WebSocket running in any HTML page rendered on the server, which causes the browser page to refresh. If you have 5 different pages open in your site, all 5 will refresh even if they are in different browsers.

This tool uses raw WebSockets, so it's very light weight with no additional library dependencies.

Live Reload can be turned off with a single configuration switch either in `applicationConfiguration.json` or via a single `config.LiveReloadEnabled` flag. When disabled the middleware is not hooked up and the entire code base is bypassed so there's no overhead when disabled. Any overhead for HTML injection and response buffering is only incurred if Live Reload is active.

In order to detect server side code changes and restart the server, you need to run your application with `dotnet watch run`. This built-in tool automatically restarts your .NET Core application any time a code change is made. `dotnet watch run` is optional, but without it server side code changes require you to manually restart the server. Razor Views/Pages don't require `dotnet watch run` to refresh since they are dynamically compiled at runtime (as long as `AddRazorRuntimeCompilation()` is added).

### Configuration
The full configuration and run process looks like this:

* Add `services.AddLiveReload()` in `Startup.ConfigureServices()`
* Add `app.UseLiveReload()` in `Startup.Configure()` before any output generating middleware
* Run `dotnet watch run` to run your application

Add the namespace in `Startup.cs`:

```cs
using Westwind.AspNetCore.LiveReload;
```

#### Startup.ConfigureServices()
Start with the following in `Startup.ConfigureServices()`:

```cs
services.AddLiveReload(config =>
{
    // optional - use config instead
    //config.LiveReloadEnabled = true;
    //config.FolderToMonitor = Path.GetFullname(Path.Combine(Env.ContentRootPath,"..")) ;
});

// for ASP.NET Core 3.x and later, add Runtime Razor Compilation if using anything Razor
services.AddRazorPages().AddRazorRuntimeCompilation();
services.AddMvc().AddRazorRuntimeCompilation();
```

The `config` parameter is optional and it's actually recommended you set any values via standard .NET configuration (see below).

#### Startup.Configure()
In `Startup.Configure()` add:

```cs
// IMPORTANT: Before **any other output generating middleware** handlers including error handlers
app.UseLiveReload();

app.UseStaticFiles();
app.UseMvcWithDefaultRoute();
```

I recommend you add this early in the middleware pipeline **before any other output generating middleware** runs as it needs to intercept any HTML content and inject the Live Reload script into it.

### Start your application
There are a couple of different ways to run your application:

* **Start as normal (via Dev IDE, or dotnet run)**
In this scenario Live Reload works for static files and Razor files (assuming Razor Compilation was added to the project), but not for .NET source files in the Web project (ie. controllers or codebehind Razor Page files, Models etc.)

* **Start with `dotnet watch run`**
Using this approach runs the application and it can detect changes to .NET Project files. Changes in .NET project files causes the server to be restarted.

When using `dotnet watch run` you'll want to disable to built-in browser refresh functionality so the recommended startup is:

```ps
$env:DOTNET_WATCH_SUPPRESS_BROWSER_REFRESH=1
dotnet watch run
```

### Configuration Settings
LiveReload middleware has a number of configuration options, and you can use the standard .NET Core configuration paths - AppSettings.json, environment vars, command line - to add configuration settings.

Here's a typical AppSettings.json file:

```json
{
  "LiveReload": {
    "LiveReloadEnabled": true,
    "ClientFileExtensions": ".cshtml,.css,.js,.htm,.html,.ts,.razor,.custom",
    "ServerRefreshTimeout": 1000,
    "WebSocketUrl": "/__livereload",
    "LiveReloadScriptUrl": "/__livereloadscript",
    "WebSocketHost":null,
    "FolderToMonitor": "~/"
    // ... more options
  }
}
```

There are two event handlers that have to be set in the `Startup.cs` initialization code.

Here are the available configuration settings:

* **LiveReloadEnabled**
If this flag is false live reload has no impact as it simply passes through requests.
*The default is:* `true`.

   > I recommend you put: `"LiveReloadEnabled": false` into `appsettings.json` and `"LiveReloadEnabled": true` into `appsettings.Development.json` so this feature isn't accidentally enabled in Production.

* **ClientFileExtensions**
File extensions that the file watcher watches for in the Web project. These are files that can refresh without a server recompile, so don't include source code files here. Source code changes are handled via restarts with `dotnet watch run`.

* **FileInclusionFilter** (code only)
This filter allows to control whether a file change should cause the browser to refresh. This is useful to explicitly exclude files or files in entire sub-folders that shouldn't cause the browser to refresh, even though they are included in the file extension list for refreshes.

  The `path` passed in is a full OS path.

```csharp
services.AddLiveReload(config => {
    config.FileInclusionFilter = path =>
    {
        // don't trigger refreshes for files changes in the LocalizationAdmin sub-folder
        if (path.Contains("\\LocalizationAdmin", StringComparison.OrdinalIgnoreCase))
            return FileInclusionModes.DontRefresh;

        // explicitly force a file to refresh without regard to file extension et al. rules
        // are checked before the configuration file filter is applied
        if (path.Contains("/customfile.mm"))
            return FileInclusionModes.ForceRefresh;

        // continue regular file extension list filtering
        return FileInclusionModes.ContinueProcessing;
    };
})
```
* **FileInclusionFilter Delegate** (code only)
This filer lets you intercept files that have been changed and optionally decide whether you want to check the file for changes as it comes in.

The `path` passed in as a physical OS path.

```cs
services.AddLiveReload(config =>
{
    config.FileInclusionFilter = osPath =>
    {
        // don't check /LocalizationAdmin subfolder
        if (osPath.Contains("LocalizationAdmin", StringComparison.OrdinalIgnoreCase))
            return FileInclusionModes.DontRefresh;

        return FileInclusionModes.ContinueProcessing;
    };
});
```

* **RefreshInclusionFilter Delegate**  (code only)
This filter lets you control whether a URL should refresh or not. This setting is useful for excluding individual files or folders from auto-refreshing in the browser.

The `path` passed in is a Root Relative Web Path.

```cs
services.AddLiveReload(config =>
{
    // config.LiveReloadEnabled = true;   ideally set this in appsettings.json
    config.RefreshInclusionFilter = webPath =>
    {
        // don't refresh files on the client in the /LocalizationAdmin folder
        if (webPath.Contains("/LocalizationAdmin", StringComparison.OrdinalIgnoreCase))
            return FileInclusionModes.DontRefresh;

        return RefreshInclusionModes.ContinueProcessing;
    };
});
```

* **ServerRefreshTimeout**
This value affects whether there's a timeout used for `.cshtml` and `.razor` pages when refreshing. This is to avoid refreshing the page before recompilation has started which might cause the page to refresh the unchanged view/page.

  In most cases this shouldn't be necessary so leave this value at 0 unless you run into problems with refreshing Razor views/pages, then bump that value by small increments.

* **WebSocketUrl**
The site relative URL to the Web socket handler. The default is `/__livereload` and there should be little reason to change this.

* **LiveReloadScriptUrl**
By default this points at the internal `/__livereloadscript` URL which serves the live reload script from a compiled resource, is linked into the page via a `<script>` tag. You can provide a custom URL with a custom script, or set the value to `null` which serves the live reload script **inline** of the original HTML document rather than the `<script>` tag.

* **WebSocketHost**
An explicit WebSocket host URL. Useful if you are running on HTTP2 which doesn't support WebSockets (yet), so you can  point at another exposed host URL in your server that serves HTTP1.1.

  Don't set this value unless you have to - the default uses the current request's host and protocol handler (`$"{prefix}://{host.Host}:{host.Port}"`).   Example: `wss://localhost:5200`.

  **Note:** Ideally set up your applications to support both HTTP 1.1 and 2.0. [More info here](#http2-support).

* **FolderToMonitor**
This is the folder that's monitored. By default it's `~/` which is the Web Project's content root (not the Web root). Other common options are: `~/wwwroot` for Web only, `~/../` for **the entire solution**, or `~/../OtherProject/` for **another project** (which works well for client side Razor).

## Try it out
So to check out this functionality you can run the simple stock ASP.NET Core sample project. Let's demonstrate the three common live reload scenarios:

* Updating Static Files
* Updating Razor Views/Pages
* Updating on server code changes

### Update Static Files

* Start the application (recommend `dotnet watch run` but not required)
* Open the Index Page
* Open `wwwroot/css/site.css'
* Make a change in the CSS  (change the Font-size in the first `html` entries)
* Save the file

You should see the change reflected immediately. Sometime you may have to refresh once to get the cache to reset for CSS changes to show, but subsequent refreshes should show immediately.

> ##### CSS Refresh may require one Hard Browser Refresh first
> When updating CSS files, changes may not cause the browser to refresh autoamtically in some cases, due to the caching rules that browsers use. However, you can hard refresh the page (ctrl-shift-r) once, and any subsequent requests should show any changes you make to the CSS file.

### Update Razor Views

* Start the application (recommend `dotnet watch run` but not required)
* Open the Index Page
* Open `Views/Home/Index.cshtml`
* Make a change in the Header text - `Welcome Live Reload`
* Save the file

You should see the change reflected immediately.

> ##### First Time Razor Refresh can be slow
> The first time you refresh a Razor Page or View can be very slow as the Razor runtime and compiler are loaded for the first time. It can take a few seconds before this first request is refreshed. Subsequent requests however, will be very quick.

### Server Changes

* Start the application with `dotnet watch run` (required or otherwise you have to manually restart app)
* Open the Index Page
* Open `Controllers/HomeController.cs`
* Make a change in `ViewBag.Message`
* Save the file

The page will refresh but it will take a while as the server has to restart. Typically 3-5 seconds or so for a simple project, longer for more complex projects obviously.

You may have to tweak the `ServerRefreshTimeout` value to account for the time your server takes to restart to get a reliable refresh.

## HTTP2 Support
If you're using this extension with HTTP2 connections make sure you set your connections to support **both Http1 and Http2**. WebSockets don't work over HTTP2, so you need to also expose HTTP1 endpoints.

To do this you you can use this in your startup Builder configuration:

```cs
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .ConfigureKestrel(options =>
        {
            options.ConfigureEndpointDefaults(c => c.Protocols = HttpProtocols.Http1AndHttp2);
        })
        .UseStartup<Startup>();
```

The important bit is `c.Protocols = HttpProtocols.Http1AndHttp2`.

## Blazor Support?
Several people have asked about Blazor support and yes this tool can provide refresh to Blazor applications and yes it can - sort of.

### Server Side Blazor
If you are using a server side Blazor project you can just use `dotnet watch run` which automatically provides browser refresh (unreliable but it sort of works). You'll need to add:

```xml
<ItemGroup>
    <Watch Include="**\*.razor" />
</ItemGroup>
```

and that should work. In my experience this is really flakey though and you can double that up with this Live Reload addin which will also refresh the page when the project restarts.

### Client Side Blazor
For client side Blazor the story is more complex and there's no real good solution for quick auto-reload, because client side blazor has no individual page recompile, but has to completely recompile the blazor project.

Live Reload can work with this but it's slow as both the Blazor project has to be recompiled and the server project restarted (don't know if there's a way to just trigger a recompile of the client project on its own - if you think of a way please file an issue so we can add that!)

The following is based on the default project template that uses two projects for a client side blazor: The ASP.NET Core hosting project and the Blazor client project.

* Add LiveReload to the **ASP.NET Core Server Project**
* Set up monitoring for the entire solution (or the Blazor Project only)
* Add the Blazor extension

You can do this in configuration via:

```json
{
  "LiveReload": {
    "LiveReloadEnabled": true,
    "ClientFileExtensions": ".css,.js,.htm,.html,.ts,.razor,.cs",
    "FolderToMonitor": "~/.."
  }
}
```

This adds the `.razor,.cs` extensions and it basically monitors the entire Solution (`~/..`) for changes. Alternately you can also point at the Blazor project instead:

```json
"FolderToMonitor": "~/../MyBlazorProject"
```

Since Blazor projects tend to not care about the .NET Core backend that just acts as static file service you probably only need to monitor the client side project in Blazor projects. Either the entire solution or Blazor project folders work.

* Start the application with `dotnet watch run` (required or you need to manually restart)
* Open the Index Page
* Open `Pages/Index.razor`
* Make a change in the page
* Save the file

Reload will not be quick because the Blazor client project **and** the .NET Core project will recompile and restart. For a simple hello world it takes about 5 seconds on my local setup. For a full blown applications this may be even slower.

Obviously this is not ideal, but it's better than nothing. Live Reload works as it should but the underlying problem is that the actual content is not refreshing quickly enough to make this really viable.

We can only hope Microsoft come up with a built-in solution to trigger the recompilation of the client project or better yet recompilation of a single view as it's changed.

## Change Log

### Version 0.3.7

* **Fix: LiveReload JavaScript code**
Cleanup the reload code for consistency. Explicitly set `no-cache` header in HTML pages to force pages to not cache on the client and always reload on a `window.location.reload()`.

### Version 0.3.6

* **Add explicit .NET 6.0 Target**
Add explicit .NET 6 targeting support and sample.
Thanks to @davidfowler for finding the missing implementation for new `WriteAsync()` behavior in 6.0.

### Version 0.3.3

* **External Script Request for Reload JavaScript**
Added a `LiveReloadScriptUrl` configuration property that when set embeds a script URL to serve the Live reload script externally. This allows customizing how the JavaScript script is loaded for special cases or for easier debugging. If set the script URL is used and the default is `/__livereloadscript` which is internally served from an embedded resource. By setting `LiveReloadScriptUrl` blank or null, the old behavior of loading the script inline in the page is used instead.

* **Fix: WebSocket Reload Logic**
Updated WebSocket reload logic by clearing the interval to avoid overlapping WebSocket reload requests if a socket is not available. This should cut down on the noise that was created when a connection with the server is lost and then fires many backed up socket requests at once. [PR #46](https://github.com/RickStrahl/Westwind.AspnetCore.LiveReload/pull/46)

### Version 0.3.0

* **Add .NET Core 5.0 Target**
Added support for .NET Core 5.0 and removed .NET Core 2.1 support which cleans up a bit of code due to core framework interface differences.

### Version 0.2.11

* **Fix: Now refreshes Developer Error Page**
When an error page using `app.UseDeveloperExceptionPage();` is displayed, the page is now refreshed when you make any changes to fix your error. The error page refreshes using the original URL that caused the error and should display the fixed page - or not if you mucked it up  :smile:.

### Version 0.2.10

* **Add RefreshInclusionFilter Configuration Property**
This setting allows you to programmatically exclude a file or folder from live refreshing. The `Func<string, RefreshInclusionModes>` hook allows you to explicitly create rules to include or exclude files or entire folders from processing.

* **Add FileInclusionFilter Configuration Property**
Adds a configuration `Func<string, FileInclusionModes>` hook to allow explicitly specifying whether files are checked for change notifications. You can either include or reject files in this hook function which gives precise control over what files are monitored and passed through for triggering browser refresh.
*Note: this feature was added by PR in 0.2.7, but has been changed to return an `FileInclusionModes` enum for more explicit options rather than the original `bool`*.

### Version 0.2.4

* **Better preservation of scroll position in Refresh script**
Changed the client script to use `location.reload()` instead of a force refresh with `location.reload(true)`. The forced refresh also forces the top of the page to be displayed, while reload preserves scroll position in most browsers (Edge Chromium not for some reason)

* **Add Lifecycle Management CancellationToken to Web Socket Read**
Added the cancellation token to the `WebSocket.Receive()` operation so the socket can safely abort when the application is shut down. Previously this was causing problems in some application that used ASP.NET Core Lifecycle operations to not fire those event due to the still active WebSocket timing out before the app would shut down.

* **Fix: Rendering Errors when Live Reload Enabled**
Fix issue where rendering was failing due to a missing `await` on output generation which would intermittently cause pages to fail. Fixed.

* **Fix: Errors with Concurrency for WebSocket Storage**
Switched to ConcurrentDictionary for the Web Socket list storage.

### Version 0.1.17

* **Delay load injected WebSocket Script Code**
Change the injected WebSocket script code so it delay loads to avoid potential page load hangs or dual updates.

* **Update Response Rewrite to use IHttpResponseStreamFeature**
Update internal code used to rewrite response data for HTML content using the recommended HTTP Features rather than rewriting the Response.Body stream directly.

#### Version 0.1.14

* **Change Targeting to .NET Core 2.1 and 3.1**
Changed targets to the LTS releases of .NET Core. Also changed dependencies to `Microsoft.AspNetCore.App` to reference all base ASP.NET Core base dependencies for better update package management support for apps integrating with this library.

* **Update Samples**
Updated the samples to be easier to use and provide links to files that can be edited so it's easier to try out the sample and see live reloading work. Also re-targeted the sample app to .NET Core 2.2 and 3.1 (two separate projects due to separate ASP.NET configuration config).

#### Version 0.1.07

* **Add explicit support for .NET Core 3.0**
Add a .NET Core 3.0 target to the NuGet package, to minimize package resolution issues.

* **Add LiveReloadWebServer Chocolatey Package**
Add support for a deployed fully self-contained [Chocolatey Package](https://chocolatey.org/packages/LiveReloadWebServer).

#### Version <IP_ADDRESS>

* **[Add new standalone LiveReloadServer Dotnet Tool](LiveReloadServe/README.md)**
Added a new generic live reload server that's used that can be used to serve generic static HTML content and loose Razor Pages out of a folder. It's basically a standalone static Web Server which by default has Live Reload enabled. Although meant as a local server/tool, it can also be used like any other ASP.NET Core application and run behind a Web server like IIS or NGINX.

* **Fix issues with .NET Core 3.0**
Fixed various compatibility issues related to API changes in .NET Core 3.0. Library now works with .NET Core 3.0.

#### Version <IP_ADDRESS>

* **Fix bug with Static HTML Files Content Length**
Fix `Response.ContentLength` by setting to `null` to force contentlength be calculated. Static files set this value to a fixed length and when we re-write this breaks the length. Fixed.

* **Update ASP.NET Core Packages to 2.1.1**
Updated all core dependencies to use patched 2.1.1. Stick with

gha_language: C#

gha_license_id: NOASSERTION


text:
---
id: test-fixtures
title: "Advanced: fixtures"
---

<!-- TOC -->

## Introduction to fixtures

Playwright Test is based on the concept of the test fixtures. Test fixtures are used to establish environment for each test, giving the test everything it needs and nothing else. Test fixtures are isolated between tests, which gives Playwright Test following benefits:
- Playwright Test runs tests in parallel by default, making your test suite much faster.
- Playwright Test can efficiently retry the flaky failures, instead of re-running the whole suite.
- You can group tests based on their meaning, instead of their common setup.

Here is how typical test environment setup differs between traditional test style and the fixture-based one. We assume a `TodoPage` class that helps interacting with a "todo list" page of the web app.

### Without fixtures

```js
// todo.spec.js
const { test } = require('@playwright/test');
const { TodoPage } = require('./todo-page');

test.describe('todo tests', () => {
  let todoPage;

  test.beforeEach(async ({ page }) => {
    todoPage = new TodoPage(page);
    await todoPage.goto();
    await todoPage.addToDo('item1');
    await todoPage.addToDo('item2');
  });

  test.afterEach(async () => {
    await todoPage.removeAll();
  });

  test('should add an item', async () => {
    await todoPage.addToDo('my item');
    // ...
  });

  test('should remove an item', async () => {
    await todoPage.remove('item1');
    // ...
  });
});
```

### With fixtures

```js js-flavor=js
// todo.spec.js
const base = require('@playwright/test');
const { TodoPage } = require('./todo-page');

// Extend basic test by providing a "todoPage" fixture.
const test = base.test.extend({
  todoPage: async ({ page }, use) => {
    const todoPage = new TodoPage(page);
    await todoPage.goto();
    await todoPage.addToDo('item1');
    await todoPage.addToDo('item2');
    await use(todoPage);
    await todoPage.removeAll();
  },
});

test('should add an item', async ({ todoPage }) => {
  await todoPage.addToDo('my item');
  // ...
});

test('should remove an item', async ({ todoPage }) => {
  await todoPage.remove('item1');
  // ...
});
```

```js js-flavor=ts
// example.spec.ts
import { test as base } from '@playwright/test';
import { TodoPage } from './todo-page';

// Extend basic test by providing a "table" fixture.
const test = base.extend<{ todoPage: TodoPage }>({
  todoPage: async ({ page }, use) => {
    const todoPage = new TodoPage(page);
    await todoPage.goto();
    await todoPage.addToDo('item1');
    await todoPage.addToDo('item2');
    await use(todoPage);
    await todoPage.removeAll();
  },
});

test('should add an item', async ({ todoPage }) => {
  await todoPage.addToDo('my item');
  // ...
});

test('should remove an item', async ({ todoPage }) => {
  await todoPage.remove('item1');
  // ...
});
```

You declare exact fixtures that the test needs and the runner initializes them for each test individually. Tests can use any combinations of the fixtures to tailor precise environment they need. You no longer need to wrap tests in `describe`s that set up environment, everything is declarative and typed.

There are two types of fixtures: `test` and `worker`. Test fixtures are set up for each test and worker fixtures are set up for each process that runs test files.

## Test fixtures

Test fixtures are set up for each test. Consider the following test file:

```js js-flavor=js
// hello.spec.js
const test = require('./hello');

test('hello', ({ hello }) => {
  test.expect(hello).toBe('Hello');
});

test('hello world', ({ helloWorld }) => {
  test.expect(helloWorld).toBe('Hello, world!');
});
```

```js js-flavor=ts
// hello.spec.ts
import test from './hello';

test('hello', ({ hello }) => {
  test.expect(hello).toBe('Hello');
});

test('hello world', ({ helloWorld }) => {
  test.expect(helloWorld).toBe('Hello, world!');
});
```

It uses fixtures `hello` and `helloWorld` that are set up by the framework for each test run.

Here is how test fixtures are declared and defined. Fixtures can use other fixtures - note how `helloWorld` uses `hello`.

```js js-flavor=js
// hello.js
const base = require('@playwright/test');

// Extend base test with fixtures "hello" and "helloWorld".
// This new "test" can be used in multiple test files, and each of them will get the fixtures.
module.exports = base.test.extend({
  // This fixture is a constant, so we can just provide the value.
  hello: 'Hello',

  // This fixture has some complex logic and is defined with a function.
  helloWorld: async ({ hello }, use) => {
    // Set up the fixture.
    const value = hello + ', world!';

    // Use the fixture value in the test.
    await use(value);

    // Clean up the fixture. Nothing to cleanup in this example.
  },
});
```

```js js-flavor=ts
// hello.ts
import { test as base } from '@playwright/test';

// Define test fixtures "hello" and "helloWorld".
type TestFixtures = {
  hello: string;
  helloWorld: string;
};

// Extend base test with our fixtures.
const test = base.extend<TestFixtures>({
  // This fixture is a constant, so we can just provide the value.
  hello: 'Hello',

  // This fixture has some complex logic and is defined with a function.
  helloWorld: async ({ hello }, use) => {
    // Set up the fixture.
    const value = hello + ', world!';

    // Use the fixture value in the test.
    await use(value);

    // Clean up the fixture. Nothing to cleanup in this example.
  },
});

// Now, this "test" can be used in multiple test files, and each of them will get the fixtures.
export default test;
```

With fixtures, test organization becomes flexible - you can put tests that make sense next to each other based on what they test, not based on the environment they need.

## Worker fixtures

Playwright Test uses worker processes to run test files. You can specify the maximum number of workers using `--workers` command line option. Similarly to how test fixtures are set up for individual test runs, worker fixtures are set up for each worker process. That's where you can set up services, run servers, etc. Playwright Test will reuse the worker process for as many test files as it can, provided their worker fixtures match and hence environments are identical.

Here is how the test looks:
```js js-flavor=js
// express.spec.js
const test = require('./express-test');
const fetch = require('node-fetch');

test('fetch 1', async ({ port }) => {
  const result = await fetch(`http://localhost:${port}/1`);
  test.expect(await result.text()).toBe('Hello World 1!');
});

test('fetch 2', async ({ port }) => {
  const result = await fetch(`http://localhost:${port}/2`);
  test.expect(await result.text()).toBe('Hello World 2!');
});
```

```js js-flavor=ts
// express.spec.ts
import test from './express-test';
import fetch from 'node-fetch';

test('fetch 1', async ({ port }) => {
  const result = await fetch(`http://localhost:${port}/1`);
  test.expect(await result.text()).toBe('Hello World 1!');
});

test('fetch 2', async ({ port }) => {
  const result = await fetch(`http://localhost:${port}/2`);
  test.expect(await result.text()).toBe('Hello World 2!');
});
```

And here is how fixtures are declared and defined:
```js js-flavor=js
// express-test.js
const base = require('@playwright/test');
const express = require('express');

// Define "port" and "express" worker fixtures.
module.exports = base.test.extend({

  // We pass a tuple to specify fixtures options.
  // In this case, we mark this fixture as worker-scoped.
  port: [ async ({}, use, workerInfo) => {
    // "port" fixture uses a unique value of the worker process index.
    await use(3000 + workerInfo.workerIndex);
  }, { scope: 'worker' } ],

  // "express" fixture starts automatically for every worker - we pass "auto" for that.
  express: [ async ({ port }, use) => {
    // Setup express app.
    const app = express();
    app.get('/1', (req, res) => {
      res.send('Hello World 1!')
    });
    app.get('/2', (req, res) => {
      res.send('Hello World 2!')
    });

    // Start the server.
    let server;
    console.log('Starting server...');
    await new Promise(f => {
      server = app.listen(port, f);
    });
    console.log('Server ready');

    // Use the server in the tests.
    await use(server);

    // Cleanup.
    console.log('Stopping server...');
    await new Promise(f => server.close(f));
    console.log('Server stopped');
  }, { scope: 'worker', auto: true } ],
});
```

```js js-flavor=ts
// express-test.ts
import { test as base } from '@playwright/test';
import express from 'express';
import type { Express } from 'express';

// Declare worker fixtures.
type ExpressWorkerFixtures = {
  port: number;
  express: Express;
};

// Note that we did not provide an test-scoped fixtures, so we pass {}.
const test = base.extend<{}, ExpressWorkerFixtures>({

  // We pass a tuple to specify fixtures options.
  // In this case, we mark this fixture as worker-scoped.
  port: [ async ({}, use, workerInfo) => {
    // "port" fixture uses a unique value of the worker process index.
    await use(3000 + workerInfo.workerIndex);
  }, { scope: 'worker' } ],

  // "express" fixture starts automatically for every worker - we pass "auto" for that.
  express: [ async ({ port }, use) => {
    // Setup express app.
    const app = express();
    app.get('/1', (req, res) => {
      res.send('Hello World 1!')
    });
    app.get('/2', (req, res) => {
      res.send('Hello World 2!')
    });

    // Start the server.
    let server;
    console.log('Starting server...');
    await new Promise(f => {
      server = app.listen(port, f);
    });
    console.log('Server ready');

    // Use the server in the tests.
    await use(server);

    // Cleanup.
    console.log('Stopping server...');
    await new Promise(f => server.close(f));
    console.log('Server stopped');
  }, { scope: 'worker', auto: true } ],
});

export default test;
```

## Overriding fixtures

In addition to creating your own fixtures, you can also override existing fixtures to fit your needs. Consider the following example which overrides the `page` fixture by navigating to a specified URL:

```js js-flavor=js
const base = require('@playwright/test');

exports.test = base.test.extend({
  page: async ({ baseURL, page }, use) => {
    await page.goto(baseURL);
    await use(page);
  },
});
```

```js js-flavor=ts
import { test as base } from '@playwright/test';

export const test = base.extend({
  page: async ({ baseURL, page }, use) => {
    await page.goto(baseURL);
    await use(page);
  },
});
```

Notice that in this example, the `page` fixture is able to depend on other built in fixtures such as `baseURL`. This allows us to override the `baseURL` used by the `page` fixture in our tests using `test.use`.

```js js-flavor=js
test.use({ baseURL: 'https://playwright.dev' })
```

```js js-flavor=ts
test.use({ baseURL: 'https://playwright.dev' })
```

Fixtures can also be overridden where the base fixture is completely replaced with something different. For example, we could override the `storageState` fixture to provide our own data.

```js js-flavor=js
const base = require('@playwright/test');

exports.test = base.test.extend({
  storageState: async ({}, use) => {
    const cookie = await getAuthCookie();
    await use({ cookies: [cookie] });
  },
});
```

```js js-flavor=ts
import { test as base } from '@playwright/test';

export const test = base.extend({
  storageState: async ({}, use) => {
    const cookie = await getAuthCookie();
    await use({ cookies: [cookie] });
  },
});
```

repository: pavelfeldman/playwright

repo_name: pavelfeldman/playwright


text:
# more-markdown / test-processor

A plugin for `more-markdown` that runs tests on the markdown contents.

# Installation

You first need a [more-markdown](https://github.com/Welfenlab/more-markdown) setup.
Then you can install it via:

```
npm install @more-markdown/test-processor
```

# Usage

```
var moreMarkdown = require('more-markdown');
var testProcessor = require('@more-markdown/test-processor');

// create a processor that writes the final html
// to the element with the id 'output'
var proc = moreMarkdown.create('output', processors: [testProcessor(...)]);

proc.render("```test" +
"it('should do X', function(){...})" +
"```");
```

Or have a look at the [markdown-editor-example](https://github.com/Welfenlab/markdown-editor-example)

repository: Welfenlab/test-processor

repo_name: Welfenlab/test-processor


text:
# Installation steps

> This small guide will teach you how to install the thttil language support for Visual Studio 2015

- Copy the file named "thttil.tmLanguage" to %userprofile%\.vs\Extensions
- Restart Visual Studio 2015

repository: Renondedju/Thttil

repo_name: Renondedju/Thttil


text:
# IL Fair Tax

[![Build status](https://github.com/pjsier/il-fair-tax/workflows/CICD/badge.svg)](https://github.com/pjsier/il-fair-tax/actions?query=workflow%3ACICD)

Vote yes for the Illinois Fair Tax. Static site built with [11ty](https://www.11ty.dev/) with a calculator for estimating how taxes would change with a Fair Tax as well as answers to some frequently asked questions.

## Setup

```shell
npm install
npm start
```

repository: pjsier/il-fair-tax

repo_name: pjsier/il-fair-tax


text:
## vscode-js-console-utils

Easily insert and remove console.log statements, by [@whtouche](https://twitter.com/whtouche)

![](https://i.imgur.com/0tiesd2.gif)

## Installing

This extension is available for free in the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=whtouche.vscode-js-console-utils)

## Usage

With selection:
* Highlight a variable (or really any text)
* Press Cmd+Shift+L
* The output (on a new line) will be: console.log('variable: ', variable);

Without selection:
* Press Cmd+Shift+L
* The output (on the same line) will be: console.log();

To remove console.logs:
* Press Cmd+Shift+D
* This will delete all console.log statements in the current document

## To Do
* Add support for other console.* methods (warn, error, time, timeEnd, etc)
* Add ability to delete console.* across project (currently just the open file)
* ~~When deleting console.*, report how many were deleted~~, across how many files
* Allow configuration to only delete certain types of console.* statements

## License
[MIT License](LICENSE)

repository: heanxu/vscode-js-console-utils

repo_name: heanxu/vscode-js-console-utils


text:
---
title: difference() function
description: The `difference()` function computes the difference between subsequent non-null records.
aliases:
  - /influxdb/cloud/reference/flux/functions/transformations/aggregates/difference
  - /influxdb/cloud/reference/flux/functions/built-in/transformations/aggregates/difference/
menu:
  influxdb_cloud_ref:
    name: difference
    parent: built-in-transformations
weight: 402
related:
  - /{{< latest "influxdb" "v1" >}}/query_language/functions/#difference, InfluxQL – DIFFERENCE()
---

The `difference()` function computes the difference between subsequent records.
The user-specified columns of numeric type are subtracted while others are kept intact.

_**Function type:** Transformation_
_**Output data type:** Float_

```js
difference(
  nonNegative: false,
  columns: ["_value"],
  keepFirst: false
)
```

## Parameters

### nonNegative
Indicates if the difference is allowed to be negative.
When set to `true`, if a value is less than the previous value, it is assumed the previous value should have been a zero.

_**Data type:** Boolean_

### columns
The columns to use to compute the difference.
Defaults to `["_value"]`.

_**Data type:** Array of Strings_

### keepFirst
Indicates the first row should be kept.
If `true`, the difference will be `null`.
Defaults to `false`.

_**Data type:** Boolean_

## Subtraction rules for numeric types
- The difference between two non-null values is their algebraic difference;
  or `null`, if the result is negative and `nonNegative: true`;
- `null` minus some value is always `null`;
- Some value `v` minus `null` is `v` minus the last non-null value seen before `v`;
  or `null` if `v` is the first non-null value seen.

## Output tables
For each input table with `n` rows, `difference()` outputs a table with `n - 1` rows.

## Examples

```js
from(bucket: "example-bucket")
  |> range(start: -5m)
  |> difference()
```
```js
from(bucket: "example-bucket")
  |> range(start: -5m)
  |> difference(nonNegative: true)
```

### Example data transformation

###### Input table
| _time | _value | tag |
|:-----:|:------:|:---:|
| 0001  | null   | tv  |
| 0002  | 6      | tv  |
| 0003  | 4      | tv  |
| 0004  | 10     | tv  |
| 0005  | null   | tv  |

#### With nonNegative set to false
```js
|> difference(nonNegative: false)
```
###### Output table
| _time | _value | tag |
|:-----:|:------:|:---:|
| 0002  | null   | tv  |
| 0003  | -2     | tv  |
| 0004  | 6      | tv  |
| 0005  | null   | tv  |

#### With nonNegative set to true
```js
|> difference(nonNegative: true):
```
###### Output table
| _time | _value | tag |
|:-----:|:------:|:---:|
| 0002  | null   | tv  |
| 0003  | null   | tv  |
| 0004  | 6      | tv  |
| 0005  | null   | tv  |

#### With keepFirst set to true
```js
|> difference(nonNegative: false, keepFirst: true):
```
###### Output table
| _time | _value | tag |
|:-----:|:------:|:---:|
| 0001  | null   | tv  |
| 0002  | null   | tv  |
| 0003  | -2     | tv  |
| 0004  | 6      | tv  |
| 0005  | null   | tv  |

gha_language: SCSS