text:
# XBLocation

[![CI Status](http://img.shields.io/travis/Eugene Nguyen/XBLocation.svg?style=flat)](https://travis-ci.org/Eugene Nguyen/XBLocation)
[![Version](https://img.shields.io/cocoapods/v/XBLocation.svg?style=flat)](http://cocoapods.org/pods/XBLocation)
[![License](https://img.shields.io/cocoapods/l/XBLocation.svg?style=flat)](http://cocoapods.org/pods/XBLocation)
[![Platform](https://img.shields.io/cocoapods/p/XBLocation.svg?style=flat)](http://cocoapods.org/pods/XBLocation)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## How to use

1. Import XBLocation.h where you want to use location function

```obj-c
#import "XBLocation.h"
```

2. Start location service

```objc-c
[XBLocation registerLocation];
```

3. Add handle of location

```obj-c
[self handleLocation:@selector(locationDidChange)];

// and

- (void)locationDidChange
{
    NSLog(@"%f %f", [XBLocation currentLocation].coordinate.latitude, [XBLocation currentLocation].coordinate.longitude);
}

// or you can use current location everywhere
[XBLocation currentLocation];

```

## Requirements

## Installation

XBLocation is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "XBLocation"
```

## Author

Eugene Nguyen<EMAIL_ADDRESS>
## License

XBLocation is available under the MIT license. See the LICENSE file for more info.

repository: EugeneNguyen/XBLocation

repo_name: EugeneNguyen/XBLocation


text:
# Utilities for ErgoDox EZ

## edLayout

Is a utility to examine layouts for ErgoDox keyboard.

``` pwsh
❯ .\edLayout.exe -i .\samples -l .\layouts\qwerty.json -sp false -o .\publish\edLayout\results.csv

Usage:
  edLayout [options]

Options:
  -i, --input <input>        Path to a directory with sampling texts.
  -p, --pattern <pattern>    Pattern to filter sampling files. [default: *.txt]
  -l, --layout <layout>      Path to a layout file.
  -o, --output <output>      Path to the output file.
  -sp, --show-progress       [default: True]
  -d, --detailed             Show sample texts statistics.
  --version                  Show version information
  -?, -h, --help             Show help and usage information
```

More details you can find [here](https://sgaliamov.medium.com/evaluating-keyboard-layouts-for-ergodox-ez-cf70042c4865).

## edText

A utility that helps to minify sampling texts without loosing statistical characteristic's of digraphs.

In case when you have a lot of texts for some algorithm, you can save some time running it on smaller version of those texts that have same quality.

``` pwsh
edText.exe .\samples 0.01 .\results 4
```

### Parameters

1. `.\samples` path to a folder with original texts. It should be `txt` files.
1. `0.01` target precision.
1. `.\results` output folder.
1. `4` defines the way how to split the set of lines in the algorithm.

### Algorithm

1. Load all texts.
1. Shuffle the current set of lines.
1. If shuffled 10 times already, save text and exit.
1. Split into 2 parts using the last input parameter.
1. Calculate a score for both parts.
1. If both bad according the chosen precision, go to 2.
1. Get the best part.
1. Go to 3.

license: MIT

repository: sgaliamov/ergo-layouts

branch_name: refs/heads/master

extension: md

gha_language: F#

gha_license_id: MIT

license_type: permissive

repo_name: sgaliamov/ergo-layouts


text:
### [CVE-2019-13289](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13289)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

In Xpdf 4.01.01, there is a use-after-free vulnerability in the function JBIG2Stream::close() located at JBIG2Stream.cc. It can, for example, be triggered by sending a crafted PDF document to the pdftoppm tool.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/0xCyberY/CVE-T4PDF
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
HasOneSelector
===================

The `Milkyway\SS\GridFieldUtils\HasOneSelector` component allows you to select a has one from the current GridField

```php
    $grid->getConfig()->addComponent($component = new Milkyway\SS\GridFieldUtils\HasOneSelector($relation = 'FeaturedItem', $columnTitle = ''));
```

## Public properties
* **$component->columnTitle** Column Title (defaults to {{relation}})
* **$component->resetButtonTitle** Reset Button Title (defaults to Reset {{relation}})
* **$component->targetFragment** Where the reset button is placed (defaults to before)

## Use Cases
* Select a featured item from a HasManyList/ManyManyList

repository: milkyway-multimedia/ss-gridfield-utils

gha_language: PHP

repo_name: milkyway-multimedia/ss-gridfield-utils


text:
# README Generator
![](https://img.shields.io/badge/License-MIT-yellow.svg)
## Description
A command-line application that dynamically generates a professional README.md file from a user's input using the Inquirer package.

**Link to deployed application:** [https://github.com/aldrinburgos18/README-generator](https://github.com/aldrinburgos18/README-generator)

## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [Questions](#questions)
- [License](#license)

## Installation
Open terminal, install dependencies using the command 'npm_install'.

## Usage
Open terminal then run index.js using node.
![Example1_gif](gif1.gif)

Answer on screen prompt to generate values for README.
![Example2_gif](gif2.gif)

Preview of finished product:
![Example3_gif](gif3.gif)

Clicking on "more information" directs user to license information page.
![Example4_gif](gif4.gif)

## Contributing
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

## Questions
If you have any additional questions, please feel free to contact me at:
E-mail<EMAIL_ADDRESS>
Github: [aldrinburgos18](https://github.com/aldrinburgos18)

## License
![](https://img.shields.io/badge/License-MIT-yellow.svg)
A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.
*[More Information about this license...](https://opensource.org/licenses/MIT)*


text:
Square Engine is a simple javascript library for making simple "pixelated" games inspired by the atari 2600 look.
The library uses the canvas element to generate its graphics.
Please check out our website to get more information on how to use the library
https://squareengine.github.io/source/index.html

The library is distributed under the MIT license.

Our website uses JQuery, JQuery UI and Cycle libraries.
These libraries and their icons are copyrighted material and belongs to its creators.
Please check out the about page for more information on these libraries.

repository: SquareEngine/source

gha_language: JavaScript

repo_name: SquareEngine/source


text:
# Bathymetric Graph SLAM

Baseline SLAM framework for underwater vehicles.
The algorithm gets a set of bathymetric submaps as input and corrects the global map constructed while refining the vehicle trajectory through a map-to-map registration followed by a pose graph optimization.

![real_data_example](https://github.com/ignaciotb/bathymetric_slam/blob/master/img/graph_borno.png)

## Paper introducing and applying the method
The method implemented is described [in this paper](https://ieeexplore.ieee.org/abstract/document/8968241) and used [in this one](https://arxiv.org/abs/2003.10931)
```
@inproceedings{torroba2019towards,
  title={Towards Autonomous Industrial-Scale Bathymetric Surveying},
  author={Torroba, Ignacio and Bore, Nils and Folkesson, John},
  booktitle={2019 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  pages={6377--6382},
  year={2019},
  organization={IEEE}
}

@article{torroba2020pointnetkl,
  title={PointNetKL: Deep Inference for GICP Covariance Estimation in Bathymetric SLAM},
  author={Torroba, Ignacio and Sprague, Christopher Iliffe and Bore, Nils and Folkesson, John},
  journal={IEEE Robotics and Automation Letters},
  volume={5},
  number={3},
  pages={4078--4085},
  year={2020},
  publisher={IEEE}
}
```

## Dependencies (tested on Ubuntu 16.04 and 18.04)
* AUVLIB [here](https://github.com/ignaciotb/auvlib)
* PCL  http://pointclouds.org/
* G2O https://github.com/RainerKuemmerle/g2o
* Ceres http://ceres-solver.org/

Note that for G2O to be used by this repo you need to install it at a system level.
From the G2O build folder, run
```
sudo make install
```

## Building

Clone this repository and create a `build` folder under the root, then execute
```
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install ..
make -j4
make install
```

Finally, add the following line to your ~/.bashrc file adapted to your own installation
```
export PATH=$PATH:/path/to/folder/bathymetric_slam/install/share
```
### Available apps
Under `bin` folder.
The process outputs .png images with the maps of bathymetry and consistency error.
The current script optimizes the graph with Ceres, but the app outputs a "graph.g2o" file which you can solve with G2O if preferred.

##### SLAM with simulated data
In order to test the framework with data from the [SMARC simulator](https://github.com/smarc-project), use the toy dataset `map_small` under `sim_data`.
You can visualize both the ground truth map and vehicle trajectory in the visualizer. To start the optimization process, hit "q".
```
./bathy_slam_real --simulation yes --bathy_survey ../sim_data/map_small/
```
The simulation outputs a measure of the error contained in the map, as well as the height maps and error plots as .png files.
To increase the complexity of the sim dataset, increase the Gaussian noise to the vehicle's position estimate.
In order to adapt the performance of the algorithm to the dataset, adjust the weights of the edges of the pose-graph accordingly and tune the GICP and the Ceres solver parameters.
The algorithm is **not** by default tuned for the toy example `map_small`.

##### SLAM with real data
To run the SLAM solution with real data from a bathymetric survey, currently the input is in the form of a cereal file containing all the necessary information from your data files.
You can find a real survey carried out with an ROV [here](https://strands.pdc.kth.se/public/IROS-2019-Bathymetry/). Download it, adjust the framework values, and test it.
```
./bathy_slam_real --simulation no --bathy_survey /path/to/datasets/mbes_pings.cereal
```
### Generating your own cereal files from real surveys
Take a look at the [AUVLIB](https://github.com/nilsbore/auvlib) toolbox in order to parse real MBES, SSS, navigation, etc data from the most common formats into .cereal files.


text:
When enabling auto-restore, Paket will

- create a `.paket` directory in your root directory,
- download `paket.targets` and [`paket.bootstrapper.exe`](bootstrapper.html)
  into the `.paket` directory,
- add an `<Import>` statement for `paket.targets` to projects that have a
  [`paket.references` file](references-files.html).

When disabling auto-restore, Paket will

- remove `paket.targets` from the `.paket` directory,
- remove the `<Import>` statement for `paket.targets` from projects that have a
  [`paket.references` file](references-files.html).

repository: fredbuluku/Paket

repo_name: fredbuluku/Paket


text:
---
title: Dependency Injection in Javascript
layout: post
date: 2017-03-17 03:55
tag:
- javascript
- fp
blog: true
---

If you like to develop your Javascript applications in a functional style, often times you have to deal with [Dependency Injection](https://martinfowler.com/articles/injection.html#FormsOfDependencyInjection) when it comes to unit-test functions that depend on other functions. Fortunately, with ES6 [default parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters) DI becomes quite simple. Let’s see an example.

## Example: An API Client

Most client applications need to communicate with a remote server, So let’s build a simple API client module with a few functions. The end goal looks like this:

{% highlight javascript %}
// an usual TODO app...

import * as apiClient from "./lib/api.client";

apiClient
  .addTodo({ text: "wash dishes" })
  .then(todo => console.log("New todo added:", todo))
  .catch(errors => console.log("Something went wrong:", errors));

//=> New todo added: { id: "1", text: "wash dishes", done: false }

// ...

apiClient
  .fetchTodos()
  .then(todos => console.log(todos))
  .catch(errors => console.log("Something went wrong:", errors));

//=> [ { id: "1", text: "wash dishes", done: false } ]
{% endhighlight %}

Our client is just a namespace of functions, each one representing a different HTTP request to a remote server. To send the actual request we intend to use [fetch](https://github.com/matthew-andrews/isomorphic-fetch) which returns a Promise wrapping the response. So the `fetch` function will be our dependency.

## Starting With Tests

Let’s write a few unit test cases to drive the development of our functions. In order  to test them in isolation we need to inject a fake `fetch` function as we don't want to exercise the real HTTP requests.

{% highlight javascript %}
// test/api.client.test.js
import * as client from "../lib/api.client";
import { expect } from "chai";
import { stub } from "sinon";

describe("api client", () => {
  let fakeFetch;

  beforeEach(() => {
    fakeFetch = stub();
  });

  describe("fetchTodos()", () => {
    it("retrieves all todos", () => {
      const fakeResponse = Promise.resolve({
        status: 200,
        json: () => Promise.resolve([{
          id: "1",
          text: "walk the dog",
          done: false
        }])
      });

      fakeFetch.withArgs("/api/todos").returns(fakeResponse);

      return client.fetchTodos(fakeFetch).then(todos => {
        expect(todos).deep.eq([{
          id: "1",
          text: "walk the dog",
          done: false
        }]);
      });
    });
  });
});
{% endhighlight %}

We stubbed `fetch` to return an arbitrary response and passed as an argument to `fetchTodos`. That can be implemented as a default parameter.

{% highlight javascript %}
// lib/api.client.js
import defaultFetch from "isomorphic-fetch";

export const fetchTodos = (fetch = defaultFetch) =>
  fetch("/api/todos").then(res => res.json());
{% endhighlight %}

We're importing the real `fetch` implementation as the default argument value. This way, we keep the proposed interface unchanged. Let's add a test for `addTodo` as well.

{% highlight javascript %}
// test/api.client.test.js
import * as client from "../lib/api.client";
import { expect } from "chai";
import { stub, match } from "sinon";

describe("api client", () => {
  let fakeFetch;

  beforeEach(() => {
    fakeFetch = stub();
  });

  // ...

  describe("addTodo()", () => {
    it("creates a new todo successfully", () => {
      const requestData = match
        .has("method", "POST")
        .and(match.has("headers"))
        .and(match.has("body", JSON.stringify({ text: "wash dishes" })));

      const fakeResponse = Promise.resolve({
        status: 202,
        json: () => Promise.resolve({
          id: "2",
          text: "wash dishes",
          done: false
        })
      });

      fakeFetch.withArgs("/api/todos", requestData).returns(fakeResponse);

      return client.addTodo({ text: "wash dishes" }, fakeFetch).then(todo => {
        expect(todo).deep.eq({
          id: "2",
          text: "wash dishes",
          done: false
        });
      });
    });
});
{% endhighlight %}

Here again, we pass the `fakeFetch` as an argument to `addTodo`. The implementation will be similar as the one for `fetchTodos`.

{% highlight javascript %}
// lib/api.client.js
import defaultFetch from "isomorphic-fetch";

export const fetchTodos = (fetch = defaultFetch) =>
  fetch("/api/todos").then(res => res.json());

export const addTodo =  (todo, fetch = defaultFetch) =>
  fetch("/api/todos", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ text: todo.text })
  }).then(res => res.json());
{% endhighlight %}

At this point, we can remove the code duplication by moving the default parameter to the namespace level. For that, we'll define a `createApiClient` function. Let's change the tests accordingly.

{% highlight javascript %}
// lib/api.client.test.js
import createApiClient from "../lib/api.client.";
import { expect } from "chai";
import { stub, match } from "sinon";

describe("api client", () => {
  let fakeFetch;
  let client;

  beforeEach(() => {
    fakeFetch = stub();
    client = createApiClient(fakeFetch)
  });

  describe("fetchTodos()", () => {
    it("retrieves all todos", () => {
      const fakeResponse = Promise.resolve({
        status: 200,
        json: () => Promise.resolve([{
          id: "1",
          text: "walk the dog",
          done: false
        }])
      });

      fakeFetch.withArgs("/api/todos").returns(fakeResponse);

      return client.fetchTodos().then(todos => {
        expect(todos).deep.eq([{
          id: "1",
          text: "walk the dog",
          done: false
        }]);
      });
    });
  });

  describe("addTodo()", () => {
    it("creates a new todo successfully", () => {
      const requestData = match
        .has("method", "POST")
        .and(match.has("headers"))
        .and(match.has("body", JSON.stringify({ text: "wash dishes" })));

      const fakeResponse = Promise.resolve({
        status: 202,
        json: () => Promise.resolve({
          id: "2",
          text: "wash dishes",
          done: false
        })
      });

      fakeFetch.withArgs("/api/todos", requestData).returns(fakeResponse);

      return client.addTodo({ text: "wash dishes" }).then(todo => {
        expect(todo).deep.eq({
          id: "2",
          text: "wash dishes",
          done: false
        });
      });
    });
  });
});
{% endhighlight %}

As you can see in the new version of the tests, we're now injecting `fakeFetch` to `createApiClient`. That new function acts like a contructor: it builds the namespace and make the injected `fetch` available to the entire namespace scope. Let's make that change to the application code.

{% highlight javascript %}
// lib/api.client.js
import defaultFetch from "isomorphic-fetch";

const createApiClient = (fetch = defaultFetch) => ({
  fetchTodos: () =>
    fetch("/api/todos").then(res => res.json()),

  addTodo: todo =>
    fetch("/api/todos", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ text: todo.text })
    }).then(res => res.json()),
});

export default createApiClient;
{% endhighlight %}

With the refactoring above, our initial code snippet will have to change a little bit. Now we have to call first `createApiClient` instead of just importing all functions.

{% highlight javascript %}
// an usual TODO app...

import createApiClient from "./lib/api.client";
const apiClient = createApiClient();

apiClient
  .addTodo({ text: "wash dishes" })
  .then(todo => console.log("New todo added:", todo))
  .catch(errors => console.log("Something went wrong:", errors));

//=> New todo added: { id: "1", text: "wash dishes", done: false }

// ...

apiClient
  .fetchTodos()
  .then(todos => console.log(todos))
  .catch(errors => console.log("Something went wrong:", errors));

//=> [ { id: "1", text: "wash dishes", done: false } ]
{% endhighlight %}

The code above represent a sample usage of our module. Notice that the calling code doesn't have to pass `fetch` to `createApiClient` since we used a default parameter. Besides that, we are now able to add more functions to the module (like `toggleTodo`, for instance) and have `fetch` available to them.

## Conclusion

ES6 default parameters enable functional DI in simple and elegant way. The approach demonstrated in this post suggests a new point of view on function arguments:

- **The regular arguments** - the arguments which matter to the application code.
- **Dependencies** - collaborator functions defaulting to the real implementation and stubbed in unit tests.

Check out the complete example code at [github.com/vvgomes/es6-di-example](https://github.com/vvgomes/es6-di-example).


text:
## Solution of titanic dataset from Kaggle
Link to Kaggle: https://www.kaggle.com/c/titanic

**Link to a lot more explanations about how the model works and it's results in**: https://github.com/yoni2k/ml-kaggle-challenges/blob/master/titanic/Simplest%20bottom%20line%20Kernel%20for%20Kaggle.ipynb or on Kaggle https://www.kaggle.com/yoni2k/top-3-with-only-4-features-no-data-leakage

## Main files
- Investigation notebooks - in main directory. Order advised to go through:
    - `initial-titanic-logistic-regression.ipynb`
    - `Fare_investigation.ipynb`
    - `age_investigation.ipynb`
    - `more_feature_engineering.ipynb`
    - `Advanced feature engineering.ipynb`
    - `Same last name different deck, embarked, pclass.ipynb`
- `titanic.py` - main and only code file that does all steps from preprocessing to producing predictions
- `ouptput.py` - takes predictions and probabilites created by `titanic.py`, does some voting / ensembling and creates the actual predictions
- `input` folder:
  - `train.csv` - training input file with expected label
  - `test.csv` -  test input file
  - `test_answers.csv` - True North.  Not used not to create leakage, left here for completeness
- `output` folder: **outputs of executions per date**
  - `input_options.csv` - inputs for the specific run
  - `results.csv` - results of all classifiers used:
     - Feature options - various features were created by different options (like binning or not binning a numeric feature)
     - Train accuracy
     - cross validation accuracy
     - cross validation STD
     - cross validatoin accuracy - 3 * STD - lowest accuracy with 99.7% certainty
     - Num features - number of features chosen by the model
     - Features - actual features chosen as the important ones by the model
  - **Per specific feature view variation**
    - `classifiers_correlations.csv` - correlations between predictions of different classifiers' used
    - `preds.csv` files - predictions of all models used per view. To create explict submission file, use `output.py`
    - `test_probas.csv` and `train_probas.csv` - probability of test set, to be used for ensembling by `output.py`

## Classifiers used
- `LogisticRegression`
- `KNeighborsClassifier`
- `SVC` - classifier based on Support Vector Machines
- `GaussianNB` - Naive Bayes
- `RandomForestClassifier`
- `ExtraTreesClassifier`
- `XGBClassifier` from xgboost library
** For most classifiers, Grid Search was done to find the best hyperparameters**

## Ensembling done:
- Soft voting
- Hard voting
- `ExtraTreesClassifier` based on `predict_proba_`

## Results:
  - ExtraTreesClassifier gets 84% locally with cross validation, and 82% on Kaggle
  - Doing Ensembling with `LogisticRegression` and `KNeighborsClassifier` gets 82.2% on Kaggle.
  See more details on:
    https://github.com/yoni2k/ml-kaggle-challenges/blob/master/titanic/Simplest%20bottom%20line%20Kernel%20for%20Kaggle.ipynb or on Kaggle https://www.kaggle.com/yoni2k/top-3-with-only-4-features-no-data-leakage

## Some of the main Features used:
  - `Title` - retrieved from `Name` feature, and grouped into cagetories, then added dummies
  - `Deck` - retrieved from first letter of `Cabin` feature, and grouped into cagetories, then added dummies.
    Only categories that helped the model were left.
  - `Pclass`
  - `Fare` per person of > 13.5 (needed to divide `Fare` by `Ticket_Frequency`). Other categories and splits, using as is, or doing `Log` on the numbers didn't help the model
  - `Age` - binned by survival rate.  See about imputing below
  - `Known family/ticket survived %` - look both based on family (last name) and ticket, and add average % of survived in training set.

 ## Features that explain the most the survival rate:
 *Notes:*
 - *Mostly based on Logistic Regression and Randon Forest feature importance info*
 - *See notebooks in this folder for much better BI of connections between survival and different features*

## More notes:
- Imputing was done on 'Age' for missing values with `RandomForestRegressor` using other features
- Scaling was done on all features with `MinMaxScaler`
- Feature selection is done per fold of cross validation
- Scaling is done per fold of cross validation
- Cross validation is done using full flow of feature selection, scaling etc.

# OLD discussion about Feature importance
**Mostly relevant**, but new version allows each model to choose best features from maximum available based on `RFECV`, so different models reach different conclusions.

**From most important to least important features**:
 #### Most important features
 - `Title_Mr` - male adult had a very low survival rate
 - `Known family/ticket survived %` - whether close family / people on the same ticket survived has 2nd highest prediction ability
 - `Ticket_Frequency` - proxy for family size, here the relationship is not linear.  Families with 2-4 members had highest survival rates, a person alone had lower survival rate, families with > 4 members had much lower survival rates
 - `Fare 13.5+` - those that paid *per person* more than 13.5 had a higher survival rate.  This is also the proxy of highest class / richest passengers out of 1st class.
 - `Pclass_3` - class 3 (lowest class) passengers had the lowest survival rate
#### Average priority features - the order is different per specific classifier
 - `Age Bin_42+` - older passengers had a relatively lower rate of survival
 - `Title_Mrs`, `Title_Miss` - women had a higher survival rate
 - `DeckBin_DE` - a mixed deck with different classes, seems that even lower classes had a higher survival rate there.  Perhaps once the deck was saved, everyone there was taken regardless of class.  In other cases, higher class decks were handled first.
 - `DeckBin_unknown_T` - unknown decks had a very low survival rate (perhaps specific area on this ship where few survived)
 - `Age Bin_-4` - youngest passengers had higher survival rate.  High correlation with `Title_Miss`
 - `Age Bin_24-32` - seems that younger adults had a higher survival rates, perhaps they moved faster and were stronger
 - `Pclass_1` - first class had a higher survival rate. Due to another feature of `Fare 13.5+` (part of first class passengers) which got a higher importance, `Pclass_1` got lower importance.  But if `Fare 13.5+` would be removed, `Pclass_1` would get an extremely high importance. Some of those that paid > 13.5 were class 2, and some in class 1 had fare 0
#### Features that made a difference, but not as important - the order is different per specific classifier
 - `Pclass_2` - had a higher survival, higher than class 3 and lower than class 1
 - `Age Bin_11-24` - ages 11-24 had a very slightly higher survival rate
 - `Age Bin_32-42` - ages 32-42 had a slightly lower survival rate than rest

 ## Features not used:
 - `Family size` - sum of `` + `` + 1 - didn't help the model, perhaps because of high correlation with `Ticket_Frequency` above
 - `SibSp` - same
 - `Parch` - same
 - `Sex` - didn't help the model, perhaps because of high correlation with `Title` above
 - `Embarked` - didn't help the model
  **Many other features were tried that were later removed because didn't help the model or had very high correlation with other features - see git history and `RESULTS.MD`**


text:
# Django Magicauth

Django Magicauth brings password-less authentication to your project.

*How it works*

 - The user inputs their email address (and optionnally an OTP).
 - An email is sent to the user with a link that contains a one-time token.
 - Once they click on this link, they are logged in to the service.

For a detailed step-by-step with screenshots of the default templates, see [Step-by-step in pictures](#step-by-step-in-pictures).

## Fonctionnement (FR)

Authentifiez vos utilisateurs sans mot de passe avec Django Magicauth.

*Comment ça marche*

 - Les utilisateurs renseignent leur adresse email (et en option un OTP).
 - Ils reçoivent alors un email avec un lien de connexion.
 - Lorsqu'ils cliquent sur le lien, ils sont authentifiés et redirigés sur le service.

Pour un détail du fonctionnement en image, voir le [déroulé en images](#step-by-step-in-pictures).

# Installations and testing instructions

## Quick start

1. Install Magicauth
```sh
pip install git+https://github.com/betagouv/django-magicauth.git
```

2. Add "magicauth" to your INSTALLED_APPS in `settings.py`
```python
INSTALLED_APPS = [
    # all your apps
    "magicauth",
]
```

2. Include the magicauth URLconf in your app's `url.py`
```python
# After your previous imports
from magicauth import views as magicauth_views
from magicauth.urls import urlpatterns as magicauth_urls

urlpatterns = [
    # here are your URL patterns
]

urlpatterns.extend(magicauth_urls)
```

3. Add the following items in your project's settings.py`

```
MAGICAUTH_FROM_EMAIL =<EMAIL_ADDRESS>MAGICAUTH_LOGGED_IN_REDIRECT_URL_NAME = 'home'
```

4. Run `python manage.py migrate` to create the polls models.

5. Setup your [mailer](https://docs.djangoproject.com/en/2.2/topics/email/#console-backend) in `settings.py`
In dev mode, you can use a [console mailer](https://docs.djangoproject.com/en/2.2/topics/email/#console-backend)

6. Make sure you have the following middlewares
```
MIDDLEWARE = [
    # [...] other middleware you may have
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.sites.middleware.CurrentSiteMiddleware",
]
```

## Two-Factor Authentication (2FA) using One Time Passwords (OTP)

Two-Factor Authentication means you ask for two different passwords from your user : their normal password and an OTP. (See https://en.wikipedia.org/wiki/Multi-factor_authentication)
They will get the magic link only if the two are valid, else they get an error and the link is not sent.

What is a OTP ? It is a short code (6 to 8 digits), usually generated by a dedicated app on a user's device (smartphone, hardware). See https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm

 ### How to enable OTPs
 We use the [django-otp](https://django-otp-official.readthedocs.io/en/stable/) package. You must have it installed and configured in your project.

   1. install django_otp : `pip install django_otp` (or whatever package manager you use)
   2. add the required apps in INSTALLED_APPS : `'django_otp'`, `'django_otp.plugins.otp_totp'`
   3. run the migrations in your project : `python manage.py migrate`
   4. Set `MAGICAUTH_ENABLE_2FA = True` in your settings.py

If you use the default login template, an OTP input will show up in the login page, below the Email. (To check your install has worked, you can revert to the default template and see if the field appears : remove your MAGICAUTH_LOGIN_VIEW_TEMPLATE var.)

If you have a custom login template, you will have to add the field for entering OTPs, in an `OTP_form`. See the default login template for an example : templates/magicauth/login.html`

For testing purposes, you can generate OTPs for a given user from the command line :
 - Add 'django_otp.plugins.otp_static' to INSTALLED_APPS.
 - Then you can use [addstatictoken](https://django-otp-official.readthedocs.io/en/stable/overview.html#addstatictoken) from command line. E.g :
`python manage.py addstatictoken -t 123456<EMAIL_ADDRESS>

## Contribute to Magicauth

To contribute to Magicauth, you can install the package in the "editable" mode

```
pip uninstall django-magicauth  # just in case...
pip install -e git+https://github.com/betagouv/django-magicauth.git#egg=django-magicauth
```

You can also install a specific branch, for instance for testing a PR. To install branch `my-branch`:

```
pip install -e git+https://github.com/betagouv/django-magicauth.git@my-branch#egg=django-magicauth
```

Django-magicauth is now a dependency of your project, and you can edit the code located here:

```
cd src/django-magicauth
```

### run tests

Create a virtual env for the project or reuse one and source it.

Install dependencies and run `tox`

```
cd src/django-magicauth
pip install -r requirements.txt
tox
```

### Release process

The follwing dependencies need to be installed: `pip setuptools wheel twine`:

```shell
python -m pip install --upgrade pip setuptools wheel twine
```

1. Create a new MD file under `docs/releases` named after the new version and fill the file with the changes
2. Change the version in `setup.py`
3. Create a commit named *Release version <version>*
4. Open and the PR for that release
5. Create a new git tag:
   ```shell
   git tag <version>
   git push --tags
   ```
6. Create a new release at https://github.com/betagouv/django-magicauth/releases/new
7. Publish the new version on PyPI:
   ```shell
    python setup.py sdist bdist_wheel
    twine upload dist/*
    ```

# Projects using Magicauth
https://github.com/betagouv/e-controle/
https://github.com/betagouv/Aidants_Connect
https://github.com/betagouv/peps
https://github.com/betagouv/urbanvitaliz-django

Join us !

# Step-by-step in pictures

Note : the screenshots below use the default templates, which don't look very nice. It is expected that you replace them with your own better-looking ones.

Step 1 : the user goes to the login page. (see `LoginView` in `magicauth/views.py`)

Step 2 : The user inputs their email address in the login page.

Step 3 : The user sees a confirmation page (`EmailSentView`), explaining that an email has been sent.

An email is sent to the user with a link that contains a one-time token.

The link looks something like this :

Step 4 : once they click on the button and follow the link, the user is directed to a wait page (this is optional) (`WaitView`)

Step 5 : the user is logged in to the service (`ValidateTokenView`) and redirected to the landing page.

repository: betagouv/django-magicauth

gha_language: Python

repo_name: betagouv/django-magicauth


text:
# Svg Icon Packages

## Features
- Support multiple js frameworks
- Load with webpack loader
- Supports multiple colors, including gradients; Supports set fill and stroke attributes at the same time; supports original colors, and can modify a certain color; Supports zoom, animation etc.
- Icon Preview

## Packages
- @yzfe/svgicon `Generate the data required by the SVG icon component according to the incoming parameters (props)`
- @yzfe/vue-svgicon `SVG icon component for vue2.x`
- @yzfe/vue3-svgicon `SVG icon component for vue3.x`
- @yzfe/react-svgicon `SVG icon component for react`
- @yzfe/svgicon-gen `Generate icon data (icon name and processed SVG content) based on the content of the SVG file`
- @yzfe/svgicon-loader `Load the SVG file as icon data (vue) or SVG icon component (react), the generated code can be customized`
- @yzfe/svgicon-viewer `Preview SVG icon`
- @yzfe/vue-cli-plugin-svgicon `A vue-cli plugin that can quickly configure svgicon`
- @yzfe/svgicon-polyfill `SVG innerHTML compatible (IE)`

## Documentation
Refer to the [documentation](https://mmf-fe.github.io/svgicon/en/)

## License
[MIT](http://opensource.org/licenses/MIT)

repository: MMF-FE/svgicon

gha_language: TypeScript

repo_name: MMF-FE/svgicon


text:
retwis-go
=========

retwis-go is the port to Go of the redis tutorial [Twitter clone](http://redis.io/topics/twitter-clone)

To get it done faster and safer the port uses :
- [redigo](https://github.com/garyburd/redigo) Go client for Redis
- [negroni](https://github.com/codegangsta/negroni) Idiomatic HTTP Middleware for Golang
- [httprouter](https://github.com/julienschmidt/httprouter) A high performance HTTP request router that scales well
- [unrolled/render](https://github.com/unrolled/render) Go package for easily rendering JSON, XML, and HTML template responses.
- [gorilla/securecookie](https://github.com/gorilla/securecookie)

repository: nfo/retwis-go

repo_name: nfo/retwis-go


text:
[![CircleCI](https://circleci.com/gh/sul-dlss/gis-robot-suite.svg?style=svg)](https://circleci.com/gh/sul-dlss/gis-robot-suite)
[![Code Climate](https://codeclimate.com/github/sul-dlss/gis-robot-suite/badges/gpa.svg)](https://codeclimate.com/github/sul-dlss/gis-robot-suite)
[![Code Climate Test Coverage](https://codeclimate.com/github/sul-dlss/gis-robot-suite/badges/coverage.svg)](https://codeclimate.com/github/sul-dlss/)
[![GitHub version](https://badge.fury.io/gh/sul-dlss%2Fgis-robot-suite.svg)](https://badge.fury.io/gh/sul-dlss%2Fgis-robot-suite)

GIS-Robot-Suite
---------------

Robot code for accessioning and delivery of GIS resources.

# Dependencies
These robots require several dependencies needed to perform its tasks. These are often shelled out to using `system` calls.

 - [GDAL](https://gdal.org/) Needed for several geospatial tasks. Also needed on servers are the utils and clients
 - rsync also used as part of the robot process and is needed

# Documentation

`gisAssemblyWF`
---------------

* `register-druid` :: Ensure proper registration of druid, source ID, and label
* `author-metadata` :: Author metadata using ArcCatalog
* `approve-metadata` :: Approve metadata quality and release for workflow (manual step)
* `extract-thumbnail` :: Extract thumbnail preview from ArcCatalog metadata
* `extract-iso19139` :: Transform ISO 19139 metadata from ArcCatalog metadata
* `generate-geo-metadata` :: Convert ISO 19139 metadata into geoMetadata RDF XML file
* `generate-mods` :: Convert geoMetadata into MODS
* `assign-placenames` :: Insert linked data into MODS record from gazetteer
* `finish-metadata` :: Finalize the metadata preparation (validity check)
* `wrangle-data` :: Wrangle the data into the digital work (manual step)
* `approve-data` :: Approve data quality for digital work and release for workflow (manual step)
* `package-data` :: Package the digital work
* `normalize-data` :: Reproject the data into common SRS projection and/or file format
* `extract-boundingbox` :: Extract bounding box from data for MODS record
* `finish-data` :: Finalize the data preparation (validity check)
* `generate-content-metadata` :: Generate contentMetadata manifest
* `load-geo-metadata` :: Accession geoMetadata xml into SDR
* `finish-gis-assembly-workflow` :: Finalize assembly workflow to prepare for assembly/delivery/discovery (validity check)
* `start-assembly-workflow` :: Kickstart the core assembly workflow at assemblyWF (manual step)
* `start-delivery-workflow` :: Kickstart the GIS delivery workflow at gisDeliveryWF (manual step)

`gisDeliveryWF`
---------------

* `load-vector` :: Load vector data into PostGIS database
* `load-raster` :: Load raster into GeoTIFF data store
* `load-geoserver` :: Load layers into GeoServer
* `reset-geowebcache` :: Reset GeoWebCache for the layer
* `finish-gis-delivery-workflow` :: Finalize delivery workflow for the object (validity check)

Data Wrangling
==============

Step 1: Preparing for stage
---------------------------

The file system structure will initially look like the following (see [Consul
page](https://consul.stanford.edu/x/C5xSC) for a description) where the temp
files for the shapefiles are all hard links to reduce space requirements: This
is *pre-stage*:

    zv925hd6723/
      temp/
        OGWELLS.dbf
        OGWELLS.prj
        OGWELLS.shp
        OGWELLS.shp.xml
        OGWELLS.shx

Step 2: Assembly
----------------

Then at the end of GIS assembly processing -- see above prior to accessioning -- it will
look like this in the workspace:

    zv925hd6723/
      metadata/
        contentMetadata.xml
        descMetadata.xml
        geoMetadata.xml
      content/
        data.zip
        data_ESRI_4326.zip
        preview.jpg
        some-other-file.ext (optionally)

repository: sul-dlss/gis-robot-suite

gha_language: XSLT

gha_license_id: NOASSERTION

repo_name: sul-dlss/gis-robot-suite


text:
# _Meal Tracker App_

#### _Angular.js app, March 18, 2016_

#### By _**Chris Houghton**_

## Description

_This app allows the user to input their meals, then displays a list of things they have eaten today. For Epicodus_

## Setup/Installation Requirements

* _Clone this repository to your local machine_
* _Be sure that you have node.js installed following the instructions  at https://nodejs.org/en/ ._
* _Be sure that you have bower installed by typing "npm install bower -g" in your terminal_
* _Be sure that you have gulp installed by typing "npm install gulp -g" in your terminal_
* _Navigate to the root file of the project in terminal_
* _Run "npm install"_
* _Run "bower install"_
* _Run "gulp build"_
* _Run "gulp serve", the site should now be running in your prefered browser_

## Known Bugs

_No known bugs_

## Technologies Used

_Angular.js, Node.js, Gulp, Bower, SASS_

### Licence

*Available under the MIT license*

Copyright (c) 2016 **_Chris Houghton_**

repository: cehoughton/meal-tracker

repo_name: cehoughton/meal-tracker


text:
# 00LapSim
Race Car Lap Simulator

Version Plan:

v0.1 - Point Mass vehicle model, constant torque, constant tire friction

v0.2 - Point Mass vehicle model, constant tire friction, torque curve with gear change

v1.0 - Point Mass vehicle model, Pajecka tire model, torque curve with gear change
		*equivalent to Optimum Lap, but without the bugs

Additions for later on:

* Bicycle model of car
* Racing Line Simulator (v1.0 features constant radius corners and straights)
* Simple GUI
* Automatic Plots
* File system to store lap and car info
* Automatic discritization of car variables (similar to OptimumLap)


text:
FRCScouting
===========

This is an Android app to be used for scouting at competitions.

See https://play.google.com/store/apps/details?id=org.growingstems.scouting for more info

[![Stories in Ready](https://badge.waffle.io/username115/frcscouting.png?label=ready&title=Ready)](http://waffle.io/username115/frcscouting) [![Stories in In Work](https://badge.waffle.io/username115/frcscouting.png?label=in%20work&title=In%20work)](http://waffle.io/username115/frcscouting)

repository: TANofX/FRCScouting

repo_name: TANofX/FRCScouting


text:
## Variable: SB-IMPL::\*PATHNAMES\*
[![package](https://img.shields.io/badge/Package-SB--IMPL-5f9ea0.svg?style=social&colorA=999999)](../) [![type](https://img.shields.io/badge/Type-Variable-5f9ea0.svg?style=social&colorA=999999)](../#variable)

> No description.

### Value
```cl
#((((:relative "docs" "source" "sb-fasl" "function")
    . #((#p"docs/source/sb-fasl/function/fop-array.md"
         #p"docs/source/sb-fasl/function/read-unsigned-byte-32-arg.md"
         #p"docs/source/sb-fasl/function/fop-list-4.md"
         #p"docs/source/sb-fasl/function/fop-uninterned-symbol-save.md"
         #p"docs/source/sb-fasl/function/note-potential-circularity.md")
        (#p"docs/source/sb-fasl/function/fop-layout-of-defstruct-slot-description.md"
         #p"docs/source/sb-fasl/function/dump-unsigned-byte-32.md" ..)))))
```

repository: Chemophile/sb-docs

repo_name: Chemophile/sb-docs


text:
### OpenVPN + Transmission

This is a set of scripts to manage a Transmission plugin jail with an OpenVPN tunnel - specifically with [privateinternetaccess.com (PIA)](https://privateinternetaccess.com/).

The primary obstacle this aims to solve is the port forwarding request.
PIA by default does not give you any open port on their side.
This means that Transmission will not work well - particularly, you will be unable to seed.
You must explicitly make a request to PIA to assign you a port,
and inform Transmission of the port number to listen on.
Of course, in case of a connection reset or jail/server restart, this needs to be automated.

This guide will let you accomplish the following:
* configure OpenVPN to connect to PIA,
* get the port forwarding working,
* make sure **all** Transmission traffic goes through VPN and nowhere else,
* make sure that whenever the connection goes down, it will automatically restart.

The guide will **not** explain how to:
* set up Transmission (read about it in the [guide](http://doc.freenas.org/11/plugins.html#installing-plugins)),
* attach the storage (read about it in the [guide](http://doc.freenas.org/11/jails.html#add-storage)).

#### Guide

1. Get Transmission running using the GUI, set up storage et cetera.
I recommend setting a username and password for the remote client.
2. SSH into the jail.
```bash
# list all available jails, check the index of the transmission jail
jls
# let's assume the jail ID was 4
jexec 4 tcsh
```
3. Set up OpenVPN.
The following guide is adapted from [Tango](https://forums.freenas.org/index.php?members/tango.44547/)'s [great guide](https://forums.freenas.org/index.php?threads/guide-setting-up-transmission-with-openvpn-and-pia.24566/), which has in turn been adapted from [fizassist](https://forums.freenas.org/index.php?members/fizassist.77752/)'s [earlier guide](https://forums.freenas.org/index.php?threads/guide-setting-up-transmission-with-openvpn-and-pia.24566/page-24#post-404858), and has bits of [shutyourj](https://www.reddit.com/user/shutyourj)'s [reddit tutorial](https://www.reddit.com/r/freenas/comments/41fhz3/configuration_guide_for_openvpn_and_ipfw_so_that/) in it.
I highly recommend putting everything in `/usr/local/etc/` as this is OpenVPN's default settings location.
See the [list of PIA servers that allow port forwarding](https://www.privateinternetaccess.com/helpdesk/kb/articles/how-do-i-enable-port-forwarding-on-my-vpn).
```bash
cd /usr/local/etc
mkdir openvpn
cd openvpn
# you will need the following packages:
pkg update
pkg install jq
pkg install wget
pkg install openvpn
# download and unpack the PIA configuration files
wget https://www.privateinternetaccess.com/openvpn/openvpn.zip --no-check-certificate
unzip -d pia openvpn.zip
cp pia/ca.rsa.2048.crt .
cp pia/crl.rsa.2048.pem .
# pick a server to connect to (needs to support port forwarding - see list above)
cp pia/Romania.ovpn openvpn.conf
# put your PIA username/password in a file (example: x0000000/password)
cat > pia.credentials <<X
x0000000
password
X
sed -i '' 's/auth-user-pass/auth-user-pass pia.credentials/' openvpn.conf
# make OpenVPN launch at boot time
cat > /etc/rc.conf.d/openvpn <<X
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/openvpn.conf"
X
```
4. Set up the scripts that automate port forwarding and downtime detection.
I like to put them in a separate directory, for example `/opt/openvpn/`.
Feel free to adjust that to your liking,
but keep in mind that each script actually uses the absolute path to the others,
so you will have to `sed` them all in this case (change the `$path` variable).
```bash
# get the scripts (read the comments in them for details)
wget https://raw.githubusercontent.com/Noiredd/freenas-scripts/master/openvpn/vpn_isrunning.sh
wget https://raw.githubusercontent.com/Noiredd/freenas-scripts/master/openvpn/vpn_log.sh
wget https://raw.githubusercontent.com/Noiredd/freenas-scripts/master/openvpn/vpn_monitor.sh
wget https://raw.githubusercontent.com/Noiredd/freenas-scripts/master/openvpn/vpn_request.sh
wget https://raw.githubusercontent.com/Noiredd/freenas-scripts/master/openvpn/vpn_up.sh
# set the execution privilege bit
chmod +x vpn_*
# configure openvpn to execute the script at start time
cat >> /usr/local/etc/openvpn/openvpn.conf <<X
up /opt/openvpn/vpn_up.sh
up-restart
X
# if you set your credentials for Transmission RPC, write them to a file
cat > transmission.credentials <<X
username
password
X
# in case the port number acquisition fails, the script can notify about that
# by writing to a given file - just store its path under notify.path
# (this is recommended, as the downtime detector will also write there)
printf '/media/downloads/VPN.log' > notify.path  # adjust the path
# finally, set cron to run the monitoring script periodically and as root
# (adjust the path if necessary)
echo "* * * * * /opt/openvpn/vpn_monitor.sh" > cron.tab
crontab cron.tab
```
At this moment the OpenVPN downtime detector is up and running.
You can temporarily stop it by creating a file `stop.it`,
whose presence will cease all activity of the scripts
(i.e. cron monitoring - **not** the OpenVPN service).
5. Configure IPFW so none of the Transmission traffic is allowed outside VPN.
```bash
# download the reference rules
# (alternatively, you could download the entire repository and unzip files)
wget https://raw.githubusercontent.com/Noiredd/freenas-scripts/master/openvpn/ipfw.rules
# my reference rules are for a gateway <IP_ADDRESS>, so be sure to adjust for yours
# the actual configuration happens now
cat > /etc/rc.conf.d/ipfw <<X
firewall_enable="YES"
firewall_script="/opt/openvpn/ipfw.rules"
X
```
6. Exit the jail and restart it.
You can check that it works using [TorGuard's tool for torrent IP checking](torguard.net/checkmytorrentipaddress.php).

#### Caveats
The reason a separate monitoring script ran by cron is needed is due to some problems I have had with putting everything in a single up script.
When the entire script was called by openvpn, I could never set the port using `transmission-remote`.
Simply nothing would happen, no error message even.
After digging some more (read on [SO](https://unix.stackexchange.com/q/447421/293652) if you're curious), I found that `transmission-remote` would segfault when it was called by openvpn's up script - even though I could run the commands myself from bash.
As a workaround, I use the fact that cron can execute tasks as root.
Up script obtains the port and stores it in a file,
and a periodic cron job reads it and sets the port on `transmission-remote`, then deletes it.

In the long run it's not such a bad thing, because the periodic task is necessary anyway: to scan for VPN downtimes and restart the service.

repository: Noiredd/freenas-scripts

repo_name: Noiredd/freenas-scripts


text:
[![CircleCI](https://circleci.com/gh/marccarre/go-github-release/tree/master.svg?style=shield)](https://circleci.com/gh/marccarre/go-github-release/tree/master)
[![Go Report Card](https://goreportcard.com/badge/github.com/marccarre/go-github-release)](https://goreportcard.com/report/github.com/marccarre/go-github-release)
[![Coverage Status](https://coveralls.io/repos/github/marccarre/go-github-release/badge.svg)](https://coveralls.io/github/marccarre/go-github-release)
[![codecov](https://codecov.io/gh/marccarre/go-github-release/branch/master/graph/badge.svg)](https://codecov.io/gh/marccarre/go-github-release)
[![Docker Repository on Quay](https://quay.io/repository/marccarre/go-github-release/status)](https://quay.io/repository/marccarre/go-github-release)

# go-github-release

## Features

- `release`:
  - creates the GitHub release matching the provided tag,
  - signs the provided release assets,
  - uploads the provided release assets and their signatures to the GitHub release.

## Installation

1. Download the [latest version](https://github.com/marccarre/go-github-release/releases/latest) of `ghrelease` and its signature.
2. [Optional] Verify `ghrelease`'s signature:

    1. Import my CI/CD GPG key:

      ```console
      $ gpg --recv-keys 92A05461
      gpg: key 6A74FEA692A05461: public key "Marc CARRE (GitHub software releases<EMAIL_ADDRESS>imported
      gpg: Total number processed: 1
      gpg:               imported: 1
      ```

    2. Check its fingerprint:

      ```console
      $ gpg --fingerprint 92A05461
      gpg: checking the trustdb
      gpg: marginals needed: 3  completes needed: 1  trust model: pgp
      gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
      gpg: next trustdb check due at 2020-11-13
      pub   rsa4096 2018-11-11 [SC] [expires: 2019-11-11]
            49A9 5DE0 562B 072A 82B4  F072 6A74 FEA6 92A0 5461
      uid           [ unknown] Marc CARRE (GitHub software releases<EMAIL_ADDRESS>      sub   rsa4096 2018-11-11 [E] [expires: 2019-11-11]
      ```

    3. Import my [personal GPG key](https://keybase.io/marccarre):

      ```console
      $ gpg --recv-keys F69B8B32
      gpg: key 062658EFF69B8B32: public key "Marc CARRE<EMAIL_ADDRESS>imported
      gpg: Total number processed: 1
      gpg:               imported: 1
      ```

    4. Ensure my CI/CD key is signed by [me](https://keybase.io/marccarre):

      ```console
      $ gpg --list-signatures 92A05461
      pub   rsa4096 2018-11-11 [SC] [expires: 2019-11-11]
            49A95DE0562B072A82B4F0726A74FEA692A05461
      uid           [ unknown] Marc CARRE (GitHub software releases<EMAIL_ADDRESS>      sig 3        6A74FEA692A05461 2018-11-11  Marc CARRE (GitHub software releases<EMAIL_ADDRESS>      sig 3        062658EFF69B8B32 2018-11-11  Marc CARRE<EMAIL_ADDRESS>      sub   rsa4096 2018-11-11 [E] [expires: 2019-11-11]
      sig          6A74FEA692A05461 2018-11-11  Marc CARRE (GitHub software releases<EMAIL_ADDRESS>      ```

    5. Check `ghrelease` against its detached signature, e.g.:

      ```console
      $ gpg --verify ghrelease-v1.0.0-linux.asc ghrelease-v1.0.0-linux
      gpg: Signature made Wed 14 Nov 12:41:17 2018 JST
      gpg:                using RSA key 6A74FEA692A05461
      gpg: Good signature from "Marc CARRE (GitHub software releases<EMAIL_ADDRESS>[ultimate]
      ```

## Usage

```console
$ gpg --export-secret-keys <key-id> > /path/to/your/private/key.asc
$ export GPG_PASSWD="..."
$ export GITHUB_API_TOKEN="..."
$ ghrelease release --help
Sign and upload the provided release assets on GitHub under the release corresponding to the provided tag

Usage:
  ghrelease release [flags]

Flags:
  -d, --draft          Should the release be a draft release, default: true (default true)
  -h, --help           help for release
  -k, --key string     Path to the private GPG key to use to sign the release assets
  -o, --owner string   GitHub owner, e.g. marccarre in github.com/marccarre/go-github-release
  -r, --repo string    GitHub repository, e.g. go-github-release in github.com/marccarre/go-github-release
  -t, --tag string     Git tag corresponding to the release to perform, e.g. v1.0.0

$ ghrelease release -o marccarre -r go-github-release -t v1.0.0 -k /path/to/your/private/key.asc <your-binary> ...
{"level":"info","msg":"creating release","owner":"marccarre","repo":"go-github-release","tag":"v1.0.0","draft":true}
{"level":"info","msg":"successfully created release","owner":"marccarre","repo":"go-github-release","tag":"v1.0.0","draft":true}
{"level":"info","msg":"signing release asset","file":"<your-binary>"}
{"level":"info","msg":"successfully signed release asset","file":"<your-binary>"}
{"level":"info","msg":"uploading release asset","file":"<your-binary>","release":"v1.0.0"}
{"level":"info","msg":"successfully uploaded release asset","file":"<your-binary>","release":"v1.0.0","asset":"<your-binary>"}
{"level":"info","msg":"uploading release asset","file":"<your-binary>.asc","release":"v1.0.0"}
{"level":"info","msg":"successfully uploaded release asset","file":"<your-binary>.asc","release":"v1.0.0","asset":"<your-binary>.asc"}
```

## Development

### Setup

- Install [`docker`](https://store.docker.com/search?type=edition&offering=community)
- Install `make`

That's all folks!
All other tools are packaged in build Docker images (see `Dockerfile`) to ensure any machine can build easily, hence avoiding the "[_it works on my machine_](http://www.codinghorror.com/blog/2007/03/the-works-on-my-machine-certification-program.html)" syndrome.

### Build

```console
make
```

### Lint

```console
make lint
```

### Test

```console
make test
```

### Release

```console
git tag vX.Y.Z <commit-hash> -a -m vX.Y.Z
git push --tags
```

repository: marccarre/go-github-release

repo_name: marccarre/go-github-release


text:
# balls

An attempt to make a casual game with mechanics similar to Luxor / Zuma / Puzz Loop. Includes a simple path editor based on Bézier curves. The gameplay itself isn't yet implemented though.

## How to "play"

The first thing you'll see after running this piece of software is the path editor. You can use the left mouse button to add new nodes, to move them around and to adjust their handles. Right-click a node to remove it. Hold shift while adjusting a node handle to make a cusp. Also, curve colors are selected randomly and don't mean anything, just so you know.

Press space to switch to the "game mode".  That's all for now, have fun, I guess.

## Requirements

This game uses [LÖVE][LOVE] framework and requires LÖVE 11.x.

## License

This code is licensed under the [MIT Open Source License][MIT]. Check out the LICENSE file for more information.

[LOVE]: https://love2d.org/
[MIT]: http://www.opensource.org/licenses/mit-license.html

repository: pevzi/balls

repo_name: pevzi/balls


text:
---
title: Walkthrough - Publishing Habitat packages to Azure Kubernetes Service (AKS)
date: 2018-05-07
author: James Casey
tags: azure, builder, kubernetes
category: update
classes: body-article
---

We recently added support in Habitat Builder for Azure Container Registry (ACR). With this integration you can export to Azure Container Registry as part of your build job and use those containers inside AKS.

In this walkthrough we'll show you how to setup the ACR integration in Habitat Builder and how to configure Azure Kubernetes Services to run the a sample Habitat application.

## What are the Azure Container Registry and Azure Kubernetes Service ?
Azure Container Registry is a managed Docker container registry service used for storing private Docker container images.

Azure Kubernetes Service (AKS) is a fully managed hosted Kubernetes environment that makes it quick and easy to deploy and manage containerized applications without container orchestration expertise. It also eliminates the burden of ongoing operations and maintenance by provisioning, upgrading, and scaling resources on demand, without taking your applications offline.

Using both of them together allows you to quickly stand up a Kubernetes cluster along with a private repository to hold the containers.

## Walkthrough
We're going to use the `az` and `kubectl` command-line tools throughout this example. If you're using the Azure Cloud Shell both of these tools are already installed.

If you choose to install and use the CLI locally see  [Install Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).  Once you have the Azure CLI installed it can download `kubectl`, the Kubernetes command line client, to manage the cluster:

```shell Azure CLI
$ az aks install-cli
```

All the code used in this example is available on GitHub at [https://github.com/jamesc/azure-habitat-example](https://github.com/jamesc/azure-habitat-example).

## Create AKS Cluster and ACR registry
First off we need to create a new cluster and registry. You can use the following script that will:

* Create a Azure Kubernetes Service Cluster
* Create a Azure Container Registry
* Grant access to the Registry for the service principal associated with the cluster
* Create a new Service Principal to be used by Habitat Builder to publish to the registry

The credentials for the Service Principal will be outputted by the script.  These will be used in the next step to configure Habitat Builder.

```shell setup-aks-acr.sh
#!/bin/sh
#
# Change these for your account
#
RESOURCE_GROUP="habitat-aks-demo"
AKS_CLUSTER_NAME="aks-demo"
ACR_NAME="habitatregistry"
BLDR_PRINCIPAL_PASSWORD="ThisIsVeryStrongPassword"
#
# No Need to change these
#
BLDR_PRINCIPAL_NAME="habitat-acr-registry"
AKS_NODE_COUNT=1
ACR_SKU="Basic"

#
# Setup AKS
#
az group create --name $RESOURCE_GROUP --location eastus
az aks create --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER_NAME --node-count $AKS_NODE_COUNT --generate-ssh-keys
az aks get-credentials --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER_NAME

#
# Setup ACR
#
az acr create --resource-group $RESOURCE_GROUP --name $ACR_NAME --sku $ACR_SKU

#
# Grant Reader access to ACR from AKS
#
CLIENT_ID=$(az aks show --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER_NAME --query "servicePrincipalProfile.clientId" --output tsv)
ACR_ID=$(az acr show --name $ACR_NAME --resource-group $RESOURCE_GROUP --query "id" --output tsv)
az role assignment create --assignee $CLIENT_ID --role Reader --scope $ACR_ID

# Create Service Principal for Habitat Builder
az ad sp create-for-rbac --scopes $ACR_ID --role Owner --password "$BLDR_PRINCIPAL_PASSWORD" --name $BLDR_PRINCIPAL_NAME
BLDR_ID=$(az ad sp list --display-name $BLDR_PRINCIPAL_NAME  --query "[].appId" --output tsv)

echo "ID/Password for Habitat Builder Principal:"
echo "ID : $BLDR_ID"
echo "Password : $BLDR_PRINCIPAL_PASSWORD"
```

```shell Command Output
  $ ./setup-aks-acr.sh
Retrying role assignment creation: 1/36
Retrying role assignment creation: 2/36
...
...
...
Configuration Details for Habitat Builder:
  Server URL : habitatregistry.azurecr.io
  Service Principal ID : 1449e154-69d5-4f44-806f-7098b8f653d6
  Service Principal Password : ThisIsVeryStrongPassword

```
## Configure builder to export to the registry
Now that you have setup the registry you need to use the Habitat Builder user interface to add the Azure Container Registry to your origin.  This uses the configuration details outputted by the setup script.

![Add Registry page on Builder](media/2018-05-07-aks-and-acr-walkthrough/add-registry-1.png)

![Add Registry to builder](media/2018-05-07-aks-and-acr-walkthrough/add-registry-2.png)

## Connect your packages to the registry
The final step to be carried out in the Habitat Builder user interface is to connect a plan file (we're using the `wordpress` and `mysql` plans from the [GitHub repository](https://github.com/jamesc/azure-habitat-example)) and configure it to export it to our container registry.  First we do this for the `wordpress` package which has its plan file at `wordpress/plan.sh`.

![Publish to the registry](media/2018-05-07-aks-and-acr-walkthrough/publish-to-registry.png)

You can then trigger a new build of the package and follow progress in the live build output window of Habitat Builder.  You'll see a container being built and pushed to the registry.

![Publish to the registry](media/2018-05-07-aks-and-acr-walkthrough/build-output.png)

Repeat these steps for the `mysql` package with a plan file at `mysql/plan.sh`. You can verify that the packages have been pushed using the `az` command-line.

```shell Verify Registry Contents
$ az acr repository list --name habitatregistry
[
  "habitat/mysql",
  "habitat/wordpress"
]
```
## Deploy the Habitat Operator to Kubernetes
The [Habitat Operator for Kubernetes](https://github.com/habitat-sh/habitat-operator) is the recommended way to integrate Habitat and Kubernetes into a unified whole. It leverages the Kubernetes API to unify communication between your Kubernetes clusters and Habitat Builder as it builds and manages your applications, and enables you to use both `kubectl` and the `hab` cli and keep all of your components in sync.

The following Kubernetes Deployment object installs the Habitat Operator in our cluster.

```yaml habitat-operator.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: habitat-operator
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: habitat-operator
    spec:
      containers:
      - name: habitat-operator
        image: habitat/habitat-operator:v0.6.1
```

```shell Verify deployment of Habitat Operator
$ kubectl apply -f habitat-operator.yml
deployment.extensions "habitat-operator" created
$ kubectl get pods
NAME                                READY     STATUS    RESTARTS   AGE
habitat-operator-854d7dc494-jnf7n   1/1       Running   0          10s
```

## Deploy your application to AKS
Finally we're ready to deploy our application.  Our example Wordpress application consists of two components - the Wordpress server and the backend MySQL database.  The following Kubernetes configuration will:

* Create a Kubernetes secret with our MySQL credentials
* Deploy two Habitat packages (`habitat/wordpress` and `habitat/mysql`) from ACR
* Setup a Kubernetes load balancer to export our wordpress application port.

```yml deploy-wordpress.yml
apiVersion: v1
kind: Secret
metadata:
  name: mysql-user-toml
type: Opaque
data:
  # Each item needs to be base64-encoded.
  # Plain text content:
  #   app_username="wordpress"
  #   app_password="ThisIsSecret"
  #   bind='<IP_ADDRESS>'
  user.toml: YXBwX3VzZXJuYW1lPSJ3b3JkcHJlc3MiCmFwcF9wYXNzd29yZD0iVGhpc0lzU2VjcmV0IgpiaW5kPScwLjAuMC4wJwo=
---
apiVersion: habitat.sh/v1beta1
kind: Habitat
metadata:
  name: wordpress-db
customVersion: v1beta2
spec:
  v1beta2:
    image: habitatregistry.azurecr.io/habitat/mysql:latest
    count: 1
    service:
      name: mysql
      topology: standalone
      configSecretName: mysql-user-toml
---
apiVersion: habitat.sh/v1beta1
kind: Habitat
metadata:
  name: wordpress-app
customVersion: v1beta2
spec:
  v1beta2:
    image: habitatregistry.azurecr.io/habitat/wordpress:latest
    count: 1
    service:
      name: wordpress
      topology: standalone
      bind:
        - name: database
          service: mysql
          group: default
---
apiVersion: v1
kind: Service
metadata:
  name: wordpress-lb
spec:
  type: LoadBalancer
  ports:
  - name: web
    port: 80
    targetPort: 80
  selector:
    habitat-name: wordpress-app
```

Again we deploy this using `kubectl apply`.  After a few minutes both pods should be running:

```shell Verify deployment of the WordPress application and database pods
$ kubectl apply -f deploy-wordpress.yml
secret "mysql-user-toml" created
habitat.habitat.sh "wordpress-db" created
habitat.habitat.sh "wordpress-app" created
service "wordpress-lb" created
$ kubectl get pods
NAME                                READY     STATUS    RESTARTS   AGE
habitat-operator-854d7dc494-jnf7n   1/1       Running   0          2m
wordpress-app-0                     1/1       Running   0          2m
wordpress-db-0                      1/1       Running   0          2m
```

We can retrieve the external IP of the load balancer from Kubernetes:

```shell Check for load balancer details
$ $ kubectl get service wordpress-lb --watch
NAME           TYPE           CLUSTER-IP   EXTERNAL-IP     PORT(S)        AGE
wordpress-lb   LoadBalancer   <IP_ADDRESS>   <IP_ADDRESS>   80:32336/TCP   8m
```

And finally we can check that WordPress is up and running on the external IP.

![Running Application](media/2018-05-07-aks-and-acr-walkthrough/wordpress-running.png)

## Summary
In this walkthrough you saw how to setup Habitat Builder, Azure Container Registry and Azure Container Services,creating a complete continuous deployment pipeline for your application.  This pattern can applied to any application packaged with Habitat creating a standard mechanism for you to run all your applications.

### Got questions?
* [Ask and answer questions on the Habitat forums](https://forums.habitat.sh/)
* [Chat with the Habitat Community on Slack](http://slack.habitat.sh/)
* [Learn more about Habitat](https://www.habitat.sh/)

### Read more:
* [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/container-service/kubernetes/)
* [Azure Container Registry](https://azure.microsoft.com/en-us/services/container-registry/)
* [Best Practices for Habitat and AKS](https://www.habitat.sh/docs/best-practices/#aks-and-habitat)
* [Sample code on GitHub](https://github.com/jamesc/azure-habitat-example)


text:
---
title: Jabber
date: 2019-06-29
tags: [ 'jabber', 'xmpp', 'chat' ]
---

# Jabber

## Reference

### Utilities

* [simpleupload](https://git.daemons.it/drymer/simpleupload) Script to upload
  files to jabber servers with HTTP Upload (XEP-0363) enabled.

### Testing

* [messaging.one](https://check.messaging.one) Test XMPP server capabilities
  and configurations.
* [ssl test](https://www.ssllabs.com/ssltest/)


text:
Contributing
---------------
If you would like to contribute - send pull request to dev branch.
Getting dev version of **Minify**:

    git clone git://github.com/coderaiser/minify.git
    git checkout dev

or by [link](https://github.com/coderaiser/minify/tree/dev "Dev version").

repository: shinetechopen/tfs-si-gen

repo_name: shinetechopen/tfs-si-gen


text:
---
name: Release
about: Use this template for creating a new release.
title: "Release: x.y.z"
labels: release
assignees: yannickkirschen
---

# Prerequisites

- [ ] All changes for the release have been merged (rebased) into `main`.
- [ ] All workflows succeeded.

# Steps

## Release

- [ ] Checkout branch `main` and pull latest changes:
    - `git checkout main`
    - `git pull origin main`
- [ ] Set version in `pom.xml` to `x.y.z`.
- [ ] Rename "Next" section in `CHANGELOG.md` to `x.y.z (Month Day, Year)`.
- [ ] Commit and push your changes:
    - `git add .`
    - `git commit -s -m "build(release): x.y.z"`
    - `git push origin main`
- [ ] Check if all workflows succeeed.
- [ ] Publish release `x.y.z`.

## Prepare next release

- [ ] Checkout branch `main` and pull latest changes:
    - `git checkout main`
    - `git pull origin main`
- [ ] Set version in `pom.xml` to `x.y+1.z-SNAPSHOT`.
- [ ] Add "Next" section in `CHANGELOG.md`.
- [ ] Commit and push your changes:
    - `git add .`
    - `git commit -s -m "build(release): next development version x.y+1.z"`
    - `git push origin main`
- [ ] Check if all workflows succeeed.

repository: yannickkirschen/one-time-pad

repo_name: yannickkirschen/one-time-pad


text:
---
title: Migrate from Hot Chocolate GraphQL server 10 to 11
---

This guide will walk you through the manual migration steps to get you Hot Chocolate GraphQL server to version 11.

As a general preparation, we recommend removing all HotChocolate.\* package references from your project. Then start by adding the `HotChocolate.AspNetCore` package. The server package now contains most of the needed packages.

When do I need to add other Hot Chocolate packages explicitly?

We have now added the most common packages to the Hot Chocolate core. But there are certain areas where we still need to add some additional packages.

| Package                                  | Topic                                                                                |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HotChocolate.AspNetCore.Authorization    | The authorization package adds the authorization directive and integrates with Microsoft Authorization Policies                                                      |
| HotChocolate.Data                        | The new data package represents our integration with all kinds of data sources. This package provides the fundamentals for filtering, sorting, and projection logic. |
| HotChocolate.Types.Spatial               | This package provides GeoJson spatial types.                                                                                |
| HotChocolate.Data.Spatial                | The package integrates the spatial types with the data package to allow for spatial filtering, sorting, and projections.                                             |
| HotChocolate.Subscriptions.Redis         | The in-memory subscription provider, is now integrated by default. To have an integration with Redis, you need to add this package.                                  |
| HotChocolate.PersistedQueries.FileSystem | This package provides a persisted query storage for the file system.                                                                                |
| HotChocolate.PersistedQueries.Redis      | This package provides a persisted query storage for Redis.                                                                                |

# ASP.NET Core

One of the main focuses of version 11 was to create a new configuration API that brings all our builders together into one unified API. This also means that we had to introduce breaking changes to the way we
configure schemas.

After you have cleaned up your packages, head over to the `Startup.cs` to start with the new configuration API migration.

## ConfigureServices

In your `Startup.cs` head over to the `ConfigureServices` methods.
The configuration of a schema has slightly changed, and the new configuration API has replaced the `SchemaBuilder`.

We now start with `AddGraphQLServer` to define a new GraphQL server, `AddGraphQLServer`, returns the new `IRequestExecutorBuilder` that lets us apply all the configuration methods that used to be on the `SchemaBuilder`, `StitchingBuilder` and the `QueryExecutionBuilder`.

**Old:**

```csharp
services.AddGraphQL(sp  =>
    SchemaBuilder.New()
        .AddServices(sp)
        .AddQueryType<QueryType>()
        .AddMutationType<MutationType>()
        ...
        .Create());
```

**New:**

```csharp
services
    .AddGraphQLServer()
    .AddQueryType<QueryType>()
    .AddMutationType<MutationType>()
    ...
```

If you were using the `QueryRequestBuilder` to configure request options or change the request pipeline, you need to add those things to the configuration chain of the ```IRequestExecutorBuilder`.

```csharp
services
    .AddGraphQLServer()
    .AddQueryType<QueryType>()
    .AddMutationType<MutationType>()
    ...
    .ModifyRequestOptions(o => o.ExecutionTimeout = TimeSpan.FromSeconds(180));
```

## Configure

After migrating the schema configuration, the next area that has fundamentally changed is the schema middleware.

Hot Chocolate server now embraces the new endpoint routing API from ASP.NET core and with that brings a lot of new features. Head over [here](aspnetcore) to read more about the ASP.NET Core integration.

**Old:**

```csharp
app.UseGraphQL();
```

**New:**

```csharp
app.UseRouting();

// routing area

app.UseEndpoints(x => x.MapGraphQL());
```

# Schema / Resolvers

## DataLoaders

With Hot Chocolate server 11, we have embraced the new DataLoader spec version 2. With that, we have decoupled the scheduler from the DataLoader itself, meaning you now have to pass on the `IBatchScheduler` to the base implementation of the DataLoader.
Apart from that, DataLoader now uses `ValueTask` instead of `Task` when doing async work.

If you were adding the `DataLoaderRegistry` to the services, remove that code since `service.AddDataLoaderRegistry` is no longer needed.

**Old:**

```csharp
public class FooDataLoader : DataLoaderBase<Guid, Foo>
{
    private readonly IFooRepository _fooRepository;

    public FooDataLoader(IFooRepository fooRepository)
    {
        _fooRepository = fooRepository;
    }

    protected override async Task<IReadOnlyList<Result<Foo>>> FetchAsync(
        IReadOnlyList<Guid> keys,
        CancellationToken cancellationToken)
    {
        ....
    }
}
```

**New:**

```csharp
public class FooDataLoader : DataLoaderBase<Guid, Foo>
{
    private readonly IFooRepository _fooRepository;

    public FooDataLoader(
        //    ▼
        IBatchScheduler scheduler,
        IFooRepository fooRepository)
        : base(scheduler)
    {
        _fooRepository = fooRepository;
    }

    //                          ▼
    protected override async ValueTask<IReadOnlyList<Result<Foo>>> FetchAsync(
        IReadOnlyList<Guid> keys,
        CancellationToken cancellationToken)
    {

    ....
}
```

## Node Resolver

With version 11, we have reworked how Relay node types are defined. Furthermore, we added pure code-first (annotation-based) support.

**Old:**

```csharp
descriptor
    .AsNode()
    .IdField(d => d.Id)
    .NodeResolver(async (ctx, id) => await ctx
        .DataLoader<FooDataLoader>()
        .LoadAsync(id, ctx.RequestAborted))
```

**New:**

The following example essentially aligns very closely to the old variant.

```csharp
descriptor
    .ImplementsNode()
    .IdField(d => d.Id)
    .ResolveNode(async (ctx, id) => await ctx
        .DataLoader<FooDataLoader>()
        .LoadAsync(id, ctx.RequestAborted))
```

But, we can now also use an external resolver like with standard resolvers. This allows us to write better testable code that takes advantage of the method parameter injection we use in everyday resolvers.

```csharp
descriptor
    .ImplementsNode()
    .IdField(d => d.Id)
    .ResolveNodeWith<NodeResolver>(t => t.GetNodeAsync(default, default));
```

But we can go even further now with pure code-first (annotation-based) support. By just annotating the entity with the `NodeAttribute`, we essentially told the schema builder that this is a node. The type initialization can then try to infer the node resolver directly from the type.

```csharp
[Node]
public class MyEntity
{
    public string Id { get; set; }

    public async Task<MyEntity> GetAsync(....)
    {
        ....
    }
}
```

Often, however, we want the repository logic decoupled from our domain object/entity. In this case, we can specify the entity resolver type.

```csharp
[Node(NodeResolverType = typeof(MyEntityResolver))]
public class MyEntity
{
    public string Id { get; set; }
}

public class MyEntityResolver
{
    public async Task<MyEntity> GetAsync(....)
    {
        ....
    }
}
```

There are more variants possible, but to give an impression of the new convenience and flexibility around nodes. As a side note, if you do not want the node attribute on the domain objects, you can also now add your very own attribute or interface to mark this and rewrite that in the schema building process to the `NodeAttribute`.

## Pagination

The first thing to note around pagination is that we listened to a lot of feedback and have removed the `PaginationAmountType`.

Moreover, we have introduced new PagingOptions, which can be set with the new configuration API on the schema level. With the new options, you can configure the `MaxPageSize`, `DefaultPageSize` and whether the total count shall be included `IncludeTotalCount`.

```csharp
builder.SetPagingOptions(
    new PagingOptions()
    {
        MaxPageSize = searchOptions.PaginationAmount,
        DefaultPageSize = searchOptions.PaginationAmount,
        IncludeTotalCount = true
    });
```

Further, you can override the paging option on the resolver level.

```csharp
[UsePaging(MaxPageSize = 100)]
```

```csharp
descriptor.Field(...).UsePaging(maxPageSize = 100)...
```

## Enum Type

HotChocolate server 11 now follows the spec recommendation with the new enum name conventions and formats the enum values by default as UPPER_SNAIL_CASE.

To avoid breaking changes to your schema, you will have to override the naming convention:

**Configuration:**

```csharp
    builder
        .AddConvention<INamingConventions>(new CompatibilityNamingConvention())
```

**Convention:**

```csharp
    public class CompatibilityNamingConvention
        : DefaultNamingConventions
    {
        public override NameString GetEnumValueName(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            return value.ToString().ToUpperInvariant();
        }
    }
```

## IResolverContext.Source

The source result stack was removed from the resolver context for performance reasons. If you need such a functionality, you can write a middleware that aggregates the resulting path on the scoped context.

**Old:**

```csharp
    public class FooType : ObjectType<Foo>
    {
        private static readonly object _empty = new object();

        protected override void Configure(IObjectTypeDescriptor<Foo> descriptor)
        {
            descriptor
                .Field("bar")
                .Type<NonNullType<BarType>>()
                .Resolver(_empty);
        }
    }

    public class BarType : ObjectType
    {
        protected override void Configure(IObjectTypeDescriptor descriptor)
        {
            descriptor
                .Field("baz")
                .Type<DateTimeType>()
                .Resolve(ctx =>
                    {
                        Foo foo = (Foo)ctx.Source.Pop().Peek();
                        return foo.Baz;
                    });
        }
    }

```

**New:**

```csharp
    public class FooType : ObjectType<Foo>
    {
        protected override void Configure(IObjectTypeDescriptor<Foo> descriptor)
        {
            descriptor
                .Field("bar")
                .Type<NonNullType<BarType>>()
                .Resolve(
                    ctx =>
                    {
                        ctx.ScopedContextData =
                          ctx.ScopedContextData.SetItem(n ameof(Foo), ctx.Parent<Foo>());

                        return new object();
                    });
        }
    }

    public class BarType : ObjectType
    {
        protected override void Configure(IObjectTypeDescriptor descriptor)
        {
            descriptor
                .Field("baz")
                .Type<DateTimeType>()
                .Resolve(
                    ctx =>
                    {
                        if (ctx.ScopedContextData.TryGetValue(
                                nameof(Foo),
                                out object? potentialFoo) &&
                            potentialFoo is Foo foo)
                        {
                            return foo.Baz;
                        }

                        throw new GraphQLException(
                            ErrorBuilder.New()
                                .AddLocation(ctx.Field.SyntaxNode)
                                .SetMessage("Foo was not pushed down.")
                                .SetPath(ctx.Path)
                                .Build());
                    });
        }
    }
```

## Autorization

If you use authorization, you need to add a package reference to `HotChocolate.AspNetCore.Authorization`.

Old

```csharp
    builder.AddAuthorizeDirectiveType()
```

New

```csharp
    builder.AddAuthorization()
```

## TypeBinding

Old

```csharp
    builder.BindClrType<DateTime, DateTimeType>()
```

New

```csharp
    builder.BindRuntimeType<DateTime, DateTimeType>()
```

## FieldMiddleware

Old

```csharp
    builder.Use<CustomMiddleware>()
```

New

```csharp
    builder.UseField<CustomMiddleware>()
```

# Stitching

## Configuration

In Version 11 there is no stiching builder anymore. Stiching can be configured on the normal schema
builder.
Old:

```csharp
    services.AddStitchedSchema(x => ....);
```

New:

```csharp
    services.AddGraphQLServer()....
```

### AddSchemaFromHttp

Registering a remote schema has slightly changed in V11. You can also remote the root types directly
when you configure the remote schema:
Old:

```csharp
    builder.AddSchemaFromHttp("SomeSchema").IngoreRootTypes("SomeSchema");
```

New:

```csharp
    builder.AddRemoteSchema("SomeSchema", ignoreRootTypes: true);
```

## AddSchemaConfiguration

As we do not have a dedicated schema builder for stitched schemas, you can just configure the schema
directly on this builder:

Old

```csharp
    services.AddStitchedSchema(x => x.AddSchemaConfiguration(y => y.RegisterType<FooType>()));
```

New

```csharp
    services
        .AddGraphQLServer()
        .AddType<FooType>();
```

## IgnoreField

The order of the parameters in ignore field has changed. The schema name is now optional and was moved to the end.

Old

```csharp
    services.AddStitchedSchema(x => x.IgnoreField("SchemaName", "TypeName, "FieldName"));
```

New

```csharp
    services
        .AddGraphQLServer()
        .IgnoreField("TypeName, "FieldName", "SchemaName")
```

## SetExecutionOptions

Execution options can now be configured on the root schema directly:

Old

```csharp
    services.AddStitchedSchema(
        x => x.SetExecutionOptions(
            new QueryExecutionOptions
                {
                    TracingPreference = TracingPreference.OnDemand
                }));
```

New

```csharp
    services
        .AddGraphQLServer()
        .ModifyRequestOptions(x => x.TracingPreference = TracingPreference.OnDemand);
```

## Configuring a downstream schema

In case you want to configure a downstream schema, you can now just use the schema builder:

```csharp
    services
        .AddGraphQLServer()
        .AddRemoteSchema("SomeSchema");
    services
        .AddGraphQL("SomeSchema")
        .AddType(new IntType());
```

## PaginationAmount

The `PaginationAmount` scalar was removed in v11. `first` and `last` are now just normal `Int`.
To avoid breaking schemas on the stitched schema, you can add a rewriter that rewrites all
`first: Int` and `last: Int` on a connection to `first: PaginationAmount` and `last: PaginationAmount`.
You also have to make sure that you register a new `IntType` on the root schema and all rewrittern
downstream schemas.

Configuration:

```csharp
    services
        .AddGraphQLServer()
        .AddRemoteSchema("SomeSchema")
        .AddType(new IntType())
        .AddType(new IntType("PaginationAmount"))
        .AddMergedDocumentRewriter(
            d => (DocumentNode)new PagingAmountRewriter().Rewrite(d, null));

    services
        .AddGraphQL("SomeSchema")
        .AddType(new IntType())
        .AddType(new IntType("PaginationAmount"));
```

PagingAmountRewriter:

```csharp
    internal class PagingAmountRewriter : SchemaSyntaxRewriter<object?>
    {
        protected override FieldDefinitionNode RewriteFieldDefinition(
            FieldDefinitionNode node,
            object? context)
        {
            if (node.Type.NamedType().Name.Value.EndsWith("Connection") &&
                node.Arguments.Any(
                    t => t.Name.Value.EqualsOrdinal("first") &&
                        t.Type.NamedType().Name.Value.EqualsOrdinal("Int")))
            {
                var arguments = node.Arguments.ToList();

                InputValueDefinitionNode first =
                    arguments.First(t => t.Name.Value.EqualsOrdinal("first"));

                InputValueDefinitionNode last =
                    arguments.First(t => t.Name.Value.EqualsOrdinal("last"));

                arguments[arguments.IndexOf(first)] =
                    first.WithType(RewriteType(first.Type, "PaginationAmount"));

                arguments[arguments.IndexOf(last)] =
                    first.WithType(RewriteType(first.Type, "PaginationAmount"));

                node = node.WithArguments(arguments);
            }

            return base.RewriteFieldDefinition(node, context);
        }

        private static ITypeNode RewriteType(ITypeNode type, NameString name)
        {
            if (type is NonNullTypeNode nonNullType)
            {
                return new NonNullTypeNode(
                    (INullableTypeNode)RewriteType(nonNullType.Type, name));
            }

            if (type is ListTypeNode listType)
            {
                return new ListTypeNode(RewriteType(listType.Type, name));
            }

            return new NamedTypeNode(name);
        }
    }

    internal static class StringExtensions
    {
        public static bool EqualsOrdinal(this string value, string other) =>
            string.Equals(value, other, StringComparison.Ordinal);
    }
```

# Testing

## Building a schema

There are new overloads on the `RequestExecutorBuilder`. Instead of creating the schema and
make it executable, it is now possible to directly create a request executor.
Be aware, the new overload is async

Old

```csharp
    var queryExecutor = builder.New()......Create().MakeExecutable();
```

Old

```csharp
    var schema = await builder.New()......BuildSchmeaAsync();
    var queryExecutor = await builder.New()......BuildExecutorAsync();

    // These overlads are also available on IServiceProvider
    var schema = await serviceProvider.GetSchemaAsync();
    var queryExecutor = await serviceProvider.GetRequestExecutorAsync();
```

## Schema Snapshots Break

Due to the new feature, `@defer` snapshots that have been taken directly on a result will fail.
These have to be updated. As you are updating them anyway, you can also add `ToJson()` to the result.
This will be more stable with upcoming releases than just snapshotting the result object
`result.ToJson().MatchSnapshot()`

### **Field ordering**

Hot Chocolate 11 follows the spec and returns the fields in the order they were defined. This feature
makes migrations harder because the schema snapshot looks different.
You can change this behavior with the following setting

```csharp
    builder.ModifyOptions(x => x.SortFieldsByName = true)
```

### **Types are ordered differently**

Especially in stitching, it could be that the types are orderer differently when you export the schema.
When you use schema snapshots to track changes, this makes the comparison much harder.
To work around this issue you can parse the schemas and sort the types alphabetically.
This way schema snapshots are easier to compare.

```csharp
string schemaAsString = /* load your schema from somwhere */
DocumentNode schema = Utf8GraphQLParser.Parse(schemaAsString);
schema = schema.WithDefinitions(
    schema.Definitions.OfType<IHasName>()
      .OrderBy(x => x.Name.Value )
      .Cast<IDefinitionNode>()
      .Concat(schema.Definitions.Where(x => !(x is IHasName)))
      .ToArray());

schemaAsString = schema.Print();
```

## DataLoader Testing

Due to the changed constructor you now need to also create a scheduler for the dataloaders

Old

```csharp
    FooDataLoader dataLoader = new FooDataLoader( fooRepoMock.Object);
```

New

```csharp
    var scheduler = new BatchScheduler();
    FooDataLoader dataLoader = new FooDataLoader(
        scheduler,
        fooRepoMock.Object);
```

// TODO : services.AddQueryRequestInterceptor((context, builder, ct)

// TODO : Testing

// TODO : Type Converter

// TODO : Serial Execution

// TODO : services.AddQueryResultSerializer<CustomQueryResultSerializer>();

repository: eknkc/hotchocolate

repo_name: eknkc/hotchocolate


text:
# Pyhamilton example: Many turbidostats

**Advanced implementation with asynchrony and other optimizations to enable 480 independent turbidostats.**

Cyclically replace media in microplate wells containing bacterial cultures using a high-level controller to maintain each culture independently at a constant optical density (OD). Estimates culture growth rate in real time. Utilizes [pyhamilton](https://github.com/dgretton/pyhamilton), Python for Hamilton liquid handling robots, for robot control. Controller simulation included.

Referenced in:

- [Flexible open-source automation for robotic bioengineering](https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>368v1), _preprint_

_Contact<EMAIL_ADDRESS>
_Developed for the Sculpting Evolution Group at the MIT Media Lab_


text:
# Exercise 15.24

Why is it that, given

```cpp
Bulk_item bulk;
Item_base item(bulk);
Item_base *p = &bulk;
```

the expression

```cpp
p->net_price(10);
```

invokes the `Bulk_item` instance of `net_price`, whereas `item.net_price(10);` invokes the `Item_base` instance?

**Answer**:

Because `Item_base *p` is a pointer to the base class, and the `net_price` member is virtual. So that the compiler will generate code to determine which version to run based on the dynamic type of the object, which is `Base_item`.

However, `Item_base item` is an object, not a reference or pointer. So that there will be no dynamic binding behavior from compiler.


text:
# DeprecatedNotificationDelayAlertPolicy

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**delay_option** | **str** | Delay type | [optional]
**duration** | [**Duration**](Duration.md) | Interval to keep count of alerts for frequency based deduplication | [optional]
**until_hour** | **int** | Should be a number between 0-23 | [optional]
**until_minute** | **int** | Should be a number between 0-59 | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: criteo-forks/opsgenie-python-sdk

repo_name: criteo-forks/opsgenie-python-sdk


text:
# bom.bat
Convert UTF-8 encoding to UTF-8 BOM using Windows Command Prompt (CMD)

## Usage
Drag UTF-8 encoding file to bom.bat.


text:
## Build
```bash
npm install -g browserify #Install browserify
npm install #Install dependencies
npm run build #Build extension
```

## Credits
The following external resources have been included as part of the project:
- Ethereum Foundation's Web3.js

## License
The Unlicense

license: MIT,Unlicense

repository: corollari/unlibra

detected_licenses: MIT Unlicense

repo_name: corollari/unlibra


text:
# Digital Land Frontend

## Requirements

- Node V16+
- Python 3.5
- PIP

## Getting started

This documentation assumes you have installed [Python](https://docs.python.org/3/using/unix.html#getting-and-installing-the-latest-version-of-python) and [Node](https://www.freecodecamp.org/news/how-to-install-node-in-your-machines-macos-linux-windows/). We recommend using 'Node Version Manager' (NVM) because this repository has a [.nvmrc](.nvmrc) file which will ensure you are using the correct version of NodeJS.

1. Clone this repository:
```
git clone git@github.com:digital-land/digital-land-frontend.git
```
2. In terminal, switch to the root directory of the cloned repository.
3. Make sure you are using the correct Node version. Users of RVM can type `rvm use`
2. Run `npm install` to install all the node packages

We use a `.editorconfig` file to ensure code consistency. There are [plugins for the popular editors](https://editorconfig.org/#download).

## Templates

All templates for HTML pages used within digital land applications will be written in Jinja and use the file extension `.jinja`.

When writing blocks in Jinja ensure the name is added to the endblock statement for example:

```
{%- block headEnd %}...{%- endblock headEnd %}
```

### Directories

* `layouts/` - page layout templates
* `components/` - individual components
* `partials/` - jinja/html snippets where we want the content to be consistent

 ## Components

 - Frontend components will use Jinja templates and will be organised so that the associated Sass/CSS and Javascript will exist in the same directory.

 ### Creating a component

 When creating a component you should follow these steps:

 - create a directory in `digital_land_frontend/templates/components`
 - in that directory add
   - `macro.jinja` - for the template
   - `_<component_name>.scss` - for the associated styles
   - `<component_name>.js` - for the associate javascript (if applicable)
- import the `.scss` into `digital_land_frontend/src/scss/dl-frontend.scss`
- import the `.js` modules into `digital_land_frontend/src/javascripts/dligital-land-frontend.js`
- check files pass linting

### The component life-cycle

When building the frontend for digital-land apps, we follow a modular "BEM"-like structure based on the [GOVUK Design System](https://design-system.service.gov.uk/). We have some principles for using, designing and building components:

1. Default to using [GOVUK Components](https://design-system.service.gov.uk/components/) first which have the benefit of being used and researched in many services across government as well as the overight of a working group who assess them against the service standard.

2. If a new component or design pattern is deemed neccessary it should first be prototyped and tested within the context of the specific service the need arose. This is when it would be given an 'app-' namespace (see [CSS](#css))

3. If the same user need arises in a different digital-land service then the work should be done to 'promote' the component to digital-land-frontend, this means the same design solution can be kept in sync across both apps, each benefitting from the iterations and research done across both services.

## CSS

When writing Sass/CSS you should follow the established class naming convention:

### App/Service specific components

New components not applicable or ready to be added to this repository should be name spaced as 'app-[componentname]' for example:

`.app-numeric-counter`

### Shared components for Digital Land apps/services

Components within this respository deemed a solution to a common problem and of sufficient quality to be shared across all digital land apps and services, namespace with 'dl-[componentname]' for example:

`.dl-data-table`

## Partials

- A partial is a shared piece of jinja which is the same across any digital land application. If the content or structure of the partial needs differ depending on it's context then it should be abstracted as a reusable component.

## Using digital-land-frontend in your projects

You need to install the python and npm packages.

Install the python package by running
```
pip install git+https://github.com/digital-land/digital-land-frontend.git#egg=digital_land_frontend
```
This gives you access to all the templates and jinja filters.

Then install the npm package by running
```
npm install https://github.com/digital-land/digital-land-frontend/tree/main/package
```
This gives you access to the scss, the compiled js and the npm build scripts you can use in your projects.

Once installed add the following line to `package.json` `scripts`
```
"nps": "nps -c ./node_modules/digital-land-frontend/package-scripts.js"
```

In your project you can now build the stylesheets by running:
```
npm run nps build.stylesheets
```

and you can put the js in the right location by running
```
npm run nps copy.javascripts
```

To change where these files are outputted create a `digital-land-frontend.config.json` file. In here you can set these options:

* digitalLandFrontendPath
* govukFrontendPath
* scssPath
* stylesheetsOutputPath
* jsOutputPath
* rollupConfig

If your project needs custom js you can use the pre-installed rollup task by creating a `rollup.config.js` file and once you are ready, running
```
npm run nps build.javascripts
```

# Tasks

- [ ] Check the rendered output of jinja templates for consistency of whitespace, and output
- [ ] Review header markup and structure for digital land
- [ ] Review scss files and govuk/all - seperate helpers from generated classes to avoid duplicate css

repository: digital-land/digital-land-frontend

repo_name: digital-land/digital-land-frontend