text:
# Dehaze-GAN
This repository contains TensorFlow code for the paper titled **Single Image Haze Removal using a Generative Adversarial Network.** [[Demo](https://www.youtube.com/watch?v=ioSL6ese46A)][[Arxiv](http://arxiv.org/abs/1810.09479)]

## Update (June 2021) (important)
On a recent review of some code I found a few issues. In the document [issue.md](issue.md), I have provided an explanation of the issues, their possible impact, and the remedies I have taken to account for the issues. Please read the document before attempting to use the codebase. I apologize for the inconvenience.

## Update (August 2020)
This work has been accepted for the 2020 International Conference on Wireless Communications, Signal Processing and Networking (**WiSPNET 2020**). The arxiv version of this work (originally published around 2018) will be updated with the accepted version of the paper. ~~Will attach a document listing out the major updates to the paper soon!~~

> (EDIT: Oct 2021) I wanted to upload a document describing the major changes between v1 and v2 of the arxiv papers but I was not able to allocate enough time to do so. The v1 paper was put on arxiv sometime in October 2018. The v2 version is shorter, but is better written than the v1 version and also has made some corrections. The v2 version of the paper is the one that was accepted for the WiSPNET 2020 conference. The interested reader can access both versions from arxiv. However, it is recommended to follow the v2 version of the paper (along with `issue.md` and other docs in this codebase).

## Features:
The model has the following components:
- The 56-Layer Tiramisu as the generator.
- A patch-wise discriminator.
- A weighted loss function involving three components, namely:
  - GAN loss component.
  - Perceptual loss component (aka VGG loss component).
  - L1 loss component.

Please refer to the [paper](http://arxiv.org/abs/1810.09479) for a detailed description.

## Notes:
1. The first version of this project was completed around December 2017. The demo video (dated March 2018) reflects the performance of one of the final versions, however some iterative improvements were made after that.
2. This repository contains code that can be used for any application, and is not limited to Dehazing.
3. For recreating the results reported in the paper, use the repository `legacy` (for more details refer below). This repository is the refactored version of the final model, but it uses newer versions of some TensorFlow operations. Those operations are not available in the old saved checkpoints.
4. ~~The codebase uses OpenCV's `imread` and `imwrite` functions without converting them from BGR to RGB space. However, there might be cases where this type of usage (such as was raised in this issue about `extract.py`) may not be desirable. To maintain reproducibility, the original code is left intact. If you application desires usage of images in the RGB space, you could manually convert them from BGR to RGB.~~ (**UPDATE: June 2021**) Please ignore the content that is stricken through. On a recent analysis I made a few key observations. Please refer to the document [issue.md](issue.md) for a detailed explanation of the colorspace issue.

## Requirements:
- TensorFlow (version 1.4+)
- Matplotlib
- Numpy
- Scikit-Image

## Instructions:
1. Clone the repository using:
```
git clone https://github.com/thatbrguy/Dehaze-GAN.git
```

2. The codebase has two branches namely `master` and `alt`. There are some differences between the two branches. The user has to choose one of the two branches to use based on their preferences. Please read [issue.md](issue.md) to understand the differences between the two branches. For instructions on the steps that are needed to be taken to setup the desired branch, go the section `Step 2 from README Instructions` in `issue.md` ([link](issue.md/#step-2-from-readme-instructions)).

3. A VGG-19 pretrained on the ImageNet dataset is required to calculate perceptual loss. In this work, we used the weights provided by [machrisaa](https://github.com/machrisaa/tensorflow-vgg)'s implementation. Download the weights from this [link](https://mega.nz/#!xZ8glS6J!MAnE91ND_WyfZ_8mvkuSa2YcA7q-1ehfSm-Q1fxOvvs) and include it in this repository.
> **Note:** You may consider using a different implementation of imagenet pretrained VGG-19 which can automatically download the weights (for example, the implementation from keras). However, in that case you would also have to modify the codebase a lot so that it can correctly use your desired implementation. Hence, please be careful if you want to use a different implementation.

4. Download the dataset.
- We used the [NYU Depth Dataset V2](https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html) and the [Make 3D](http://make3d.cs.cornell.edu/data.html) dataset for training. The following code will download the NYU Depth Dataset V2 and create the hazy and clear image pairs. The images will be placed in directories `A` and `B` respectively. The formula and values used to create the synthetic haze are stated in our paper.
```
wget -O data.mat http://horatio.cs.nyu.edu/mit/silberman/nyu_depth_v2/nyu_depth_v2_labeled.mat
python extract.py
```
> **Note 1:** The above step is only given for the NYU dataset. If you are interested in creating hazy and clear image pairs for any other dataset which has RGB and depth information, please create your own script. The method mentioned in `extract.py` can be adapted for your custom dataset.

> **Note 2:** For training the model in the paper (and also for validation and some testing experiments), we also used some data from the Make 3D dataset. Around the time the codebase was released, I think there were some issues with accessing the dataset link and hence `extract.py` was only given for the NYU dataset. If the link is accessible now and you are interested in using the Make 3D dataset, you can create your own script to create hazy and clear image pairs by using the method in `extract.py` as a reference.

5. In case you want to use your own dataset, follow these instructions. If not, skip this step.
- Create two directories `A` and `B` in this repository.
- Place the input images into directory `A` and target images into directory `B`.
- Ensure that an input and target image pair has the **same name**, otherwise the program will throw an error (For instance, if `0001.png` is present in `A` it must also be present in `B`).
- Resize all images to be of size `(256, 256, 3)`.

6. Train the model by using the following code.
```
python main.py \
--A_dir A \
--B_dir B \
--batch_size 2 \
--epochs 20
```
The file `main.py` supports a lot of options, which are listed below:
- `--mode`: Select between `train`, `test` and `inference` modes. For `test` and `inference` modes, please place the checkpoint files at `./model/checkpoint` (you can replace `model` with your setting of the `--model_name` argument). Default value is `train`.
- `--model_name`: Tensorboard, logs, samples and checkpoint files are stored in a folder named `model_name`. This argument allows you to provide the name of that folder. Default value is `model`.
- `--lr`: Sets the learning rate for both the generator and the discriminator. Default value is `0.001`.
- `--epochs`: Sets the number of epochs. Default value is `200`.
- `--batch_size`: Sets the batch_size. Default value is `1`.
- `--restore`: Boolean flag that enables restoring from old checkpoint. Checkpoints must be stored at `model_name/checkpoint`. Default value is `False`.
- `--gan_wt`: Weight factor for the GAN loss. Default value is `2`.
- `--l1_wt`: Weight factor for the L1 loss. Default value is `100`.
- `--vgg_wt`: Weight factor for the Perceptual loss (VGG loss). Default value is `10`.
- `--growth_rate`: Growth rate of the dense block. Refer to the DenseNet paper to learn more. Default value is `12`.
- `--layers`: Number of layers per dense block. Default value is `4`.
- `--decay`: Decay for the batchnorm operation. Default value is `0.99`.
- `--D_filters`: Number of filters in the 1st conv layer of the discriminator. Number of filters is multiplied by 2 for every successive layer. Default value is `64`.
- `--save_samples`: Since GAN convergence is hard to interpret from metrics, you can choose to visualize the output of the generator after each validation run. This boolean flag enables the behavior. Default value is `False`.
- `--sample_image_dir`: If `save_samples` is set to `True`, you must provide sample images placed in a directory. Give the name of that directory to this argument. Default value is `samples`.
- `--custom_data`: Boolean flag that allows you to use your own data for training. Default is `True`. (Note: As of now, I have not linked the data I used for training).
- `--A_dir`: Directory containing the ipnut images. Only used when `custom_data` is set to `True`. Default value is `A`.
- `--B_dir`: Directory containing the target images. Only used when `custom_data` is set to `True`. Default value is `B`.
- `--val_fraction`: Fraction of the data to be used for validation. Only used when `custom_data` is set to `True`. Default value is `0.15`.
- `--val_threshold`: Number of steps to wait before validation is enabled. Usually, the GAN performs suboptimally for quite a while. Hence, disabling validation initially can prevent unnecessary validation and speeds up training. Default value is `0`.
- `--val_frequency`: Number of batches to wait before performing the next validation run. Setting this to `1` will perform validation after one discriminator and generator step. You can set it to a higher value to speed up training. Default value is `20`.
- `--logger_frequency`: Number of batches to wait before logging the next set of loss values. Setting it to a higher value will reduce clutter and slightly increase training speed. Default value is `20`.

## Replicating:
The code in `legacy` can be used for replicating results of our model on the test split of the "Custom Dataset" as mentioned in the paper. The following steps explain how to replicate the results:

1. Download the model checkpoint and the data used for testing from this [link](https://drive.google.com/file/d/1d2HUyumIu6BwSYiPuGOdnvTiCArQjrCm/view?usp=sharing). Place the tar file inside the `legacy` folder. Extract the contents using the following commands.
```
cd legacy
tar -xzvf replicate.tar.gz
```
2. Move weights of the pretrained VGG-19 into the the `legacy` folder. The download [link](https://mega.nz/#!xZ8glS6J!MAnE91ND_WyfZ_8mvkuSa2YcA7q-1ehfSm-Q1fxOvvs) is reproduced here for convenience.

3. Run the code from the `legacy` folder using:
```
python replicate.py
```

If you would like to replicate the results on the SOTS outdoor dataset as well, you may do so. However, a ready to use script to quickly test it is not provided. However, it should be pretty straightforward to write and add a small function in `replicate.py` to test the same.

## Known Issues:
1. For newer versions of NumPy, you may get an error when the codebase attempts to load the pretrained VGG-19 weights NumPy file (for example, see issue [#7](https://github.com/thatbrguy/Dehaze-GAN/issues/7)). One simple solution to avoid this issue is to use a lower version of NumPy (as mentioned in issue [#7](https://github.com/thatbrguy/Dehaze-GAN/issues/7)). If you prefer to use a higher version of NumPy, you can take a look at PR [#17](https://github.com/thatbrguy/Dehaze-GAN/pull/17) on how to modify the code so that it can work with the higher versions of NumPy.

2. This repository may not work with TensorFlow 2.x out of the box. It also may not work with eager mode for TensorFlow 1.x out of the box. The code was created a few years ago so consider using an older version of TensorFlow 1.x (maybe around 1.4 to 1.9) in the graph execution mode (which is the default mode for TensorFlow 1.x).

## License:
This repository is open source under the MIT clause. Feel free to use it for academic and educational purposes.


text:
---
title: Whanganui rider Rebecca Benge at NZ Mounted Games aiming for clean sweep
  of open titles
feature_image:
  image: https://res.cloudinary.com/whanganuihigh/image/upload/v1616114034/News/Rebecca_Benge._Chron_19.3.21_photo_Alex_Naera_Equestrian_phtos.jpg
  description: "Whanganui rider Rebecca Benge on her way to winning the national
    open pairs title on chestnut mare Cindy at the New Zealand Mounted Games
    Championships in Hawke's Bay last week. "
  credit: Alex Naera Equestrian Photos
news_author:
  date: 2021-03-19T00:32:59.430Z
  publication: Whanganui Chronicle
  name: Iain Hyndman
extracurricular_areas:
  - Sport
show_in_slider: true
date: 2021-03-19T00:32:59.482Z
---
Whanganui riders continue to feature among the elite group at national level of the New Zealand Mounted Games.

Former Whanganui High School student, **Rebecca Benge**, 20, only needs the national individual title to hold all three trophies in the open grade after winning the open teams and open pairs in Hastings last week. Benge won the open pairs title with partner Olivia Brookes (Hawke's Bay) riding Briar.

Normally the national pairs and teams events are held in conjunction with the Horse of the Year showcase in Hawke's Bay, but with HOY cancelled because of Covid-19 this season, the Mounted Games was held as a stand-alone event.

The national individual competition will also be held as a stand-alone event as it traditionally is over Easter weekend, this year in Cambridge.

If Benge is successful in adding the open individual title to her tally at Easter this season, she will hold all three major open trophies on offer.

Meanwhile, fellow Whanganui club member Hayden O'Leary finished third in the open team event, after a jump-off with another team following a dead-heat for second.

O'Leary's younger sister Elena O'Leary finished third in the under-17 pairs and under-17 teams.

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: Blade

gha_license_id: MIT

license_type: permissive


text:
---
title: 'How to publish email bounce notifications to an SQS queue'
excerpt: 'In this post, I configure AWS to publish email bounce notifications to an SQS queue using terraform'
coverImage: './cover.jpg'
category: "programming"
tags:
    - 'terraform'
    - 'devops'
    - 'AWS'
series: Handle email bounce notifications
---

Recently, I had to work on a task to notify us in slack whenever an email sent through Amazon Simple Email Service(SES) bounced. **Rohan Deshpande** has a great [article which shows how to handle bounces and complaints](https://aws.amazon.com/blogs/messaging-and-targeting/handling-bounces-and-complaints/). Since this article leans heavily on his approach, I recommend reading that first.

Go on, I will wait.

Oh, Good, you are back. So you might be wondering that if Rohan has already written the article, why am I writing this and more importantly, why should you spend your precious time reading this?

Well, although his solution solves the problem, it requires me to use the AWS Management Console. However, I want to leverage [terraform](https://www.terraform.io/) so that any changes I make can be easily deployed to all the environments.

## Step 1: Create an Amazon SQS queue

I will setup the SQS queue using [Resource: aws_sqs_queue](https://www.terraform.io/docs/providers/aws/r/sqs_queue.html)

```hcl
resource "aws_sqs_queue" "ses_bounces_queue" {
  name                      = "ses_bounces_queue"
  message_retention_seconds = 1209600
  redrive_policy            = "{\"deadLetterTargetArn\":\"${aws_sqs_queue.ses_dead_letter_queue.arn}\",\"maxReceiveCount\":4}"
}

resource "aws_sqs_queue" "ses_dead_letter_queue" {
  name = "ses_dead_letter_queue"
}
```

-   Set the human-readable name of the queue to _ses_bounces_queue_ so that terraform does not assign a random name to our queue.
-   Set the number of seconds SQS retains the message to 14 days(1209600 seconds).
-   Set up our dead letter queue to handle messages that could not be handled to help debug and isolate problems. Read more about [SQS Dead-Letter Queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html).

## Step 2: Create an Amazon SNS topic_arn

I will set up the SNS topic using [Resource: aws_sns_topic](https://www.terraform.io/docs/providers/aws/r/sns_topic.html)

```hcl
resource "aws_sns_topic" "ses_bounces_topic" {
  name     = "ses_bounces_topic"
}
```

-   Set the human-readable name of the queue to _ses_bounces_topic_ so that terraform does not assign a random name to our queue.

## Step 3: Configure the Amazon SNS topic to publish to the SQS queue

I will use [Resource: aws_sns_topic_subscription](https://www.terraform.io/docs/providers/aws/r/sns_topic_subscription.html) to automatically place the messages sent to the SNS topic in the SQS queue.

```hcl
resource "aws_sns_topic_subscription" "ses_bounces_subscription" {
  topic_arn = aws_sns_topic.ses_bounces_topic.arn
  protocol  = "sqs"
  endpoint  = aws_sqs_queue.ses_bounces_queue.arn
}
```

-   Set the ARN of the SNS topic to subscribe to _ses_bounces_topic_.
-   Set the protocol to _sqs_ so that we can send the data to the SQS queue.
-   Set the endpoint to _ses_bounces_queue_.

## Step 4: Configure Amazon SES to publish bounce notifications using ses-bounces-topic to ses-bounces-queue

I will use [Resource: ses_identity_notification_topic](https://www.terraform.io/docs/providers/aws/r/ses_identity_notification_topic.html) to set the SNS topic to use when delivering bounce notifications.

```hcl
resource "aws_ses_identity_notification_topic" "ses_bounces" {
  topic_arn                = aws_sns_topic.ses_bounces_topic.arn
  notification_type        = "Bounce"
  identity                 = email_domain
  include_original_headers = true
}
```

-   Set the Amazon SNS topic to _ses_bounces_topic_.
-   Set the notification type to _Bounce_.
-   Set the identity to the email domain, e.g. setting to _example.com_ will set it for emails in the _example.com_ domain.
-   Include the original email headers in the SNS notifications.

## Step 5: Ensure that IAM policies are in place so that Amazon SNS has access to publish to the appropriate SQS queues

I will use [Data Source: aws_iam_policy_document](https://www.terraform.io/docs/providers/aws/d/iam_policy_document.html) to configure the IAM policy to allow the SNS topic to send messages to the SQS queue and use [Resource: aws_sqs_queue_policy](https://www.terraform.io/docs/providers/aws/r/sqs_queue_policy.html) to set the policy of the queue.

```hcl
data "aws_iam_policy_document" "ses_bounces_queue_iam_policy" {
  policy_id = "SESBouncesQueueTopic"
  statement {
    sid       = "SESBouncesQueueTopic"
    effect    = "Allow"
    actions   = ["SQS:SendMessage"]
    resources = ["${aws_sqs_queue.ses_bounces_queue.arn}"]
    principals {
      identifiers = ["*"]
      type        = "*"
    }
    condition {
      test     = "ArnEquals"
      values   = ["${aws_sns_topic.ses_bounces_topic.arn}"]
      variable = "aws:SourceArn"
    }
  }
}

resource "aws_sqs_queue_policy" "ses_queue_policy" {
  queue_url = aws_sqs_queue.ses_bounces_queue.id
  policy    = data.aws_iam_policy_document.ses_bounces_queue_iam_policy.json
}
```

-   Set an id for the policy document.
-   Allow the sending of a message to the _ses_bounces_queue_ SQS queue.
-   Allow it on all principles. _We can probably lock it down to just AWS ARN's_.
-   Constrain the policy so that access is allowed only when the request originates from _ses_bounces_topic_.
-   Set the URL of the SQS queue to _ses_bounces_queue_.
-   Set the policy.

## Next Steps

You can see the [code here](https://github.com/AnkurSheel/ses-bounces).

So far, we have configured AWS to publish bounce notifications to an SQS queue. In the next post(s), we will see how we can configure an AWS Lambda to process the messages in the queue and send a custom message to a Slack channel.

Read [Part2](./handle-bounces-aws-ses-terraform-2)

gha_language: HTML


text:
# Computer-Vision
This repository will contain the implementation of various types of application of Computer Vision.

## Getting Started

These instructions will get you various implementation of applications of computer vision up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

## Authors

* **Archit Khatri** - *Initial work* - [architkhatri98](https://github.com/architkhatri98)

See also the list of [contributors](https://github.com/architkhatri98/Computer-Vision/contributors) who participated in this project.

## License
https://github.com/ritika1995/scoobynaturalhttps://github.com/ritika1995/scoobynatural
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* Hat tip to anyone whose code was used

gha_language: Python


text:
# KRRPM (Repository under construction)
## Kernel Ridge Regression Predictive Machine

This repository contains an implementation of a Kernel Ridge Regression
Predictive Machine, a non-parametric method for the probabilistic prediction of
continuous values.

The implementation is available as a package that can be installed with `pip`

```
pip install krrpm
```

## KRRPM
KRRPM[1] is a form of Conformal Predictive Distribution[2] which is a framework for
non-parametric prior-free probabilistic prediction.
The prediction for a test object is provided in the form of Cumulative
Distribution Function for the label of test objects.

![Predictive Distribution](PredictiveDistributionInterpretation.png "Predictive Distribution")

A key advantage is that, under minimal assumptions, the KRRPM produces
**calibrated** predictions, i.e. the probabilities assigned to events correspond
to the relative frequencies of those events, within statistical
fluctuation. The only assumption is that training data and test data be
*i.i.d.*, that is, independent and identically distributed.

 A gentle introduction to Conformal Predictive Distributions can be found in the
 Tutorial at [https://cml.rhul.ac.uk/people/ptocca/HomePage/COPA2020___Tutorial_on_Predictive_Distributions.pdf]

## KRRPM Implementation
The KRRPM.py file implements the Kernel Ridge Regression Predictive Machine.
The API it exposes has been kept as similar as possible to that of
`scikit-learn` regressors. This makes it interoperable with the `scikit-learn`
framework, allowing in particular the use of its parameter optimization
 facilities (e.g. `GridSearchCV`).

An instance of the KRRPM regressor is first created with the constructor
`KRRPM()`, which takes a scalar `a` as regularization parameter and a choice of
`kernel`.     The regression can be then `fit()` on the training data.     The
predictions are obtained with the `predict()` method; in keeping with the
`scikit-learn` conventions, the `predict()` method returns a vector with one
scalar (as opposed to a distribution) for each supplied test object. The value
corresponds to the median in the distribution computed for the test object. The
predictive distributions are in a data attribute (`predicted_distributions`) of
the regressor, which is populated when the predict() method is called. Each
predictive distribution (which corresponds in a sense to a Cumulative  Distribution Function, as mentioned
above) is expressed as a step-wise function specified by an array of 'n' floats.
The steps have all "height" `1/n` and the elements of the array specify their
location.

The implementation uses *O(n^2)* memory and *O(n^3)* time.

Some effort has been put into minimizing the use of memory.
As a reference, a training set of 80,000 objects was used successfully to train
a KRRPM model on a server with 132GB of RAM.

## KRRPM Example
The notebook `KRRPM-Example.ipynb` in this repository provides a complete example of the application of KRRPM.
It can be run by clicking on the badge below.

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ptocca/KRRPM/HEAD?filepath=examples/KRRPM-Example.ipynb)

## Acknowledgements
This implementation was developed while at the Centre for Reliable Machine Learning, Royal Holloway, University of London.
The author is grateful to AstraZeneca for the grant R10911 "Automated Chemical Synthesis".

## References
[1]: "Conformal Predictive Distributions  with Kernels", V. Vovk et al., 2018 [https://link.springer.com/chapter/10.1007/978-3-319-99492-5_4]
[2]: "Nonparametric Predictive Distributions Based on Conformal Prediction", V. Vovk, 2019, [https://doi.org/10.1007/s10994-018-5755-8]

repository: ptocca/KRRPM

branch_name: refs/heads/main

repo_name: ptocca/KRRPM


text:
Status
======

**NOTE: This project has been rebooted at [https://github.com/pinf](https://github.com/pinf) and is maintained
here for archival purposes only until applicable content has been moved to new projects.**

Overview
========

PINF is a toolchain automation platform designed to manipulate your project artifacts via defined,
predictable and repeatable processes in a globally unique namespace.

Initial audience: **Server Side JavaScript developers**

Requirements: **UNIX, java, git**

Start with the [Quick Start Guide](http://github.com/cadorn/pinf/blob/master/docs/QuickStart.md).
You can follow PINF on [twitter](http://twitter.com/pinf), [email](http://groups.google.com/group/pinf-dev) or
[github](http://github.com/cadorn/pinf).

More information (*Coming Soon* is referring to the documentation, the features are mostly implemented):

 * [Quick Start](http://github.com/cadorn/pinf/blob/master/docs/QuickStart.md)
 * [About PINF](http://github.com/cadorn/pinf/blob/master/docs/About.md)
 * [Roadmap](http://github.com/cadorn/pinf/blob/master/docs/Roadmap.md)
 * [Installing PINF](http://github.com/cadorn/pinf/blob/master/docs/Install.md)
 * [Configuration](http://github.com/cadorn/pinf/blob/master/docs/Configuration.md)
 * [Directory Structure](http://github.com/cadorn/pinf/blob/master/docs/DirectoryStructure.md)
 * [Packages](http://github.com/cadorn/pinf/blob/master/docs/Packages.md) - *Coming Soon*
 * [Workspaces](http://github.com/cadorn/pinf/blob/master/docs/Workspaces.md) - *Coming Soon*
 * [Platforms](http://github.com/cadorn/pinf/blob/master/docs/Platforms.md) - *Coming Soon*
 * [Build Flow](http://github.com/cadorn/pinf/blob/master/docs/BuildFlow.md) - *Coming Soon*
 * [Builders](http://github.com/cadorn/pinf/blob/master/docs/Builders.md) - *Coming Soon*
 * [Build Server](http://github.com/cadorn/pinf/blob/master/docs/BuildServer.md) - *Coming Soon*
 * [Namespaces](http://github.com/cadorn/pinf/blob/master/docs/Namespaces.md) - *Coming Soon*
 * [Versioning](http://github.com/cadorn/pinf/blob/master/docs/Versioning.md) - *Coming Soon*
 * [Registry](http://github.com/cadorn/pinf/blob/master/docs/Registry.md)
 * [Vendors](http://github.com/cadorn/pinf/blob/master/docs/Vendors.md)
 * [CLI](http://github.com/cadorn/pinf/blob/master/docs/CLI.md)
 * [Links](http://github.com/cadorn/pinf/blob/master/docs/Links.md)
 * [Notes](http://github.com/cadorn/pinf/blob/master/docs/Notes.md)

 * [PINF Fundamental Design](http://github.com/cadorn/pinf/blob/master/docs/Design/Foundation.md)

Status
======

PINF is under **heavy development** and while some concepts are set in stone many details are a work in progress.

PINF is considered to be of **Alpha** quality meaning things are subject to change without notice. That being said we will
try hard to make changes as pain free as possible. After all we use PINF too and need the same migration paths.

Even though PINF is a young project, with some care it can be used in **production workflows**. We are
actively looking for **early adopters** to begin using PINF. This is essential to prove PINF as a generic
toolchain automation platform by ensuring it works with many different workflows and requirements.

License
=======

[MIT License](http://www.opensource.org/licenses/mit-license.php)

Copyright (c) 2009-2010 Christoph Dorn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

repository: cadorn/pinf-during-commonjs

repo_name: cadorn/pinf-during-commonjs


text:
# python-dtab
Python DTab Parser (Delegation Table)

This is a direct port of Finagles [DTab implementation](http://twitter.github.io/finagle/guide/Names.html).

## What works
* parser (see tests for usage)

## What doesn't work
* namers aren't implemented

repository: jayeve/python-dtab

repo_name: jayeve/python-dtab


text:
---
sidebar_position: 5
sidebar_label: "Access keys and login 1/2"
title: "Covering access keys and login"
---

import chapter1Correct from '/docs/assets/crosswords/chapter-1-crossword-correct.gif';
import accessKeys from '/docs/assets/crosswords/keys-cartoon-good--alcantara_gabriel.near--Bagriel_5_10.png';
import functionCallAction from '/docs/assets/crosswords/function-call-action.png';
import tutorialAccessKeys from '/docs/assets/crosswords/access-keys.png';

# Logging in with NEAR

## Previously…

In the previous chapter we simply displayed whether the crossword puzzle was solved or not, by checking the solution hash against the user's answers.

## Updates to transfer prize money

In this chapter, our smart contract will send 5 Ⓝ to the first person who solves the puzzle. For this, we're going to require the user to have a NEAR account and log in.

:::note Better onboarding to come
Later in this tutorial we won't require the user to have a NEAR account.

Since logging in is important for many decentralized apps, we'll show how this is done in NEAR and how it's incredibly unique compared to other blockchains.
:::

This transfer will occur when the first user to solve the puzzle calls the `submit_solution` method with the solution. During the execution of that function it will check that the user submitted the correct answer, then transfer the prize.

We'll be able to see this transfer (and other steps that occurred) in [NEAR Explorer](https://explorer.testnet.near.org).

But first let's talk about one of the most interesting superpowers of NEAR: access keys.

## Access keys

You might be familiar with other blockchains where your account name is a long string of numbers and letters. NEAR has an account system where your name is human-readable, like `friend.testnet` for testnet or `friend.near` for mainnet.

You can add (and remove) keys to your account on NEAR. There are two types of keys: full and function-call access keys.

The illustration below shows a keychain with a full-access key (the large, gold one) and two function-call access keys.

Art by alcantara_gabriel.near

### Full-access keys

Full-access keys are the ones you want to protect the most. They can transfer all the funds from your account, delete the account, or perform any of the other [Actions on NEAR](03-actions.md).

When we used the `near login` command in the [previous chapter](../01-basics/01-set-up-skeleton.md#creating-a-new-key-on-your-computer), that command asked the full-access key in the NEAR Wallet to use the `AddKey` Action to create another full-access key: the one we created locally on our computer. NEAR CLI uses that new key to deploy, make function calls, etc.

### Function-call access keys

Function-call access keys are sometimes called "limited access keys" because they aren't as powerful as the full access keys.

A Function-call access key will specify:

- What contract it's allowed to call
- What method name(s) it's allowed to call (you can also specify all functions)
- How much allowance it's allowed to use on these function calls

It's only allowed to perform the `FunctionCall` Action.

### Example account with keys

Let's look at this testnet account that has one full-access key and two function-call access keys. As you can see, we use the NEAR CLI [command `keys`](https://docs.near.org/tools/near-cli#near-keys) to print this info.

Let's look deeper into each key.

#### First key:

```js
{
  access_key: {
    nonce:<PHONE_NUMBER>0000, // Large nonce, huh!
      permission: {
      FunctionCall: {
        allowance: '777000000000000000000000000', // Equivalent to 777 NEAR
          method_names: [], // Any methods can be called
          receiver_id: 'puzzle.testnet' // This key can only call methods on puzzle.testnet
      }
    }
  },
  public_key: 'ed25519:9Hhm77W4KCFzFgK55sZgEMesYRaL8wV1kpqh8qntnSPV'
}
```

The first key in the image above is a function-call access key that can call the smart contract `puzzle.testnet` on **any method**.  Note the empty array (`[]`) next to `method_names`, which indicates this.

We won't discuss the nonce too much, but know that in order to prevent the possibility of [replay attacks](https://en.wikipedia.org/wiki/Replay_attack), the nonce for a newly-created key is large and includes info on the block height as well as a random number.

The allowance is the amount, in yoctoNEAR, that this key is allowed to use during function calls. This **cannot** be used to transfer NEAR. It can only be used in gas for function calls.

The allowance on this key is intentionally large for demonstration purposes. `777000000000000000000000000` yoctoNEAR is `777` NEAR, which is unreasonably high for an access key. So high, in fact, that it exceeded the amount of NEAR on the contract itself when created. This shows that you can create an access key that exceeds the account balance, and that it doesn't subtract the allowance at the time of creation.

So the key is simply allowed to use the allowance in NEAR on gas, deducting from the account for each function call.

#### Second key:

```js
{
  access_key: {
    nonce:<PHONE_NUMBER>0000,
    permission: {
      FunctionCall: {
        allowance: '250000000000000000000000', // 0.25 NEAR, which is a typical allowance
        method_names: [ 'foo', 'bar' ], // Can call methods foo and bar only
        receiver_id: 'puzzle.testnet'
      }
    }
  },
  public_key: 'ed25519:CM4JtNo2sL3qPjWFn4MwusMQoZbHUSWaPGCCMrudZdDU'
},
```

This second key specifies which methods can be called, and has a lower allowance.

Note that the allowance for this key (a quarter of a NEAR) is the default allowance when a person "logs in" in with the NEAR Wallet.

In NEAR, "logging in" typically means adding a key like this to your account. We'll cover this more in a moment.

#### Third key

```js
{
  access_key: { nonce:<PHONE_NUMBER>0019, permission: 'FullAccess' },
  public_key: 'ed25519:FG4HjEPsvP5beScC3hkTLztQH8k9Qz9maTaumvPDa5t3'
}
```

The third key is a full-access key.

Since this key can perform all the Actions, there aren't additional details or restrictions like the function-call access keys we saw.

## What does "log in" mean in a blockchain context?

Let's take a step back from NEAR and talk about how login works broadly using web3 wallets.

A web3 wallet (like Ethereum's MetaMask, Cosmos's Keplr, or the NEAR Wallet) stores a private key for an account. When interacting with decentralized apps, a user will typically use the wallet to sign transactions and send them to the blockchain for processing.

However, web3 wallets can also be used to sign any kind of message, and it doesn't need to send anything to the blockchain. This is sometimes called "offline signing" and protocols will sometimes create standards around how to sign data.

In other ecosystems, the idea of "logging in" with a web3 wallet uses this offline signing. A user is asked to sign a structured message and a backend can confirm that the message was signed by a given account.

NEAR keys can also sign and verify messages in this manner. In fact, there are a couple simple examples of how to achieve this in the [`near-api-js` cookbook](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/verify-signature.js).

There are potential drawbacks to this offline signing technique, particularly if a signed message gets intercepted by a malicious party. They might be able to send this signature to a backend and log in on your behalf.  We quickly see that using a web3 wallet for signed typed data runs into limitations.

So signing a message is fine, but what if we could do better?

With NEAR, we can leverage access keys to improve a user's login experience and give the power back to the user.

If I log into the [Guest Book example site](https://github.com/near-examples/guest-book-js), I create a unique key just for that dApp, adding it to my account. When I'm done I can remove the key myself. If I suspect someone has control of my key (if a laptop is stolen, for example) I can remove the key as long as I have a full-access key in my control.

Logging in with NEAR truly gives the end user control of their account and how they interact with dApps, and does so on the protocol level.

---

The concept of access keys is so important that we've spent longer than usual on the topic without actually implementing code for our improved crossword puzzle.

Let's move to the next section and actually add the login button.

repository: think-in-universe/docs

gha_language: TypeScript

repo_name: think-in-universe/docs


text:
# Persian Poetry Generator
Martin Gorner originally wrote this code in this [repo](https://github.com/martin-gorner/tensorflow-rnn-shakespeare). I just modified it to make it compatible with Persian language. I also gathered some Persian poetry from the renowned Persian poet Ferdowsi from the [Ganjoor](https://ganjoor.net/) site.

Clone this repo and execute the following command to start the training process:

```bash
$ python rnn_train.py
```

During the training, you can view some sample piece of poetry generated by the network in Pinglish (Persian written in English letters).

After the training finished, you can modify the `rnn_play.py` file to set the trained file path. Then run this file to
generate a random generated poetry.

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

# Code for the Recurrent Neural Network in the presentation "Tensorflow and deep learning - without a PhD, Part 2"

The presentation itself is available here:

* [Video](https://t.co/cIePWmdxVE)
* [Slides](https://goo.gl/jrd7AR)

## Usage:

```
> python3 rnn_train.py
```
The script **rnn_train.py** trains a language model on the complete works of William Shakespeare.
You can also train on Tensorflow Python code. See comments in the file.

The file **rnn_train_stateistuple.py** implements the same model using
the state_is_tuple=True option in tf.nn.rnn_cell.MultiRNNCell (default).
Training is supposedly faster (by ~10%) but handling the state as
a tuple is a bit more cumbersome.

```
> tensorboard --logdir=log
```
The training script **rnn_train.py** is set up to save training and validation
data as "Tensorboard sumaries" in the "log" folder. They can be visualised with Tensorboard.
In the screenshot below, you can see the RNN being trained on 6 epochs of Shakespeare.
The training and valisation curves stay close together which means that overfitting is not a major issue here.
 You can try to add some dropout but it will not improve the situation much becasue it is already quite good.

![Image](https://martin-gorner.github.io/tensorflow-rnn-shakespeare/tensorboard_screenshot.png)
```
> python3 rnn_play.py
```

The script **rnn_play.py** uses a trained snapshot to generate a new "Shakespeare" play.
You can also generate new "Tensorflow Python" code. See comments in the file.

Snapshot files can be downloaded from here:

[Fully trained](https://drive.google.com/file/d/0B5njS_LX6IsDQ1laeDJ6dktSb3M/view?usp=sharing)
on Shakespeare or Tensorflow Python source.

[Partially trained](https://drive.google.com/file/d/0B5njS_LX6IsDc2Y0X1VWc1pVTE0/view?usp=sharing)
to see how they make progress in training.

```
> python3 -m unittest tests.py
```
Unit tests can be run with the command above.

## FAQ

### 1) Why not apply a softmax activation function to the outputs of the LSTM directly?
That is because you need to convert vectors of size CELLSIZE to size ALPHASIZE.
The reduction of dimensions is best performed by a learned layer.

###  Why does it not work with just one cell? The RNN cell state should still enable state transitions, even without unrolling ?
Yes, a cell is a state machine and can represent state transitions like
the fact that an there is a pending open parenthesis and that it will need
to be closed at some point. The problem is to make the network learn those
transitions. The learning algorithm only modifies weights and biases. The input
state of the cell cannot be modified by it: that is a big problem if the wrong
predictions returned by the cell are caused by a bad input state. The solution
is to unroll the cell into a sequence of replicas. Now the learning algorithm
can change the weights and biases to influence the state flowing from one cell
in the sequence to the next (with the exception of the input state of the first
cell)

###  3) OK, so this trained model will only be able to generate state transitions over a distance equal to the number of cells in an unrolled sequence, right ?
No, it will be able to *learn* state transitions over that distance only.
However, when we will use the model to generate text, it will be able to produce
correct state transitions over longer distances. For example, if the unrolling
size is 30, the model will be able to correctly open and close parentheses over
distances of 100 characters or more. But you will have to teach it this trick
using examples of 30 or less characters.

###  4) So, now that I have unrolled the RNN cell, state passing is taken care of. I just have to call my train_step in a loop right ?
Not quite, you sill need to save the last state of the unrolled sequence of
cells, and feed it as the input state for the next minibatch in the traing loop.

### 5) What is the proper way of batching training sequences ?
All the character sequences in the first batch, must continue in the second
batch and so on, because all the output states produced by the sequences in the
first batch will be used as input states for the sequences of the second batch.
txt.rnn_minibatch_sequencer is a utility provided for this purpose.
It even continues sequences from one epoch to the next (apart from one sequence
in the last batch of the epoch: the one where the training text finishes. There
is no way to continue that one.) So there is no need to reset the state between
epochs. The training will see at most one incoherent state per epoch, which is
negligible.

### 6) Any other gotcha's ?
When saving and restoring the model, you must name your placeholders and name
your nodes if you want to target them by name in the restored version (when you
run a session.run([-nodes-], feed_dict={-placeholders-}) using the restored model.

### 7) This is not serious. I want more math!
If you want to go deeper in the math, the one piece you are missing is the explanation
of retropropagation, i.e. the algorithm used to compute gradients across multiple layers
of neurons. Google it! It's useful if you want to re-implement gradient descent on your
own, or understand how it is done. And it's not that hard. If the explanations do not make
sense to you, it's probably because the explanations are bad. Google more :-)

The second piece of math I would advise you to read on is the math behind "sampled softmax"
in RNNs. You need to write down the softmax equations, the loss functions, derive it, and
then try to devise cheap ways of approximating this gradient. This is an [active area of
research](http://sebastianruder.com/word-embeddings-softmax/index.html).

The third interesting piece of mathematics is to understand why LSTMs converge while RNNs built with basic
RNN blocks do not.

Good mathematical hunting!

### 8) Show us some generated Shakespeare
```
         TITUS ANDRONICUS

ACT I

SCENE III	An ante-chamber. The COUNT's palace.

[Enter CLEOMENES, with the Lord SAY]

Chamberlain
    Let me see your worshing in my hands.

LUCETTA
    I am a sign of me, and sorrow sounds it.

[Enter CAPULET and LADY MACBETH]

What manner of mine is mad, and soon arise?

JULIA
    What shall by these things were a secret fool,
    That still shall see me with the best and force?

Second Watchman
    Ay, but we see them not at home: the strong and fair of thee,
    The seasons are as safe as the time will be a soul,
    That works out of this fearful sore of feather
    To tell her with a storm of something storms
    That have some men of man is now the subject.
    What says the story, well say we have said to thee,
    That shall she not, though that the way of hearts,
    We have seen his service that we may be sad.

[Retains his house]
ADRIANA What says my lord the Duke of Burgons of Tyre?

DOMITIUS ENOBARBUS
    But, sir, you shall have such a sweet air from the state,
    There is not so much as you see the store,
    As if the base should be so foul as you.

DOMITIUS ENOY
    If I do now, if you were not to seek to say,
    That you may be a soldier's father for the field.

[Exit]
 ```

repository: adavoudi/ganjoorNet

repo_name: adavoudi/ganjoorNet


text:
# Crawler using AWS Lambda and Puppeteer

## Development

- Require
  - Nodejs
  - Chrome browser

- Local development

```bash
npm run local
```

- Bundle package

```bash
npm run package
```

## AWS Setting

### Other components

### Prepare S3 bucket

- As usual

### DynamoDB

- Create table
- Use 1 key only and named `key`

### Lambda

- Add AWS Lambda function
- Add role to the function
  - AmazonElastiCacheFullAccess
  - AWSLambdaVPCAccessExecutionRole

- Setting environment variables

```bash
ACCESS_KEY_ID=
SECRET_ACCESS_KEY=
S3_BUCKET=
DYNAMO_DB_REGION=
DYNAMO_DB_TABLE=
```

- Upload package.zip to S3
  - Example: `https://apollon-53624.s3-ap-northeast-1.amazonaws.com/package.zip`
  - Choose Runtime: Node.js 8.10
  - Then "Save"
  - Run "Test" to test the function


text:
# nextjs-with-styled-components

Boilerplate for NextJS with Styled-Components

## How to use

```
git clone *repo*
```

## Install dependencies

```
yarn or yarn install
```

## Run

```
yarn dev
```


text:
# User Stories

### As a developer, I want to keep code clean and easy to understand.

### As the marketing team, I want to be able to get detailed statistics of clicks and product preferences percentages.

### As a user, I want to be able to understand the UI with minimal instructions.

### As a stakeholder, I want to be able to see the understand the meaning of this project without being very tech savvy

repository: felipedelatorre/bus-mall

gha_language: JavaScript

repo_name: felipedelatorre/bus-mall


text:
This is the official code repository for the work "Duodepth: Static Gesture Recognition Via Dual Depth Sensors": https://arxiv.org/abs/2006.14691

This repository contains tools I used to record and process data from two Intel RealSense D415 cameras.
It might not be the most efficient implementation of these tools, but I hope it to be functional and relatively human readable.

### Prerequisites
You'll need the **opencv-python, numpy, pyrealsense2, and open3d** libraries for full code functionality. I highly recommended making a Conda environment for this.
Code was tested on machines running **Python 3.6.5 and 3.7.0** on **Ubuntu 18.04 and 16.04**.

## The Basics
    python3 two_camera_player.py
This will start recording from the two cameras, saving the recorded data in data/the_current_time/, pressing the **a** button will save 2 color .ply files from the left and right cameras into data/the_current_time/plys/, similarly pressing **s** will save 2 numpy arrays of points (without colour) from the left and right cameras into data/the_current_time/npys/.

If this code does not run properly, try unplugging and re-plugging the cameras and running again (sometimes flipping the wires works even though they’re type-c and theoretically reversible). I highly recommend always checking that the hardware is working with Intel's RealSense Viewer before attempting to run this code.
At the end of recording the player will "compact" the numpy arrays, removing zero distance entries and converting it into a 3xnum_nonzero_points array, which can then be directly loaded into PyTorch.
Parameters such as turning on and off the color and infrared streams, hardware sync, and .bag recording can be found within the player.py utility and toggled accordingly.

## Other Files and Folders
    archive/
Old, and possibly unused, code for transform estimation and stitching; may be useful for experimenting.

    test/
Put individual folders full of test data here.

    train/
Put individual folders full of train data here.

    utils/
The heart of this project, contains utilities for fusing, cropping, processing, recording, and playing back recordings of point clouds.

    hand.json
Json file containing camera properties for recording such as max distance, color correction, and point density.

    two_camera_reader.py
Carbon copy of two_camera_player.py except it takes two inputs "-i1 left.bag -i2 right.bag" and will play from file instead of from device.

    train_*.py
Various files for training with various parameters and datasets, used for ablation testing primarily.

    compact.py
Re-processing for point clouds that didn't come out in the right data format.

    graphs.ipynb
Graphs.

## The ML Stuff
All architecture is written using **PyTorch** and is ran on **PyTorch 0.4.0**.
The train_\*.py files are the most top-level files and execute loading the datasets, training on them, and saving/printing accuracy results. utils/pointnet.py and utils/dualnet.py implement training and optimization. utils/torchnet/pointnet/ contains all the various architectures to train on.

This is not production ready code, but most research isn’t; I hope you can find it useful.

A big thanks fxia22 as much of this code would not be possible without https://github.com/fxia22/pointnet.pytorch.

## Dataset
Dataset can be downloaded from:
https://drive.google.com/open?id=1-nHLWO1fVMprPBvNDVsLZKLB8zvrqUWk

Good luck.
-	Ilya

repository: Ilya-Muromets/DuoDepth

repo_name: Ilya-Muromets/DuoDepth


text:
# KNOB
> Knob's Not One Blog

## For Users
The structure tree for this repo is ~~complicated~~ simple. (* = feature not implemented)
```
knob/
    public/
        * blogs/

        comics/
            1/
                your-comic-nam.png
                [any other file you like, e.g. raw, hi-res copies]
                meta.json
            2/...
            3/...
            ...
            meta.js (mind that its extension is js, for it will be imported into client page as text/javascript)
        css/
            * blog.css
            comic.css
            * index.css
        js/
            lib/
                axios.min.js (imported module, originally MIT-licensed)
            * blog.js
            comic.js
        index.html
        * about.html
        * blog.html
        comic.html
    index.js (node.js entry point)
    (misc npm-generated files and node_modules/)
```

### Comics
Comics are stored in numbered directories of `./public/comics/`, along with a mandatory meta.json file.
Another file called `mata.js` is stored in `./public/comics/`, and only holds init stage value(s) that client script will import.

#### meta.json
The template of `meta.json` is listed as follows.
```
 {
     "id": 1,
     "name": "Roche Limit",
     "year": 2019,
     "month": 2,
     "date": 6,
     "author": "fakefred",
     "hover": "I tried losing weight, but it didn't help.",
     "image": "roche-limit.png"
 }
```
It is forbidden to set month to any other format, but you can tamper with date whatever you want.

#### meta.js
```
latest = 3
```

Yes, it _is_ just one line, one variable declaration, and 10 bytes.
Though automation is in progress, you must as for now manually change its value at each comic upload.
`comic.js` will read it, and then fetch the comic numbered 3, in this case.

repository: fakefred/knob

repo_name: fakefred/knob


text:
---
title: Cryptography
tags: [WIP]
---

### Password algorithms

* [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) - password-based key derivation function

* [HMAC](http://en.wikipedia.org/wiki/HMAC) - Hash-based message authentication code

repository: rstacruz/cheatsheets-ng

detected_licenses: ISC MIT BSD-2-Clause

repo_name: rstacruz/cheatsheets-ng


text:
# Docker AWS EB Deployer

Docker image for automatic deploys to AWS Elastic Beanstalk.

## Purpose

This image was created specifically for usage with continuous integration systems, and contains the minimum requirements to deploy a project to [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/). Currently being used with [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines), but should meet the requirements for most CI systems.

## Details

### Base Image

* [python (alpine)](https://hub.docker.com/r/library/python/) - The latest Python
  (Alpine) image

### Additional Packages

* zip

repository: RenderbitTechnologies/aws-eb-deployer

repo_name: RenderbitTechnologies/aws-eb-deployer


text:
Description
===========

Installs ImageMagick and optionally Rmagick (RubyGem).

Requirements
============

## Platform:

Tested on:

* Ubuntu (10.04)
* RHEL (6.1, 5.7)

Usage
=====

To install just ImageMagick,

  include_recipe "imagemagick"

In your own recipe/cookbook. To install the development libraries,

  include_recipe "imagemagick::devel"

To install the RubyGem rmagick,

  include_recipe "imagemagick::rmagick"

Which will install imagemagick, as well as the development libraries for imagemagick (so rmagick can be built).

Changes
=======

## v0.2.2:

* Fixes COOK-662

License and Author
==================

Author:: Joshua Timberman<EMAIL_ADDRESS>
Copyright:: 2009, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

repository: luctus/rails-vagrant-starter

repo_name: luctus/rails-vagrant-starter


text:
---
hrs_structure:
  division: '1'
  volume: '2'
  title: '8'
  chapter: '91'
  section: 91-17
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0091-0017
    parent: HRS0091
    name: 91-17 Federal aid
weight: 52135
title: Federal aid
full_title: 91-17 Federal aid
---
**§91-17 Federal aid.** The provisions of section 91-14 shall not be applicable where such applicability would jeopardize federal aid or grants of assistance. [L 1961, c 103, §19; Supp, §6C-17; [HRS §91-17](/title-8/chapter-91/section-91-17/)]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# News Aggregator Website
This is a simple news aggregator built with React JS. This makes use of [newsapi](https://newsapi.org/) to get the news feed.

## Tech Used
1. Node
2. NPM
3. NewsAPI
4. React JS with create-react-app

## Usage
1. First, clone the repository with the following command and then enter the directory.
```
git clone https://github.com/hellomlorg/news-app
cd news-app
```
2. We made use of a third party API to obtain the news. It can be accessed via [News API](https://newsapi.org/). Create an account here and get an API key to use in the project.
3. Open [/src/config.js](https://github.com/hellomlorg/news-app/blob/main/src/config.js) and replace "ENTER YOUR KEY HERE" with the key you generated in step 2.
4. Now that you are in the repository, enter the below command to install all the dependencies.
```
npm install
```
or
```
npm i
```
4. Now, we start the project.
```
npm start
```
5. Head to [http://localhost:3000](http://localhost:3000) in any browser to view the project.

## Recommended Reading
You can learn more about react from [reactjs.org](https://reactjs.org/).

## License
This project is opensourced under the MIT License.

## Contributing Guidelines
We welcome all kinds of PRs which improve this project. Make sure that you open an issue before you start contributing to it.

repository: hellomlorg/news-app

repo_name: hellomlorg/news-app


text:
# Raffi

#### HTML page, 08.19.2019

#### By Amy Pierce

## Description

The web page is a blog about a dog named Raffi

## Setup

Clone the code to your computer and open the index.html file, or visit the link directly: [https://amypierce.github.io/raffi/]

## Known Bugs

None

## Support and contact details

If you run into any issues or have questions, ideas or concerns, please contact Amy Pierce<EMAIL_ADDRESS>
## Technologies Used

* HTML
* CSS

### License

* MIT

Copyright (c) 2019 **Amy Pierce**

repository: amypierce/raffi

repo_name: amypierce/raffi


text:
Causality and Experiments
======================

*"These problems are, and will probably ever remain, among the inscrutable
secrets of nature. They belong to a class of questions radically inaccessible to
the human intelligence."* —The Times of London, September 1849, on how cholera
is contracted and spread

Does the death penalty have a deterrent effect? Is chocolate good for you? What
causes breast cancer?

All of these questions attempt to assign a cause to an effect. A careful
examination of data can help shed light on questions like these. In this section
you will learn some of the fundamental concepts involved in establishing
causality.

Observation is a key to good science. An *observational study* is one in which
scientists make conclusions based on data that they have observed but had no
hand in generating. In data science, many such studies involve observations on a
group of individuals, a factor of interest called a *treatment*, and an
*outcome* measured on each individual.

It is easiest to think of the individuals as people. In a study of whether
chocolate is good for the health, the individuals would indeed be people, the
treatment would be eating chocolate, and the outcome might be a measure of blood
pressure. But individuals in observational studies need not be people. In a
study of whether the death penalty has a deterrent effect, the individuals could
be the 50 states of the union. A state law allowing the death penalty would be
the treatment, and an outcome could be the state’s murder rate.

The fundamental question is whether the treatment has an effect on the outcome.
Any relation between the treatment and the outcome is called an *association*.
If the treatment causes the outcome to occur, then the association is *causal*.
*Causality* is at the heart of all three questions posed at the start of this
section. For example, one of the questions was whether chocolate directly causes
improvements in health, not just whether there there is a relation between
chocolate and health.

The establishment of causality often takes place in two stages. First, an
association is observed. Next, a more careful analysis leads to a decision about
causality.

repository: choldgraf/jupyter-book-DEPRECATED

gha_language: Jupyter Notebook

repo_name: choldgraf/jupyter-book-DEPRECATED


text:
# File storage for PHP

* [About resolved issue](#about-resolved-issue)
    * [Advantages](#advantages)
    * [Disadvantages](#disadvantages)
* [Usage of php-filestorage](#usage-of-php-filestorage)
    * [Standard usage](#standard-usage)
* [How to install](#how-to-install)

## About resolved issue

> I need to use something where around 60,000 files with average size of 30kb are stored in a single directory (this is a requirement so can't simply break into sub-directories with smaller number of files).
>
> The files will be accessed randomly, but once created there will be no writes to the same filesystem. I'm currently using Ext3 but finding it very slow. Any suggestions?
>
> -- [Filesystem large number of files in a single directory - bugmenot77, voretaq7]

This file storage solves this issue simply - it **creates virtual layer between file system and application**. Every path is converted into path which is composed from many directories which contains only small amount of sub-directories.

If you wish to store 1 000 000 files in single directory, this file storage converts paths and stores them in huge tree-structure. Every directory (exclude leafs) contains up to 256 sub-directories. Leafs contains only files.

### Advantages

 * Can store a huge amount of files in single directory
 * Can use fully localized paths to files (f.e.: `/シックス.log`)
 * Naturally protects files outside the storage
 * Every user can has separated and isolated file storage
 * Fully compatible and based on [League\Flysystem]

### Disadvantages

 * Real file structure is not user-friendly
 * Can not effectively get files sorted by any key (without DBMS)

## Usage of php-filestorage

### Standard usage

```php
<?php

use League\Flysystem\Adapter\Local as LocalAdapter;
use PetrKnap\Php\FileStorage\FileSystem;
use PetrKnap\Php\FileStorage\Plugin\SQLiteIndexPlugin;

$fileSystem = new FileSystem(new LocalAdapter(__DIR__ . "/temp"));
SQLiteIndexPlugin::register($fileSystem, __DIR__ . "/temp/index.sqlite"); // optional

$fileSystem->write("/file.txt", null);
$fileSystem->update("/file.txt", "Hello World!");

printf("%s", $fileSystem->read("/file.txt"));

foreach ($fileSystem->listContents() as $metadata) {
    $fileSystem->delete($metadata["path"]);
}
```

## How to install

Run `composer require petrknap/php-filestorage` or merge this JSON code with your project `composer.json` file manually and run `composer install`. Instead of `dev-master` you can use [one of released versions].

```json
{
    "require": {
        "petrknap/php-filestorage": "dev-master"
    }
}
```

Or manually clone this repository via `git clone https://github.com/petrknap/php-filestorage.git` or download [this repository as ZIP] and extract files into your project.

[one of released versions]:https://github.com/petrknap/php-filestorage/releases
[this repository as ZIP]:https://github.com/petrknap/php-filestorage/archive/master.zip

[Filesystem large number of files in a single directory - bugmenot77, voretaq7]:http://serverfault.com/q/43133
[League\Flysystem]:https://github.com/thephpleague/flysystem

repository: petrknap/php-filestorage

gha_language: PHP

repo_name: petrknap/php-filestorage


text:
---
layout: layout.hbs
---

# Data Models

## **Users**
- This data model consists of all the users who will be collaborating on a single project.
- Users can create new projects, view all their existing projects, and create new tasks for the projects they are a collaborator of.

  ```
  Users
  - Name
  - Email
  - Contact Number
  ```

## **Projects**
- This includes all the projects that the user is a collaborator of.
- It will also include other details of the project like the project name itself and the tasks under the project.
- This data model also lists all the projects that user is a part of.

  ```
  Projects
  - Project title
  - Collaborators
  - Tasks
  ```

## **Tasks**
- The project data model will consist of the tasks data model.
- This will have all the tasks that are created by the user for a particular project.

  ```
  Tasks
  - Task Name
  - Duties
  - Deadline
  - Assigned To
  ```

## **Revision**
- Made the website compatible to fit to an iPad screen without requiring the user to scroll between sections.
- Awareness feature:
  - Whenever a new task is added, the person adding the task along with the name of the task is shown to users seeing it for the first time
  - In the chat window, as a user types, other collaborators of the project are able to see that they are typing
  - Also, if a user has been added as a collaborator or assigned a new task, they will be notified via the announcements icon on the right of the navbar.

repository: kavyaravikumar/book

repo_name: kavyaravikumar/book


text:
## An Empty Example

Bare application; that does nothing except ensure the Trusona SDK dependency compiles against the supported Android baseline.

You may use this as a starting point for any applications depending on the Trusona SDK.

### Building

On your terminal, from this directory, simply run:

```bash
./gradlew build
```

On success, the (debug) APK will be found at `./app/build/outputs/apk/debug/app-debug.apk`

repository: trusona/trusona-mobile-sdk-android

gha_language: Java

repo_name: trusona/trusona-mobile-sdk-android


text:
## What is this?

Most of the business world uses standard A4 (letter size) paper. It always comes 8.5"x11" (210mm x 279.4mm) since it is an established standard.

It would be silly for A4 paper to come in random sizes larger than 8.5"x11" each time you ordered it. Some days it might be 8.5"x11" and other days it might be 9"x12". Since it must be 8.5x11 to work with scanners and other equipment, you would have to crop sizes larger back down to 8.5"x11" and then you could use it.

This would be ridiculous. However, aren't our websites the same way?

It seems 98% of all web themes use three basic sections to order content. Each has a header (top), content area (middle), and footer (bottom).The look and sub elements of these three sections varies drastically - but the fact that they are there wrapping those elements doesn't.

In an attempt to standardize this format (if for no-one else by myself) I have created this file. At the core of all my themes are these three basic sections. By adopting this file as the base for all my themes I will be able to standardize my HTML so that I can concentrate more on CSS styling.

Think of it like a less restrictive csszengarden.com

I dare you to find a theme that this file isn't built for. Every site out there is page based, full-width, or the background is full-width while the content is page-based.

Totally free and released under the MIT license. Enjoy.

David Pennington
http://code2design.com

repository: absullivan/microtheme

extension: markdown

repo_name: absullivan/microtheme


text:
# Noh as Intermedia

Noh as Intermedia is a React/Redux application built on top of Jekyll. It uses yarn for Javascript package management and scripts, and webpack for build processes along with Jekyll's own.

## Setup

Run `bundle install --path vendor/bundle` and `yarn`

## Development

`main` branch is our stable version. `develop` is the current working branch. For features, branch off of `develop` and we will periodically merge develop into `main` for releases/major updates.

`yarn dev` will run both `webpack` and `jekyll serve` in watch state.

`yarn test` will run all jest tests.

`yarn test:update` runs `jest -u` to update test snapshots.

`yarn coverage` runs `jest --coverage` to generate a test coverage report.

`yarn lint` runs `eslint` with settings per .eslintrc.json.

`yarn parse` will extract the core data from the PI's speadsheets into json files for the app to consume.

`yarn parse:catalog` will extract the catalogs of shōdan and kata (movement) data from the PI's speadsheets into json files that are used to generate static pages for the site.

`contents` is the branch that is deployed to the staging version of the site. Additions and edits to the long-form static scholarly content of the site -- play narratives, essays, descriptions -- are made to the markdown and HTML files here. The `develop` branch is merged into `contents` before deploying a site update.

The project also includes and is set up for prettier. We recommend setting up your text editor to use both eslint and prettier for consistent code formatting. However, to ensure that files that get into the repo are minimally consistently formatted, the repo is set up to run prettier on any git staged js files.

## Adding new JS bundles/entry-points

Noh as Intermedia uses webpack to handle all JS bundling. To add a new bundle, in `webpack.config.js`, add a new key to the `entry` object with a value pointing to the location of the entry file for that bundle (for example: `./webpack/play.jsx`). Webpack will create a new bundle within `src/assets/` that can be linked to within a Jekyll layout or partial.

## Production

`yarn build` runs a production build with webpack along with `jekyll build`.

## HTML structure of analytical narratives for sections and plays

Within the `src` folder of the repo, there are two folders that contain the analytic narratives for the sections: `_hashitomi/narratives/` and `_kokaji/narratives/`. Within each folder are html files, one for each section of each play. The HTML for each narrative should follow a basic format.

Each chunk that should appear within a tab should go into `<section>` tags. This tag tells the application to split the content there to create the tabs for the analysis.

For example, the following markup creates a narrative with three tabs:

        Intro. Lorem ipsum dolor sit amet, <time datetime='00:00:10.000' title='00:10:98.987'>consectetur</time> adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.

        Part I. Lorem ipsum dolor sit amet, <time datetime='00:00:20' title='00:11:98.987'>consectetur</time> adipisicing elit. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

        Part II. Lorem ipsum dolor sit amet, <time datetime='00:00:30.303' title='00:12:98.987'>consectetur</time> adipisicing elit. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

The analytical text for the plays works the same way, but the files are located in the `src/_plays/narratives/` directory. For Hashitomi, the narrative is in `hashitomi.html`, while for Kokaji, it is in `kokaji.html`.

Templates are available for inserting various components into the "Level 0" static scholarly content (tabs, tables, images, video and audio players) and into the "Level 1" and "Level 2" interactive portions of the site (video links, tabs, tables of contents). See the [wiki](https://github.com/sul-cidr/noh/wiki/List-of-HTML-components) for further documentation.

repository: sul-cidr/noh

branch_name: refs/heads/develop

repo_name: sul-cidr/noh


text:
---
title: PC
permalink: /2023/pc/
---

## <span style="color:#267CB9"> Program committee (in alphabetical order) </span>

* Ali Seyfi, George Washington University
* Ameya Godbole, University of Southern California
* Amittai Axelrod, Apple
* Andrey Kutuzov, University of Oslo
* Anil Nelakanti, Amazon
* Anuj Khare, Google
* Arijit Adhikari, Amazon
* Anil Kumar Nelakanti, Amazon
* Ashutosh  Modi, Indian Institute of Technology Kanpur
* Carolina  Scarton, University of Sheffield
* Chanjun Park, Korea University
* Chung-Chi Chen, National Institute of Advanced Industrial Science and Technology
* Constantine Lignos, Brandeis University
* David Samuel, University of Oslo, Language Technology Group
* Edison Marrese-Taylor, National Institute of Advanced Industrial Science and Technology (AIST)
* Efsun Kayi, Johns Hopkins APL
* Emil Vatai, RIKEN
* Gaurav Mishra, Google
* Giovanni Puccetti, Scuola Normale Superiore di Pisa
* Guenter Neumann, DFKI & Saarland University
* Happy Buzaaba, RIKEN
* John Ortega, Northeastern University
* Kaveri Anuranjana, Saarland University
* Mahesh Goud Tandarpally, Amazon
* Marzena Karpinska, University of Massachusetts Amherst
* Maximilian Splieth¨over, Leibniz University Hannover
* Neha Nayak Kennard, University of Massachusetts, Amherst
* Salvatore Giorgi, University of Pennsylvania
* Shubham Chatterjee, University of Glasgow
* Tamás Ficsor, University of Szeged
* Tristan Naumann, Microsoft Research
* Wazir Ali, Institute of Business Management


text:
## Requirements

This application uses [Apache Cordova](http://cordova.apache.org/).
So the basic requirements are [Node.js](http://nodejs.org) including npm.
Additionally you will need the SDKs depending on what platforms you want to build the application for.

## Setup

Install dependancies like bootstrap with npm:

    npm install

Build Javascripts und Stylesheets from `src/` -folder:

    ./node_modules/gulp/bin/gulp.js run

Add target-platform:

    cordova platform add android

Build the application:

    cordova build android

gha_license_id: NOASSERTION


text:
# Counterfactual Off-Policy Evaluation with Gumbel-Max SCMs

## Overview

This repository contains all the code required to replicate the figures in the ICML 2019 paper.  To do so from scratch, you will need to run the following steps:
* To generate the MDP parameters, run `learn_mdp_parameters.ipynb`, which will save the learned parameters in the `data` folder;  This takes ~2 hours.
* Alternatively, you can use the parameters that are already learned - To do so, unzip `data/diab_txr_mats-replication.zip` locally (e.g., using `unzip diab_txr_mats-replication.zip`)
* To re-create the plots in the main paper, run `plots-main-paper.ipynb`;  This assumes that you have `data/diab_txr_mats-replication.pkl`, by one of the methods above
* To re-create the plots in the appendix, see the corresponding notebooks

## Dependencies

This code was run using Python 3.7 in a `conda` environment:  Running the following commands should cover all the dependencies of the code (e.g., installing `pandas` will install `numpy`, and so on)
```
conda install jupyter
conda install pandas
conda install seaborn
conda install tqdm
pip install pymdptoolbox
```

## Updated Simulator

As we receive suggestions for improving the realism of the sepsis simulator, we will collect them in the `sim-v2` branch of this repository, in case it is useful for others.  The `master` branch will remain unchanged to facilitate reproduction of the original paper.

## Acknowledgements

First, we would like to thank Christina X Ji and [Fredrik D. Johansson](http://www.mit.edu/~fredrikj/) for their work on an earlier version of the sepsis simulator we use in this paper.

Second, for some of the code used in the posterior inference over Gumbel variables, we borrowed from Chris Maddison's blog post [here](https://cmaddis.github.io/gumbel-machinery)

Finally, in this repository (in `pymdptoolbox/`) we have the source code for the `pymdptoolbox` package from [sawcordwell/pymdptoolbox](https://github.com/sawcordwell/pymdptoolbox), which is in turn based the toolset described in `Chades I, Chapron G, Cros M-J, Garcia F & Sabbadin R (2014) 'MDPtoolbox: a multi-platform toolbox to solve stochastic dynamic programming problems', Ecography, vol. 37, no. 9, pp. 916–920, doi 10.1111/ecog.00888.`  We reproduce it here because we needed to make a slight modification to the `mdp` class to bypass certain checks; in particular, it checks for whether or not the rows of the transition matrix sum to one, but can fail due to floating-point inaccuraries - we replace this check in the main code with an assertion using `np.allclose` instead of checking for strict equality.


text:
# Semantic Convention YAML Language

First, the syntax with a pseudo [EBNF](https://en.wikipedia.org/wiki/Extended_Backus-Naur_form) grammar is presented.
Then, the semantic of each field is described.

<!-- tocstart -->

<!-- toc -->

- [Semantic Convention YAML Language](#semantic-convention-yaml-language)
  - [JSON Schema](#json-schema)
  - [Syntax](#syntax)
  - [Semantics](#semantics)
    - [Groups](#groups)
    - [Semantic Convention](#semantic-convention)
      - [Span semantic convention](#span-semantic-convention)
      - [Event semantic convention](#event-semantic-convention)
      - [Metric Group semantic convention](#metric-group-semantic-convention)
      - [Metric semantic convention](#metric-semantic-convention)
      - [Attribute group semantic convention](#attribute-group-semantic-convention)
    - [Attributes](#attributes)
      - [Examples (for examples)](#examples-for-examples)
      - [Ref](#ref)
      - [Type](#type)
    - [Constraints](#constraints)
      - [Any Of](#any-of)
      - [Include](#include)

<!-- tocstop -->

## JSON Schema

A JSON schema description of the syntax is available as [semconv.schema.json](./semconv.schema.json),
see [README.md](./README.md) for how to use it with an editor. The documentation
here in `syntax.md` should be considered more authoritative though. Please keep
`semconv.schema.json` in synch when changing the "grammar" in this file!

## Syntax

All attributes are lower case.

```ebnf
groups ::= semconv
       | semconv groups

semconv ::= id [convtype] brief [note] [prefix] [extends] [stability] [deprecated] attributes [constraints] [specificfields]

id    ::= string

convtype ::= "span" # Default if not specified
         |   "resource" # see spanspecificfields
         |   "event"    # see eventspecificfields
         |   "metric"   # see metricfields
         |   "metric_group"
         |   "scope"
         |   "attribute_group" # no specific fields defined

brief ::= string
note  ::= string

prefix ::= string

extends ::= string

stability ::= "deprecated"
          |   "experimental"
          |   "stable"

deprecated ::= <description>

attributes ::= (id type brief examples | ref [brief] [examples]) [tag] [stability] [deprecated] [required] [sampling_relevant] [note]

# ref MUST point to an existing attribute id
ref ::= id

type ::= "string"
     |   "int"
     |   "double"
     |   "boolean"
     |   "string[]"
     |   "int[]"
     |   "double[]"
     |   "boolean[]"
     |   enum

enum ::= [allow_custom_values] members

allow_custom_values := boolean

members ::= member {member}

member ::= id value [brief] [note]

requirement_level ::= "required"
         |   "conditionally_required" <condition>
         |   "recommended" [condition] # Default if not specified
         |   "opt_in"

# EXPERIMENTAL: Using this is NOT ALLOWED in the specification currently.
sampling_relevant ::= boolean

examples ::= <example_value> {<example_value>}

constraints ::= constraint {constraint}

constraint ::= any_of
           |   include

any_of ::= id {id}

include ::= id

specificfields ::= spanfields
               |   eventfields
               |   metricfields

spanfields ::= [events] [span_kind]
eventfields ::= [name]

span_kind ::= "client"
          |   "server"
          |   "producer"
          |   "consumer"
          |   "internal"

events ::= id {id} # MUST point to an existing event group

name ::= string

metricfields ::= metric_name instrument unit

metric_name ::= string
instrument ::=  "counter"
            | "histogram"
            | "gauge"
            | "updowncounter"
unit ::= string
```

## Semantics

### Groups

Groups contain the list of semantic conventions and it is the root node of each yaml file.

### Semantic Convention

The field `semconv` represents a semantic convention and it is made by:

- `id`, string that uniquely identifies the semantic convention.
- `type`, optional enum, defaults to `span` (with a warning if not present).
- `brief`, string, a brief description of the semantic convention.
- `note`, optional string, a more elaborate description of the semantic convention.
   It defaults to an empty string.
- `prefix`, optional string, prefix for the attributes for this semantic convention.
   It defaults to an empty string.
- `extends`, optional string, reference another semantic convention `id`.
   It inherits the prefix, constraints, and all attributes defined in the specified semantic convention.
- `stability`, optional enum, specifies the stability of the semantic convention.

   Note that, if `stability` is missing but `deprecated` is present, it will automatically set the `stability` to `deprecated`.
   If `deprecated` is present and `stability` differs from `deprecated`, this will result in an error.
- `deprecated`, optional, specifies if the semantic convention is deprecated.
   The string provided as `<description>` MUST specify why it's deprecated and/or what to use instead.
   See also `stability`.
- `attributes`, list of attributes that belong to the semantic convention.
- `constraints`, optional list, additional constraints (See later). It defaults to an empty list.

#### Span semantic convention

The following is only valid if `type` is `span` (the default):

- `span_kind`, optional enum, specifies the kind of the span.
- `events`, optional list of strings that specify the ids of
  event semantic conventions associated with this span semantic convention.

#### Event semantic convention

The following is only valid if `type` is `event`:

- `name`, conditionally required string. The name of the event.
  If not specified, the `prefix` is used. If `prefix` is empty (or unspecified),
  `name` is required.

#### Metric Group semantic convention

Metric group inherits all from the base semantic convention, and does not
add any additional fields.

The metric group semconv is a group where related metric attributes
can be defined and then referenced from other `metric` groups using `ref`.

#### Metric semantic convention

The following is only valid if `type` is `metric`:

  - `metric_name`, required, the metric name as described by the [OpenTelemetry Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#timeseries-model).
  - `instrument`, required, the [instrument type]( https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument)
  that should be used to record the metric. Note that the semantic conventions must be written
  using the names of the synchronous instrument types (`counter`, `gauge`, `updowncounter` and `histogram`).
  For more details: [Metrics semantic conventions - Instrument types](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/metrics/semantic_conventions#instrument-types).
  - `unit`, required, the unit in which the metric is measured, which should adhere to
    [the guidelines](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/metrics/semantic_conventions#instrument-units).

#### Attribute group semantic convention

Attribute group (`attribute_group` type) defines a set of attributes that can be
declared once and referenced by semantic conventions for different signals, for example spans and logs.
Attribute groups don't have any specific fields and follow the general `semconv` semantics.

### Attributes

An attribute is defined by:

- `id`, string that uniquely identifies the attribute.
- `type`, either a string literal denoting the type or an enum definition (See later).
   The accepted string literals are:

  * `"string"`: String attributes.
  * `"int"`: Integer attributes.
  * `"double"`: Double attributes.
  * `"boolean"`: Boolean attributes.
  * `"string[]"`: Array of strings attributes.
  * `"int[]"`: Array of integer attributes.
  * `"double[]"`: Array of double attributes.
  * `"boolean[]"`: Array of booleans attributes.

  See the [specification of Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute) for the definition of the value types.
- `ref`, optional string, reference an existing attribute, see [below](#ref).
- `tag`, optional string, associates a tag ("sub-group") to the attribute.
   It carries no particular semantic meaning but can be used e.g. for filtering
   in the markdown generator.
- `requirement_level`, optional, specifies if the attribute is mandatory.
   Can be "required", "conditionally_required", "recommended" or "opt_in". When omitted, the attribute is "recommended".
   When set to "conditionally_required", the string provided as `<condition>` MUST specify
   the conditions under which the attribute is required.
- `sampling_relevant`, optional EXPERIMENTAL boolean,
  specifies if the attribute is (especially) relevant for sampling and
  thus should be set at span start. It defaults to `false`.
- `brief`, `note`, `stability`, `deprecated`, same meaning as for the whole
  [semantic convention](#semantic-convention), but per attribute.
- `examples`, sequence of example values for the attribute or single example value.
   They are required only for string and string array attributes.
   Example values must be of the same type of the attribute.
   If only a single example is provided, it can directly be reported without encapsulating it into a sequence/dictionary. See [below](#examples-for-examples).

#### Examples (for examples)

Examples for setting the `examples` field:

A single example value for a string attribute. All the following three representations are equivalent:

```yaml
examples: 'this is a single string'
```

or

```yaml
examples: ['this is a single string']
```

or

```yaml
examples:
   - 'this is a single string'
```

Attention, the following will throw a type mismatch error because a string type as example value is expected and not an array of string:

```yaml
examples:
   - ['this is an error']

examples: [['this is an error']]
```

Multiple example values for a string attribute:

```yaml
examples: ['this is a single string', 'this is another one']
```

or

```yaml
examples:
   - 'this is a single string'
   - 'this is another one'
```

A single example value for an array of strings attribute:

```yaml
examples: ['first element of first array', 'second element of first array']
```

or

```yaml
examples:
   - ['first element of first array', 'second element of first array']
```

Attention, the following will throw a type mismatch error because an array of strings as type for the example values is expected and not a string:

```yaml
examples: 'this is an error'
```

Multiple example values for an array of string attribute:

```yaml
examples: [ ['first element of first array', 'second element of first array'], ['first element of second array', 'second element of second array'] ]
```

or

```yaml
examples:
   - ['first element of first array', 'second element of first array']
   - ['first element of second array', 'second element of second array']
```

#### Ref

`ref` MUST have an id of an existing attribute. When it is set, `id` and `type` MUST NOT be present.
`ref` is useful for specifying that an existing attribute of another semantic convention is part of
the current semantic convention and inherit its `brief`, `note`, and `example` values. However, if these
fields are present in the current attribute definition, they override the inherited values.

#### Type

An attribute type can either be a string, int, double, boolean, array of strings, array of int, array of double,
array of booleans, or an enumeration. If it is an enumeration, additional fields are required:

- `allow_custom_values`, optional boolean, set to false to not accept values
     other than the specified members. It defaults to `true`.
- `members`, list of enum entries.

An enum entry has the following fields:

- `id`, string that uniquely identifies the enum entry.
- `value`, string, int, or boolean; value of the enum entry.
- `brief`, optional string, brief description of the enum entry value. It defaults to the value of `id`.
- `note`, optional string, longer description. It defaults to an empty string.

### Constraints

Allow to define additional requirements on the semantic convention.
Currently, it supports `any_of` and `include`.

#### Any Of

`any_of` accepts a list of sequences. Each sequence contains a list of attribute ids that are required.
`any_of` enforces that all attributes of at least one of the sequences are set.

#### Include

`include` accepts a semantic conventions `id`. It includes as part of this semantic convention all constraints
and required attributes that are not already defined in the current semantic convention.

repository: open-telemetry/build-tools

repo_name: open-telemetry/build-tools


text:
# Policy Lookup

Action Policy tries to automatically infer policy class from the target using the following _probes_:

1. If the target is a `Symbol`:

    a) Try `"#{target.to_s.camelize}Policy"` as a `policy_name` (see below);

    b) If `String#classify` is available, e.g. when using Rails' ActiveSupport, try `"#{target.to_s.classify}Policy"`;

2. If the target responds to `policy_class`, then use it;
3. If the target's class responds to `policy_class`, then use it;
4. If the target or the target's class responds to `policy_name`, then use it (the `policy_name` should end with `Policy` as it's not appended automatically);
5. Otherwise, use `#{target.class.name}Policy` or `#{target.name}Policy` if target is a Module or Class.

> \* [Namespaces](namespaces.md) could be also be considered when `namespace` option is set. You can also set the `strict_namespace` option to disable constant cascade lookup.

You can call `ActionPolicy.lookup(record, options)` to infer policy class for the record.

When no policy class is found, an `ActionPolicy::NotFound` error is raised.

You can [customize lookup](custom_lookup_chain.md) logic if necessary.

gha_language: Ruby


text:
# Obi Cursor

![Obi Cursor](https://github.com/johnstack/obi_cursor/blob/master/cursoranim.gif)

A legacy (Pre-MacOS X) Macintosh system extension to replace the spinning beachball cursor with one that shows pixel art of my old cat, Obi.

[Download the zip file](https://github.com/johnstack/obi_cursor/blob/master/ObiCursor.zip) and move the extension file (see image below) into the Extensions folder in the System folder.

![Obi Cursor](https://github.com/johnstack/obi_cursor/blob/master/obicursor.gif)

From what I remember, this works on System 7, MacOS 8 and MacOS 9.


text:
# Example Inspection Report Forms
Printable forms you can use to prepare or extend inspection reports.
## Getting Started
These instructions will walk you through installing the pages and resources.

### Deploy using Heroku

### Installing Pages
1. Open the Developer Console under the settings gear

2. Under the File > New menu select Visualforce Page

3. Enter a descriptive name (e.g. VehicleReportCard) and select ok

4. Paste the contents of the example page and save (File > Save)

### Installing Static Resources
1. Open the Developer Console under the settings gear

2. Under the File > New menu select Static Resource

3. Enter a descriptive name (e.g. VehicleReportCardCSS) and select ok

4. Select text/css under MIME Type

5. Paste the contents of the example static resource and save (File > Save)

6. Note, you will need to update the stylesheet name on line 4 of the Visualforce page ````<apex:stylesheet value="{!URLFOR($Resource.VehicleReportCardCSS)}" />````

### Viewing Pages
To view your page(s) you will need to pass the DealID parameter. ````https://agility-ruby-6856-dev-ed--dealer.visualforce.com/apex/vehiclereportcard````

1. Click the App Launcher icon

2. Enter Inspection in the search area.

3. Click Inspection Reports.

4. Select the report # to open up the inspection report.

5. Copy the unique identifier from the URL between the slashes. **a0n17000003SP87AAG** is the report ID in the example below. ````https://agility-ruby-6856-dev-ed.lightning.force.com/lightning/r/dealer__Inspection_Report__c/a0n17000003SP87AAG/view````

6. Browse to your page appending the report ID.
````https://agility-ruby-6856-dev-ed.lightning.force.com/apex/vehiclereportcard?id=a0n17000003SP87AAG````

## Customizing Pages
The pages can be customized to meet your needs.


text:
# Reagent autocomplete widget

[![Clojars Project](https://clojars.org/thereisnodot/reagent_autocomplete/latest-version.svg)](https://clojars.org/thereisnodot/reagent_autocomplete)

Reagent autocomplete is a  **Reagent** autocomplete widget.
It supports:

* Cycling through options with Tab, Up and Down arrows

* Autocomplete current option with Right arrow or Tab

* Complete, if there is only a single option

* *Optional* forbid complete if there are no options
* Customizable styling and no framework dependency

## Usage

### Getting started

Add dependency to the project.clj

[![Clojars Project](https://clojars.org/thereisnodot/reagent_autocomplete/latest-version.svg)](https://clojars.org/thereisnodot/reagent_autocomplete)

Then. This set up should yield the same result as on the screenshot

```clojure

(ns stuff.app
  (:require [reagent.core :as reagent]
            [thereisnodot.reagent-autocomplete.core :as autocomplete]))

(defn some-component []
  [:div {:style {:width "100%"}}
   [autocomplete/autocomplete_widget
   ["albania" "algeria" "andorra" "angola"]
    {:can-enter-new? false
     :display-size 5
     :placeholder "Enter any city"
     :submit-fn
     (fn [item]
       (.log js/console "Submitted: " item))}]])

(defn init []
  (reagent/render-component [some-component]
                            (.getElementById js/document "container")))

```

Below we list additional parameters that can be set.

### Params

#### Common
```clojure
   {:app-state (reagent/atom {:cur-index 0 :cur-input ""})
    :can-enter-new? true ;;whether you can submit data that is not in the list of completions
    :display-size 10
    :placeholder "Input anything here..."
    :autofocus? true}
```

#### Actions (Render/Filter/Submit) functions

##### Complete and submit policy

User can submit input if:

* The input does not pass `:validate-fn`. Nothing gets submitted
* There is no input. Nothing will get submitted
* There is existing completion, that will be submitted. **U**SA, the **USA** will be submitted
* There is no completion, but the user can enter new. Their input will be submitted. **ADLSKJDKAJ** will be submitted.
* There is no completion and user cannot enter new. Their input won't be submitted.

##### Render functions

These govern how to display the data.

######  Render

Function that renders autocomplete dropdown list.

```clojure
{:render-fn
  (fn [cur-input selected? text]
    [:div.reagent-autocomplete-item
      {:style {:padding "0.5em"
               :background (if  selected? "#dcdbfa" "white")
               :font-size "1em" :cursor "pointer"}}
    [:span cur-input]
    [:b (apply str (drop (count cur-input) text))]])}
```

Function that renders search button.
In the default case, we see that this button rendered
only when the policy matches. (I.e. search can be performed)

```clojure
 {:render-click-submit-fn
   (fn [can-submit? on-click]
     (if can-submit?
       [:div
        {:on-click on-click
         :style {:color "#dcdbfa" :cursor "pointer"}}
        [:img {:src search-icon}]]))}
```

##### Submit
If FN is validated and matches policy, this function will be called.
After this call the app state will be reset.

```clojure
{:submit-fn
  (fn [data]
    (.log js/console "Submitted the following: " data))}
```

##### Validate input
Default is

```clojure
{:validate-fn
  (fn [data] true)}
```

##### Compare input

Is a filter function that should return `bool`.
Decides whether to match the input with the output.

```clojure
{:compare-fn
  (fn [cur-input item]
    "Checking whether input matches with the item"
    (cljs-string/starts-with?   item  cur-input))}
```

#### Styling

Defaults are these.

```clojure
  {:dropdown-style
   {:position "absolute" :right "0" :left "0"
    :top "4em" :box-shadow "grey 1px 2px 1px 0px"
    :background "white" :overflow "hidden"  :border "none" :z-index "999"}

   :input-style
   {:width "100%" :height "2em" :font-size "1.5em"
    :padding-left "10px" :background "transparent" :border "none"}

   :background-input-style
   {:width "100%" :height "2em" :font-size "1.5em" :padding-left "10px"
    :color "gray" :position "absolute" :top "0" :right "0" :left "0"
    :bottom "0" :z-index "-1" :background "white" :border "none"}

   :click-submit-style
   {:position "absolute" :right "0" :top "0.3em" :padding "0.5em"}

   :parent-div-style
   {:position "relative" :box-shadow "1px 1px 1px gray"}

   :general-style ".reagent-autocomplete-input:focus{outline:none;}
     .reagent-autocomplete-item:hover{background:#dcdbfa !important;}"}
```

## License

MIT


text:
# DrawPy
Hello and welcome to DrawPy!
This is a simple graphics package built on pygame so you need pygame to run this.
To start using this, run the following command in a terminal with python and pip installed:

    pip install DrawPy
There are 3 basic formats to using DrawPy.

Format 1, for basic graphics and animations:

    from DrawPy import *

    screen = Window((500, 500), "MyWindow")  # Creates the window
    screen.circle([250, 250], 250)  # Draws a circle centered at (250, 250) with a radius of 250
    draw()  # Flips the drawings on to the screen
    done()  # Waits to close the window
Format 2, for more complex graphics and animations. Also suitable for simple games:

    from DrawPy import *
    """Animates a circle moving around a screen"""
    screen = Window(caption="Moving circle")  # Creates the window

    # Set the speed of the circle
    x_change = 5
    y_change = 5
    # Set the initial position of the circle
    x_pos = 50
    y_pos = 50

    # Main loop, used for animations and some games
    while not check_quit():  # Loop until the user closes the window
        screen.circle([x_pos, y_pos], 25, thickness=0)  # Draws the circle
        x_pos += x_change  # Moves the position of the circle
        y_pos += y_change
        # Causes the circle to bounce if it touches the edge
        if x_pos >= 475:
            x_change = -1 * abs(x_change)
        if x_pos <= 25:
            x_change = abs(x_change)
        if y_pos >= 675:
            y_change = -1 * abs(y_change)
        if y_pos <= 25:
            y_change = abs(y_change)
        draw()  # Flips the circle to the screen
        frame_rate(60)  # Sets a frame rate of 60 fps
        screen.clear()  # Clears the screen
    quit()  # Quits the program
Format 3, more advanced and for event based graphics, animations, and games:

    from DrawPy import *
    # Used mainly for games or animation that handle events.
    screen = Window((500, 700), "My Window", BLUE)  # Creates the screen

    def default():  # Sets the default function
        screen.ellipse([0, 0, 500, 700])

    def on_click():  # Sets an on click function
        screen.ellipse([0, 0, 500, 700], thickness=0)

    screen.register(screen.DEFAULT, default)  # Registers the functions
    screen.register(MOUSEBUTTONDOWN, on_click)
    screen.go()  # Runs the code
For more help, run the help() function.
## Enjoy!