text:
<img src="logo.svg" alt="GuanajaHills Logo" height="100px" align="right">

# Guanaja Hills Ethereum Contracts

[![Lint](https://github.com/GuanajaHills/ethereum-contracts/actions/workflows/lint.yaml/badge.svg)](https://github.com/GuanajaHills/ethereum-contracts/actions/workflows/lint.yaml)
[![Test](https://github.com/GuanajaHills/ethereum-contracts/actions/workflows/test.yml/badge.svg)](https://github.com/GuanajaHills/ethereum-contracts/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/GuanajaHills/ethereum-contracts/branch/master/graph/badge.svg?token=VHOBBYCAYI)](https://codecov.io/gh/GuanajaHills/ethereum-contracts)

This repository contains all Ethereum Contracts of the Guanaja Hills Association.

---

## Token Contracts

Tokens are currently distributed in a closed private sale. If you are interested, please inquire at [GuanajaHills.com](https://guanajahills.com/inquiry)

### Guanaja Hills Investment Token (GHI)

* ERC-20
* Static supply of 100'000'000
* 0 Decimal places (GHI Tokens use full numbers)
* Snapshot creation for secure trustless dividends
* Mainnet Address: `0xCa076efE6e2FD92CB44A2C1224246791F8E66421`
* Rinkeby Testnet Address: `0x4ff85444075DbC3b160936ef94DE0162A59c61D5`

### Guanaja Hills Resort Chip (CHIP)

* ERC-20
* Mintable by Guanaja Hills Association
* Uncapped but burnable
* 2 Decimal places (Used for USD cents)
* Mainnet Address: `0x3383E1ff517F617b54beb149587db5fBaF5bEE2B`
* Rinkeby Testnet Address: `0xae75D3FF517Ae2212Fc97F7Ba5dA5E3f74F1C352`

---

## Security disclosure contact

We use [OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) as a basis, which is the community-vetted standard for smart contract development and is regularly audited.

Please report any security issues you find to<EMAIL_ADDRESS>
## License

This repository is released under the [MIT License](LICENSE).

repository: GuanajaHills/ethereum-contracts

repo_name: GuanajaHills/ethereum-contracts


text:
---
lab:
    az204Title: 'Lab 04: Construct a polyglot data solution'
    az204Module: 'Learning Path 04: Develop solutions that use Cosmos DB storage'
---

# Lab 04: Construct a polyglot data solution

## Microsoft Azure user interface

Given the dynamic nature of Microsoft cloud tools, you might experience Azure UI changes that occur after the development of this training content. As a result, the lab instructions and lab steps might not align correctly.

Microsoft updates this training course when the community alerts us to needed changes. However, cloud updates occur frequently, so you might encounter UI changes before this training content updates. **If this occurs, adapt to the changes, and then work through them in the labs as needed.**

## Instructions

### Before you start

#### Sign in to the lab environment

Sign in to your Windows 10 virtual machine (VM) by using the following credentials:

- Username: `Admin`
- Password: `Pa55w.rd`

> **Note**: Your instructor will provide instructions to connect to the virtual lab environment.

#### Review the installed applications

Find the taskbar on your Windows 10 desktop. The taskbar contains the icons for the applications that you'll use in this lab, including:

-   Microsoft Edge
-   File Explorer
-   Visual Studio Code

## Lab Scenario

In this lab, you will create an Azure Cosmos DB resource and a storage account resource. Using C# and .NET, you will access the Cosmos DB resource and upload data into it.

Additionally, as Contoso may want to access the data in Cosmos DB through a user-friendly interface, you will implement a .NET solution that accesses and displays the data from Cosmos DB in a web browser.

Finally, you will set the consistency level for your Cosmos DB instance and implement an Azure function for change feed notifications.

## Architecture diagram

![Architecture diagram depicting a user constructing a polyglot data solution by creating an Azure storage account and an Azure Cosmos DB account.](./media/Lab04-Diagram.png)

### Exercise 1: Creating data store resources in Azure

#### Task 1: Open the Azure portal

1. On the taskbar, select the **Microsoft Edge** icon.

1. In the open browser window, browse to the Azure portal at `https://portal.azure.com`, and then sign in with the account you will be using for this lab.

    > **Note**: If this is your first time signing in to the Azure portal, you'll be offered a tour of the portal. Select **Get Started** to skip the tour and begin using the portal.

#### Task 2: Create an Azure Cosmos DB account resource

1. In the Azure portal, use the **Search resources, services, and docs** text box to search for **Azure Cosmos DB** and then in the list of results, select **Azure Cosmos DB**.

1. On the **Azure Cosmos DB** blade, select **+ Create**.

1. On the **Select API option** blade, select **Create** in the **Azure Cosmos DB for NoSQL** box.

1. On the **Basics** tab of the **Create Azure Cosmos DB Account - Azure Cosmos DB for NoSQL** page, perform the following actions, and then select **Review + Create**:

    | Setting | Action |
    | -- | -- |
    | **Subscription** list | Retain defaults |
    | **Resource group** section  | Select **Create new** |
    | **Name** text box | Enter **Polyglotdata** and select **OK** |
    | **AccountName** text box | Enter **polycosmos**_[yourname]_ |
    | **Location** drop-down list | Select an Azure region that is closest to the location of your lab computer and where you can create a Cosmos DB account |
    | **Capacity mode** section | Select **Serverless** |

    The following screenshot displays the configured settings on the **Create Azure Cosmos DB Account - Azure Cosmos DB for NoSQL** page.

    ![Screenshot displaying the options configured for creating an Azure Cosmos DB account](media/l04_cosmosdb_create_summary.png)

1. On the **Review + Create** tab of the **Create Azure Cosmos DB Account - Azure Cosmos DB for NoSQL** page, review the options that you selected during the previous steps.

1. Select **Create** to create the Azure Cosmos DB account by using your specified configuration.

    > **Note**: Wait for the creation task to complete before you move forward with this lab.

1. Select **Go to resource**.

1. On the **Azure Cosmos DB account** blade, find the **Settings** section, and then select the **Keys** link.

1. In the **Keys** pane, on the **Read-write Keys** tab, record the values of the **URI**, **PRIMARY KEY**, and **PRIMARY CONNECTION STRING** text boxes. You'll use these values later in this lab.

#### Task 3: Create an Azure Storage account resource

1. In the Azure portal, use the **Search resources, services, and docs** text box to search for **Storage accounts** and, in the list of results, select **Storage accounts**.

1. On the **Storage accounts** blade, select **+ Create**.

1. On the **Basics** tab of the **Create a storage account** blade, perform the following actions, and then select **Review**:

    | Setting | Action |
    | -- | -- |
    | **Subscription** list | Retain defaults |
    | **Resource group** section | Select **PolyglotData** |
    | **Storage account name** text box | Enter **polystor**_[yourname]_ |
    | **Region** drop-down list | Select the same region where you created the Cosmos DB account earlier in this exercise |
    | **Performance** section | Select **Standard** |
    | **Redundancy** drop-down list | Select **Locally-redundant storage (LRS)** |

    The following screenshot displays the configured settings on the **Create a storage account** blade.

     ![Screenshot displaying the options configured for creating an Azure storage account](media/l04_storage_create_summary.png)

1. On the **Review** tab of the **Create a storage account** blade, review the options that you selected during the previous steps.

1. Select **Create** to create the storage account by using your specified configuration.

    > **Note**: Wait for the creation task to complete before you proceed with this lab.

#### Review

In this exercise, you created the Azure resources that you'll need for the polyglot data solution you'll implement in this lab. The Azure resources you created include an Azure Cosmos DB account and an Azure Storage account.

### Exercise 2: Review and upload data

#### Task 1: Upload images to Azure Blob Storage

1. In the Azure portal's navigation pane, navigate back to the **Storage accounts** blade, and then select the **polystor**_[yourname]_ storage account that you created in this lab's previous exercise.

1. On the **polystor**_[yourname]_ storage account blade, select the **Containers** link in the **Data storage** section.

1. In the **Containers** section, select **+ Container**.

1. In the **New container** pop-up window, perform the following actions, and then select **Create**:

    | Setting | Action |
    | -- | -- |
    | **Name** text box | Enter **images** |
    | **Public access level** drop-down list | Select **Blob (anonymous read access for blobs only)** |

1. Back in the **Containers** section, select the newly created **images** container.

1. Find the **Settings** section on the **Container** blade, and then select the **Properties** link.

1. In the **Properties** pane, note and record the value in the **URL** text box. You'll use this value later in this lab.

1. Find and select the **Overview** link on the blade.
1. On the blade, select **Upload**.

1. In the **Upload blob** pop-up, perform the following actions:

    a.  In the **Files** section, select **Browse for files** or use the drag and drop feature.

    b.  In the **File Explorer** window, browse to **Allfiles (F):\\Allfiles\\Labs\\04\\Starter\\Images**, select all 42 individual **.jpg** image files, and then select **Open**.

    c.  Ensure that **Overwrite if files already exist** is selected, and then select **Upload**.

    > **Note**: Wait for all blobs to upload before you continue with this lab.

#### Task 2: Review JSON data

1. From the lab computer, start Visual Studio Code.

1. From the **File** menu, select **Open File**, browse to **Allfiles (F):\\Allfiles\\Labs\\04\\Starter\\AdventureWorks\\AdventureWorks.Upload**, select **models.json**, and then select **Open**.

1. Review the format of the **models.json** file and note that it contains an array of JSON objects, with a nested array of objects that are part of the **Products** property.

    > **Note**: This will determine the classes you'll define to deserialize the JSON file's contents before uploading it to a Cosmos DB collection.

1. Within the **models.json** file, note that one of the properties is named **Category**.

    > **Note**: You'll use the **Category** property to define partitioning of the target Cosmos DB collection.

1. Close Visual Studio Code.

#### Task 3: Create a Cosmos DB database and collection, and perform a JSON data upload

1. On the **Start** screen, select the **Visual Studio Code** tile.

1. From the **File** menu, select **Open Folder**.

1. In the **File Explorer** window that opens, browse to **Allfiles (F):\\Allfiles\\Labs\\04\\Starter\\AdventureWorks**, and then select **Select Folder**.

1. In the **Visual Studio Code** window, on the Menu Bar, select **Terminal** and then select **New Terminal**.

1. In the terminal, verify that the current directory is set to **AdventureWorks** (or change it to that if it's not), and then run the following command to switch your terminal context to the **AdventureWorks.Upload** folder:

    ```
    cd .\AdventureWorks.Upload\
    ```

    > **Note**: Before you perform the next step, open Windows Explorer and remove the **Read-only** attribute from the file **Allfiles (F):\\Allfiles\\Labs\\04\\Starter\\AdventureWorks\\AdventureWorks.Upload\\AdventureWorks.Upload.csproj**

1. From the terminal prompt, run the following command to add the Azure Cosmos DB .NET client library to the currently opened project:

    ```
    dotnet add package Microsoft.Azure.Cosmos --version 3.28.0
    ```

    > **Note**: The **dotnet add package** command will add the **Microsoft.Azure.Cosmos** package from **NuGet**. For more information, refer to [Microsoft.Azure.Cosmos](https://www.nuget.org/packages/Microsoft.Azure.Cosmos).

1. Observe the results of the build printed in the terminal. The build should complete successfully with no errors or warning messages.

1. In the **Explorer** pane of the **Visual Studio Code** window, expand the **AdventureWorks.Upload** project.

1. Open the **Program.cs** file.

1. In the **Program.cs** file, review the **using** directives and note that they include **Microsoft.Azure.Cosmos**, **System.IO;**, **System.Text.Json**, **System.Threading.Tasks**, and **System.Collections.Generic**. This enables asynchronous upload of JSON items from a local file on your lab computer to a collection in a Cosmos DB database.

1. In the **Program.cs** file, on line 14, set the value of **EndpointUrl** by replacing the empty string with the **URI** property of the Cosmos DB account that you recorded earlier in this lab. Ensure that the value is enclosed in double quotes.

1. On line 15, set the value of **AuthorizationKey** by replacing the empty string with the **PRIMARY KEY** property of the Cosmos DB account that you recorded earlier in this lab. Ensure that the value is enclosed in double quotes.

1. On line 18, set the value of **PartitionKey** by replacing the empty string with **"/Category"**.

1. On line 19, set the value of **JsonFilePath** by replacing the empty string with **"F:\\\\Allfiles\\\\Labs\\\\04\\\\Starter\\\\AdventureWorks\\\\AdventureWorks.Upload\\\\models.json"**.

1. Within the try block, note the invocation of the **CreateDatabaseIfNotExistsAsync** method of the **CosmosClient** class. This will create a database if one doesn't already exist.

1. Note the invocation of the **DefineContainer** method of the **Database** class. This will create a container that will host the JSON items if one doesn't already exist.

    > **Note**: The **DefineContainer** method includes a cost-minimizing option whereby you can modify the default indexing policy (which automatically indexes all attributes).

1. Note the **using** statement that relies on a **StreamReader** object to read JSON items from a text file and deserializes them into objects of the **Model** class defined further in the **Program.cs** file.

1. Note the foreach loop that iterates over the collection of deserialized objects and asynchronously inserts each of them into the target collection.

1. Review the **Model** and **Product** classes that reflect the format of the objects stored in the JSON-formatted file you reviewed earlier in this lab.

1. Save and close the **Program.cs** file.

    > **Note**: Select **Overwrite** if you received a prompt that the file is read-only.

1. In terminal, run the following command to restore any missing NuGet packages and build the project in the folder:

    ```
    dotnet build
    ```

    > **Note**: The **dotnet build** command will automatically restore any missing NuGet packages prior to building all projects in the folder.

1. From the terminal prompt, run the following command to run the .NET Core console application:

    ```
    dotnet run
    ```

    > **Note**: The **dotnet run** command will automatically build any changes to the project and then start the web application without a debugger attached. The command will output the messages indicating the data load's progress, including the number of items inserted into the target collection and the duration of the insert operation.

1. Observe the results of running the command printed in the terminal. The run should complete successfully, displaying the message about there being 119 items inserted into the target Cosmos DB collection.

1. Select **Kill Terminal** (the **Recycle Bin** icon) to close the terminal pane and any associated processes.

#### Task 4: Validate JSON data upload

1. On your lab computer, switch to the **Microsoft Edge** browser window displaying the Azure portal.

1. In the Azure portal, select the **Search resources, services, and docs** text box, in the **Recent resources** list, select the **polycosmos**_[yourname]_ Azure Cosmos DB account that you created earlier in this lab.

1. On the **Azure Cosmos DB account** blade, find and select the **Data Explorer** link on the blade.

1. In the **Data Explorer** pane, expand the **Retail** database node.

1. Expand the **Online** container node, and then select **New SQL Query**.

    > **Note**: The label for this option might be hidden. You can display labels by hovering over the icons in the **Data Explorer** pane.

1. On the query tab, enter the following text:

    ```sql
    SELECT * FROM models
    ```

1. Select **Execute Query**, and then observe the list of JSON items returned by the query.

1. Back in the query editor, replace the existing text with the following text:

    ```sql
    SELECT VALUE COUNT(1) FROM models
    ```

1. Select **Execute Query**, and then observe the result of the **COUNT** aggregate operation.

1. Switch back to the **Visual Studio Code** window.

#### Review

In this exercise, you used the .NET SDK for Azure Cosmos DB to insert data into Azure Cosmos DB. The web application that you implement next will use this data.

### Exercise 3: Configure a .NET web application

#### Task 1: Update references to data stores and build the web application

1. In the **Explorer** pane of the **Visual Studio Code** window, expand the **AdventureWorks.Web** project.

1. Open the **appsettings.json** file.

1. In the JSON object on line 3, find the **ConnectionStrings.AdventureWorksCosmosContext** path. Note that the current value is empty:

    ```json
    "ConnectionStrings": {
        "AdventureWorksCosmosContext": "",
    },
    ```

1. Update the value of the **AdventureWorksCosmosContext** property by setting its value to the **PRIMARY CONNECTION STRING** of the Azure Cosmos DB account that you recorded earlier in this lab.

1. In the JSON object on line 6, find the **Settings.BlobContainerUrl** path. Note that the current value is empty:

    ```json
    "Settings": {
        "BlobContainerUrl": "",
        ...
    }
    ```

1. Update the **BlobContainerUrl** property by setting its value to the **URL** property of the Azure Storage blob container named **images** that you recorded earlier in this lab.

1. Save the **appsettings.json** file and close it.

    > **Note**: Select **Overwrite** if you received a prompt that the file is read-only.

1. In the **Visual Studio Code** window, right click on **AdventureWorks.Context** folder in the explorer pane, and then select **Open in Integrated Terminal**.

    ![Screenshot displaying Open In Integrated Terminal](media/l04_vscode_open_in_integreated_terminal.png)

    > **Note**:Before you perform the next step, open Windows Explorer and remove the Read-only attribute from the file **Allfiles (F):\Allfiles\Labs\04\Starter\AdventureWorks\AdventureWorks.Context\AdventureWorks.Context.csproj**

1. From the terminal prompt, verify that the current directory is set to **AdventureWorks.Context** (or change it to that if it's not), and then run the following command to import **Microsoft.Azure.Cosmos** from NuGet:

    ```
    dotnet add package Microsoft.Azure.Cosmos --version 3.28.0
    ```

1. From the terminal prompt, run the following command to build the **AdventureWorks.Context** project:

    ```
    dotnet build
    ```

1. Observe the results of the build printed in the terminal. The build should complete successfully with no errors or warning messages.

#### Task 2: Configure connectivity to Azure Cosmos DB

1. In the **Explorer** pane of the **Visual Studio Code** window, expand the **AdventureWorks.Context** project.

1. From the shortcut menu of the **AdventureWorks.Context** folder node, select **New File**.

1. At the new file prompt, enter **AdventureWorksCosmosContext.cs**.

1. From the code editor tab for the **AdventureWorksCosmosContext.cs** file, add the following code:

    ```csharp
    using AdventureWorks.Models;
    using Microsoft.Azure.Cosmos;
    using Microsoft.Azure.Cosmos.Linq;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;

    namespace AdventureWorks.Context
    {
        /* AdventureWorksCosmosContext class will implement the
        IAdventureWorksProductContext interface */
       public class AdventureWorksCosmosContext : IAdventureWorksProductContext
       {
            /* Create a new read-only Container variable named _container */
            private readonly Container _container;

          public AdventureWorksCosmosContext(string connectionString, string database = "Retail", string container = "Online")
          {
            /* Create a new instance of the CosmosClient class, and then obtain
              both a Database and Container instance from the client */
            _container = new CosmosClient(connectionString)
            .GetDatabase(database)
            .GetContainer(container);
          }

          public async Task<Model> FindModelAsync(Guid id)
          {
            /* Create a LINQ query, transform it into an iterator, iterate over the result set,
               and then return the single item in the result set */
            var iterator = _container.GetItemLinqQueryable<Model>()
            .Where(m => m.id == id).ToFeedIterator<Model>();
            List<Model> matches = new List<Model>();
            while (iterator.HasMoreResults)
            {
                var next = await iterator.ReadNextAsync();
                matches.AddRange(next);
            }

            return matches.SingleOrDefault();
          }

          public async Task<List<Model>> GetModelsAsync()
          {
            /* Run an SQL query, get the query result iterator, iterate over the result set,
                and then return the union of all results */
            string query = $@"SELECT * FROM items";
            var iterator = _container.GetItemQueryIterator<Model>(query);
            List<Model> matches = new List<Model>();
            while (iterator.HasMoreResults)
            {
                var next = await iterator.ReadNextAsync();
                matches.AddRange(next);
            }

            return matches;
          }

          public async Task<Product> FindProductAsync(Guid id)
          {
            /* Run an SQL query, get the query result iterator, iterate over the result set,
               and then return the single item in the result set */
            string query = $@"SELECT VALUE products
                        FROM models
                        JOIN products in models.Products
                        WHERE products.id = '{id}'";
            var iterator = _container.GetItemQueryIterator<Product>(query);
            List<Product> matches = new List<Product>();
            while (iterator.HasMoreResults)
            {
                var next = await iterator.ReadNextAsync();
                matches.AddRange(next);
            }

            return matches.SingleOrDefault();
          }

       }
    }
    ```

1. Save and close the **AdventureWorksCosmosContext.cs** file.

1. From the terminal prompt, with the current directory set to **AdventureWorks.Context**, run the following command to build the .NET web application:

    ```
    dotnet build
    ```

    > **Note**: If there are any build errors, review the **AdventureWorksCosmosContext.cs** file in the **Allfiles (F):\\Allfiles\\Labs\\04\\Solution\\AdventureWorks\\AdventureWorks.Context** folder.

#### Task 3: Review the .NET application startup logic

1. In the **Explorer** pane of the **Visual Studio Code** window, expand the **AdventureWorks.Web** project.

1. Open the **Startup.cs** file.

1. In the **Startup** class, note the existing **ConfigureProductService** method:

    ```csharp
    public void ConfigureProductService(IServiceCollection services)
    {
        services.AddScoped<IAdventureWorksProductContext, AdventureWorksCosmosContext>(provider =>
            new AdventureWorksCosmosContext(
                _configuration.GetConnectionString(nameof(AdventureWorksCosmosContext))
            )
        );
    }
    ```

    > **Note**: The product service uses Cosmos DB as its database.

1. Close the **Startup.cs** file without making any modifications.

#### Task 4: Validate that the .NET application successfully connects to data stores

1. In Visual Studio Code, from the terminal prompt, run the following command to switch your terminal context to the **AdventureWorks.Web** folder:

    ```
    cd ..\AdventureWorks.Web\
    ```

1. From the terminal prompt, run the following command to run the ASP.NET web application:

    ```
    dotnet run
    ```

    > **Note**: The **dotnet run** command will automatically build any changes to the project and then start the web application without a debugger attached. The command will output the URL of the running application and any assigned ports.

1. On the taskbar, select the **Microsoft Edge** icon.

1. In the open browser window, browse to the currently running web application (<http://localhost:5000>).

1. In the web application, observe the list of models displayed from the front page.

1. Find the **Touring-1000** model, and then select **View Details**.

1. On the **Touring-1000** product detail page, review the listing of options.

1. Close the browser window displaying your web application.

1. Switch to the **Visual Studio Code** window, and then select **Kill Terminal** (the **Recycle Bin** icon) to close the currently open terminal and any associated processes.

#### Review

In this exercise, you wrote C# code to query an Azure Cosmos DB collection by using the .NET SDK.

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: C#

gha_license_id: MIT

license_type: permissive


text:
# Decision Trees
_A project for master studies at ITESM_

[TO DO](todo.md)

Uses [WekaData](https://github.com/fehu/min-dat--weka-data) project.

References
----------

- Yo-Ping Huang and Vu Thi Thanh Hoa. 2009. General criteria on building decision trees for data classification.  In Proceedings of the 2nd International Conference on Interaction Sciences: Information Technology, Culture and Human (ICIS '09). ACM, New York, NY, USA,  649-654. DOI=http://dx.doi.org/10.1145/1655925.1656042

repository: fehu/min-dat--decision-trees

repo_name: fehu/min-dat--decision-trees


text:
# Minio Client SDK for Haskell [![Build Status](https://travis-ci.org/minio/minio-hs.svg?branch=master)](https://travis-ci.org/minio/minio-hs)[![Hackage](https://img.shields.io/hackage/v/minio-hs.svg)](https://hackage.haskell.org/package/minio-hs)[![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)

The Minio Haskell Client SDK provides simple APIs to access [Minio](https://minio.io) and Amazon S3 compatible object storage server.

## Minimum Requirements

- The Haskell [stack](https://docs.haskellstack.org/en/stable/README/)

## Installation

```sh
git clone https://github.com/minio/minio-hs.git

cd minio-hs/

stack install
```

Tests can be run with:

```sh

stack test

```

A section of the tests use the remote Minio Play server at
`https://play.minio.io:9000` by default. For library development,
using this remote server maybe slow. To run the tests against a
locally running Minio live server at `http://localhost:9000`, just set
the environment `MINIO_LOCAL` to any value (and unset it to switch
back to Play).

Documentation can be locally built with:

```sh

stack haddock

```

## Quick-Start Example - File Uploader

### FileUploader.hs
``` haskell
#!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs --package optparse-applicative --package filepath

{-# Language OverloadedStrings, ScopedTypeVariables #-}
import Network.Minio

import Control.Monad.Catch (catchIf)
import Control.Monad.IO.Class (liftIO)
import Data.Monoid ((<>))
import Data.Text (pack)
import Options.Applicative
import Prelude
import System.FilePath.Posix

-- | The following example uses minio's play server at
-- https://play.minio.io:9000.  The endpoint and associated
-- credentials are provided via the libary constant,
--
-- > minioPlayCI :: ConnectInfo
--

-- optparse-applicative package based command-line parsing.
fileNameArgs :: Parser FilePath
fileNameArgs = strArgument
               (metavar "FILENAME"
                <> help "Name of file to upload to AWS S3 or a Minio server")

cmdParser = info
            (helper <*> fileNameArgs)
            (fullDesc
             <> progDesc "FileUploader"
             <> header
             "FileUploader - a simple file-uploader program using minio-hs")

ignoreMinioErr :: ServiceErr -> Minio ()
ignoreMinioErr = return . const ()

main :: IO ()
main = do
  let bucket = "my-bucket"

  -- Parse command line argument, namely --filename.
  filepath <- execParser cmdParser
  let object = pack $ takeBaseName filepath

  res <- runMinio minioPlayCI $ do
    -- Make a bucket; catch bucket already exists exception if thrown.
    catchIf (== BucketAlreadyOwnedByYou) (makeBucket bucket Nothing) ignoreMinioErr

    -- Upload filepath to bucket; object is derived from filepath.
    fPutObject bucket object filepath

  case res of
    Left e -> putStrLn $ "file upload failed due to " ++ (show e)
    Right () -> putStrLn "file upload succeeded."
```

### Run FileUploader

``` sh
./FileUploader.hs "path/to/my/file"

```

## Contribute

[Contributors Guide](https://github.com/minio/minio-hs/blob/master/CONTRIBUTING.md)

repository: donatello/minio-hs

gha_language: Haskell

repo_name: donatello/minio-hs


text:
---
layout: default
---

# 1997-05-02 - Response to Alan Davidson

## Header Data

From: Tim May<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 31b2449c1baec325245a310d45e604bafca1c28f0bc00dff10c23a78aeca1fe8

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-05-02 05:50:58 UTC

Raw Date: Fri, 2 May 1997 13:50:58 +0800

## Raw message

```
{% raw  %}From: Tim May<EMAIL_ADDRESS>Date: Fri, 2 May 1997 13:50:58 +0800
To<EMAIL_ADDRESS>Subject: Response to Alan Davidson
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

I posted this article to the newsgroups alt.cypherpunks,
talk.politics.crypto, comp.org.eff.talk, and copied this list on it from my
newsreader, but the article hasn't shown up here on the list. Sometimes the
newsreader/spooler/whateer runs into snags, so here it is, manually sent:

At 1:56 PM -0800 5/1/97, Alan Davidson wrote to the Cypherpunks list:

>SAFE would legalize the export (to all but a few countries such as Iran, N.
>Korea, and Cuba) of non-escrow encryption *of unlimited strength* that is
>designed for the mass market or is in the public domain, i.e.:
>
>        "(i) that is generally available, as is, and is
>                    designed for installation by the purchaser; or
>
>                    "(ii) that is in the public domain for which
>                    copyright or other protection is not available
>                    under title 17, United States Code, or that is
>                    available to the public because it is generally
>                    accessible to the interested public in any form;"
>         (See also Footnote below)

But of course this is not the complete quote. Here is the material above,
plus the surrounding context (and what I think are some "gotchas"):

[[My comments are in brackets like this.]]

"(2) ITEMS NOT REQUIRING LICENSES. -- No validated license may be required,
except pursuant to the Trading With the Enemy Act or the International
Emergency Economic Powers Act (but only to the extent that the authority of
such Act is not exercised to extend controls imposed under this Act), for
the export or reexport of--

[[And what limitations on export does the International Emergency Economic
Powers Act impose? This is a murky and complicated area of the law, and our
own Professor Froomkin, in his excellent "It Came from Planet Clipper"
review of Clipper, noted: "The only authorities noted in Executive Order
12,924 are the
President's inherent constitutional authority and the International
Emergency Economic Powers Act (IEEPA).{224} Assuming that the President
does
not have inherent constitutional authority to block exports in peacetime,
the authority for this action is IEEPA, which by its own terms applies to
"any
unusual and extraordinary threat, which has its source in whole or
substantial part outside the Untied States ... if the President declares a
national
emergency with respect to such threat."{225} While Executive Order 12,924
refers to the danger of "unrestricted access of foreign parties to U.S.
goods, technology and technical data," it seems that the real "unusual and
extraordinary" threat consists of Congress's failure to renew the EAA.
Indeed, the President's most recent renewal of the state of emergency
admits that the state of emergency must be extended "[b]ecause the Export
Administration Act has not been renewed by the Congress."{226}"

[[I take this quote to mean that the EEPA grants the Pres. authority to
limit exports. Thus, the "except pursuant to" provision could with the
stroke of a pen impose export limits on unbreakable crypto, even if the
later provisions, which I'll get to in a moment, are not the clauses
invoked to limit exports.]]

"(A) any software, including software with encryption capabilities --

"(i) that is generally available, as is, and is designed for installation
by the purchaser; or
"(ii) that is in the public domain for which copyright or other protection
is not available under title 17, United States Code, or that is available
to the public because it is generally accessible to the interested public
in any form; or
"(B) any computing device solely because it incorporates or employs in any
form software (including software with encryption capabilities) exempted
from any - requirement for a validated license under subparagraph (A).

[[The section above does seem to say that, unless EEPA is invoked, crypto
software is exportable. However, the next section states the following:]]

"(3) SOFTWARE WITH ENCRYPTION CAPABILITIES. -- The Secretary shall
authorize the export or reexport of software with encryption capabilities
for nonmilitary end-uses in any country to which exports of software of
similar capability are permitted for use by financial institutions not
controlled in fact by United States persons, unless there is substantial
evidence that such software will be
       --

"(A) diverted to a military end-use or an end-use supporting international
terrorism;

[[So, if it is determined that PGP is being used by the Iraqi regime--as
some sources tell me is the case today!--does this not encompass "diverted
to a military end-use"? If it is obvious that Irish members of the IRA or
Sinn Fein are buying copies of "Mil-Grade PGP" at the Egghead in Boston and
shipping them back to Dublin on cargo pallets, will this satisfy the
"supporting international terrorism" clause? If the 'substantial evidence
that such software will be" part means that such exports are blocked only
if the exporter makes it clear that he will be exporting to the Iraqi High
Command, which he would be foolish to do, then this is an Alice in
Wonderland law. I surmise that the intended interpretation is to block
software with substantially military uses, even if not the primary uses. I
could be wrong, but the confluence of the EEPA and the "diverted to a
military" and "supporting international terrorism" bits lead me to
interpret the bill as saying military-grade PGP will be limited for export
even to countries which are not on the "hot list" of Trading with the Enemy
nations.]]

"(B) modified for military or terrorist end-use; or

[[And what does this mean? If I widely advocate and encourage use of PGP
3.0 as a tool for liberation of oppressed peoples under the bootheel of the
American fascist regime, and show how PGP 3.0 is a tool for blowing up
fascists and their lackeys, and there is even evidence that terrorist
groups are indeed adopting PGP 3.0 in droves, is this clause then
triggered?

(Or must I actually purchase a software export license from PGP, Inc.,
alter the code to read "Pretty Good Terrorist Tool," stamp my boxes "Meant
for International Terrorist Use," apply for an export license, and only
then will the clause be triggered? Ha.

The clear, to mek, interpretation of this language is that the SecDef and
other such persons will notify the Pres., or Commerce, etc., that some
particular program or product is easily capable of being used against
putative American interests, as has long been the case with so many other
export-limited products.

(And the limits are not, Alan's implications to the contrary, limited to
the "Hot List" of terrorist nations. The COCOM agreements, the CCL, and now
the Wasenaar agreements, clearly are a very broad list of products. Hell,
the Japanese are now citing the Wasenaar as the reason the RSA chip will
not be given an export license! The real reason, looking deeper, is because
David Aaron, Stuart Baker, and the other folks in the NSA orbit almost
certainly asked them in very strong terms not to make the RSA chip
available for products.)]]

>SAFE's export control relief is not unlimited. The bill does not allow
>export to Iran, Iraq,  Cuba, or N. Korea (that's what the "Trading With The
>Enemy" provision is about); Congress is not likely to pass a law saying you
>can export strong crypto to Saddam Hussein.  Relief is also limited for

And what of the EEPA provisions? Will the Wasenaar list simply cease to
exist? My recollection, refreshed by skimming the Froomkin article a few
minutes ago, is that the EEPA, semi-perpetually in effect, is the reason
products are already on the list of controlled exports. As Froomkin writes,
"Given, however, that IEEPA provides the current authority for the
continuance of the EAA regime, and that the Clinton Administration proposes
to
move DES, however temporarily, off the USML and onto the CCL, a creation of
the EAA,{229}..."

On to another topic:

>Contrary to reports, the SAFE bill does not say: "Use a cipher, go to
>prison."  It does say: "Use cryptography TO COMMIT A CRIME, go to prison":

This is being disingenuous. I stated very clearly, in two places very
prominently, that the chilling effect of the criminalization section is
analogous to the "use a gun, go to prison" language (and billboards) used
in the War on Crime.

I'd've thought that analogies are a basic skill, not to mention a necessary
skill for doing well on the Verbal section of the SATs. To wit:

"Use a gun, go to prison" is to "Use a gun when committing a crime, go to
prison" as "Use a cipher, go to prison" is to "Use a cipher when committing
a crime, go to prison."

The point is that such criminalization of crypto will have a chilling effect.

In fact, why not support another modification of the First Amendment? (The
crypto modification being one involving speech.) Let's extend it to
religion:

"Religious beliefs are not allowed, but the holding of certain religious
beliefs when a crime is committed may in itself be criminal."

So, if someone bombs and abortion clinic, surely a crime by our laws, and
is found to be a Roman Catholic, this could add 5 years to their sentence.
This is what the criminalization of crypto is comparable to.

Or in the precise language of the SAFE bill:

>   2805. Unlawful use of religious beliefs in furtherance of a criminal act
>
>     "Any person who willfully uses religious beliefs in furtherance
>  of the commission of a criminal offense for which the
>  person may be prosecuted in a court of competent jurisdiction...
>  [may be imprisoned or fined]"

>CDT opposes both these provisions because they are unnecessary and could
>chill the use of encryption (especially by self-confessed felons like Tim
>May!).  But they are not as sweeping as some on this list have said.

Not as sweeping? Where is this "not as sweeping" spelled out? The SAFE text
is itself very short, so I don't see where this comes from. Is it from the
infamous "assurances" which are so often given verbally, but never in
ironclad written form attached as part of the bill? Is it an
"understanding" that this criminalization clause will actually not be
applied except certain classes of criminals? (Who are they, by the way,
that _would_ have the law applied to them?)

I take laws to mean what they say. Al Capone was gotten on income tax
evasion. If the law says using crypto in connection with a crime can result
in a 5-year sentence for a first offense, etc., I take the law to mean just
that. If that's _not_ what was intended, then change the language!!!!

Meanwhile, the crimininalization of crypto use in connection with any of
the ever-increasing array of prosecutable offenses is reason enough to
reject SAFE. That PGP, Inc. or Netscape has an easier time exporting
browers to foreigners is no reason to sacrifice basic liberties.

>Passage of the SAFE Bill would put strong security tools in the hands of
>many more people.  That's why CDT supports SAFE, and why we think people
>who care about privacy and security online should support it too.

Strong crypto, with no criminal penalties attached, is about to become
widely available in the U.S. with the incorporation of S/MIME into
Netscape's and Microsoft's products. Netscape has already said, and I
presume MS has or will too, that they will if necessary have multiple
versions of their products, with a "policy statement" enforcement mechanism
for foreigners.

So, what does SAFE buy us? There are no crypto laws in the U.S., and crypto
is avialable, and will soon be built into tens of millions of browsers.
Looks like we're getting what we need.

Why give up basic liberties so that Netscape can ship just one version?

A bad deal, I say.

"Use a cipher, go to prison."

--Tim May

--
There's something wrong when I'm a felon under an increasing number of laws.
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>408-728-0152 | anonymous networks, digital pseudonyms, zero
W.A.S.T.E.: Corralitos, CA  | knowledge, reputations, information markets,
Higher Power: 2^1398269     | black markets, collapse of governments.
"National borders aren't even speed bumps on the information superhighway."

There's something wrong when I'm a felon under an increasing number of laws.
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>408-728-0152 | anonymous networks, digital pseudonyms, zero
W.A.S.T.E.: Corralitos, CA  | knowledge, reputations, information markets,
Higher Power: 2^1398269     | black markets, collapse of governments.
"National borders aren't even speed bumps on the information superhighway."

{% endraw %}
```

## Thread

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

+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ 1997-05-02 (Fri, 2 May 1997 13:50:58 +0800) - Response to Alan Davidson - _Tim May<EMAIL_ADDRESS>


text:
<!-- README.md is generated from README.Rmd. Please edit that file -->

# fiderent

<!-- badges: start -->

[![R build
status](https://github.com/fmichonneau/fiderent/workflows/R-CMD-check/badge.svg)](https://github.com/fmichonneau/fiderent/actions)
[![CRAN
status](https://www.r-pkg.org/badges/version/fiderent)](https://CRAN.R-project.org/package=fiderent)
<!-- badges: end -->

fiderent allows you to compare whether files with the same file names in
two different folders are actually identical. Determining whether two
files are identical is sometimes done based on their timestamps or their
sizes. There are many situations where these methods is not suitable. A
more robust method is to compare their [md5sum
hashes](https://en.wikipedia.org/wiki/Md5sum).

I created this package to identify the files that were changed
subsequent Jekyll builds. Once this list of file was identified, I could
then invalidate them in their CloudFront distribution. I created a
[GitHub Action](https://github.com/fmichonneau/ga-compare-folders) that
relies on this package.

## Installation

You can install the development version from
[GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("fmichonneau/fiderent")
```

## Example

To demonstrate the use of the package, let’s compare the files that have
changed between the versions 0.8.0 and <IP_ADDRESS> of the `dplyr` package.

``` r
## download the two dplyr archives
download.file(
  "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.8.0.tar.gz",
  "dplyr_0.8.0.tar.gz"
)
download.file(
  "https://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_<IP_ADDRESS>.tar.gz",
  "dplyr_<IP_ADDRESS>.tar.gz"
)

## extract them in two different folders
untar("dplyr_0.8.0.tar.gz",  exdir = "dplyr_0.8.0")
untar("dplyr_<IP_ADDRESS>.tar.gz",  exdir = "dplyr_<IP_ADDRESS>")

## load the fiderent package
library(fiderent)

## get the full comparison between the two folders
compare_folders("dplyr_0.8.0", "dplyr_<IP_ADDRESS>")
#> # A tibble: 440 x 4
#>    files         `/home/francois/R-dev/fid… `/home/francois/R-dev/fid… identical
#>    <fs::path>    <chr>                      <chr>                      <lgl>
#>  1 /DESCRIPTION  f0632e50b2e4d6fa21db08455… ba5d03865dd38f7d6f0c299c8… FALSE
#>  2 /LICENSE      c7180788a8ec3035d54fc733f… c7180788a8ec3035d54fc733f… TRUE
#>  3 /MD5          e9846e4a590600faa337b4aeb… 46d2c1d85e01a994674fd6b87… FALSE
#>  4 /NAMESPACE    e884ab3192f1a0a21b9b4a7f4… e884ab3192f1a0a21b9b4a7f4… TRUE
#>  5 /NEWS.md      caf1e85bd53dfc528c0fe22d5… caf1e85bd53dfc528c0fe22d5… TRUE
#>  6 /R/RcppExpor… e19f85e800b3b920f4bdd9b2d… e19f85e800b3b920f4bdd9b2d… TRUE
#>  7 /R/all-equal… 385c938e7ddaf4321adf4ee19… 385c938e7ddaf4321adf4ee19… TRUE
#>  8 /R/bench-com… 9d5b6b054df3934c26af87b53… 9d5b6b054df3934c26af87b53… TRUE
#>  9 /R/bind.r     1f12f8b0dc718ffd7ddb1d89e… 1f12f8b0dc718ffd7ddb1d89e… TRUE
#> 10 /R/case_when… 8d39ad0a1e4b1341b5b9a4956… 8d39ad0a1e4b1341b5b9a4956… TRUE
#> # … with 430 more rows

## extract just the names of the files that have changed
library(dplyr)
compare_folders("dplyr_0.8.0", "dplyr_<IP_ADDRESS>") %>%
  filter(!identical) %>%
  pull(files)
#> /DESCRIPTION
#> /MD5
#> /build/dplyr.pdf
#> /inst/include/dplyr/hybrid/vector_result/ntile.h
```

## Etymology

Try to say “different folders” ten times very fast.

## Code of Conduct

Please note that the fiderent project is released with a [Contributor
Code of
Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

repository: fmichonneau/fiderent

branch_name: refs/heads/main

repo_name: fmichonneau/fiderent


text:
---
title: Configuring god to monitor Sphinx's searchd
permalink: 2008/09/10/configuring-god-to-monitor-sphinxs-searchd
published_at: 2008-09-10 12:55:00 +0000
---

[God](http://god.rubyforge.org/) is a server monitoring tool helpful for starting your server processes and keeping them running, all the while making sure they don't misbehave. In the Rails world, it appears to be used most commonly with packs of mongrels or thins. However, this is not to say it can't be used to monitor other software. For one of my recent work projects, we've been using God to monitor the searchd process that [Sphinx](http://sphinxsearch.com/) uses to serve results to search queries.

The configuration required for this can be based mostly on what you see around the place for thins or mongrels:

```
require 'yaml'

app_config = YAML.load(File.open(File.dirname( __FILE__ ) + "/config.yml"))['production']

God.watch do |w|
  w.group = "#{app_config['app_name']}-sphinx"
  w.name = w.group + "-1"

  w.interval = 30.seconds

  w.uid = app_config['user']
  w.gid = app_config['group']

  w.start = "searchd --config #{app_config['app_root']}/config/sphinx.conf"
  w.start_grace = 10.seconds
  w.stop = "searchd --config #{app_config['app_root']}/config/sphinx.conf --stop"
  w.stop_grace = 10.seconds
  w.restart = w.stop + " && " + w.start
  w.restart_grace = 15.seconds

  w.pid_file = File.join(app_config['app_root'], "tmp/pids/sphinx.pid")

  w.behavior(:clean_pid_file)

  w.start_if do |start|
    start.condition(:process_running) do |c|
      c.interval = 5.seconds
      c.running = false
    end
  end

  w.restart_if do |restart|
    restart.condition(:memory_usage) do |c|
      c.above = 100.megabytes
      c.times = [3, 5] # 3 out of 5 intervals
    end
  end

  w.lifecycle do |on|
    on.condition(:flapping) do |c|
      c.to_state = [:start, :restart]
      c.times = 5
      c.within = 5.minutes
      c.transition = :unmonitored
      c.retry_in = 10.minutes
      c.retry_times = 5
      c.retry_within = 2.hours
    end
  end
end
```

There are a number of other changes required for this configuration to work properly. Firstly, you will require a `config/config.yml` file, containing something like the following:

```
development: &production_settings
  app_name: myapp
  user: deployer
  group: deployer
  app_root: "/home/deployer/deployments/myapp.amc.org.au/current"
test:
  << *production_settings
production:
  << *production_settings
```

This config file sets the app's short name, the user and group to run the searchd process, and the path to the rails application root. We keep these settings in a yaml file because they are also used in a number of other places besides here. If you don't have this requirement, you can put all of these settings directly into your god config file.

The other requirement is that we make Sphinx use a configuration file that has a predictable name. The default Sphinx config file, when using [Pat Allen's](http://freelancing-gods.com/) awesome [Thinking Sphinx](http://ts.freelancing-gods.com/) plugin, has a file name contains the name of the current Rails environment. God can't use this to launch searchd, because it is does not run within the context of the Rails environment. To set location and name of the sphinx configuration file, set up a config/sphinx.yml file that contains something like this:

```
development: &production_settings
  config_file: /home/deployer/deployments/myapp.amc.org.au/current/config/sphinx.conf
  pid_file: /home/deployer/deployments/myapp.amc.org.au/current/tmp/pids/sphinx.pid
test:
  << *production_settings
production:
  << *production_settings
```

Thinking Sphinx respects these settings and uses them when it generates the Sphinx config file.

So that's about it. Make sure you've run `rake thinking_sphinx:index` at least once in your Rails app, to generate the Sphinx configuration and indexes, and then you are ready to start god and have your searchd automatically started and monitored!

repository: timriley/my-site

gha_language: Ruby

repo_name: timriley/my-site


text:
# EuroPy

EuroPy is a declarative python testing framework designed for the machine learning (ML) pipeline. Inspired by other testing frameworks (such as JUnit and NUnit) EuroPy uses test decorators to register and execute tests.

EuroPy is designed to work within an Iron Python interactive environment (i.e. Jupyter Notebook) as well as within the typical python kernel.

## Philosophy
TODO: Fill this in

## Usage

Creating a test function is accmplished by simply decorating any function with decorators from `europy.decorators`. This will register your test function with the EuroPy lifecycle. In order to execute all registered tests you simply need to execute the `europy.lifecycle.reporting.execute_tests` function. Any parameters passed to the `execute_tests` function will also be passed to all registered functions.

```python
from europy.decorators import bias, fairness
from europy.lifecycle.reporting import execute_tests

@bias("My example bias test", "Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
def foo(input):
    assert input % 2 == 0
    return input

@fairness("My example fairness test that fails")
@bias()
def foo_failure(input):
    assert input % 2 == 1
    return input

execute_tests(100)
```

### Example Notebook Output
![Notebook Output](./.img/notebook-output-1.png)

### Example Standard Output
![Standard Output](./.img/standard-output-1.png)

## Testing Report
TODO: Fill me in after this is incorporated

## Model Card
EuroPy can also help with generating high level details of your model for use in the report. This is included with the `@model_details()` decorator which reads data from `.yaml` or `.json` file. An example can be found at `tests/model_details_example.[yml|json]`.

### Simple Model Card Example
```python
@model_details('model_details.yml') # will load details from file and pass into train
def train(details: ModelDetails=None):
    # train
    details.description = "something computed"

@model_details() # will load existing details from the current report
def test(detail: ModelDetails=None):
    pass
```

## Hyper-Parameters
Keeping track of hyper-parameter tuning can be accomplished in configuration `.yml` or `.json` files and loaded into your code with the decorator `using_params()` or globally with `load_global_params()`. Doing so will automatically add the parameter details to your report. Parameters are loaded from

### Example Param Usage
```yaml
global:
    num_epochs: 4
    batch_size: 128
    learning_rate: 0.0001
train:
    test_split: 0.2
test:
    title: "Testing Run 01"
    batch_size: 256
```
```python
@using_params('params.yml')
def train(num_epochs: int=None, batch_size: int=None, learning_rate: float=None, test_split: float=None):
    # will load global params first, then params matching func name
    pass

@using_params('params.yml')
def test(title: str="", batch_size: int=None):
    # will load batch_size from test, overriding the global definition
    pass
```

### Example Notebook Output
![Global Params Output](./.img/global_params_notebook.png)
![Function Params Capture](./.img/func_params_notebook.png)

## Test Decorators
EuroPy supports a number of test classes out of the box. These test classes have been created by surveying industry practitioners and creating a list of well known testing labels. When defining a testing function you may pass two optional parameters to any decorator: name and description. These parameters are used as metadata and will be included in the resulting test report. The supported labels are listed below.

- `@bias()`
- `@data_bias()`
- `@fairness()`
- `@transparency()`
- `@accountability()`
- `@accuracy()`
- `@unit()`
- `@integration()`
- `@minimum_functionality()`

### Custom Test Decorators
While we believe these decorators should be comprehensive we have provided two ways in which you can add your own custom label to the test reports. For the examples below we will be adding a custom "end-to-end" testing label to our testing function.

- Using the  generic `@test()` decorator you can provide a custom string label
    ```python
    from europy.decorators import test
    from europy.lifecycle.reporting import execute_tests

    EXAMPLE_LABEL_NAME = "end-to-end"

    @test(EXAMPLE_LABEL_NAME, "My custom label test")
    def foo(input):
        assert input % 2 == 0
        return input

    execute_tests(100)
    ```
- Defining your own test decorator using the decorator_factory
    ```python
    from europy.decorators import decorator_factory
    from europy.lifecycle.reporting import execute_tests

    def end_to_end(name: str = ""):
        # here you can add multiple labels if you wish
        labels = ["end-to-end"]
        return decorator_factory(labels, name)

    @end_to_end("Test with custom decorator")
    def foo(input):
        assert input % 2 == 0
        return input

    execute_tests(100)
    ```

repository: sundaramx/EuroPy

repo_name: sundaramx/EuroPy


text:
# PBCS Java Client (PBJ)

The PBCS Java Client (PBJ) project is an open source project to implement a high-quality, easy to
use, and robust API for working with Oracle's Planning and Budgeting Cloud Service (PBCS) via its
REST API.

As a very quick example, consider the following scenario where the server, identity domain, username
and password have all been set already and you want to launch a business rule in an application
named "Vision". The following code would accomplish this:

```
PbcsClient client = new PbcsClientImpl(server, identityDomain, username, password);
PbcsApplication app = client.getApplication("Vision");
app.launchBusinessRule("AggAll");
```

Behind the scenes, the PBCS Java Client takes care of the details of connecting, executing the
proper REST method, and returning the result (in the above example, the result is ignored, but it
could be returned in order to determine the status of the call and its ID).

## Getting Started

The PBCS Java Client is packaged as a Maven project. And is best to include in your own Java projects
as a Maven dependency. If you absolutely have to include this project manually in your own project,
you will need to gather up the proper dependencies and add those to your project.

To get started, first clone the the PBJ repository to your local machine:

```
git clone https://github.com/jasonwjones/pbcs-client
```

Then `cd` into the folder and run a Maven install:

```
mvn install
```

This will build the project and install it to your local machine. You can then include it
as just any other dependency in your own project.

### Notes on Samples in Test Folder

The samples all derive from a common base class `AbstractIntegrationTest` that loads in details for a PBCS server from a local file on your computer. By default, the location of this file is here:

```
System.getProperty("user.home") +"/pbcs-client.properties";
```

The contents of this file should look something like this:

```
server=example-pbcs.pbcs.us2.oraclecloud.com
identityDomain=examplecorp
<EMAIL_ADDRESS>password=yourpass
appName=appname
```

Note that all of the above values are fictitious. You will need to put in your own information to connect to your PBCS isntance. Your username will typically if not always be an email address. Specifying the appName is optional but it's used in a few examples.

## Planning API vs LCM API

There are effectively two REST APIs that can be interacted with for PBCS: One is a Hyperion Planning
specific API (at version 'v3' as of this writing) and the other is an API for LCM. At the time of
this writing the LCM API version is <IP_ADDRESS>.600. To the extent possible, the PBJ tries to hide the
underlying details of these APIs from the user. Sometimes its inevitable that these APIs must be
worked with separately. For example, a full use-case of exporting and downloading a file

## Development Status

### Working

- Getting an application
- Getting the API info
- Launching business rule
- Refreshing a cube
- Getting job definitions
- Getting a job status
- Exporting a data file (but not subsequently downloading it, yet)

### Next to be developed

- Downloading exported file from LCM service
- Rule sets
- Plan type maps
- Other things you launch

## About

The PBCS Java Client is written by Jason Jones and is licensed under the generous Apache Software
License version 2.0. You are welcome to use the code for any purposes. It is recommended that if you
make fixes or enhancements to contribute those back to the project.

## License

Licensed under the Apache Software License version 2.0.

repository: cvkattookaran/pbcs-client

repo_name: cvkattookaran/pbcs-client


text:
# scan-docker-image

Scan docker images with various sbom tools.

## SBOM tools

- anchore/scan-action | [workflow](./.github/workflows/scan-anchore.yml) | output --> See Action / Artifacts
- tern | [workflow](./.github/workflows/scan-tern.yml) | output --> See Action / Artifacts

repository: syllogy/scan-docker-image

repo_name: syllogy/scan-docker-image


text:
---
layout: default
---

# 1996-07-14 - Re: Execution of signed scripts received by e-mail

## Header Data

From: Adam Shostack<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 4ef1f5c8f8abf45b3bdfe1b8ade1023f4d963c3813683e38d1826379944faa3c

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-07-14 21:38:39 UTC

Raw Date: Mon, 15 Jul 1996 05:38:39 +0800

## Raw message

```
{% raw  %}From: Adam Shostack<EMAIL_ADDRESS>Date: Mon, 15 Jul 1996 05:38:39 +0800
To<EMAIL_ADDRESS>Subject: Re: Execution of signed scripts received by e-mail
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

Matt Carpenter wrote:

| If I am reading the procmail docs correctly, then the following recipe
| should create a lockfile called 'emscrypt.lock' which will prevent more than
| one instance of the script from being run at a time
|
| :0:emscrypt
| ^ Subject.*SQUEAMISH OSSIFRAGE
| |/PATH/emscrypt
|
| I agree it would be better if emscrypt used its own locks on the timestamp
| files.  However, it is my understanding (someone please correct me if I am
| wrong) that there is no simple way to provide file locking in Perl that is
| portable across the various flavours of Unix (see the descriptions of the
| fcntl and flock functions on p. 144-145 of the Camel book).  So I haven't
| tried to implement locking from within emscrypt yet.  Of course, if these
| functions are available on the majority of machines (anyone?) then I should
| probably use them.

	procmail includes a program called lockfile, which is based on
its thorough as hell lock mechanism tests.  If you're calling from
procmail, you might decide to require lockfile.

Adam

--
"It is seldom that liberty of any kind is lost all at once."
					               -Hume

{% endraw %}
```

## Thread

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

+ Return to "[Adam Shostack <adam@homeport.org>](/authors/adam_shostack_adam_at_homeport_org_)"
+ Return to "[Matt Carpenter <mcarpent@Dusk.obscure.net>](/authors/matt_carpenter_mcarpent_at_dusk_obscure_net_)"
+ Return to "[Steven L Baur <steve@miranova.com>](/authors/steven_l_baur_steve_at_miranova_com_)"

+ 1996-07-14 (Sun, 14 Jul 1996 21:59:55 +0800) - [Re:  Execution of signed scripts received by e-mail](/archive/1996/07/d724fba9d0d50f6203883be23aab481112831adfd725c985371a3dabe51581f6) - _Matt Carpenter<EMAIL_ADDRESS>  + 1996-07-14 (Mon, 15 Jul 1996 05:38:39 +0800) - Re: Execution of signed scripts received by e-mail - _Adam Shostack<EMAIL_ADDRESS>  + 1996-07-14 (Mon, 15 Jul 1996 06:30:09 +0800) - [Re: Execution of signed scripts received by e-mail](/archive/1996/07/4f6a4f8750e32a19a43b608e7981de0064e0aa0e129758e8413e0e60803ad3d7) - _Steven L Baur<EMAIL_ADDRESS>


text:
# Mortgage
A mortgage calculator package, which exposes API for simple mortgage calculation.

# Installation
- composer require joshbrw/laravel-module-installer
- composer require techlify/mortgage-module

# Usage
Exposes the following POST API for mortgage calculation and amoritization.

Route::post('/mortgage', 'MortgageController@mortgage');
Route::post('/amortization', 'MortgageController@amortization');
Route::post('/personalized-report', 'MortgageController@report');

# Mortgage

Calculate the mortgage for the given model.

Request body:
{
  "loanAmount":number,
  "rpa":number,
  "loanTerm":number,
  "extraAmount"?:number,
  "downPayment"?:number
}

# Amortization

Calculate the amortization schedule for the given model

Request body:
{
  "loanAmount":number,
  "rpa":number,
  "loanTerm":number,
  "extraAmount"?:number,
  "downPayment"?:number
}

# Report

Calculate the amortization schedule for the given model and email it to logged in user.

Request body:
{
  "loanAmount":number,
  "rpa":number,
  "loanTerm":number,
  "extraAmount"?:number,
  "downPayment"?:number
}

repository: techlify/mortgage

repo_name: techlify/mortgage


text:
---
title: "Enable Custom Auto-Heal settings for an Azure App via PowerShell"
---

[Auto-healing](https://azure.github.io/AppService/2018/09/10/Announcing-the-New-Auto-Healing-Experience-in-App-Service-Diagnostics.html) is a powerful feature of Azure App Service and is used a lot by Azure App Service customers. Once a requirement came to me asking if it was possible to configure Auto-Healing settings for an app via PowerShell. Since all the AutoHeal settings are stored in ARM (Azure Resource Manager), you can easily write a PowerShell script that configures autohealing for your app and use the script to set the same settings across all your apps.

It took me some time while writing such a script so I thought of sharing it on this blog.

```powershell
$subscriptionId = "Your_Subscription_Id"    # Your App's SubscriptionId
$webapp = "App Name"                        # Your App's Name
$rg = "Resource Group"                      # Your App's Resource Group

Select-AzureRmSubscription -SubscriptionId $subscriptionId

$autohealRules = @{
    triggers=@{privateBytesInKB=777777;requests=@{count=1000;timeInterval="00:02:39"}};
    actions=@{actionType="Recycle";minProcessExecutionTime="00:01:39"};
}

$PropertiesObject = @{
     autoHealEnabled = $true;
    autoHealRules = $autohealRules
}

Set-AzureRmResource -PropertyObject$PropertiesObject -ResourceGroupName $rg -ResourceType Microsoft.Web/sites/config -ResourceName "$webapp/web" -ApiVersion 2018-02-01 -Force

```

The above script configures these two auto-heal rules and sets the action to **Recyle** whenever the conditions are met

1. Whenever Private Bytes for an app cross 777777 KB.
2. Whenever 1000 requests are served in a time interval of 2 minutes 39 seconds.

> Note: The script is provided as an example to demonstrate configuring AutoHeal rules via PowerShell. It is *in no way* recommended for all apps and you should fine tune it per your requirement.

**Hope this helps!**

gha_language: HTML


text:
# nexus-blockchain-info

Blockchain.info gateway for ip.nexus

# Install

**First Step**

Included in the package of this mod is a folder called Upload, upload the contents of this folder to your forums corresponding folders keeping the folders structure intact.
NOTE: If you have renamed your admin folder to something else (for example: myadminarea) and the upload directory of this mod contains a folder called admin,
you need to rename it with the correct new name before uploading it. So following the example above you need to rename the folder admin to myadminarea.

**Second Step**

Log in to your IP.Board Admin CP and visit the System tab -> Applications & Modules -> Manage Hooks page.
In the 'Install a New Hook' section, browse to the XML file included with these instructions and click Open.
Once it installs this hook, be sure to enable it!

**Final Step**

Now you can make a gateway, visit Admin Cp -> Nexus Application -> Store Settings -> Payment Gateways, then add a BCI Gateway.

repository: skinod/nexus-blockchain-info

repo_name: skinod/nexus-blockchain-info


text:
# React Navigation [![CircleCI](https://circleci.com/gh/react-community/react-navigation/tree/master.svg?style=shield&circle-token=622fcb1d78413084c2f44699ed2104246a177485)](https://circleci.com/gh/react-community/react-navigation/tree/master) [![npm version](https://badge.fury.io/js/react-navigation.svg)](https://badge.fury.io/js/react-navigation) [![codecov](https://codecov.io/gh/react-community/react-navigation/branch/master/graph/badge.svg)](https://codecov.io/gh/react-community/react-navigation) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactnavigation.org/docs/guides/contributors)

*学习一次, 导航全球.*

React Navigation 诞生于React Native社区对基于Javascript的可扩展但易于使用的导航解决方案的需求。

React Navigation is the result of a collaboration between developers from Facebook, Expo and the React community at large: it replaces and improves upon several navigation libraries in the ecosystem, including Ex-Navigation, React Native's Navigator and NavigationExperimental components.

* [Installation](#installation)
* [Community contributions](#community-contributions)
  * [Introduction to the library](#introduction-to-the-library)
  * [Basic Tutorials](#basic-tutorials)
  * [Intermediate Concepts](#intermediate-concepts)
  * [Advanced Topics](#advanced-topics)
  * [Comparisons and Discussion](#comparisons-and-discussion)
  * [Example Projects](#example-projects)
  * [Libraries](#libraries)
* [FAQs](#faqs)
  * [When is version 1.0.0 going to be released?](#when-is-version-100-going-to-be-released)
  * [I'm having troubles using the library, what can I do?](#im-having-troubles-using-the-library-what-can-i-do)
  * [My app is really slow!](#my-app-is-really-slow)
  * [How can I help?](#how-can-i-help)
  * [Is this the only library available for navigation?](#is-this-the-only-library-available-for-navigation)
  * [Can I use this library for web?](#can-i-use-this-library-for-web)
* [Code of conduct](#code-of-conduct)
* [License](#license)

## Installation

Since the library is a JS-based solution, to install the latest version of react-navigation you only need to run:

  ```bash
  yarn add react-navigation
  ```

  or

  ```bash
  npm install --save react-navigation
  ```

## Get Started

To learn how the library work, head to the [introduction](https://reactnavigation.org/docs/intro/) on the website for a quick tutorial that will cover all the basics - or try it out [our expo demo](https://exp.host/@react-navigation/NavigationPlayground).

#### Advanced guides

* [Redux integration](https://reactnavigation.org/docs/guides/redux)
* [Deep linking](https://reactnavigation.org/docs/guides/linking)

#### React Navigation API

* [Navigators](https://reactnavigation.org/docs/navigators/)
* [Routers](https://reactnavigation.org/docs/routers/)
* [Views](https://reactnavigation.org/docs/views/)

## Community contributions

A lot of developers poured their knowledge in blog posts, and other repos - we will try to keep here a list of tutorials and resources to help someone who wants to learn about React Navigation and techniques to handle navigation effectively.

#### Introduction to the library

* [Getting Started with React Navigation](https://hackernoon.com/getting-started-with-react-navigation-the-navigation-solution-for-react-native-ea3f4bd786a4)

#### Basic Tutorials

* [Basic ReactNavigation Example App and Tutorial](http://docs.nativebase.io/docs/examples/navigation/StackNavigationExample.html)
* [Understanding Navigation in React Native](https://www.codementor.io/blessingoraz/understanding-navigation-in-react-native-a3wlcxmzu?published=1#.WXfDlvk_ooE.twitter)
* [Comprehensive routing and navigation in React Native made easy](https://medium.com/@kevinle/comprehensive-routing-and-navigation-in-react-native-made-easy-6383e6cdc293)
* [Replace a Screen Using React Navigation](https://medium.com/handlebar-labs/replace-a-screen-using-react-navigation-a503eab207eb)

#### Intermediate Concepts

* [Integrating React-Navigation and Redux with authentication flow](https://medium.com/@shubhnik/a-comprehensive-guide-for-integrating-react-navigation-with-redux-including-authentication-flow-cb7b90611adf)
* [Using React Navigation and Redux in your React Native Application](https://medium.com/modus-create-front-end-development/using-react-navigation-and-redux-in-your-react-native-application-efac33265138)
* [React-Navigation, complete Redux state management, tab-bar, and multiple navigators](https://medium.com/@parkerdan/react-navigation-with-complete-redux-state-management-tab-bar-and-multiple-navigators-ed30a69d9a4d)
* [Custom Drawer with React-Navigation in React-Native](http://www.skywardsoftwares.co.in/react-native/custom-drawer-with-react-navigation-in-react-native/)
* [React Navigation Drawer - a tutorial series](https://shift.infinite.red/react-navigation-drawer-tutorial-a802fc3ee6dc)

#### Advanced Topics

* [Full Stack React Native Development using GraphCool and Apollo Subscriptions + React Navigation](https://medium.com/react-native-training/full-stack-react-native-development-using-graphcool-and-apollo-subscriptions-react-navigation-cdb3e1374c05)

#### Comparisons and Discussion

* [Migrate from ExNavigation to React Navigation](https://hackernoon.com/migrate-from-exnavigation-to-react-navigation-1af661ec5082)
* [Playing with React Navigation and Airbnb's Native Navigation](https://medium.com/@ericvicenti/playing-with-react-navigation-and-airbnbs-native-navigation-4e49fc765489)
* [How we restructured our app with React Navigation](https://m.oursky.com/how-we-restructured-our-app-with-react-navigation-98a89e219c26)
* [What’s Happening with Navigation in React Native?](https://blog.revisify.com/whats-happening-with-navigation-in-react-native-c193535888c3)

#### Example Projects

* [Yaba-Social](https://github.com/allpwrfulroot/yaba-social)
* [React Native Boilerplate with React Navigation and Redux integration](https://github.com/verybluebot/react-native-boilerplate)

#### Libraries

* [react-navigation-addons](https://github.com/satya164/react-navigation-addons)
* [react-navigation-props-mapper](https://github.com/vonovak/react-navigation-props-mapper)

## FAQs

#### When is version 1.0.0 going to be released?

As soon as all the tasks [here](https://github.com/react-community/react-navigation/issues/2585) have been completed. You can read more about it in the [blog](https://reactnavigation.org/blog/2017/9/Renewed-v1).

(in the meantime, you can find the changelog for every release [here](https://github.com/react-community/react-navigation/releases))

#### I'm having troubles using the library, what can I do?

Head to the [issues](https://github.com/react-community/react-navigation/issues) and do a quick search: if you think you are experiencing a bug chances are somebody already opened an issue for it. If instead you are having more general problems, use [Stack Overflow](https://stackoverflow.com/search?q=react-navigation) - which is better suited and helps keeping the Issues section of the repo clean. Alternatively you could join the [Reactiflux](https://www.reactiflux.com/) community on Discord where there are React Native and React Navigation channels with helpful people who might be able to answer you.

You should **only** open a new issue if you believe that you are experiencing a bug or have a feature request, and please **follow** the dedicated template - it will help everyone helping you (and may get closed if it doesn't).

#### My app is really slow!

We are aware that the performances can be improved - we will work on this (keep an eye on the roadmap linked above). In the meantime, please refer to these few issues for specific information regarding:

* [Tab Navigators](https://github.com/react-community/react-navigation/issues/739)

* [Stack Navigators](https://github.com/react-community/react-navigation/issues/608)

In particular, refer to [this comment](https://github.com/react-community/react-navigation/issues/608#issuecomment-328635042) (and the [one after](https://github.com/react-community/react-navigation/issues/608#issuecomment-333386346) that) to learn more about how you can try improving the performance of your code.

#### How can I help?

Glad you ask! This library is a community effort: it can only be great if we all help out in one way or another 😄 . If you feel like you aren't experienced enough using react navigation to contribute, you can still make an impact by:

1. Responding to one of the open [issues](https://github.com/react-community/react-navigation/issues). Even if you can't resolve or fully answer a question, asking for more information or clarity on an issue is extremely beneficial for someone to come after you to resolve the issue.

1. Creating public example repos of navigation problems you have solved.

1. Answering questions on [Stack Overflow](https://stackoverflow.com/search?q=react-navigation). Alternatively, asking questions on Stack Overflow instead of opening an issue.

1. Answering questions in our [Reactiflux](https://www.reactiflux.com/) channel.

1. Providing feedback on the open [PRs](https://github.com/react-community/react-navigation/pulls).

If you feel brave enough you can submit a PR: follow the [Contributors guide](https://reactnavigation.org/docs/guides/contributors) to find out how. If you don't know where to start, check the ones with the label [`good first issue`](https://github.com/react-community/react-navigation/labels/good%20first%20issue) - even [fixing a typo in the documentation](https://github.com/react-community/react-navigation/pull/2727) is a worthy contribution!

#### Is this the only library available for navigation?

No: there are some other libraries - which, depending on your project, can be better or worse suited for your project. They differ in the approach and implementation from `react-navigation`, but share the common goal of helping you create a good React Native application; you can find a general round up in the [React Native docs](http://facebook.github.io/react-native/docs/navigation.html).

#### Can I use this library for web?

This library originally planned to support web too - but at the moment [it is not a priority](https://github.com/react-community/react-navigation/issues/2585#issuecomment-330338793) for v1.0; a lot of work is necessary to reach it as-is and we had to freeze this support (consider it ["experimental"](https://reactnavigation.org/docs/guides/web)).

## Code of conduct

This library has adopted a Code of Conduct that we expect project participants to adhere to. Please read the [full text](https://github.com/react-community/react-navigation/blob/master/CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.

## License

React-navigation is licensed under the [BSD 2-clause "Simplified" License](https://github.com/react-community/react-navigation/blob/master/LICENSE).

gha_language: JavaScript


text:
# Brazilian Portuguese Messages for React-Admin

## Note:

This project is a **temporary fork** based on the great work made by @gucarletto in his [ra-language-pt-br](https://github.com/gucarletto/ra-language-pt-br/) repository.

Reason: the published package is [not working properly](https://npm.runkit.com/ra-language-pt-br), so I have forked and adapted it to be able to create and publish the npm package again, see [issue](https://github.com/gucarletto/ra-language-pt-br/issues/1).

---

Brazilian Portuguese messages for [react-admin](https://github.com/marmelab/react-admin), the frontend framework for building admin applications on top of REST/GraphQL services.

[![react-admin-demo](https://marmelab.com/react-admin/img/react-admin-demo-still.png)](https://vimeo.com/268958716)

## Installation

```sh
npm install --save @denisazevedo/ra-language-pt-br
```

## Usage

```js
import ptBrMessages from '@denisazevedo/ra-language-pt-br';
import polyglotI18nProvider from 'ra-i18n-polyglot';

const messages = {
    'pt-br': ptBrMessages,
};
const i18nProvider = polyglotI18nProvider(locale => messages[locale]);

<Admin locale="pt-br" i18nProvider={i18nProvider}>
  ...
</Admin>
```

## License

This translation is licensed under the MIT License.

repository: denisazevedo/ra-language-pt-br

repo_name: denisazevedo/ra-language-pt-br


text:
# react-country-region-selector

[![Build Status](https://travis-ci.com/country-regions/react-country-region-selector.svg?branch=master)](https://travis-ci.com/country-regions/react-country-region-selector)

- [About](#about)
    - [Features](#features)
    - [Gotchas](#gotchas)
- [Demo](#demo)
- [Installation](#installation)
- [Usage](#usage)
- [List of component options](#options)
- [Command-line](#command-line)
- [Changelog](#changelog)
- [Tests](#tests)
- [Thanks!](#thanks)
- [License](#license) (spoiler: MIT!)

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

### About

This library provides a pair of React components to display _connected_ country and region dropdowns (pick a country, it shows the relevant regions). If you're not using React, check out the [plain vanilla JS version](https://github.com/country-regions/country-region-selector) instead. The list of countries and regions is maintained separately and found in the [country-region-data](https://github.com/country-regions/country-region-data) repo.

#### Features

It's pretty versatile.

- There are two separate components (`<CountryDropdown />`, `<RegionDropdown>`) that you can embed in your
DOM wherever you need.
- The source data used by the library is also exposed, should you need it.
- It let's you customize the list of countries that appears via a whitelist, blacklist.
- [A lot of options](#options) are provided, for things like styling, event callbacks and so on.
- To keep file sizes down you have the option of creating a custom build of the library containing only a list of
those countries you want to show up. See [command line options](#command-line) for more info.

#### Gotchas

- *Page charset*: some country names contain UTF-8 chars, so your page will need an appropriate charset to handle them.
If you see some invalid characters appearing in the dropdown, make sure you have UTF-8 specified in your page
<head>, like so: ```<meta charset="UTF-8">```
- *Return values*: on an onChange event `event.target.value` is returned as the first value and the full `event` as the second.

### Demo

Check out the [github pages](http://country-regions.github.io/react-country-region-selector/) section for some examples + example
JSX code.

### Installation

Using npm or yarn:

```javascript
npm i react-country-region-selector
yarn add react-country-region-selector
```

### Usage

It's very easy to use, but note that you will need to track the country and region value somewhere - either in your
component state or in a store somewhere. Here's a simple example that uses state:

```javascript
import React, { useState } from 'react';

// note that you can also export the source data via CountryRegionData. It's in a deliberately concise format to
// keep file size down
import { CountryDropdown, RegionDropdown, CountryRegionData } from 'react-country-region-selector';

const Example = () => {
  const [country, setCountry] = useState('');
  const [region, setRegion] = useState('');

  return (
    <div>
      <CountryDropdown
        value={country}
        onChange={(val) => setCountry(val)} />
      <RegionDropdown
        country={country}
        value={region}
        onChange={(val) => setRegion(val)} />
    </div>
  );
}
```

Generally you don't need `CountryRegionData`, but if you should need it, the raw data is accessible like in the above example.

### Options

These are the attributes that can be passed to the two components. _Note: any other attributes that aren't
specified here will be added directly to the `<select>` DOM element._

```<CountryDropdown />```

| Parameter | Required? | Default | Type | Description |
|:---|:---:|:---|:---|:---|
| value | Yes | `""` | `string` | The currently selected country. This should either be the shortcode, or the full country name depending on what you're using for your value attribute (see the `valueType` option). By default it's the full country name. |
| onChange | Yes | `-` | `function` | Callback that gets called when the user selects a country. Use this to store the value in whatever store you're using (or just the parent component state). |
| onBlur | No | `-` | `function` | Callback that gets called when the user blurs off the country field. |
| name | No | `"rcrs-country"` | `string` | The name attribute of the generated select box. |
| id | No | `""` | `string` | The ID of the generated select box. Not added by default. |
| classes | No | `""` | `string` | Any additional space-separated classes you want to add. |
| showDefaultOption | No | `true` | `boolean` | Whether you want to show a default option. |
| priorityOptions | No | `array` | `[]` | Lets you target countries that should appear at the top of the dropdown. Should also be an array of country shortcodes. |
| defaultOptionLabel | No | `"Select Country"` | `string` | The default option label. |
| labelType | No | `"full"` | `string` | Either `"full"` or `"short"`. This governs whether you see country names or country short codes in the dropdown. |
| valueType | No | `"full"` | `string` | Either `"full"` or `"short"`. This controls the actual `value` attribute of  each `<option>` in the dropdown. Please note, if you set this to `"short"` you will need to let the corresponding `<RegionDropdown />` component know as well, by passing a `countryValueType="short"` attribute. |
| whitelist | No | `[]` | `array` | This setting lets you target specific countries to appear in the dropdown. Only those specified here will appear. This should be an array of country shortcodes. See the [country-region-data](https://github.com/country-regions/country-region-data) repo for the data and the shortcodes. |
| blacklist | No | `[]` | `array` | Lets you target countries that should *not* appear in the dropdown. Should also be an array of country shortcodes. |
| disabled | No | `false` | `boolean` | Disables the country field. |

```<RegionDropdown />```

| Parameter | Required? | Default | Type | Description |
|:---|:---:|:---|:---|:---|
| country | Yes | `""` | `string` | The currently selected country. |
| value | Yes | `""` | `string` | The currently selected region. |
| onChange | Yes | - | `function` | Callback that gets called when the user selects a region. Use this to store the value in whatever store you're using (or just the parent component state). |
| onBlur | No | - | `function` | Callback that gets called when the user blurs off the region field. |
| name | No | `"rcrs-region"` | `string` | The name attribute of the generated select box. |
| id | No | `""` | `string` | The ID of the generated select box. Not added by default. |
| classes | No | `""` | `string` | Any additional space-separated classes you want to add. |
| blankOptionLabel | No | `-` | `string` | The label that appears in the region dropdown when the user hasn't selected a country yet.|
| showDefaultOption | No | `true` | `boolean` | Whether you want to show a default option. This is what the user sees in the region dropdown after selecting a country. It defaults to the `defaultOptionLabel` setting (see next). |
| defaultOptionLabel | No | `Select Region` | `string` | The default region option. |
| onChange | No | `-` | `function` | Called when the user selects a region. Use this to store the region value. |
| countryValueType | No | `full` | `string` | If you've changed the country dropdown `valueType` to `short` you will need to set this value to `short` as well, so the component knows what's being passed in the `country` property. |
| labelType | No | `"full"` | `string` | Either `"full"` or `"short"`. This governs whether you see region names or region short codes in the dropdown. |
| valueType | No | `"full"` | `string` | Either `"full"` or `"short"`. This controls the actual `value` attribute of each `<option>` in the dropdown.  |
| disableWhenEmpty | No | `false` | `boolean` | Disables the region field when the user hasn't selected a country. |
| disabled | No | `false` | `boolean` | Disables the region field. If set to true, it overrides `disableWhenEmpty` |
| customOptions | No | `[]` | `Array<string>` | Appends a list of string to the every region dropdown, regardless of the country selected.
| whitelist | No | `{ CountryCode: [] }` | `object` | This setting lets you target specific regions to appear in the dropdown. Only those specified here will appear. This should be an array of region codes keyed by the country code. |
| blacklist | No | `{ CountryCode: [] }` | `object` | This setting lets you target specific regions that should *not* appear in the dropdown. This should be an array of region codes keyed by the country code. || disableWhenEmpty | No | `false` | `boolean` | Disables the region field when the user hasn't selected a country. |
| disabled | No | `false` | `boolean` | Disables the region field. If set to true, it overrides `disableWhenEmpty` |

### Command-line

Check out the `scripts` section of the package.json file to see them all, but these are the highlights:

- `npm start` - regenerate everything, plus a watcher for local development.
- `npm build` - build the dist files again. No watcher.
- `rollup -c --config-countries=UK,US` - generate a custom build of the script `/dist` folder containing only those
countries you specify here. This *seriously* reduces file size, so if you can do it, do it.

### Changelog

- `3.6.1` - Aug 3, 2022
    - Dependency version fix.
- `3.6.0` - Aug 2, 2022
    - React 18 support added.
- `3.5.0` - Jul 30, 2022
    - Upgrade country-region-data to 2.6.0.
- `3.4.0` - Oct 24, 2021
    - Typings fix.
    - Upgrade country-region-data to 1.11.0.
- `3.3.0` - Aug 17, 2021
    - Upgrade country-region-data to 1.10.0.
- `3.2.0` - Jul 30, 2021
    - Upgrade country-region-data to 1.9.0.
- `3.1.0` - May 11, 2021
    - React 17 support added, thanks [madhums](https://github.com/madhums)!
- `3.0.2` - Jan 18, 2021
    - typings file fix.
- `3.0.1` - Sep 26, 2020
    - typings file fix.
- `3.0.0` - Sep 8, 2020
    - blacklist option added for the Region component (thanks [Mitch Rickman](https://github.com/mitch-rickman)!)
    - typings fix and onBlur callback standardized with value passed as first param, with full event as second. This
is a *breaking change*. Thanks [Vinod Ramakrishnan](https://github.com/vinod-rp)!
- `2.1.0` - Mar 28, 2020
    - country-region-data updated to 1.6.0
- `2.0.0` - Mar 21, 2020
    - Typings fixes
    - Dependency updates
- `1.4.7` - Dec 24, 2019:
    - Fix to include typings in published bundle.
- `1.4.6` - Dec 22, 2019:
    - Typescript typings added. Thanks, [Kyle Davis](https://github.com/kyledavisdev)!
    - [country region data](https://github.com/country-regions/country-region-data) updated to 1.5.1
- `1.4.5` - Oct 9, 2019.
    - [country region data](https://github.com/country-regions/country-region-data) updated to 1.5.0
    - RegionDropdown component updates to refactor deprecated componentWillReceiveProps method
    - misc dependency updates
- `1.4.4` - Aug 2, 2019. Country data updates.
- `1.4.3` - Dev 2, 2018:
    - RegionDropdown converted to PureComponent; now updates on any prop change
    - [country region data](https://github.com/country-regions/country-region-data) updated to 1.4.5
- `1.4.2` - Nov 8, 2018:
    - `customOptions` setting added for the Region dropdown.
    - `priorityOptions` option added to the CountryDropdown to allow placing items at the top of the country dropdown.
- `1.4.1` - Sept 9, 2018: bug fix for invalid JSON data source conversion.
- `1.4.0` - Sept 8, 2018:
    - *Breaking change*: the library is no longer exported in UMD format. Now it's only exported in es6
    (`dist/rcrs.es.js`) and commonJS (`dist/rcrs.js`) format. This library is intended for use in _React_ applications.
    - *Breaking change*: no longer available via Bower. I don't recall ANY react component used via Bower, so if I'm
    mistaken here, open a github issue to explain your use-case and I can re-add it.
    If you need UMD, check out the [plain vanilla version](https://github.com/country-regions/country-region-selector).
    - country-region-data updated to latest version (1.4.4)
    - You can now pass arbitrary attributes to the components (e.g. `style={{ color: 'red' }}` and have them output in the
    markup)
    - the old gulp build process updated to use rollup
    - this component library, the source data set and the plain vanilla JS version are now all grouped under a single github
organization
- `1.3.0` - Mar 20, 2018. Bug fix for invalid country, [@n-david](https://github.com/n-david)! onBlur event added.
- `1.2.3` - Nov 7, 2017. Country data updates. React moved to peer dependency, thanks [@iamdey](https://github.com/iamdey)!
- `1.2.2` - Oct 4, 2017 - Update to pass event on change. Thanks [@robertnealan](https://github.com/robertnealan)!
- `1.2.1` - Sept 6, 2017 - IE11 bug fix.
- `1.2.0` - Aug 7, 2017 - updated country-region-data; dependency updates.
- `1.1.0` - May 18, 2017 - dependency updates. `disabled` option added to `<CountryDropdown />` and `<RegionDropdown />`.
- `1.0.4` - April 12, 2017 - bug fix. Thanks @bebbi and @tchaffee!
- `1.0.3` - Jan 2, 2016 - updated country-region-data, repo link fix.
- `1.0.2` - October 16, 2016 - Fix issue where source-data.js in lib had no country data.
- `1.0.0` - July 1, 2016 - initial version.

### Tests

The Jest/Enzyme unit tests are found in the `src/tests` folder. The repo is hooked up to Travis CI to automatically run the tests for each commit.

### Local Dev

This is pretty dated, I'm afraid. But to run this locally, do the following:
- `npm install`
- in one terminal window: `npm start`
- in another terminal window, go to the `/example` subfolder and do the same: `npm install`, `npm start`
- open `http://localhost:3000` in your browser.

### Thanks!

Big thanks to a whole boatload of people:
- contributors to this project and the source data.
- Special thanks to the [create-react-library](https://github.com/transitive-bullshit/create-react-library) tool which
I use here (un-ejected) to rollup this component library. Great stuff.

### License

MIT.


text:
# sad

> ## `S`earch for lines, then `A`dd or `D`elete strings around them.

A shell command that searches a file for lines that match a regular expression and adds or removes strings before or after them.

## Installation

Note: Replace `/directory/set/in/$PATH/` to suit your environment, for example `/usr/local/bin/`.

In your terminal:
```shell
$ git clone git@github.com:aotree/sad.git

$ cd sad/

$ # Allow 'sad' command to be used without './'
$ cp src/sad /directory/set/in/$PATH/
```

## How it works

1. Search the [file] for lines that match a [regexp]
2. Add or delete [string] before or after matched line

## How to use

Usage:
```shell
$ sad [option] [string] [regexp] [file]
```

- Option:
  - -h: Display help
  - -a: Add [string] at the begining of the line
  - -A: Add [string] at the end of the line
  - -d: Delete [string] at the begining of the line
  - -D: Delete [string] at the end of the line

### Note

If you use special characters in the [string], escape them.

- e.g.)
  - If you add or delete #, pass \\# for $2.
  - If you add or delete ;, pass \\; for $2.
  - If you add or delete //, pass \\\\/\\\\/ for $2.
  - If you add or delete <!--, pass \\<\\!\\-\\- for $2.
  - If you add or delete -->, pass \\\\-\\-\\> for $2.

repository: aotree/sad

repo_name: aotree/sad


text:
---
parent: "Getting Started"
title: "Router Setup"
description: "Setting up the router"
slug: "router-setup"
order: 2
---

# Router Setup

Muxa is build to figure out your routes using the directory. This is done
through following a few rules... Lets get started

## Creating your homepage

In `src/routes` create a file called index.tsx

```tsx
import { useRouteData } from "muxa";

//What ever your default export is, will be your route
export default function HomePage() {
  return (
    <div>
      <h1>Hello world</h1>
    </div>
  );
}
```

## Setting up the router

Since everything we are doing is client side, we have to create a file which
will tell Muxa which routes to use. This is done through a command.

In package.json under scripts add a command:

`"migrate": "muxa typescript"`,

If you are not using typescript then remove that part.

We can then run `npm run migrate` which will create a file for us called
route-config.

In `app.js`

```jsx
import { Router, Document } from "muxa";
// importing the routes that are generated by muxa
import { routes } from "./route-config"

export default function App() {
  return (
    <Router>
      <Document routes={routes}>
    </Router>
  );
}
```

And there we go, we now have our home page running!

Just remember that each time you create a new route, you have to run
`npm run migrate` to create your new route.

repository: tobias-z/muxa

gha_language: TypeScript

repo_name: tobias-z/muxa


text:
# ecdaa-python
Python wrappers for the ECDAA project

## Requirements
- ecdaa >= 0.6.0

To use a local copy of `ecdaa` install at `ECDAA_DIR`, do the following before building/installing:
```
python setup.py addlibpath --ecdaa-lib=ECDAA_DIR
```

## Installation
```
python setup.py install
```

## Tests
```
python setup.py test
```

## Usage
See the test script at `ecdaa/test/test_wrapper.py`
for an example of usage.

repository: xaptum/ecdaa-python

gha_language: Python

repo_name: xaptum/ecdaa-python


text:
# Spring AOP
* Aspect Oriented Programming
* inject code
* affect many methods without having to change them
* [good reference](https://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html)

# Aspect / Cross Cutting Concern (CCC)
* the code to inject
* good examples
  * transactions
  * security
  * logging

# Join point
* where you **can** inject
* method execution

# Pointcut
* where you **will** inject
* AspectJ pointcut expression

```java
execution(* com.example.service.EventService.play*(..))
```

# Advice
* **when** you will inject
* before
* after
* after-returning
* after-throwing
* around

# AspectJ annotations
* `@Before`
* `@After`
* `@AfterReturning`
* `@AfterThrowing`
* `@Around`

# Example

# AOP Timer Challenge
* Write an aspect to time methods

gha_language: Java


text:
# Spike JS Standards

This is a super simple wrapper for a basic webpack2 babel configuration. It's `babel-preset-env` without es module parsing (webpack does this), and a plugin for supporting `import()` which is a ecma standard, and webpack uses for dynamic code splitting.

### Installation

`yarn add spike-js-standards`

### Usage

```js
const jsStandards = require('spike-js-standards')

// wherever you have your babel config, this is how spike's looks
module.exports = {
  // ...
  babel: jsStandards()
  // ...
}
```

### Options

| Name | Description | Default |
| ---- | ----------- | ------- |
| **appendPlugins** | Adds a single plugin or array of plugins after all the defaults | |
| **prependPlugins** | Adds a single plugin or array of plugins before all the defaults | |
| **appendPresets** | Adds a single preset or array of presets after all the defaults | |
| **prependPresets** | Adds a single preset or array of presets before all the defaults | |

### License & Contributing

- Details on the license [can be found here](LICENSE.md)
- Details on running tests and contributing [can be found here](contributing.md)

repository: mgienow/first-spike-experiment

repo_name: mgienow/first-spike-experiment


text:
# Dockerfiles

Dockerfiles for building Opencomp specific Docker images

## jtraulle/php

PHP Alpine Linux build with all necessary modules and dependencies needed for running an Opencomp instance (bundled with wkhtml2pdf with patched QT).

### PHP 8.0

#### Alpine 3.12

  * `8.0-fpm-alpine3.12`
  * `8.0-fpm-alpine3.12-dev`

#### Alpine 3.13

  * `8.0-fpm-alpine3.13`
  * `8.0-fpm-alpine3.13-dev`

Standard images are provided with the following PHP modules : `mbstring` `intl` `simplexml` `mysqli` `pdo` `pdo_mysql` `pdo_pgsql` `zip` `gd` `redis`.

Images suffixed with `-dev` are provided with required dependencies for development (this includes Chromium browser for running acceptance tests and php modules `pcov` and `ast` used to calculate code coverage et [`phan`](https://github.com/phan/phan) static analyzer tool).

## jtraulle/wkhtmltopdf

wkhtml2pdf on Alpine Linux from sources with patched QT for supporting headers and footers.

repository: Opencomp/Dockerfiles

repo_name: Opencomp/Dockerfiles