text:
# Minimum Support Price Analysis with regard to APMCs

Minimum Support Price or MSP refers to the minimum price at which a commodity can be sold legally. The MSP is set by the government for various commodities annually. Agricultural Produce Market Committees or APMCs are the different marketing boards established by the government. A farmer sells his/her produce via auction at the mandi established by the APMC. Retailers cannot directly buy produce from the farmers. This prevents exploitation of the farmer.

Here, APMCs in Maharashtra are being looked at. Commodities are brought into the mandis and auctioned, however the price should legally be above the MSP.

## Objectives:
1. To test and filter outliers.
2. To understand price fluctuations accounting the seasonal effect

    -Detect seasonality type (multiplicative or additive) for each cluster of APMC and commodities

    -De-seasonalise prices for each commodity and APMC according to the detected seasonality type
3. To compare prices in APMC/Mandi with MSP(Minimum Support Price)- raw and deseasonalised
4. To flag set of APMC/mandis and commodities with highest price fluctuation across different commodities in each relevant season, and year.

## Data Files:

All the data files are in `.csv` format.
* `CMO_MSP_Mandi.csv`: Raw data containing the MSPs of different commodities set up by the government in different years.
* `Monthly_data_cmo.csv`: Raw data containing the minimum, maximum and modal prices, and the quantity supplied in quintals, of commodities at various mandis for each month.

## Approach Methodology and Documentation:

### Exploration and Finding Outliers
* The code for the first objective: [here](https://github.com/itsmepiyush2/Agriculture-Commodities-Price-and-Seasons/blob/master/exploration%20and%20outlier%20detection.ipynb)

The MSP varies greatly from commodity to commodity as can be seen from this bar plot.

#### "An outlier is an observation which deviates so much from the other observations as to arouse suspicions that it was generated by a different mechanism."
While carrying out outlier detection, one must be very careful and meticulous in order not to remove any useful information. Thus, it is important to keep in mind that a univariate outlier might not be a multivariate or regression outlier and vice versa. Thus, simply plotting boxplots and removing data values that seem to have an abnormal behaviour might chop off some useful information. Hence, I'll follow a very rudimentary approach to detect outliers.
The basic idea is the intuition that minimum, maximum and modal prices, throughout time, should follow similar patterns. Thus, they should be directly proportional to each other. In other words, they should have a positive correlation.

From the scatterplots, it is evident that there are three data points that do not conform to the general behaviour, two with minimum price > 500000 and one with maximum price > 1400000. Once these data points are removed, the scatterplots are as shown.

Now even after cleaning the data, there is one particular point that shows some abnormal behaviour. But, it's scale is almost negligible compared to the previous outliers. Moreover, there could be some other reason of it showing that specific behaviour which might not be decipherable right now. So removing it might as well be more dangerous.

We know that MSPs are decided by government policy. So the MSP dataset is simply a policy jotted down in a tabular form. There is no experiment so there are no observations in actuality. We are treating the data values in MSP dataset as ground truths. So attempting to detect outliers in the MSP dataset would seem absurd.

### Seasonality Detection, Seasonality Removal and Comparing Prices
* The code for the second and third objectives: [here](https://github.com/itsmepiyush2/Agriculture-Commodities-Price-and-Seasons/blob/master/seasonality%20detection%2C%20deseasonalising%20and%20comparing%20prices.ipynb)

#### "Any predictable change or pattern in a time series that recurs or repeats over a specific period can be said to be seasonal."
In order to detect seasonality in a time series, the signal needs to be broken down into trend, seasonality and the residue. In case of an additive seasonality, the signal is the summation of trend, seasonality and residue; and in case of multiplicative seasonality, the signal is the product of the three components.

The function `identify_seasonality` takes in two inputs, `APMC` and `Commodity`, and displays the type of seasonality that is present in the signal for the corresponding APMC and Commodity. It also decomposes the signal into its 3 components and plots them. Two use cases are given below in the form of a gif.
(The gifs are little slower than the actual running code.)

* Detecting additive seasonality

* Detecting multiplicative seasonality

The function `deseasonalise` acts in a similar way except that it only returns the original and the deseasonalised signals. It acts as a helping function for another function `compare_prices` which takes in the inputs `APMC` and `Commodity` and compares the MSP, raw prices and de-seasonalised prices for the corresponding APMC and Commodity. A use case is given below.

### Flagging the Set of APMC-Commodity Clusters that have High Price Fluctuation:
* The code for the fourth objective: [here](https://github.com/itsmepiyush2/Agriculture-Commodities-Price-and-Seasons/blob/master/fluctuations.ipynb)

The basic idea here is to first collect all the sets of APMCs and Commodities that have more than a year's worth of data. Then finding how far the data values are spread out by finding the coefficient of variation. (Coefficient of variation is simply the ratio of standard deviation and mean) Then sort the APMC-Commodity clusters in decreasing order of coefficient of variation and choose the top few clusters which have the highest coefficients of variation.

After sorting the clusters in descending order of coefficients of variation, it is plotted.

Logically, only those clusters need to be selected which lie to the left of the elbow formation since these have high coefficients of variation. However, it is difficult to pin-point exactly where the elbow is being formed. Let's zoom in.

It is evident that the clusters having indices less than or equal to 20 need to be selected.

Now, if we consider Gaussian (Normal) distribution, we know that ~99.7% of the entire data lies within 3 standard deviations of the mean on both sides. So if in case, a data point crosses 3 standard deviations, then the cluster has high price fluctuation. Using this intuition, the values of modal price that cross 3 standard deviations are recorded.

### Conclusion:

An MSP is a prime example of price floors that are set by the government to prevent them from falling further in order to prevent the exploitation of the seller. It is the minimum price in which a commodity can be sold. But setting of price floors have other effects on individual demand and supply. If a price floor is set above the equilibrium price, then it reduces the demand for the commodity but there is an increase in its supply.

In other words, the producers produce more but the consumers are reluctant to buy at that price point. Thus, it creates a surplus of the commodity.
The government takes the burden of buying the excess surplus, which is only fair because it is the government that intervenes in the naturally facilitated demand and supply forces. However, in doing so, the government has to bear the burden of buying at a higher price and selling at a lower price.
In some other cases, the government introduces production quotas; these increase the prices while the producer is incentivised to produce less. This saves the government from bearing the loss, and supply and demand stay at equilibrium.


text:
# cryptobill

Retrieves quotes and create transactions for multiple crypto bill services and cryptocurrencies.

*Please note that this is under development, and although it works for me, you should use caution.*

Currently supports price quoting for:

 * Bit2Bill (https://www.bit2bill.com.au/)
 * Living Room of Satoshi (https://www.livingroomofsatoshi.com/)
 * Paid by Coins (https://paidbycoins.com/)

Only supports creating a transaction with `Paid by Coins` for [BPAY](https://www.bpay.com.au/).

## Quote Example

This is a real result on `2018-10-26`.

It shows the list in order of the apparent markup based on [BitcoinAverage](https://bitcoinaverage.com/) prices.

```
$ quote 1000 AUD --filter=BTC,ETH,BCH

  PBC| BTC| 0.11343| 1039.09807|  3.910%|
  B2B| BTC| 0.11352| 1039.90846|  3.991%|
  PBC| ETH| 3.64804| 1042.86772|  4.287%|
  B2B| ETH| 3.66797| 1048.56729|  4.857%|
  PBC| BCH| 1.66889| 1052.68224|  5.268%|
  B2B| BCH| 1.66889| 1052.68224|  5.268%|
 LROS| BTC| 0.11634| 1065.71874|  6.572%|
 LROS| ETH| 3.74721| 1071.21697|  7.122%|
 LROS| BCH| 1.75148| 1104.77434| 10.477%|
```

## Pay BPAY Example

It will give you a destination address and an amount to pay into, e.g.:

```
$ cryptobill pay bpay 1000 aud btc pbc 1234<PHONE_NUMBER>776666 --auth<EMAIL_ADDRESS>
&cryptobill.TransactionAddResponse{
  ToAddress: "3TxgIzzzzzzzzzyyyyyyyyyyyyyyyxxxxx",
  TotalAmount: 0.1111,
}
```

## How to use

This is a [Go app](https://golang.org/). You need Go installed and in your path.

Commands:
  quote <amount> <fiat>

  pay bpay --auth=STRING <amount> <fiat> <crypto> <service> <code> <account>

  pay eft --auth=STRING <amount> <fiat> <crypto> <service> <bsb> <account-number> <account-name>

Run "cryptobill.exe <command> --help" for more information on a command.
exit status 1
```

## Contributions

Feel free to send in pull requests.

license: MIT

repository: gak/cryptobill

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: gak/cryptobill


text:
# Djamocha

Integrating [Django](http://djangoproject.com/) and [Mocha](https://mochajs.org/) for
great good.

## But how?

Djamocha, lovingly named after a sort-of-gross-but-sometimes-appealing [beverage from Arby's](http://arbys.com/menu/shakes-desserts/jamocha-shake.html),
provides a new management command: `djamochatest` and a metaclass DSL for defining tests.

### How does it work?

* Djamocha is designed to run a single browser against the entire test suite at a time, automatically.

Djamocha looks for subclasses of `djamocha.Test` using the same process that `manage.py test` looks
for unit tests. Running `manage.py djamochatest` will run `manage.py testserver` in the background,
and tell you to hit `http://localhost:8000/idle/`. When you do so, it will automatically open up a
popup that cycles through all of your Djamocha test cases. When it finishes, your command line
program will exit with the number of failures as its exit code. If you wish to run again, assuming
your browser is still on the `idle` page, you can simply rerun the management command.

While a test suite is running, it assumes full control over the URL structure of your Django app --
you may provide a link to a `urls.py`, a `patterns` object, or nothing at all in your test -- and
stub XHR-based views this way.

Djamocha automatically runs a static server that provides your `Media`, excluding your tests.

Your tests are pulled from a `js` directory alongside the test file containing the unit test,
which allows you to keep your JavaScript tests separate from your static media.

## The DSL

The python side of things:

````python
# myapp/tests/jstests.py

import djamocha

class JSTest(djamocha.Test):
    # the media to be tested
    class Media:
        css = {}
        js = []

    # the routes that will be available while this
    # test case is running
    routes = 'routes.for.my.app'

    # the tests to run against that media
    tests = ['some.test.js']

````

You may define as many of these as you like in a single file.

`routes` accepts a string (to import) or a `patterns` object. You may use this
to stub out XHR requests (or perform full stack testing -- up to you!)

`tests` is a list of JavaScript files containing Mocha test suites to pull from the
current test's adjacent `js` directory. You have access to jQuery, `suite`, `test`,
and `assert` (patterned off of [Node's assert module](http://nodejs.org/api/assert.html)).

A look at our JavaScript:

````javascript
// myapp/tests/js/some.test.js

suite("test", function() {
  test("hello world", function() {
    assert.equal(2, 1 + 1)
  })
})

````

## LICENSE

new BSD

repository: Matheus-IT/djamocha

repo_name: Matheus-IT/djamocha


text:
# Mycosphaerella rhois (Sawada & Katsuki) C.C. Chen, 1967 SPECIES

#### Status
ACCEPTED

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

#### Published in
Biblthca Mycol. 59: 117 (1977)

#### Original name
Cercospora rhois E. Castell., 1942

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# 2D Human Whole-Body Pose Estimation

2D human whole-body pose estimation aims to localize dense landmarks on the entire human body including face, hands, body, and feet.

Existing approaches can be categorized into top-down and bottom-up approaches.

Top-down methods divide the task into two stages: human detection and whole-body pose estimation. They perform human detection first, followed by single-person whole-body pose estimation given human bounding boxes.

Bottom-up approaches (e.g. AE) first detect all the whole-body keypoints and then group/associate them into person instances.

## Data preparation

Please follow [DATA Preparation](/docs/en/dataset_zoo/2d_wholebody_keypoint.md) to prepare data.

## Demo

Please follow [Demo](/demo/docs/en/2d_wholebody_pose_demo.md) to run demos.

repository: open-mmlab/mmpose

branch_name: refs/heads/main

gha_language: Python

repo_name: open-mmlab/mmpose


text:
# Regius Mark

Regius Mark is a cryptocurrency that is backed by physical gold assets. A single
token is backed by one physical gram of gold. Blockchain technology is used to
provide an immutable and cryptographically verified ledger. The system is
centralized allowing for global scalability that would otherwise be foregone in
a decentralized system.

[Website](https://regiusmark.io) |
[Whitepaper](https://regiusmark.io/whitepaper)

## Overview

Regius Mark's core library and blockchain implementation.

The library API provides:

- Building transactions
- Building network messages
- Creating scripts and converting them to P2SH addresses used for receiving
- Generating keys and optionally converting them to a default P2SH address
- Backend storage for blocks and indexing
- Validating blocks and transactions

This library does not provide a network client implementation remaining agnostic
to any networking library.

[![Build Status](https://travis-ci.com/RegiusMark/regiusmark.svg?branch=master)](https://travis-ci.com/RegiusMark/regiusmark)

## Supported Rust Versions

Regius Mark is built against the latest stable version of the compiler. Any
previous versions are not guaranteed to compile.

## Developing

When bugs are fixed, regression tests should be added. New features likewise
should have corresponding tests added to ensure correct behavior.

Run the test suite:
```
$ cargo test
```

The crate should build and tests should pass.

repository: RegiusMark/regiusmark

repo_name: RegiusMark/regiusmark


text:
# Front end Example for Okta Spring Security Resource Server

This front-end sample application can be used to test the [Resource Server](../resource-server) sample application provided in this repo.

## Prerequisites

Before running this sample, you should start the resource server backend.

**backend:**
```bash
cd ../resource-server
mvn spring-boot:run -Dspring-boot.run.arguments="--okta.oauth2.issuer=https://{yourOktaDomain}/oauth2/default"
```

> **NOTE:** The above command starts the resource server on port 8000. You can browse to `http://localhost:8000` to ensure it has started. If you get the message "401 Unauthorized", it indicates that the resource server is up. You will need to pass an access token to access the resource, which will be done by the front-end below.

**front-end:**

To start the front-end, you need to gather the following information from the Okta Developer Console:

- **Client Id** - The client ID of the SPA application that you created earlier. This can be found on the "General" tab of an application, or the list of applications. The resource server will validate that tokens have been minted for this application.
- **Issuer** - This is the URL of the authorization server that minted the tokens.  All Developer Accounts have a "default" authorization server.  The issuer is a combination of your Org URL (found in the upper right of the console home page) and `/oauth2/default`. For example, `https://dev-1234.oktapreview.com/oauth2/default`.

Now start the front-end.

```bash
cd front-end
mvn spring-boot:run -Dspring-boot.run.arguments="--okta.oauth2.issuer=https://{yourOktaDomain}/oauth2/default \
    --okta.oauth2.clientId={clientId}"
```

Browse to: `http://localhost:8080/` to login!

repository: okta/samples-java-spring

gha_language: Java

repo_name: okta/samples-java-spring


text:
## Document for examples
You can add your example to this directory.
If you want to share it with other developers, please use this directory.

## Rules
If you want to merge your example by a pull request, please follow these guidelines. The license of your program is same as WORLD.
- Please determine a file name to appropriately describe the function.
- Please write your contact address (e.g. email).
- Please write header information in .cpp to clearly show the purpose and how to use this program.
- Please add the compile command in the makefile in this directory.
- Please don't change the WORLD-core (in "src") programs.
- Please permit to modify the programs. I might fix the program.

Follows are rules for modification.
- To modify the program, please send a pull request. However, I accept only the request by the same developer.
- If you want to add a similar function, please determine a different name.

## Caution
Since I do only the check whether the program works or not, I can't guarantee the quality of the program in this directory.
If you have a question in an example, please contact the developer (I can't answer the question).

repository: yohaneshalim/speech

repo_name: yohaneshalim/speech


text:
spmv-omp-phi
============

Implementation of Sparse-Matrix Vector Multiplication (SpMV) in C and OpenMP for highly parallel architectures such as Intel Xeon Phi

Currently supports the following sparse storage formats:
1. CRS aka CSR
2. CCS aka CSC
3. BCRS aka BCSR
4. ELL aka ELLPack format

Desired formats to add support to (no timeline maybe never):
1. COO
2. HYB (COO+ELL)
3. ELL_A similar to ELL except with variable length rows

license: Unlicense

gha_license_id: Unlicense


text:
# RRPN_pytorch
RRPN in pytorch, which is implemented under framework of facebook's benchmark: https://github.com/facebookresearch/maskrcnn-benchmark.
Its caffe version can be viewed at: https://github.com/mjq11302010044/RRPN.

This repo has been deprecated, please see our new repo RRPN++ (https://github.com/mjq11302010044/RRPN_plusplus).

![alt text](demo/results/rrpn3.png "Results from IC15 testing set")

## Highlights
- **From original repo:** In pytorch 1.0, Somehow faster than original repo in both training and inference.
- **Training and evaluation checked:** Testing in IC15 with training data in {IC13, IC15, IC17mlt}, and receives Fscore of 83% vs. 81% in caffe repo.
- **What's new:** RRoI Pooling is replaced with RRoI Alignment(bilinear interpolation for sampling), FPN structure supported, easy to change various backbones for different purposes.

## Installation

Check [INSTALL.md](INSTALL.md) for installation instructions.

## Configuring your dataset
- Your dataset path can be set in `$RRPN_ROOT/maskrcnn_benchmark/config/paths_catalog.py`. We implemented interface for {IC13, IC15, IC17mlt, LSVT, ArT} for common use(Start from line 96):
```bash
...
 "RRPN_train": {  # including IC13 and IC15
            'dataset_list':{
                # 'IC13': 'Your dataset path',
                ...
            },
            "split": 'train'
        },
...
```
- Add your dataset?
You need to form a dict array as follows:
```bash
im_info = {
    'gt_classes': your class_id array,
    'max_classes': your class_id array,
    'image': path to access one image,
    'boxes': rotate box in {cx, cy, w, h, θ},
    'flipped': Not supported, just False,
    'gt_overlaps': overlaps fill with 1 (gt with gt),
    'seg_areas': H * W for an rbox,
    'height': height of an image,
    'width': width of an image,
    'max_overlaps': overlaps fill with 1 (gt with gt),
    'rotated': just True
}
```
Examples can be seen in `$RRPN_ROOT/maskrcnn_benchmark/data/rotation_series.py`
Your data API should be add to the variable `DATASET`:
```bash
DATASET = {
    'IC13':get_ICDAR2013,
    'IC15':get_ICDAR2015_RRC_PICK_TRAIN,
    'IC17mlt':get_ICDAR2017_mlt,
    ...
    'Your Dataset Name': 'Your Dataset API'
}
```

## Training
```bash
# create your data cache directory
mkdir data_cache
```
```bash
# In your root of RRPN
python tools/train_net.py --config-file=configs/rrpn/e2e_rrpn_R_50_C4_1x_ICDAR13_15_17_trial.yaml
```
- Multi-GPU phase is not testing yet, be careful to use GPU more than 1.

## Testing
- Using `$RRPN_ROOT/demo/RRPN_Demo.py` to test images you want. The demo will generate a text for your detected coodinates.
- Showing the detected image by ture the variable `vis` to True.

## Final
- Enjoy it with all the codes.
- Citing us if you find it work in your projects.
```
@misc{ma2019rrpn,
    author = {Jianqi Ma},
    title = {{RRPN in pytorch}},
    year = {2019},
    howpublished = {\url{https://github.com/mjq11302010044/RRPN_pytorch}},
}
@article{Jianqi17RRPN,
    Author = {Jianqi Ma and Weiyuan Shao and Hao Ye and Li Wang and Hong Wang and Yingbin Zheng and Xiangyang Xue},
    Title = {Arbitrary-Oriented Scene Text Detection via Rotation Proposals},
    journal = {IEEE Transactions on Multimedia},
    volume={20},
    number={11},
    pages={3111-3122},
    year={2018}
}
```

gha_license_id: MIT


text:
# Unit Testing with NativeScript and Angular

We all know that testing is important and now thanks to the [changes in NativeSript to support Angular 12](https://blog.nativescript.org/nativescript-angular-12/index.html) this is easier than ever for NativeScript Angular projects.

## A sample project to demonstrate

We will run through an example adding tests to a SideDrawer angular app generated from the standard angular templates.  When we are done we will have tests which execute our code on the phone/emulator of our choice.

<image src="assets/RunningTests.gif" height="400">

### Create the project

1. ```ns create```
1. Enter a Name e.g. nstestingdemo
1. Choose angular flavour
1. Choose Sidedrawer template

You now have a project that should build and run, you can check with ``` ns run android```.

### Add a service that we can test

We are going to need some code to test so let's add a simple service.

1. Create a file ```demo.service.ts``` in ```src/app/services``` folder
1. Add the content

    ```ts
    import { Injectable } from "@angular/core";

    @Injectable()
    export class DemoService {

        doSomething(): string {
            return "correct message";
        }
    }
    ```

    This is a simple service that we can inject into our controllers with a single method that returns a value.

1. Make the service available to the search controller

    In ```app.module.ts``` add the demo service as a provider i.e.
    ```ts
    import { DemoService } from './services/demo.service'

    @NgModule({
    bootstrap: [AppComponent],
    imports: [AppRoutingModule, NativeScriptModule, NativeScriptUISideDrawerModule],
    declarations: [AppComponent],
    schemas: [NO_ERRORS_SCHEMA],
    providers: [ DemoService ]
    })
    ```
1. Import the service into the search controller (```src/app/search/search.component.ts``` )

    ```import {DemoService} from '../services/demo.service';```
1. Now inject the service into the search controller
    ```ts
    constructor(private demo: DemoService) {
        // Use the component constructor to inject providers.
    }
    ```
1. Add a method to the search controller which uses this service

    ```ts
    doDemo(): string {
        return this.demo.doSomething();
    }
    ```

## Add Testing to our project

1. ```ns test init```
1. Choose the framework jasmine

    This installs the various frameworks etc.

    If you execute ```ns test android``` at this point you will get compile errors, this is because we have not configured our tsconfig.json to compile the sample tests.

1. Configure the tsconfig.json for testing

    Add a new file tsconfig.spec.json to the root of the project ( alongside tsconfig.json ).

    Add the contents
    ```json
    {
        "extends": "./tsconfig.json",
        "include": [
            "./src/tests/test-main.ts",
            "./src/tests/*.spec.ts",
            "./src/tests/**/*.spec.ts",
            "**/*.d.ts"
        ]
    }
    ```
    Here we extend the exiting configuration, but add in our test spec files.

1. Rename example.ts to example.spec.ts ( to conform to what we have entered in the previous step).
1. Configure webpack to use this new tsconfig.spec.json when we are running tests:

    In the webpack.config.js add
    ```ts
    	if (env.unitTesting == true) {

			webpack.chainWebpack((config) => {
				config.plugin("AngularWebpackPlugin").tap((args) => {
					args[0].tsconfig = "./tsconfig.spec.json";
					return args;
				});
			});
		}
    ```
    Here we are setting the tsconfig file to our specific test one when running tests ( in other words when ```env.unitTesting``` is true).

## Run the tests

Now we can execute the sample test.

1. Launch the android emulator
1. Execute ```ns test android```

    As you watch the simulator you will see that the tests run, and then the app exits.  It would be nice to see the app after it has executed so that we can look at the detail etc.

    In ```webpack.config.js``` add the following inside the chainwebpack call we added previously.
    ```js
        config.plugin('DefinePlugin').tap((args) => {

            args[0] = merge(args[0], {
            __TEST_RUNNER_STAY_OPEN__: true,
            });
            return args;
        });
    ```
    we need to require in the merge method at the top of the file.
    ```js
    const { merge } = require('webpack-merge');
    ```

    This sets a flag to keep the app running in the emulator after the test run has completed.

    Executing ```ns test android``` again you will see the tests have executed correctly.

    <image src="assets/TestsComplete.PNG" height="400">

## Setup Angular TestBed

The Service we created in our app is injected by angular into our controllers/components so we need to use Angular TestBed to test our components and have those services available to our tests.

1. Add setup code

    Add a new file in the ```tests``` folder named ```test-main.ts```

    Add the content

    ```ts
    import "@nativescript/core/globals";
    import "@nativescript/angular/polyfills";
    import "@nativescript/zone-js/dist/pre-zone-polyfills";
    import "zone.js";
    import "@nativescript/zone-js";
    import "zone.js/testing";
    import { TestBed } from "@angular/core/testing";
    import { NativeScriptTestingModule } from "@nativescript/angular/testing";
    import { platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing";

    TestBed.initTestEnvironment([NativeScriptTestingModule], platformBrowserDynamicTesting());

    ```
1. Update the karma.config.js for the new file

    Add ```tests/test-main.ts``` to the start of the ```filePatterns``` array.

1. Add our test for the doDemo method on our Search component.

    Add a new file ```angular-example.spec.ts``` to the ```tests``` folder
    Add the contents
    ```ts
    import { TestBed } from "@angular/core/testing";
    import { SearchComponent } from "../app/search/search.component";
    import { DemoService } from "../app/services/demo.service";
    import { Page } from "@nativescript/core";
    describe("search.component", () => {

        beforeEach(async () => {
            await TestBed.configureTestingModule({
                declarations: [SearchComponent],
                providers: [
                    DemoService, Page
                ]
            }).compileComponents();
        });

        it("should fail", async () => {
            const fixture = TestBed.createComponent(SearchComponent);
            const component = fixture.componentInstance as SearchComponent;
            expect(component.doDemo()).toEqual('angular-component-testing');
        });

        it("should succeed", async () => {
            const fixture = TestBed.createComponent(SearchComponent);
            const component = fixture.componentInstance as SearchComponent;
            expect(component.doDemo()).toEqual("correct message");
        });
    });

    ```
    * In the beforeEach we are setting up TestBed, telling it about our component and the providers required for it to function.
    * We have two tests, one will fail as it tests for the incorrect message.

    Running ```ns test android``` will now show our extra tests and that some fail.

    <image src="assets/TestsCompleteFail.PNG" height="400">

    As this is a live watch we can go ahead and change the "should fail" test to test for the correct value, save the file and see the tests now pass.

     <image src="assets/TestsCompleteFailOK.PNG" height="400">

## Sample Project

A sample project is available https://github.com/jcassidyav/nativescript-testing-demo

## Running Tests in a CI Environment

If you have a CI environment setup for your builds it is always great to have the tests also be a part of that, here are a couple of tips.

### Configure a reporter

Some CI Environments allow you to publish your tests results as part of the build, for example in Azure you can use the [Publish Test Task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=trx%2Cyaml) to publish the results.

For this you will need to configure a reporter so output the results of the tests.

1. In the karma.conf.js file add 'junit' to the list of reporters
1. Configure the reporter as desired

e.g.

```js
 reporters: ['progress', 'junit'],

    junitReporter: {
      outputDir: '../TestResults',
      outputFile: 'TESTS_RESULTS.xml'
    },

```

### Launch the emulator

A CI environment introduces challanges around launching/killing the instances of an emulator on which to run your tests.

* If your CI is setup to run only one test run at a time, it is a good idea to kill the emulator at the start and end of each run.
* Passing -no-window to emulator.exe results in a headless emulator
* You can use adb to poll the emulator until it is booted before trying to run your tests.

    e.g. On windows Powershell:
    ```powershell
    do {
         $outVar=cmd /c "C:\Android\android-sdk\platform-tools\adb.exe shell getprop sys.boot_completed" '2>&1'
         $outVar=$outVar.Split([Environment]::NewLine) | Select -First 1
         echo $outVar
         Start-Sleep -Seconds 10
      } Until ($outVar -eq "1")
    ```

repository: timdoege/nativescript-testing-demo

repo_name: timdoege/nativescript-testing-demo


text:
Norma Martinez
06.02.2021
Unit 12 MySQL Homework: Employee Tracker

For this assignment I attempted to create a Content Management System (CMS).  It was my goal to build a solution for managing a company's employees using node, inquirer and MySQL.  I used this design for my database schema:

* department:

  * id - INT PRIMARY KEY
  * name - VARCHAR(30) to hold department name

* role:

  * id - INT PRIMARY KEY
  * title -  VARCHAR(30) to hold role title
  * salary -  DECIMAL to hold role salary
  * department_id -  INT to hold reference to department role belongs to

* employee:

  * id - INT PRIMARY KEY
  * first_name - VARCHAR(30) to hold employee first name
  * last_name - VARCHAR(30) to hold employee last name
  * role_id - INT to hold reference to role employee has
  * manager_id - INT to hold reference to another employee that manages the employee being Created. This field may be null if the employee has no manager

Using this I attempted to build a command-line application that at a minimum allows the user to:

  * Add departments, roles, employees

  * View departments, roles, employees

  * Update employee roles

I had hoped to be able to accomplish some of the bonuses, but at this point it proved to be too daunting of a task.  I did use a seed file to populate my database.  One problem I ran into was that it displays the information in the database multiple times.  I hope to be able to continue working on this to make it function as required.  I know I didn't do multiple commits.  Once I started coding it felt wrong to upload something that I was unable to get running at least the bare minimum.

## Screenshots

![image1](https://user-images.githubusercontent.com/78131360/120918025-246d3500-c667-11eb-9877-80e858e3b494.png)
![image2](https://user-images.githubusercontent.com/78131360/120918027-2505cb80-c667-11eb-801b-6f445cddc08a.png)
![image3](https://user-images.githubusercontent.com/78131360/120918028-259e6200-c667-11eb-83a3-5a0d35af9d1d.png)

repository: AngyMtz/Employee-Tracker

repo_name: AngyMtz/Employee-Tracker


text:
# dgraph-client

A super simple, yet awesome client for dgraph using gRPC protocol.

#### Benefits:
 - Fast (gRPC)
 - no handling with NQuads, just set objects

### Example

```javascript
import DgraphClient from 'dgraph-client';

// create a new client
let client = new DgraphClient('localhost:8080');

// set objects
let me = {name: 'Paul', size: 1.85, time: Date.now()};
await client.set(me);

// query objects
let me = await client.query(`query { me(id:${me._uid_}) { name, size } }`);
// reponse is {me: {name: 'Paul', size: 1.85} }

// set also works with geojson
let me = {name: 'Paul', location: {type: 'Point', coordinates: [13.25, 52.14]}};

await client.set(me);

// and with nested objects
let me = {name: 'Paul', friends: [{name: 'Max'}, {_uid_: "0xd8450668580bf30f"}]};
await client.set(me);

```

repository: reicheltp/dgraph-client

repo_name: reicheltp/dgraph-client


text:
# cookiedough

This is an experiment I started on a slow Netbook (Intel) back in 2006, if I recall correctly, to do some really retro (demoscene) graphical effects.

WARNING 1: last project being made was our Revision 2023 PC entry "Arrested Development" by Bypass - cleanup session planned after I branch off.
WARNING 2: OSX build files aren't necessarily easy to get to work; read through 'code/main.cpp' and follow the bread crumbs; I'll fix that when I've got time (see issue list).

Supported platforms as of 20/04/2023:
- Win64/x64 (builds out of the box with MSVC 2019 or higher)
- OSX/x64 (builds with some effort, might be fixed soon)
- OSX/Silicon (should build with little effort if you follow instructions)
- Linux, courtesy of Erik 'Kusma' Faye-Lund

As of 26/04/2023 Linux should also be supported, thank you Erik Faye-Lund.

For OSX preferably something like Visual Studio Code (using all the suggested extensions: C++, CMake, CMake tools, Makefile and
perhaps a few more, Code will tell you what you need) which in turn through CMake will enable VSCode to build, run, debug and
soforth. If VSCode is misbehaving, resort to LLDB on the command line or retain your sanity and use a Windows machine and MSVC
to do your debugging. It's always wise to run the Windows debug build before releasing anything, just to be sure.

Do realize that you need to run a GNU Rocket client locally (or if you've modified '/code/rocket.cpp' perhaps on another
machine); if it can't connect it will time out and quit.

DISCLAIMER: this code has been in tinkered with since 17 years back and I'm trying to straighten it out and modernize
the use of C++ mostly but it will be an 'as we go' process. It started as a pure C 'whatever let's have some fun' project.

Check '/code/main.cpp' for a list of third party libraries used and some more useful hints (certainly if you want to build it yourself).

repository: visualizersdotnl/cookiedough

gha_license_id: NOASSERTION

repo_name: visualizersdotnl/cookiedough


text:
---
title: "How to import comments from Disqus to Vuukle in Wordpress"
date: 2017-05-01T22:12:03.284Z
category: "FAQ"
tags:

    - how to
    - import comments
    - from disqus

path: "/how-to-import-comments-form-disqus/"
shortDescription: "You installed Vuukle and need all your previous comments from Disqus imported?

Just press 1 button and we will handle the rest :)"
---

You installed Vuukle and need all your previous comments from Disqus imported?

Just press 1 button and we will handle the rest :)

# How to import comments from Disqus to Vuukle in Wordpress

To import comments just follow this steps:

1. [Synchronize your comments and back it up to your Wordpress website from Disqus](https://help.disqus.com/import-export-and-syncing/syncing-with-wordpress)
2.
3. Click on the 'Send comment Export to Vuukle Team' button and within 48 hours we will import your comments to the Vuukle .

![enable transliteration with wp 01](/img/how-to-import-comments-form-disqus-img-1.png)

Or click the 'Download File' button to export as a Zip-archive.

![enable transliteration with wp 04](/img/how-to-import-comments-form-disqus-img-4.png)

## There is second way you can do it

1. [Export your comments directly from Disqus](https://help.disqus.com/developer/comments-export).
2. Send us the file on<EMAIL_ADDRESS>with URL to your site in Subject field.
3. We will handle the rest :)

repository: homearanya/testing-site

gha_language: JavaScript

repo_name: homearanya/testing-site


text:
# Pseudocercospora puerariicola (W. Yamam.) Deighton, 1976 SPECIES

#### Status
ACCEPTED

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

#### Published in
Mycol. Pap. 140: 151 (1976)

#### Original name
Cercospora puerariicola W. Yamam., 1934

### Remarks
null


text:
# Reporting statistics

In this chapter, I'll give a few examples for how to report statistical analysis.

## General advice

Here is some general advice first:

1. Make good figures!
2. Use statistical models to answer concrete research questions.
3. Illustrate the uncertainty in your statistical inferences.
4. Report effect sizes.

### Make good figures!

Chapters \@ref(visualization-1) and \@ref(visualization-2) go into how to make figures and also talk a little bit about what makes for a good figure. Personally, I like it when the figures give me a good sense for the actual data. For example, for an experimental study, I would like to get a good sense for the responses that participants gave in the different experimental conditions.

Sometimes, papers just report the results of statistical tests, or only visually display estimates of the parameters in the model. I'm not a fan of that since, as we've learned, the parameters of the model are only useful in so far the model captures the data-generating process reasonably well.
### Use statistical models to answer concrete research questions.

Ideally, we formulate our research questions as statistical models upfront and pre-register our planned analyses (e.g. as an RMarkdown script with a complete analysis based on simulated data). We can then organize the results section by going through the sequence of research questions. Each statistical analysis then provides an answer to a specific research question.

### Illustrate the uncertainty in your statistical inferences.

For frequentist statistics, we can calculate confidence intervals (e.g. using bootstrapping) and we should provide these intervals together with the point estimates of the model's predictors.

For Bayesian statistics, we can calculate credible intervals based on the posterior over the model parameters.

Our figures should also indicate the uncertainty that we have in our statistical inferences (e.g. by adding confidence bands, or by showing some samples from the posterior).

### Report effect sizes.

Rather than just saying whether the results of a statistical test was significant or not, you should, where possible, provide a measure of the effect size. Chapter \@ref(power-analysis) gives an overview of commonly used measures of effect size.


text:
# Laravel Leaflet JS - Aplikasi Dirosa

This is an project for [Leaflet JS](https://leafletjs.com) and [OpenStreetMap](https://www.openstreetmap.org) built with Laravel 6.0.

![Laravel Leaflet JS Project Example](public/screenshots/capture.PNG)

## Features

In this project, we have an Halaqah Dirosa Management (CRUD) with location/coordinate point that shown in map.
### Leaflet config

We have a `config/leaflet.php` file in this project. Set default **zoom level** and **map center** coordinate here (or in `.env` file).

```php
<?php

return [
    'zoom_level'           => 13,
    'detail_zoom_level'    => 16,
    'map_center_latitude'  => env('MAP_CENTER_LATITUDE', '-5.1609734'),
    'map_center_longitude' => env('MAP_CENTER_LONGITUDE', '119.4760907'),
];
```

> Please note that this is not an official or required config file from Leaflet JS, it is just a custom config for this project.

## License

This project is open-sourced software licensed under the [MIT license](LICENSE).

repository: mashurimansur/dirosa

gha_language: HTML

repo_name: mashurimansur/dirosa


text:
Inox 0.1 [![Build Status](http://laraquad4.epfl.ch:9000/epfl-lara/inox/status/master)](http://laraquad4.epfl.ch:9000/epfl-lara/inox)
==========

InOx
----

InOx has no rust.
InOx we trust!

![InOx](./InOxWeTrust.jpg?raw=true "InOx We Trust")

To build InOx, you will need JDK, scala, sbt, and some external solver binaries.
On Linux, it should already work out of the box.

To get started, see the documentation chapters, such as
  * [Getting Started](src/sphinx/gettingstarted.rst)
  * [Installation](src/sphinx/installation.rst)
  * [Introduction to Inox](src/sphinx/intro.rst)

repository: ptrbman/inox

repo_name: ptrbman/inox


text:
# Triangles Console App

#### Epicodus C#: 06/26/2018

#### By Rita Bennett-Chew

## Description

Create a Triangle class that takes 3 numbers, each representing the side of a triangle, and tell whether they form an equilateral (all sides equal), isosceles (2 sides equal), or scalene (no sides equal) triangle. Note that if any side is longer than the other 2 combined, the lengths do not make a triangle

## Setup/Contribution Requirements

1. Clone the repo
1. Make a new branch
1. Commit and push your changes
1. Create a PR

## Technologies Used

* Bootstrap x.x.x
* jQuery 3.3.1
* C#
* Mono

## Steps
* Set up file, Triangle class
* Take user input for three sides
* Make properties private and create getters and setters
* Determine if the 3 sides make a triangle
* Determine which type of triangle they make

## License

This software is licensed under the MIT license.

Copyright (c) 2018 **Rita Bennett-Chew**

repository: ritabc/triangles

repo_name: ritabc/triangles


text:
[![Build Status](https://travis-ci.org/yandex-money-tech/db-queue.svg?branch=master)](https://travis-ci.org/yandex-money-tech/db-queue)
[![Build status](https://ci.appveyor.com/api/projects/status/2ee4wumomugjnnl7?svg=true)](https://ci.appveyor.com/project/f0y/db-queue)
[![codecov](https://codecov.io/gh/yandex-money-tech/db-queue/branch/master/graph/badge.svg)](https://codecov.io/gh/yandex-money-tech/db-queue)
[![Codebeat](https://codebeat.co/badges/ff7a4c21-72fb-446c-b245-ba739240fe49)](https://codebeat.co/projects/github-com-yandex-money-db-queue-master)
[![Codacy](https://api.codacy.com/project/badge/Grade/78c05240110c427f873895a5a3ee1eae)](https://www.codacy.com/project/f0y/db-queue/dashboard?utm_source=github.com&utm_medium=referral&utm_content=yandex-money-tech/db-queue&utm_campaign=Badge_Grade_Dashboard)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Javadoc](https://img.shields.io/badge/javadoc-latest-blue.svg)](https://yandex-money-tech.github.io/db-queue/)
[![Download](https://api.bintray.com/packages/yandex-money-tech/maven/db-queue/images/download.svg)](https://bintray.com/yandex-money-tech/maven/db-queue/_latestVersion)
# Database Queue

Library provides worker-queue implementation on top of Java and database.

## Why?

There are several reasons:

* You need simple, efficient and flexible task processing tool which supports delayed job execution.
* You already have a database and don't want to introduce additional tools
in your infrastructure (for example Kafka, RabbitMq, ...)
* You have somewhat small load. This worker queue mechanism can handle
more than 1000 rps on single database and table. Moreover you can shard your database and get horizontal scalability.
However we cannot guarantee that it would be easy to auto scale or handle more than 1000 rps.
* You require strong guaranties for task delivery or processing. Library offers at-least-once delivery semantic.

## How it works?

1. You have a task that you want to process later.
2. You tell [QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) to schedule the task.
3. [QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) chooses a database shard through [QueueShardRouter](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueShardRouter.html).
4. [QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) converts the task payload to string representation through [TaskPayloadTransformer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/TaskPayloadTransformer.html).
5. [QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) inserts the task in the database through [QueueDao](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/dao/QueueDao.html).
6. ... the task has been selected from database in specified time ...
7. The task payload is converted to typed representation through [TaskPayloadTransformer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/TaskPayloadTransformer.html).
8. The task is passed to the [QueueConsumer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueConsumer.html) instance in order to be processed.
9. You process the task and return processing result.

## Features

* Persistence working-queue
* Support for PostgreSQL with version higher or equal to 9.5.
* Storing queue tasks in a separate tables or in the same table ([QueueLocation](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/QueueLocation.html)).
* Storing queue tasks in a separate databases for horizontal scaling ([QueueShardRouter](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueShardRouter.html)).
* Delayed task execution.
* At-least-once task processing semantic.
* Several retry strategies in case of a task processing error ([TaskRetryType](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/TaskRetryType.html)).
* Task event listeners ([TaskLifecycleListener](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/TaskLifecycleListener.html), [ThreadLifecycleListener](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/ThreadLifecycleListener.html)).
* Strong-typed api for task processing and enqueuing ([TaskPayloadTransformer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/TaskPayloadTransformer.html)).
* Several task processing modes ([ProcessingMode](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/ProcessingMode.html)).

## Dependencies

Library supports only PostgreSQL as backing database, however library architecture
makes it easy to add other databases which has "skip locked" feature.

Furthermore, library requires Spring Framework (spring-jdbc and spring-tx) for interacting with database.
Spring-context is used only for alternative configuration and can be safely excluded from runtime dependencies.

# Usage

## Versioning Rules

Project uses [Semantic Versioning](http://semver.org/).

## Dependency management

Library is available on [Bintray's JCenter repository](http://jcenter.bintray.com)

```
<dependency>
  <groupId>com.yandex.money.tech</groupId>
  <artifactId>db-queue</artifactId>
  <version>7.0.0</version>
</dependency>
```

## Configuration

* Create table (with index) where tasks will be stored.
```sql
CREATE TABLE queue_tasks (
  id                BIGSERIAL PRIMARY KEY,
  queue_name        VARCHAR(128) NOT NULL,
  task              TEXT,
  create_time       TIMESTAMP WITH TIME ZONE DEFAULT now(),
  process_time      TIMESTAMP WITH TIME ZONE DEFAULT now(),
  attempt           INTEGER                  DEFAULT 0,
  reenqueue_attempt INTEGER                  DEFAULT 0,
  total_attempt     INTEGER                  DEFAULT 0,
  actor             VARCHAR(128),
  log_timestamp     TEXT
) WITH (fillfactor = 80);
CREATE INDEX queue_tasks_name_time_desc_idx
  ON queue_tasks (queue_name, process_time, id DESC);
```
* Specify a queue configuration through [QueueConfig](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/QueueConfig.html) instance (or use [QueueConfigsReader](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/QueueConfigsReader.html)).
  * Choose name for the queue.
  * Specify [betweenTaskTimeout](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/QueueSettings.html#getBetweenTaskTimeout) and [noTaskTimeout](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/QueueSettings.html#getNoTaskTimeout) settings.
* Use manual or spring-auto configuration.

### Manual configuration

Manual configuration may be used in cases where you don't have spring context.
It offers more flexibility than spring configuration.
Example - [example.ManualConfiguration](https://github.com/yandex-money/db-queue/blob/master/src/test/java/example/ManualConfiguration.java).

Main steps to create manual configuration:

* Implement [QueueShardRouter](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueShardRouter.html) interface
* Implement [TaskPayloadTransformer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/TaskPayloadTransformer.html) interface or use [NoopPayloadTransformer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/impl/NoopPayloadTransformer.html).
* Implement [QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) interface or use [TransactionalProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/impl/TransactionalProducer.html).
* Implement [QueueConsumer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueConsumer.html) interface.
* Create [QueueRegistry](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/init/QueueRegistry.html) and register [QueueConsumer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueConsumer.html) and [QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) instances.
* Create [QueueExecutionPool](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/init/QueueExecutionPool.html) and start it.

### Spring-Auto Configuration

Spring configuration is more lightweight than manual configuration.
Example - [example.SpringAutoConfiguration](https://github.com/yandex-money-tech/db-queue/blob/master/src/test/java/example/SpringAutoConfiguration.java).

Spring configuration can be divided in two parts:

* Base configuration. You may put it in your common code - _example.SpringAutoConfiguration.Base_
* Client configuration specifies how your queues will work - _example.SpringAutoConfiguration.Client_

Base configuration includes several beans:

* [SpringQueueConfigContainer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/spring/SpringQueueConfigContainer.html) - Provides settings for all queues in your spring context.
* [SpringQueueCollector](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/spring/SpringQueueCollector.html) - Collects beans related to spring configuration.
* [SpringQueueInitializer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/spring/SpringQueueInitializer.html) - Wires queue beans to each other and starts queues.

In client configuration you must use classes with prefix Spring.

## Project structure

* internal

Internal classes. **Not for public use**.

*Backward compatibility for classes in that package may be broken in any release*

* [api](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/package-frame.html)

You should provide implementation for interfaces in that package.
The package contains classes which are involved in processing or enqueueing tasks.

* [api.impl](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/impl/package-frame.html)

Default implementation for api interfaces. Allows easy configuration in common use cases.

* [settings](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/settings/package-frame.html)

Queue settings.

* [dao](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/dao/package-frame.html)

Additional classes for queue managing and statistics retrieval.
In common use cases you don't need to use that classes.

* [init](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/init/package-frame.html)

Registration and running queues.

* [spring](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/spring/package-frame.html)

Classes related to Spring configuration.

* [spring.impl](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/spring/impl/package-frame.html)

Default implementation for Spring configuration. Allows easy configuration in common use cases.

## Database Tuning

### PostgreSQL

You should always analyze your database workload before applying
this recommendations.

#### Fill Factor

You need to set a low fill-factor for table in order to
let database put row updates to the same page.
In that case database will need less amount of random page writes.
This technique also prevents fragmentation so we get more robust selects.
Same rules are applied to an indexes. You can safely set fill-factor
for tables and indexes to 70%.

#### Autovacuum

You need to make autovacuum more aggressive in order to eliminate dead tuples.
Dead tuples leads to excessive page reads because they occupy space
that can be reused by active tuples. Autovacuum can be configured in many ways,
for example, you can set
[scale-factor](https://www.postgresql.org/docs/current/static/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-SCALE-FACTOR) to 1%.

# Known Issues

* Retry strategies cannot be defined by a user

In some cases a you may want to use different retry strategies.
For example, do first retry almost immediately and then use standard behaviour.
Library does not support this type of customization.

* Uneven load balancing

One of the hosts can consequently process several tasks very quickly while other hosts are sleeping.

* Max throughput is limited by "between task timeout"

Thread falls asleep for "between task timeout" regardless of task processing result.
Although, it can pick next task after successful result and do processing.

* No support for Blue-green deployment

There is no support for blue-green deployment because a task is not bound to a host or to a group of hosts.

* No support for failover.

[QueueProducer](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/api/QueueProducer.html) can fail on task scheduling. You can manually detect that fail is caused by database
and try insert task on next shard.

* Hard to write tests.

Task processing is asynchronous. Therefore, it is hard to write tests because you always must think about that fact
and write code according to it. To ease development of tests you can use `wakeup` method of [QueueExecutionPool](https://yandex-money-tech.github.io/db-queue/ru/yandex/money/common/dbqueue/init/QueueExecutionPool.html)

# How To Build

You can look at Travis (`.travis.yml`) or AppVeyor (`appveyor.yml`) configuration.
We have two gradle build files. There are `build.gradle`, `gradlew`, `gradle/wrapper` for Yandex.Money infrastructure and
`build-public.gradle`, `gradlew-public`, `gradle-public/wrapper` for configuration outside of private network.

# How To Import Project in IDE

Unfortunately, there is a bug in IntelliJ IDEA (https://github.com/f0y/idea-two-gradle-builds) so you have to replace
`gradle-public/wrapper/gradle-wrapper.properties` with `gradle/wrapper/gradle-wrapper.properties` and
`build-public.gradle` with `build.gradle` before importing.

repository: kennywest/db-queue

repo_name: kennywest/db-queue


text:
vagrant-xnat-ldap
============

Provision Ubuntu 14.04 based Vagrant box with XNAT 1.6.4 linked to a local openldap directory.

### Dependencies:
* VirtualBox
* Vagrant

### Installation:
```bash
git clone git@github.com:mattsouth/vagrant-xnat-ldap.git
cd vagrant-xnat-ldap
vagrant up
```

Once the Vagrant box is up and running XNAT is available at http://<IP_ADDRESS>:8080/xnat

To read or write to the directory you will need to logon with the User DN 'dc=admin,dc=test,dc=net' and password 'adminpassword'

### Change IP address of Vagrant box:
* Change xdat.url option in build.properties
* Change config.vm.network option in Vagrantfile

repository: mattsouth/vagrant-xnat-ldap

repo_name: mattsouth/vagrant-xnat-ldap


text:
# go-webserver-cluster-demo

- [go-webserver-cluster-demo](#go-webserver-cluster-demo)
  - [Introduction](#introduction)
    - [Example of information visible](#example-of-information-visible)
    - [Result of a rollout to a multi-region (anycasted) Kubernetes cluster](#result-of-a-rollout-to-a-multi-region-anycasted-kubernetes-cluster)
  - [Distribution](#distribution)
  - [Quickstart Kubernetes deployment](#quickstart-kubernetes-deployment)
  - [Environment Variables available](#environment-variables-available)
  - [HTTP Headers available](#http-headers-available)
  - [Custom installation](#custom-installation)
  - [Contributing](#contributing)

## Introduction
This is a very simple webserver written in Go that outputs information via HTML and headers about the running environment such as the hostname / node it's running on. Additionally it can have environment variables configured to set the page title and cluster name.

This is designed to be used with Kubernetes deployments in a cluster or multiple clusters to see if they're working and to print unique information for that cluster. A use case for example is to deploy this to a multi-region anycasted solution in Kubernetes. You could then use https://www.dotcom-tools.com/website-speed-test.aspx (not sponsored) for example to check the resulting screenshots there to see if your routing is working correctly world wide.

### Example of information visible
![alt text](https://raw.githubusercontent.com/vvdaal/go-webserver-cluster-demo/master/docs/exampleinformation.png "Example of information visible")

### Result of a rollout to a multi-region (anycasted) Kubernetes cluster
![alt text](https://raw.githubusercontent.com/vvdaal/go-webserver-cluster-demo/master/docs/example_checking_deployments.gif "Result of a rollout to a multi-region (anycasted) Kubernetes cluster")

## Distribution
The code here is automatically build into a docker image and distributed to https://hub.docker.com/r/vhwdev/go-webserver-cluster-demo

## Quickstart Kubernetes deployment
Copy paste the below to your terminal.

```bash
kubectl apply -f https://raw.githubusercontent.com/vvdaal/go-webserver-cluster-demo/master/examples/kubernetes/001-namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/vvdaal/go-webserver-cluster-demo/master/examples/kubernetes/002-deployments.yaml
kubectl apply -f https://raw.githubusercontent.com/vvdaal/go-webserver-cluster-demo/master/examples/kubernetes/003-services.yaml
kubectl apply -f https://raw.githubusercontent.com/vvdaal/go-webserver-cluster-demo/master/examples/kubernetes/004-ingress.yaml
```

This requires a working, configured and authenticated kubectl and will create a new namespace called "cluster-demo" within your Kubernetes cluster together with a deployment, service and ingress of this application using the public Docker image. The ingress is configured to listen on port 8080 by default.

## Environment Variables available

|Environment Variable | Default value |
|---|---|
| ListenPort | 8080 |
| ClusterName | - |
| PageTitle | Demo test page |

## HTTP Headers available

The following HTTP headers are available with the corresponding information

| HTTP Header name | Value |
|---|---|
| Origin-Cluster-Name | Output of environment value "ClusterName" |
| Origin-Hostname | Output of the hostname |

## Custom installation

For a custom installation or to modify the templates used in the Quickstart Kubernetes deployment, simple check-out this repository and make any modifications you want locally. Feel free to also build the image yourself with any customization and put it in a private repository if you so desire.

## Contributing

Have a great idea to add as information on the webserver? Please open a new branch and create a merge request against master.

repository: vvdaal/go-webserver-cluster-demo

gha_language: Go

repo_name: vvdaal/go-webserver-cluster-demo


text:
# tokasdk.SSLCertificateManagementApi

All URIs are relative to *https://LS200VE-Controller/tokalabs/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**configure_custom_certificate**](SSLCertificateManagementApi.md#configure_custom_certificate) | **POST** /ssl/customCertificate | Configures the Tokalabs controller to use a new certificate (and private key associated with the certificate)
[**configure_self_signed_certificate**](SSLCertificateManagementApi.md#configure_self_signed_certificate) | **POST** /ssl/selfSignedCertificate | Generate a new self-signed SSL certificate and configure the Tokalabs server to use this newly generated self-signed SSL certificate
[**generate_csr**](SSLCertificateManagementApi.md#generate_csr) | **POST** /ssl/csr | Generate a new certificate signing request (CSR) and a private key associated with the CSR

# **configure_custom_certificate**
> TokaAPIResponse configure_custom_certificate(cert_file=cert_file, key_file=key_file)

Configures the Tokalabs controller to use a new certificate (and private key associated with the certificate)

Configures the Tokalabs controller to use a new certificate (and private key associated with the certificate)

### Example

* Api Key Authentication (ApiKeyAuth):
```python
from __future__ import print_function
import time
import tokasdk
from tokasdk.rest import ApiException
from pprint import pprint
configuration = tokasdk.Configuration()
# Configure API key authorization: ApiKeyAuth
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# Defining host is optional and default to https://LS200VE-Controller/tokalabs/api
configuration.host = "https://LS200VE-Controller/tokalabs/api"
# Create an instance of the API class
api_instance = tokasdk.SSLCertificateManagementApi(tokasdk.ApiClient(configuration))
cert_file = 'cert_file_example' # str |  (optional)
key_file = 'key_file_example' # str |  (optional)

try:
    # Configures the Tokalabs controller to use a new certificate (and private key associated with the certificate)
    api_response = api_instance.configure_custom_certificate(cert_file=cert_file, key_file=key_file)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SSLCertificateManagementApi->configure_custom_certificate: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **cert_file** | **str**|  | [optional]
 **key_file** | **str**|  | [optional]

### Return type

[**TokaAPIResponse**](TokaAPIResponse.md)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json, text/html; charset=UTF-8

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Request was successfully serviced |  -  |
**201** | New resource was successfully created |  -  |
**202** | Request was successfully received and is being serviced. |  -  |
**400** | Request was malformed |  -  |
**401** | Request did not include a valid authentication token |  -  |
**403** | Request includes a valid authentication token but the token in unauthorized to perform the requested action |  -  |
**404** | Resource was not found on the server |  -  |
**409** | Resource could not be created as another resource with the same name already exists |  -  |
**500** | Unexpected error occurred while processing the request |  -  |

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

# **configure_self_signed_certificate**
> TokaAPIResponse configure_self_signed_certificate()

Generate a new self-signed SSL certificate and configure the Tokalabs server to use this newly generated self-signed SSL certificate

Generate a new self-signed SSL certificate and configure the Tokalabs server to use this newly generated self-signed SSL certificate

### Example

* Api Key Authentication (ApiKeyAuth):
```python
from __future__ import print_function
import time
import tokasdk
from tokasdk.rest import ApiException
from pprint import pprint
configuration = tokasdk.Configuration()
# Configure API key authorization: ApiKeyAuth
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# Defining host is optional and default to https://LS200VE-Controller/tokalabs/api
configuration.host = "https://LS200VE-Controller/tokalabs/api"
# Create an instance of the API class
api_instance = tokasdk.SSLCertificateManagementApi(tokasdk.ApiClient(configuration))

try:
    # Generate a new self-signed SSL certificate and configure the Tokalabs server to use this newly generated self-signed SSL certificate
    api_response = api_instance.configure_self_signed_certificate()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SSLCertificateManagementApi->configure_self_signed_certificate: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**TokaAPIResponse**](TokaAPIResponse.md)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, text/html; charset=UTF-8

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Request was successfully serviced |  -  |
**201** | New resource was successfully created |  -  |
**202** | Request was successfully received and is being serviced. |  -  |
**400** | Request was malformed |  -  |
**401** | Request did not include a valid authentication token |  -  |
**403** | Request includes a valid authentication token but the token in unauthorized to perform the requested action |  -  |
**404** | Resource was not found on the server |  -  |
**409** | Resource could not be created as another resource with the same name already exists |  -  |
**500** | Unexpected error occurred while processing the request |  -  |

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

# **generate_csr**
> file generate_csr(generate_csr_request=generate_csr_request)

Generate a new certificate signing request (CSR) and a private key associated with the CSR

Generate a new certificate signing request (CSR) and a private key associated with the CSR

### Example

* Api Key Authentication (ApiKeyAuth):
```python
from __future__ import print_function
import time
import tokasdk
from tokasdk.rest import ApiException
from pprint import pprint
configuration = tokasdk.Configuration()
# Configure API key authorization: ApiKeyAuth
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# Defining host is optional and default to https://LS200VE-Controller/tokalabs/api
configuration.host = "https://LS200VE-Controller/tokalabs/api"
# Create an instance of the API class
api_instance = tokasdk.SSLCertificateManagementApi(tokasdk.ApiClient(configuration))
generate_csr_request = tokasdk.GenerateCSRRequest() # GenerateCSRRequest |  (optional)

try:
    # Generate a new certificate signing request (CSR) and a private key associated with the CSR
    api_response = api_instance.generate_csr(generate_csr_request=generate_csr_request)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SSLCertificateManagementApi->generate_csr: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **generate_csr_request** | [**GenerateCSRRequest**](GenerateCSRRequest.md)|  | [optional]

### Return type

**file**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/zip, application/json, text/html; charset=UTF-8, application/pdf

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Certificate and key as zip file |  -  |
**201** | New resource was successfully created |  -  |
**202** | Request was successfully received and is being serviced. |  -  |
**400** | Request was malformed |  -  |
**401** | Request did not include a valid authentication token |  -  |
**403** | Request includes a valid authentication token but the token in unauthorized to perform the requested action |  -  |
**404** | Resource was not found on the server |  -  |
**409** | Resource could not be created as another resource with the same name already exists |  -  |
**500** | Unexpected error occurred while processing the request |  -  |
**0** | Downloadable certificate and key as zip file |  -  |

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

repository: Tokalabs/tokasdk

repo_name: Tokalabs/tokasdk


text:
# Using Micronaut Data JPA to Simplifiy Data Repositories

## Introduction
In this lab you will learn how to define Data access repository interfaces that simplify your database access code using JPA.

> IMPORTANT If you have already completed the previous lab on Micronaut Data JDBC you can skip this lab and go onto the next lab directly.

Estimated Lab Time: 20 minutes

### Objectives

In this lab you will:
* Learn how to write repository interfaces
* Query the database with the repository interfaces
* Learn how to write custom JPA-QL queries

### Prerequisites

- Access to your project instance
- Basic knowledge of JPA and JPA-QL

## Configuring Micronaut Data JPA

To configure Micronaut Data JPA, add the following dependencies to your `build.gradle` file's `dependencies` block:

    <copy>
    annotationProcessor("io.micronaut.data:micronaut-data-processor")
    implementation("io.micronaut.data:micronaut-data-hibernate-jpa")
    </copy>

Or if you are using Maven, first add the `micronaut-data-jpa` dependency under `<dependencies>`:

    <copy>
    <dependency>
        <groupId>io.micronaut.data</groupId>
        <artifactId>micronaut-data-hibernate-jpa</artifactId>
        <scope>compile</scope>
    </dependency>
    </copy>

Then add `micronaut-data-processor` under `<annotationProcessorPaths>`:

    <copy>
    <path>
      <groupId>io.micronaut.data</groupId>
      <artifactId>micronaut-data-processor</artifactId>
      <version>${micronaut.data.version}</version>
    </path>
    </copy>

Before proceeding you should refresh your project dependencies:

![Project Dialog](../images/dependency-refresh.png)

Now add the following configuration to your `src/main/resources/application.yml` file:

    <copy>
    jpa:
      default:
        entity-scan:
          enabled: true
    </copy>

This enables the lookup of entities from metadata produced at compilation time (avoiding a full classpath scan).

## Mapping Entities to Database Tables

To map entities to the underlying databse tables, simply define classes that match the table names (the default convention is underscore-separated lowercase, but this is configurable) and annotate them with `javax.persistence.Entity`.

For example try and alter the existing `Owner` class as follows:

    <copy>
    package example.micronaut;

    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.validation.constraints.Min;
    import javax.validation.constraints.NotBlank;

    @Entity
    public class Owner {

        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Long id;

        @NotBlank
        private String name;

        @Min(18)
        private int age;

        public Owner() {
        }

        public Owner(String name, int age) {
            this.name = name;
            this.age = age;
        }

        public void setName(String name) {
            this.name = name;
        }

        public void setAge(int age) {
            this.age = age;
        }

        public String getName() {
            return name;
        }

        public int getAge() {
            return age;
        }

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }
    }
    </copy>

> NOTE: Hibernate/JPA requires a public no-args constructor and getters/setters for each property. You will need to correct the compilation errors in your project as a result of removing the constructor.

Now create a new class that represents the `Pet` entity in a file called `src/main/java/example/micronaut/Pet.java`:

    <copy>
    package example.micronaut;

    import edu.umd.cs.findbugs.annotations.NonNull;

    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.ManyToOne;

    @Entity
    public class Pet {

        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Long id;

        private String name;

        @ManyToOne
        private Owner owner;

        private PetHealth health = PetHealth.VACCINATED;

        public Pet() {
        }

        public Pet(String name, @NonNull Owner owner) {
            this.name = name;
            this.owner = owner;
        }

        public void setName(String name) {
            this.name = name;
        }

        public void setOwner(Owner owner) {
            this.owner = owner;
        }

        public Owner getOwner() {
            return owner;
        }

        public String getName() {
            return name;
        }

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public PetHealth getHealth() {
            return health;
        }

        public void setHealth(PetHealth health) {
            this.health = health;
        }

        public enum PetHealth {
            VACCINATED,
            REQUIRES_VACCINATION
        }
    }
    </copy>

The `Pet` class maps to the `pet` table and includes a `@ManyToOne` relationship to the `Owner`. An `enum` is used to represent the health of the `Pet`.

## Defining Repository Interfaces

The next step is to define data access repository interfaces. First define an `OwnerRepository` in a file called `src/main/java/example/micronaut/OwnerRepository.java`:

    <copy>
    package example.micronaut;

    import edu.umd.cs.findbugs.annotations.NonNull;
    import io.micronaut.data.annotation.Repository;
    import io.micronaut.data.repository.CrudRepository;

    import java.util.Collection;

    @Repository
    public interface OwnerRepository extends CrudRepository<Owner, Long> {
        @NonNull
        @Override
        Collection<Owner> findAll();
    }
    </copy>

The `@Repository` annotation designates this interface as a data access repository.

Define another repository interface to manage instances of `Pet` in a file called `src/main/java/example/micronaut/PetRepository.java`:

    <copy>
    package example.micronaut;

    import io.micronaut.data.annotation.Repository;
    import io.micronaut.data.repository.CrudRepository;

    @Repository
    public interface PetRepository extends CrudRepository<Pet, Long> {
    }
    </copy>

Both of these repository interfaces extend from [CrudRepository](https://micronaut-projects.github.io/micronaut-data/latest/api/io/micronaut/data/repository/CrudRepository.html) which contains methods to perform Create, Read, Update and Delete operations.

## Writing Data

To see these in action, let's first modify the `OwnerConfiguration` and add a `pets` property to model each pet an initial `Owner` can have:

    <copy>
    private List<String> pets = Collections.emptyList();

    public List<String> getPets() {
        return pets;
    }

    public void setPets(List<String> pets) {
        this.pets = pets;
    }
    </copy>

You'll also need these imports:

    <copy>
    import java.util.Collections;
    import java.util.List;
    </copy>

Now modify `application.yml` to include some pets for each initial `Owner`:

    <copy>
    owners:
      fred:
        name: Fred
        age: 35
        pets:
          - Dino
          - Baby Puss
      barney:
        name: Barney
        age: 30
        pets:
          - Hoppy
    </copy>

Finally re-write the `OwnerService` which currently uses an in-memory collection to instead use the data access repository:

    <copy>
    package example.micronaut;

    import io.micronaut.context.event.StartupEvent;
    import io.micronaut.runtime.event.annotation.EventListener;

    import javax.inject.Singleton;
    import javax.transaction.Transactional;
    import java.util.Collection;
    import java.util.List;
    import java.util.stream.Collectors;

    @Singleton
    public class OwnerService implements OwnerOperations {
        private final OwnerRepository ownerRepository;
        private final PetRepository petRepository;
        private final List<OwnerConfiguration> ownerConfigurations;

        OwnerService(OwnerRepository ownerRepository,
                     PetRepository petRepository,
                     List<OwnerConfiguration> ownerConfigurations) {
            this.ownerRepository = ownerRepository;
            this.petRepository = petRepository;
            this.ownerConfigurations = ownerConfigurations;
        }

        @EventListener
        @Transactional
        void init(StartupEvent startupEvent) {
            if (ownerRepository.count() == 0) {
                for (OwnerConfiguration ownerConfiguration : ownerConfigurations) {
                    Owner owner = ownerConfiguration.create();
                    ownerRepository.save(owner);
                    List<Pet> pets = ownerConfiguration.getPets().stream().map(n ->
                            new Pet(n, owner)
                    ).collect(Collectors.toList());
                    petRepository.saveAll(pets);
                }
            }
        }

        @Override
        @Logged
        public Collection<Owner> getInitialOwners() {
            return ownerRepository.findAll();
        }

        @Override
        @Transactional
        public void addOwner(Owner owner) {
            ownerRepository.save(owner);
        }
    }
    </copy>

There are a few important aspects to note about this code. First, to create the initial set of `Owner` instances the logic has been moved into an `init` method that is annotated with [@EventListener](https://docs.micronaut.io/latest/api/io/micronaut/runtime/event/annotation/EventListener.html) and receives [StartupEvent](https://docs.micronaut.io/latest/api/io/micronaut/context/event/StartupEvent.html). This ensures that the initialization logic is executed when the `ApplicationContext` first starts. See the section on [Context Events](https://docs.micronaut.io/latest/guide/index.html#contextEvents) in the Micronaut documentation for further information.

Secondly the `init` method is annotated with `javax.transaction.Transactional`, which ensures that the method executes within the context of a database transaction and changes will be rolled back if an exception occurs during the execution of the method.

The remainder of the methods of `OwnerService` have been rewritten to use methods that read and write to the database.

## Implementing Query Methods

Micronaut Data makes implementing query methods a breeze. To demonstrate this add a few new methods to the `OwnerOperations` interface:

    <copy>
    // lookup by owner and pet name
    Pet getPet(String owner, String pet);

    // lookup all by owner
    Collection<Pet> getPets(String owner);

    // lookup all by owner and health
    Collection<Pet> getPetsWithHeath(String owner, Pet.PetHealth health);
    </copy>

Now modify the `PetRepository` data access repository interface to include methods that implement these different use cases:

    <copy>
    package example.micronaut;

    import io.micronaut.data.annotation.Join;
    import io.micronaut.data.annotation.Repository;
    import io.micronaut.data.repository.CrudRepository;

    import java.util.Collection;

    @Repository
    public interface PetRepository extends CrudRepository<Pet, Long> {
        @Join("owner")
        Collection<Pet> findByOwnerName(String owner);

        @Join("owner")
        Pet findByNameAndOwnerName(String pet, String owner);

        @Join("owner")
        Collection<Pet> findByOwnerNameAndHealth(String owner, Pet.PetHealth health);
    }
    </copy>

Micronaut Data supports [method patterns](https://micronaut-projects.github.io/micronaut-data/latest/guide/#querying) which are automatically implemented for you at compilation time, producing the appropriate SQL query.

Note that the [@Join](https://micronaut-projects.github.io/micronaut-data/latest/api/io/micronaut/data/annotation/Join.html) annotation is used to fetch the associated `Owner` instance for each `Pet` with a single query.

Also take note how a method like `findByOwnerName` can query the `name` property of the associated `Owner`.

In addition, you can use `And` or `Or` to query multiple properties as demonstrated by the `findByOwnerNameAndHealth` method.

Now let's modify `OwnerService` to implement the new methods in the `OwnerOperations` interface:

    <copy>
    @Override
    public Pet getPet(String owner, String pet) {
        return petRepository.findByNameAndOwnerName(pet, owner);
    }

    @Override
    public Collection<Pet> getPets(String owner) {
        return petRepository.findByOwnerName(owner);
    }

    @Override
    public Collection<Pet> getPetsWithHeath(String owner, Pet.PetHealth health) {
        return petRepository.findByOwnerNameAndHealth(owner, health);
    }
    </copy>

Finally modify `OwnerController` to include new routes to retrieve all an `Owner`'s pets (or only the healthy ones) plus retrieving a unique pet by name for an `Owner`:

    <copy>
    @Get("/{owner}/pets{?health}")
    Collection<Pet> getPets(String owner, @Nullable Pet.PetHealth health) {
        if (health != null) {
            return ownerOperations.getPetsWithHeath(owner, health);
        } else {
            return ownerOperations.getPets(owner);
        }
    }

    @Get("/{owner}/pets/{pet}")
    Pet getPet(String owner, String pet) {
        return ownerOperations.getPet(owner, pet);
    }
    </copy>

You'll also need this import:

    <copy>
    import edu.umd.cs.findbugs.annotations.Nullable;
    </copy>

Note that the `getPets` method demonstrates the use of [URI Templates](https://docs.micronaut.io/latest/guide/index.html#routing) within routes in Micronaut. You can specify optional URI variables with the `{..}` syntax and add optional query parameters with `{?health}`.

> The syntax for URI templates is based on the [RFC-6570 URI template specification](https://tools.ietf.org/html/rfc6570)

Finally, let's write some tests! Add the following two definitions to the `OwnerClient` defined within `OwnerControllerTest`:

    <copy>
    @Get("/{owner}/pets{?health}")
    Collection<Pet> getPets(String owner, @Nullable Pet.PetHealth health);

    @Get("/{owner}/pets/{pet}")
    Pet getPet(String owner, String pet);
    </copy>

You'll also need these imports:

    <copy>
    import edu.umd.cs.findbugs.annotations.Nullable;
    import java.util.Collection;
    </copy>

And define a test within `OwnerControllerTest` that executes the new route:

    <copy>
    @Test
    void testGetHealthPets() {
        Collection<Pet> pets = ownerClient.getPets("Barney", Pet.PetHealth.VACCINATED);
        assertEquals(
                1,
                pets.size()
        );
    }
    </copy>

Run your test and see the result!

You may now *proceed to the next lab*.

### Acknowledgements
- **Owners** - Graeme Rocher, Architect, Oracle Labs - Databases and Optimization
- **Contributors** - Palo Gressa, Todd Sharp, Eric Sedlar


text:
# [Inspirational Quotes](http://alexa.amazon.com/#skills/amzn1.ask.skill.41003e3e-335c-414b-b228-5b9044e86764)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the Inspirational Quotes skill, try saying...

* *Alexa, ask inspirational quotes to tell me a quote*

* *Alexa, ask inspirational quotes to give me a quote*

Simply say "Alexa, ask inspirational quotes to tell me a quote" and Alexa will respond with a random inspirational quote.

***

### Skill Details

* **Invocation Name:** inspirational quotes
* **Category:** null
* **ID:** amzn1.ask.skill.41003e3e-335c-414b-b228-5b9044e86764
* **ASIN:** B01M6C8GRD
* **Author:** fofx
* **Release Date:** November 4, 2016 @ 02:44:04
* **In-App Purchasing:** No


text:
Book Search Engine

Using MongoDB, Express, React & Node

MERN Stack

## Description
This Book Search Engine uses the entire MERN Stack, with a MongoDB database, an Express and Node Server/API, and a React front end. The user can search for books by a keyword, and save books to their login account. The application uses Google Books API, GraphQL, Apollo Server, Bootstrap, and Create React App.
***

## Deployed Application
https://lmp-book-search.herokuapp.com/
***

![Screen Shot 2021-07-12 at 8 32 24 AM](https://user-images.githubusercontent.com/77073582/125288108-c083ff00-e2eb-11eb-892e-c45e30a831f9.png)

![screencapture-localhost-3000-2021-07-12-08_18_29](https://user-images.githubusercontent.com/77073582/125288110-c083ff00-e2eb-11eb-986a-237c01580d48.png)

![screencapture-localhost-3000-saved-2021-07-12-08_19_22](https://user-images.githubusercontent.com/77073582/125288112-c11c9580-e2eb-11eb-9d14-887b0b83288d.png)

## License
  Copyright © Lisa Pessin 2021
  This application is covered under the MIT License.
  For more information, visit https://opensource.org/licenses/MIT.
  ***

repository: lmp-beep/Books

repo_name: lmp-beep/Books


text:
---
layout: post
title: I Finished My Sewing Sampler!
tags: [crafts]
---
  I finally finished my sewing sampler!! It feels as though I've been working on it forever, but I still had a ton of fun completing it. I'm pretty pleased with my finished work, and so was my mom (lol). Also:
  Dear past me,
  Please, for the love of all things dear to you, pull your thread all the way through when doing the back stitch. I used at least three spools trying to correct the mistakes I made, so if you love me (and you!), make sure to pull the thread all the way through after each stitch!

  ![picture of a circular sewing sampler outlined in yellow thread. The inside is divided into sections decorated with pink thread. One of these sections is a giant W and another says Williams](https://raw.githubusercontent.com/Katelyn-H/Katelyn-H.github.io/master/img/PicsArt_09-23-11.20.07.jpg)


text:
---
layout: default
---

# 1994-07-28 - What can one do for remail operators?

## Header Data

From: Tommy the Tourist (Anon User<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 9c7183821cd6b435999a2d8dcc4c61102da23fbd0298147cf8a9136089d8765d

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-07-28 12:39:37 UTC

Raw Date: Thu, 28 Jul 94 05:39:37 PDT

## Raw message

```
{% raw  %}From: Tommy the Tourist (Anon User<EMAIL_ADDRESS>Date: Thu, 28 Jul 94 05:39:37 PDT
To<EMAIL_ADDRESS>Subject: What can one do for remail operators?
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

I am interested in doing something to support the remailer operators
that put their necks on the line for us cypherpunks.

I have noticed people like Detweiler (dunno who he is) who are basically
awed by the fact that a remailer crashes when you send your VM swap
file through it, or people using it to do "nanny-nanny-boo-boo, you
can't catch me, so pween off" messages, et al.

I would like to something in support of these people who are noble
enough to keep things running even when EVERYONE it seems is out
to get them.

If I knew any around here, they would get a free beer, and if
the operator of Soda's remailer or Julf was in my area, they
would get the whole keg ;).

------------
To respond to the sender of this message, send mail to
<EMAIL_ADDRESS>starting your message with
the following 8 lines:
::
Response-Key: ideaclipper

====Encrypted-Sender-Begin====
MI@```%A_^P;+]AB?X=];G11ZU97K(ZZQ%(8AU>834+"Y)5E3KUBX2/<MQ>'(
MBT+==!$N]6_?T:4C:5,Q,BAM)?]<+`\GIHV&$_?,,`(NIK"[)^,Y)\9:_QL[
#\H'B
====Encrypted-Sender-End====

{% endraw %}
```

## Thread

+ Return to [July 1994](/archive/1994/07)

+ Return to "[Berzerk <berzerk@xmission.xmission.com>](/authors/berzerk_berzerk_at_xmission_xmission_com_)"
+ Return to "[Tommy the Tourist (Anon User) <nobody@soda.Berkeley.EDU>](/authors/tommy_the_tourist_anon_user_nobody_at_soda_berkeley_edu_)"

+ 1994-07-28 (Thu, 28 Jul 94 05:39:37 PDT) - What can one do for remail operators? - _Tommy the Tourist (Anon User<EMAIL_ADDRESS>  + 1994-07-28 (Thu, 28 Jul 94 11:04:08 PDT) - [Re: What can one do for remail operators?](/archive/1994/07/2904f744d49a624ad6aeca6b612e794436d086265ad5813228e522c51c5e1d3f) - _Berzerk<EMAIL_ADDRESS>


text:
# Coniothyrium fuckelii var. sporulosum W. Gams & Domsch, 1969 VARIETY

#### Status
SYNONYM

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

#### Published in
Nova Hedwigia 18: 9 (1969)

#### Original name
Coniothyrium fuckelii var. sporulosum W. Gams & Domsch, 1969

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Montagnulaceae/Paraconiothyrium/Paraconiothyrium sporulosum/ Syn. Coniothyrium fuckelii sporulosum/README.md

repo_name: mdoering/backbone


text:
# Virginia Covid Charter

The intent of this project is to provide covid spread at a county level for the state of Virginia.

## Installation

```bash
cd covidcharter
pip install requirements.txt
```

## Usage
 With the current feature set, you must specify a county. If you do not include the county, a list of all possible counties will be given to you.
```bash
python3 main.py --county=Henrico
```

## Contributing
Pull requests are always welcome.

## Use as a package
If you want to use parts of the service layer as a package, you may pull it as a backage from PyPi: https://pypi.org/project/covidcharter/

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: creecherr/virginia-covid-charter

repo_name: creecherr/virginia-covid-charter