text:
---
title: 'Image Segmentation'
date: 2019-12-01
permalink: /posts/2019/12/image_segmentation/
usemathjax: true
tags:
  - CNN
  - image segmentation
  - FCN
  - U-Net
---

In this post I will explain **Image Segmentation**, focusing on the architecture of the models used to perform this task. Fully Convolutional Networks and U-Net will be at the center of the discussion.

**Disclaimer:** *These notes are for the most part a collection of concepts taken from the slides of the 'Artificial Neural Networks and Deep Learning' course at Polytechnic of Milan and from some other online resources. I am just putting together all the information to study for the exam and I thought it would be a good idea to upload them here since they can be useful for someone interested in this topic.*

# Image Segmentation

In the last post, we introduced CNNs and their use in image classification. Image segmentation is not so different, that's why I suggest you to read the 'Introduction to CNN' first if you haven't already done it.

Indeed, if in image classification we want to assign a label to a whole image, in image segmentation we want to **assign a label to every pixel in an image** such that pixels with the same label share certain visual characteristics.

## Fully Convolutional Networks

***Paper: [Fully Convolutional Networks for Semantic Segmentation](https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf)***

In order to understand the differences between a CNN and a FCN let's analyze the architectures:

{:refdef: style="text-align: center;"}
![CNN_architecture]({% link images/CNN_wiki.png %})
{: refdef}

As we can see from the above image, a typical CNN can be seen as a stack of convolutional and pooling layers, ended by a fully connected layer, which is a standard Multi-Layer Perceptron. With an architecture like this, if we feed an input image with a larger size w.r.t. the one used for the training, the model would not work, because even if the convolutional part is size independent, the final fully connnected layer has a fixed input size.

However, the FC is **linear**, so it can be represented as a convolution. More precisely, citing the paper:

> The fully connected layers of these nets have fixed dimensions and throw away spatial coordinates. However, these fully connected layers can also be viewed as convolutions with kernels that cover their entire input regions. Doing so casts them into fully convolutional networks that take input of any size and output classification maps.
>
>> Fully Convolutional Networks for Semantic Segmentation

So, assuming to have a fully connected layer like this:

{:refdef: style="text-align: center;"}
![FC_layer]({% link images/FC_layer.png %})
{: refdef}

this can be represented as a 2D convolutional layer against $L$ filters having size $1 \times 1 \times N$.

Ok, but what do we obtain as output now? Well, for each output class we obtain an image having lower resolution than the input image and class probabilities for the receptive field of each pixel: **heatmaps**.

{:refdef: style="text-align: center;"}
![FCN_paper]({% link images/FCN_paper.png %}){:height="300px" width="500px"}
{: refdef}

{:refdef: style="text-align: center;"}
Image from the paper *Fully Convolutional Networks for Semantic Segmentation*
{: refdef}

Consider for example the heatmap that corresponds to the "wheel" class: it's telling us how much likely in the receptive field associated to this pixel there is something that looks like a wheel.

## Approaches to segmentation

### Direct heatmap predictions

{:refdef: style="text-align: center;"}
![direct_heatmap]({% link images/direct_heatmap.png %}){:height="300px" width="500px"}
{: refdef}

{:refdef: style="text-align: center;"}
Image from the paper *Fully Convolutional Networks for Semantic Segmentation*
{: refdef}

The idea here is that we can take the last volume in the network, which is the output of our CNN, having depth 1000. We slice this volume 1000 times and for each slice, namely for each class, we take the argmax, through which we obtain an image that contains in each pixel the index of the slice referring to the most probable class.
What's the drawback of this approach? It is a very coarse estimate, since going through the convolution we are losing a lot of spatial resolution.

### The shift and stitch

As we have seen, mapping the output directly to the input will cause resolution to look patchy. The idea behind the shift and stitch method is to take the same input and to shift it a bit multiple times, computing a heatmap for all $f^2$ possible shifts. We then map predictions from the heatmaps to the image (each pixel in the heatmap provides prediction of the central pixel of the receptive field). Finally, we interleave the heatmaps to form an image as large as the input.

One might think of it as taking multiple (shifted) low resolution images of an object and combining (stitch) them to get a higher resolution image.

I found an image from this [website](https://www.jianshu.com/p/e534e2be5d7d) which can help to get the idea:

{:refdef: style="text-align: center;"}
![shift_and_stitch]({% link images/shift_and_stitch.png %}){:height="400px" width="600px"}
{: refdef}

Assume that your FCN is a $2 \times 2$ max pooling layer. Every time the input (the black pixels) is shifted, you obtain a different heatmap ($3 \times 3$).

Although performing this transformation naively increases the cost by a factor of $f^2$, there is an efficient implementation through the à trous algorithm. However, the upsampling part is very rigid: we would like to learn also this part.

### Only convolutions

Another approach would be that of using only convolutional and activation layers, without any subsampling. Two problems:

- very small receptive field
- very inefficient, since convolutions at original image resolution will be very expensive

## Upsampling

Ok, so what can we do? There is a clear tradeoff here: on the one hand we need to go **deep** to extract high level information on the image, on the other hand we want to stay **local** to not lose **spatial resolution** in the prediction.

> Semantic segmentation faces an inherent tension between semantics and location:

>- global information resolves **what**
>- local information resolves **where**

{:refdef: style="text-align: center;"}
![upsampling]({% link images/upsampling.png %}){:height="300px" width="500px"}
{: refdef}

The good news is that upsampling filters can be learned during training, since linear upsampling of a factor $f$ can be implemented as a convolution against a filter with a fractional stride $1/f$.

{:refdef: style="text-align: center;"}
![upsampling_examples]({% link images/upsampling_examples.png %})
{: refdef}

{:refdef: style="text-align: center;"}
[CS231n: Convolutional Neural Networks for Visual Recognition](http://cs231n.stanford.edu/)
{: refdef}

{:refdef: style="text-align: center;"}
![max_unpooling]({% link images/max_unpooling.png %})
{: refdef}

{:refdef: style="text-align: center;"}
[CS231n: Convolutional Neural Networks for Visual Recognition](http://cs231n.stanford.edu/)
{: refdef}

One problem with these three approaches is that there are no parameters, so they are not learnable. Let's see something that is learnable.

### Transpose convolution

With transpose convolution we're changing the role of the filter. Indeed, suppose for example to have an input image of size $5 \times 5 \times 1$ and a filter of size $3 \times 3 \times 1$ with stride $2 \times 2$ and padding VALID. The output will be a $2 \times 2$ image.

Ok, now we want to upsample this output to the original image. In order to do so, by using the same filter of size $3 \times 3$, we multiply each value of our $2 \times 2$ image with the values of the filter. This procedure is repeated for each pixel of the input image, moving the filter according to the stride (2 in our example).

{:refdef: style="text-align: center;"}
![transpose_convolution]({% link images/transpose_convolution.png %}){:height="300px" width="500px"}
{: refdef}

{:refdef: style="text-align: center;"}
[CS231n: Convolutional Neural Networks for Visual Recognition](http://cs231n.stanford.edu/)
{: refdef}

## Skip connections

Nice, so we have finished! Not really, these are the results obtained by the authors of the paper:

{:refdef: style="text-align: center;"}
![FCN_32]({% link images/FCN_32.png %}){:height="120px" width="220px"}
{: refdef}

{:refdef: style="text-align: center;"}
Image from the paper *Fully Convolutional Networks for Semantic Segmentation*
{: refdef}

Where 32 is the number of times the image has been upsampled.

As we can see, the result is not very good. This means that this upsampling is not able to recover all the spatial information. Where can we grab this information? We need higher resolution information about the content of the image, so a good starting point would be to go in the shallow layers. This is the reason for which **skip connections** were introduced.

> Combining fine layers and coarse layers lets the model make local predictions that respect global structure.
>
>> Fully Convolutional Networks for Semantic Segmentation

The idea is to combine the upsampled output of one layer in the upsampling part of the network with the unchanged output of a previous layer in the downsampling part of the network by adding them together. The result of this sum will be upsampled again and summed with a shallower layer in the downsampling part, and so on.

{:refdef: style="text-align: center;"}
![skip_connections]({% link images/skip_connections.png %})
{: refdef}

{:refdef: style="text-align: center;"}
*https://www.jeremyjordan.me/semantic-segmentation/*
{: refdef}

As written in the paper, this process yields 3 models:

- Train first the lowest resolution network (FCN-32s)
- Then the weights of the next network (FCN-16s) are initialized with (FCN-32s)
- The same for FCN-8s

{:refdef: style="text-align: center;"}
![results]({% link images/results.png %}){:height="200px" width="400px"}
{: refdef}

{:refdef: style="text-align: center;";}
Image from the paper *Fully Convolutional Networks for Semantic Segmentation*
{: refdef}

## Training a F-CNN (and segmentation networks)

### Patch-based way

- Prepare a training set for a classification network
- Crop as many patches from annotated images and assign to each patch label corresponding to the patch center
- Train a CNN for classification from scratches, or fine-tune a pre-trained model over the segmentation classes
- Once trained the network, move the FC layers to $1 \times 1$ convolutions
- Train the upsampling filters

The classification network is trained to minimize the classification loss $l$ over a mini-batch:

$$
    \hat{\theta} = min_{\theta} \sum_{\boldsymbol{x_j}} l(\boldsymbol{x_j},\theta)
$$

where $\boldsymbol{x_j}$ belongs to a mini-batch.

Batches of patches are randomly assembled during training and it is possible to resample patches for solving class imbalance. However, this approach is very inefficient, since convolutions on overlapping patches are repeated multiple times.

### Full-image way

$$
    \hat{\theta} = min_{\theta} \sum_{\boldsymbol{x_j}} l(\boldsymbol{x_j},\theta)
$$

The loss function is the same, but in this case $\boldsymbol{x_j}$ are all the pixels in a region of the input image and the loss is evaluated over the corresponding labels.

In the previous approach if you want to classify a whole image you have to crop multiple patches, so if you have input images of size $500 \times 500$ and you train your network to classify patches of size $90 \times 90$ to recover the value of the label which is in the central pixel. This means that in practice you have to compute the same convolution **multiple times**.

Instead, if you directly train your network in order to perform segmentation and to provide as output the image of the labels, and if you compute the loss by comparing the output labels with the ground truth, you have to compute convolution **only once**, because you're moving the whole image through the network.

The drawback of the full-image approach, however, is that we are losing the **randomness** of the minibatches which is present in the patch-based way (due to the fact they can be randomly selected). Although, we can recover this randomness to make the estimated loss a bit stochastic by using some random masks, excluding some pixels when computing the loss:

$$
    minimize \sum_{\boldsymbol{x_j}} M(\boldsymbol{x_j}) l(\boldsymbol{x_j},\theta)
$$

being $M(\boldsymbol{x_j})$ a binary random variable.

Another problem is the class imbalance. With patch-wise training this is not a problem, since we can repeat the same patch multiple times to adjust the difference in terms of number of samples. Instead, with full-image approach this is not possible. Also in this case we can compensate by weighting the loss:

$$
    minimize \sum_{\boldsymbol{x_j}} w(\boldsymbol{x_j}) l(\boldsymbol{x_j},\theta)
$$

being $w(\boldsymbol{x_j})$ a weight that takes into account the true label of $\boldsymbol{x_j}$.

## U-Net

***Paper: [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://arxiv.org/pdf/1505.04597.pdf)***

This paper was published in the same period of time as the previous one, although this seems to be a bit more famous. The concepts behind the architecture of this model are exactly the ones we've discussed so far. However, there are some interesting details.

{:refdef: style="text-align: center;"}
![U-Net]({% link images/U-Net.png %}){:height="600px" width="600px"}
{: refdef}

{:refdef: style="text-align: center;"}
Image from the paper *U-Net: Convolutional Networks for Biomedical Image Segmentation*
{: refdef}

It is pretty obvious the reason for which it was called **U-Net**.

>The contracting path follows the typical architecture of a convolutional network. It consists of the repeated application of two 3x3 convolutions (unpadded convolutions), each followed by a rectified linear unit (ReLU) and a 2x2 max pooling operation with stride 2 for downsampling. At each downsampling step we double the number of feature channels. Every step in the expansive path consists of an upsampling of the feature map followed by a 2x2 convolution (“up-convolution”) that halves the number of feature channels, a concatenation with the correspondingly cropped feature map from the contracting path, and two 3x3 convolutions, each followed by a ReLU. The cropping is necessary due to the loss of border pixels in every convolution. At the final layer a 1x1 convolution is used to map each 64-component feature vector to the desired number of classes. In total the network has 23 convolutional layers.
>
>> U-Net: Convolutional Networks for Biomedical Image Segmentation

Note indeed that a major difference w.r.t. *(long et al. 2015)* is that U-Net uses a large number of feature channels in the upsampling part, leading the network to become **symmetric**.

Another interesting detail is how the information coming from the skip connections are combined with the one coming from the upsampling path: they are **concatenated** and then **mixed in a learnable manner** through convolution.

### Training

The network was trained using a full-image approach with the following weighted loss function:

$$
    \hat{\theta} = min_{\theta} \sum_{\boldsymbol{x_j}} w(\boldsymbol{x_j}) l(\boldsymbol{x_j},\theta)
$$

where the weight

$$
    w(\boldsymbol{x}) = w_c(\boldsymbol{x}) + w_0 e^{-\frac{(d_1(\boldsymbol{x}) + d_2(\boldsymbol{x}))^2}{2\sigma^2}}
$$

- $w_c$ is used to balance class proportions (since it's a full-image approach)
- $d_1$ is the distance to the border of the closest cell
- $d_2$ is the distance to the border of the second closest cell

The second term is indeed used to enhance classification performance at borders of different objects, that in the scenario in which this network was used by the authors of the paper was very useful.

### Data augmentation

An interesting fact is that if in the first paper the authors said that data augmentation

> yielded no noticeable improvement

In the U-Net paper, instead, they claim that data augmentation

> is essential to teach the network the desired invariance and robustness properties, when only few training samples are available. [...] Especially random elastic deformations of the training samples seem to be the key concept to train a segmentation network with very few annotated images.

Indeed, the two scenario are pretty different, so as always data augmentation must be performed according to the problem we're facing.

## References

- [Fully Convolutional Networks for Semantic Segmentation](https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf)
- [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://arxiv.org/pdf/1505.04597.pdf)
- [CS231n: Convolutional Neural Networks for Visual Recognition](http://cs231n.stanford.edu/)
- [Jeremy Jordan website - Semantic Segmentation](https://www.jeremyjordan.me/semantic-segmentation/)


text:
---
app_id: com.github.alexkdeveloper.pasgen
title: "Pasgen"
summary: "Simple password generator"
developer: "Alex Kryuchkov"
homepage: http://github.com/alexkdeveloper/pasgen
help_page: http://github.com/alexkdeveloper/pasgen/issues
bugtracker: http://github.com/alexkdeveloper/pasgen/issues
dist: flatpak
screenshots:
  - https://raw.githubusercontent.com/alexkdeveloper/pasgen/main/data/screenshots/screenshot.png
icons:
  "64": https://flatpak.elementary.io/repo/appstream/x86_64/icons/64x64/com.github.alexkdeveloper.pasgen.png
  "128": https://flatpak.elementary.io/repo/appstream/x86_64/icons/128x128/com.github.alexkdeveloper.pasgen.png
color:
  primary: "#485a6c"
  primary-text: "#fff"
price: false
releases:

redirect_from: /com.github.alexkdeveloper.pasgen.desktop/
---

With this application, you can quickly create passwords of any length. You can switch between character sets for generation.

license: Unlicense

repository: elementary/appcenter-web

branch_name: refs/heads/main

extension: md

gha_language: Ruby

gha_license_id: Unlicense

license_type: permissive

repo_name: elementary/appcenter-web


text:
# jquery.autosave.js

    $("input").autosave({url:"/save",success:function(){},error:function(){});

That will bind a "change" event handler to all input elements, and post their values to the "/save" url each time the input value has changed.

## Options
You can pass any of these options to the .autosave() function:

      Option
      Type
      Default
      Description

      url
      string
      null
      Url use to post ajax data.

      event
      string
      change
      Event that causes the plugin to send data to your url. See jQuery.bind for options.

      data
      object
      null
      Object that holds all data that will be posted back to the url when the event is fired. You can set global default values to be sent here. All data-* attribute values end up here, minus "data-" (e.g. "data-id" becomes "id").

      debug
      boolean
      false
      Will stop any requests from being performed and will console.log the data variable inside of the autosave library

      type
      string
      html
      You can now specify the dataType you are expecting (xml, json, script, or html)

      success
      function
      function(data,$jqueryElement){}
      Callback used when data was saved successfully. The data returned from the ajax request, plus the jQuery element are passed to this method.

      error
      function
      function(error,$jqueryElement){}
      Callback used when data was not saved, or there was an error. The jQuery element is passed to this method.

      before
      function
      function($jqueryElement){}
      Callback called just before a request is sent to the server. The jQuery element is passed to this method.

license: MIT

branch_name: refs/heads/master


text:
# PingPong

> Developer: James Kimari

> --------------------------------------------------------------------------------

> Project Name: PingPong

> --------------------------------------------------------------------------------

## Description

> This is a website that returns a list of numbers counting from 1 up to the user's input. It returns "ping" if number is divisible by 3, "pong" if number is divisible by 5, "pingpong" if number is divisible by 15 and the current number if number is not divisible by either of the three divisors.

## Specifications
> - The webpage counts from 1 upto to the inputted number.
> - The webpage outputs "ping" for numbers divisible by 3, "pong" for numbers divisible by 5, "pingpong" for numbers divisible by 15 and returns the current number for those that don't meet the criteria.
> - It also allows the user to clear the output.

## Example
> If the user inputs the number 24 and submits, this will be the output:

> - 1
> - 2
> - ping
> - 4
> - pong
> - ping
> - 7
> - 8
> - ping
> - pong
> - 11
> - ping
> - 13
> - 14
> - pingpong
> - 16
> - 17
> - ping
> - 19
> - pong
> - ping
> - 22
> - 23
> - ping

## Setup/Installation Requirements

> - Internet connection
> - Link to deployed page: [PingPong](https://JamesKimari.github.io/Pingpong/)

## Known Bugs

> When you click the 'Clear Output!' button, the output is cleared but on input on a new number, the submit event does not work. You have to refresh the webpage and input a new number.

## Technologies used

> - html5
> - css3
> - bootstrap4
> - javascript
> - jQuery-3.2.1

## Support and contact details

> - Mobile number:<PHONE_NUMBER>32
> - Email Address<EMAIL_ADDRESS>
## License and terms of use

> [MIT License](license) this application's source code is free for any open source projects

> --------------------------------------------------------------------------------

> © JamesKimari | Credits [Moringa School](https://moringaschool.com/)

repository: JamesKimari/Pingpong

repo_name: JamesKimari/Pingpong


text:
This is a sample project using [Create React Native App](https://github.com/react-community/create-react-native-app).

## Table of Contents

* [What's Mobile Flashcards App?](#app-intro)
* [Get Starter](#get-started)
  * [npm install](#npm-install)
  * [yarn start](#yarn-start)
  * [Using Expo](#using-expo)
  * [Run on iOS or Android Phone](#using-ios-or-android-device)
  * [Run on iOS or Genymotion emulator](#using-emulator)
* [How to use this App?](#how-to-use-this-app)
  * [Homepage](#homepage)
  * [Add a Deck](#add-deck)
  * [Add Questions and Answers](#add-questions-and-answers)
  * [Take a Quiz](#take-quiz)
  * [Daily Reminder Notifcation](#daily-reminder)
* [MIT License](#mit-license)

## App Intro

Mobiel Flashcards is a mobile app that allows users to study collections of flashcards. The app will allow users to create different categories of flashcards called "decks", add flashcards to those decks, then take quizzes on those decks.

## Getting Started

### `npm install`

After downloading this GitHub repo, run `npm install` on your terminal to install dependencies.

### `yarn start`

Run the program by typing `yarn start` on your terminal.

### Using Expo

This app is built on [Expo](https://expo.io)

### Run on iOS or Android Phone

1. Install Expo app from Google Play or Apple Store
2. Use QR code to run this program on your device

### Run on iOS or Android Emulator

Click `a` in your terminal to run Android emulator, or `i` to run iOS simulator

## How To Use This App?

### Homepage

1. When you open this app, you'll a homepage with 2 tabs, ie. Show All Decks and Add a Deck tabs
2. We've provided 2 default Decks with existing Q&A to get started

### Add A Deck

1. To add a deck, click + sign or go to `Add a Deck` tab
2. Enter the name for the new deck
3. Click `Save` button
4. Next, you'll be able to add Q&A or take Quiz

### Add Questions and Answers

1. To add a Q-and-A, click `Add QA Cards` button from individual deck
2. Enter a Question and the answer
3. Click `Save` button
4. Next, you'll routed back to individual deck

### Take a Quiz

1. To start a quiz, click `Start Quiz` button from individual deck
2. The app will show a question
3. If you answer correctly, click `correct` button and you'll get +1 score
4. If you answer incorrectly, click `incorrect` button and you'll get +1 score
5. If you need help, click `Show Answer` button to see the answer
6. At the end of the quiz, you can `Restart Quiz` or `Go Back to Deck`

### Daily Reminder Notification

This app will send you a local notification everyday at 8pm, unless if you take a quiz.

## MIT License

The MIT License (MIT)

Copyright (c) 2018 - Present

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.


text:
# Firebase Management

Tool to handle data with a firebase project and between projects using Flutter and Dart

## Getting Started

There is are two main ways to use this application

1. Use the online version for something quick with optional persistence [here](https://fir-management-c07b8.web.app/#/)
2. Clone or fork to use offline and expand off of for personal customization.
    1. There is also the option of using this on your phone since it is a flutter project,
    but I don't plan to maintain that

## Contributing Guidelines

nothing formally created. If you see this it's hopefully early in the project, and I haven't made time to write it down.

To have changes approved
1. create a ticket and with the feature or enhancement tag
2. included your intended requirements and functionality
3. branch off of <ins>_master_</ins> and commit changes there
4. submit a pull request into master and hopefully a testing kit will be ready

## FBM Documentation
Firebase management comes in three main applications

#### FBM Firestore
##### Description:
I can speak latin, but I can't remember how to write it
##### Features:
* Feature 1
Here is a description of how to use this feature and hopefully
a good examples of using the tool

#### FBM Database

#### FBM Storage

Please reach out with other work or project you want to work on.
email    : [psycthekid<EMAIL_ADDRESS>
linkedin : [Nick Lewis](https://www.linkedin.com/in/nick-lewis-thekid)


text:
---
title: Week 3 Overview
module: 3
---

# Week 3 Overview

Active: {{ site.data.dates[page.module][0] }}

Homework Due: {{ site.data.dates[page.module][1] }}

For this week, and the next couple of weeks, we will explore the basic concepts and techniques of coding in JavaScript.

Most of you will already have taken [MART120 - Creative Coding 1](https://Montana-Media-Arts.github.io/creative-coding-1). For those of you who have taken 120, this will be a review for you. I feel comfortable asking you to review this material through the lens of true JavaScript, as opposed to the gentler p5 lens.

For those of you who have not taken 120, this will be new material. Take your time, work through this material slowly and methodically (i.e., I would be reading deep and not skimming). Remember, if you have questions while you work through the content this week, post them to the [GitHub-hosted Issues-Forum](https://github.com/Montana-Media-Arts/441-WebTech-Spring2019/issues).

For everyone, I again, would encourage you to consider developing a study group, that you can meet with once a week. If you get in the habit now of meeting with these people, when the content gets difficult later this semester, you will have a group to work with. Please feel free to use the issues-forum to arrange groups if you are so inclined.


text:
# Vostok.Applications.AspNetCore

[![Build & Test & Publish](https://github.com/vostok/applications.aspnetcore/actions/workflows/ci.yml/badge.svg)](https://github.com/vostok/applications.aspnetcore/actions/workflows/ci.yml)
[![NuGet](https://img.shields.io/nuget/v/Vostok.Applications.AspNetCore.svg)](https://www.nuget.org/packages/Vostok.Applications.AspNetCore)

AspNetCore vostok application template.

**Build guide**: https://github.com/vostok/devtools/blob/master/library-dev-conventions/how-to-build-a-library.md

**User documentation**: not written yet.

gha_language: C#

gha_license_id: MIT


text:
Identity
========

[![Build Status](https://travis-ci.org/krixon/identity.svg?branch=master)](https://travis-ci.org/krixon/identity)
[![Coverage Status](https://coveralls.io/repos/github/krixon/identity/badge.svg?branch=master)](https://coveralls.io/github/krixon/identity?branch=master)
[![Latest Stable Version](https://poser.pugx.org/krixon/identity/v/stable)](https://packagist.org/packages/krixon/identity)
[![Latest Unstable Version](https://poser.pugx.org/krixon/identity/v/unstable)](https://packagist.org/packages/krixon/identity)
[![License](https://poser.pugx.org/krixon/identity/license)](https://packagist.org/packages/krixon/identity)

Classes for handling object identity. Particularly useful for DDD Entities.

# Prerequisites

- PHP 7.4+

# Installation
## Install via composer

To install this library with Composer, run the following command:

```sh
$ composer require krixon/identity
```

You can see this library on [Packagist](https://packagist.org/packages/krixon/identity).

## Install from source

```sh
# HTTP
$ git clone https://github.com/krixon/identity.git
# SSH
$ git clone git@github.com:krixon/identity.git
```

# Contributing

Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md)

repository: krixon/identity

repo_name: krixon/identity


text:
# Foodali
Hybrid App with Ionic 5.2

### Environment setup (Linux)
```
sudo apt update
```
```
sudo apt install nodejs
```
```
nodejs --version
```
```
sudo apt install npm
```
```
npm --version
```
### Install Ionic framework
```
npm install -g ionic cordova
```

### Go to the folder modern-foodies-india & run the command
```
npm install -g @angular/cli
```
```
npm install
```
```
npm rebuild node-sass
```
```
ionic serve
```
The app will open in a browser on http://localhost:8100

repository: Compro-Prasad/modern-foodies-india

repo_name: Compro-Prasad/modern-foodies-india


text:
# Resolving

The [IResolver](xref:Makaretu.Dns.IResolver) interface defines the
**ResolveAsync** method that is used to answer a [query message](message.md).

## Resolvers

The following resolvers are available

| Name | Description |
| ---- | ----------- |
| [NameServer](name-server.md) | Finds an answer in a [Catalog](catalog.md) |

## Example

Getting the IPv4 addresses of `ns.example.com`

```csharp
IResolver resolver = ...

var query = new Message();
query.Questions.Add(new Question { Name = "ns.example.com", Type = DnsType.A });
var answer = await resolver.ResolveAsync(request);
```

The answer is
```
;; Header: QR AA RCODE=NoError

;; Answer
ns.example.com 3600 IN A <IP_ADDRESS>

```

repository: EbramTawfik/mDNSPublisher

repo_name: EbramTawfik/mDNSPublisher


text:
# Scala.js typings for redux-orm

Typings are for version 0.9

## Library description:
Simple ORM to manage and query your state trees

|                    |                 |
| ------------------ | :-------------: |
| Full name          | redux-orm |
| Keywords           | redux, orm |
| # releases         | 17 |
| # dependents       | 6 |
| # downloads        | 185284 |
| # stars            | 0 |

## Links
- [Homepage](https://github.com/redux-orm/redux-orm#readme)
- [Bugs](https://github.com/redux-orm/redux-orm/issues)
- [Repository](https://github.com/redux-orm/redux-orm)
- [Npm](https://www.npmjs.com/package/redux-orm)

## Note
This library has been generated from typescript code from [DefinitelyTyped](https://definitelytyped.org).

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

## Comments

These comments are from the typescript definitions and might be useful:
```
// Type definitions for redux-orm 0.9
// Project: https://github.com/redux-orm/redux-orm
// Definitions by: Andrey Goncharov <https://github.com/keenondrums>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

```

repository: Jeswang/Distribution

repo_name: Jeswang/Distribution


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

My name is Joseph Wagner. Here are some quick facts about me:

- I'm a fellow of Lambda School studying data science.
- I'm always looking to help with FOSS projects. Can I help? Let's get in touch!
- I'm most interested in big data & data engineering.

My interests:

- Python & programming language design
- Functional programming
- Metaheuristics & optimization
- Blockchains & distributed systems

### My history
I started programming for my high school's FIRST FRC robotics team, working with LabView. Since then, my interests in tech have grown to include programming language technology, machine learning, data engineering/big data, and principles of software engineering. I'm currently a student at Lambda School, and if you're interested in seeing what I'm currently working on go check out my repositories (GitHub link in the footer). Aside from programming and research, I am also passionate about playing music (Does Guitar Hero count too?), reading, hiking, and downhill skating.


text:
# ManyKey Writer
A wxPython-based GUI to write key configuration to serial devices using the ManyKey protocol.

![ManyKey Writer Screenshot](https://www.manykey.org/img/writer_ss.png?u=1)

## Key Codes
Any basic character ascii character you can type with an english language keyboard (without modifiers) should work as a keycode. For other keys, see the list below.
- LEFT_MOUSE
- RIGHT_MOUSE
- MIDDLE_MOUSE
- LEFT_CTRL
- LEFT_SHIFT
- LEFT_ALT
- LEFT_GUI
- RIGHT_CTRL
- RIGHT_SHIFT
- RIGHT_ALT
- RIGHT_GUI
- UP_ARROW
- DOWN_ARROW
- LEFT_ARROW
- RIGHT_ARROW
- BACKSPACE
- TAB
- RETURN
- ESC
- INSERT
- DELETE
- PAGE_UP
- PAGE_DOWN
- HOME
- END
- CAPS_LOCK
- F1
- F2
- F3
- F4
- F5
- F6
- F7
- F8
- F9
- F10
- F11
- F12
- SPACE


text:
# Scala.js typings for mdast-comment-marker

Typings are for version 2.1.2

## Library description:
mdast utility to parse a comment marker

|                    |                 |
| ------------------ | :-------------: |
| Full name          | mdast-comment-marker |
| Keywords           | unist, mdast, mdast-util, util, utility, marker, comment |
| # releases         | 3 |
| # dependents       | 0.0 |
| # downloads        |<PHONE_NUMBER>333333 |
| # stars            | 9.0 |

## Links
- [Homepage](https://github.com/syntax-tree/mdast-comment-marker#readme)
- [Bugs](https://github.com/syntax-tree/mdast-comment-marker/issues)
- [Repository](https://github.com/syntax-tree/mdast-comment-marker)
- [Npm](https://www.npmjs.com/package/mdast-comment-marker)

## Note
This library has been generated from typescript code from first party type definitions.

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

repository: ScalablyTyped/Distribution

repo_name: ScalablyTyped/Distribution


text:
# MDDatasets.jl: Multi-Dimensional Datasets
## [:heavy_exclamation_mark: Core of C-Data Analysis/Visualization Suite](https://github.com/ma-laforge/CData.jl)

[![Build Status](https://travis-ci.org/ma-laforge/MDDatasets.jl.svg?branch=master)](https://travis-ci.org/ma-laforge/MDDatasets.jl)

## Description

The MDDatasets.jl module provides tools to simplify manipulation of multi-dimensional datasets.  MDDatasets.jl implements the core algorithms of the [C-Data Analysis/Visualization Suite](https://github.com/ma-laforge/CData.jl)

|  |
| :---: |

### Important Features
- ***Single variable for (x,y) values:*** Stores both `(x,y)` values representing `y=f(x)` in a single, coherent structure.  This signficantly improves the simplicity & readability of your calculations.
- ***Automatic Interpolation:*** Calculations will automatically be interpolated over `x` as if `y=f(x)` data represented a ***continuous*** function of x.
- ***Automatic Broadcasting:*** Operations on multi-dimensional datasets will automatically be broadcasted (vectorized) over all subsets.  This significantly improves the readability of programs.

## Concrete Example
```
using MDDatasets
```

Create `(x,y)` container pair, and call it “x”:
```
x = DataF1(0:.1:20)
#NOTE: Both x & y coordinates of "x" object initialized as y = x = [supplied range]
```

“Extract” maximum x-value from data:
```
xmax = maximum(x)
```

Construct a normalized ramp dataset, `unity_ramp`:
```
unity_ramp = x/xmax
```

#### Observe `x` and `unity_ramp`
(Note how `unity_ramp` is normalized such that maximum value is 1)

Compute `cos(kx)` & `ksinkx = cos'(kx)`:
```
coskx = cos((2.5pi/10)*x)
ksinkx = deriv(coskx)
```

Compute ramps with different slopes using `unity_ramp` (previously computed):
```
#NOTE: for Inner-most sweep, we need to specify leaf element type (DataF1 here):
ramp = fill(DataRS{DataF1}, PSweep("slope", [0, 0.5, 1, 1.5, 2])) do slope
	return unity_ramp * slope
end
```

NOTE: the above expression constructs a multi-dimensional `DataRS` structure, and fills it with `(x,y)` values for each of the desired parameter values (the slope).

#### Observe `coskx`, `ksinkx` and `ramp`

Merge two datasets with different # of sweeps (`coskx` & `ramp`):
```
r_cos = coskx+ramp
```

#### Observe newly constructed `r_cos` dataset:

Shift all ramped cos(kx) waveforms to make them centered at their mid-points:
```
midval = (minimum(ramp) + maximum(ramp)) / 2
c_cos = r_cos - midval #Shift by midval (different for each swept slope of "ramp")
```

#### Observe newly constructed `c_cos` dataset:

## Core Architecture

### Functions Of 1 Argument (`DataF1`) & Interpolation

Type `DataF1` is used to represent *continuous* functions of 1 argument (`y = f(x)`).  `DataF1` stores samples of said functions in its `x` & `y` vectors.

Operations performed on two `DataF1` objects will result in the interpolation of the corresponding `{x, y}` coordinates.  Furthermore, operations beyond the x-range of a `DataF1` object "extrapolate" to 0.

By grouping `x` & `y` vectors together, `DataF1` objects can also lead to simpler/less error-prone interfaces:

	PlottingModule.plot(x, y, ...)

gets simplified to:

	PlottingModule.plot(data, ...)

NOTE: When dealing with complex algorithms, this simplification is rearkably quite significant.

### Multi-Dimensional Datasets (`DataRS`) & Broadcasting

In order to identify trends, or simply to verify the repeatability of a process, one often needs to perform the same operation on multiple "experiments".  This module provides the `DataRS` type to store/organize/access experiment data in a convenient fashion.

As a side-note, `DataRS` collects simpler data elements (like `DataF1` or simple scalar values) into a recursive data structure.  Each `DataRS` element is used to store the results on an "experiment" (or collection of experiments) where a control variable was varied (swept).  Due to the recursive nature of `DataRS`, each "sweep" can potentially represent a control variable that is *dependent* on a previous "sweep".

#### Broadcast Features

Operations performed on multi-dimensional data sets (`DataRS`) will automatically be broadcast to each element of the dataset ([see Known Limitations](#KnownLimitations)).

Explicit looping over `DataRS` structures is therefore typically not required.  Many algorithms can be used unmodified, even after changing the set of experimental points.

By default, reducing functions (like `maximum`, `minimum`, or `mean(::Vector) => Scalar`) will operate on `DataRS` structures by collapsing the inner-most dimension:

	#Assuming sig -> DataRS{sweeps={supply, temp, ctrlVoltage}} of DataF1{x=time}
	freqVctrl = mean(measfreq(sig)) #DataRS{sweeps={supply, temp, ctrlVoltage}}
	maxfVtemp = maximum(freqVctrl) #DataRS{sweeps={supply, temp}}
	maxfVsupply = maximum(maxfVtemp) #DataRS{sweeps={supply}}

As can be inferred from above, the sweep from the inner-most dimension can be thought as the x-coordinate of the data.  That is because subsequent operations will be applied along that dimension.

TODO: Provide a means to re-order dimensions.

## Principal Types

- **`DataInt, DataFloat, DataComplex`**: Useful aliases for largest practical data types on a platform (not yet platform dependent).
- **`DataMD`**: Abastract data type for multi-dimensional data.
- **`DataF1`**: Represents a function of 1 variable, y(x) using a x/y vector pair.
- **`DataHR{DataF1/DataInt/DataFloat/DataComplex}`**: ***DO NOT USE*** A hyper-rectangular organizaton of data.  Principally designed to collect massive datasets with *independent* control variables ([see examples](README_DataHR.md#SampleUsage_DataHR)).
- **`DataRS{DataF1/DataInt/DataFloat/DataComplex}`**: A recursive-sweep organization of data.  Principally designed to collect massive datasets with *dependent* control variables([see examples](#SampleUsage_DataRS)).
- **`PSweep`**: A parameter sweep (i.e. an independent control variable that generates experimental points in a `DataRS/DataHR` dataset).

### Function Listing

#### Imported From `Base`

- Single-argument functions:

  - `zeros, ones, abs, abs2, angle,`

`imag, real, exponent,`

`exp, exp2, exp10, expm1,`

`log, log10, log1p, log2,`

`ceil, floor,`

`asin, asind, asinh, acos, acosd, acosh,`

`atan, atand, atanh, acot, acotd, acoth,`

`asec, asecd, asech, acsc, acscd, acsch,`

`sin, sind, sinh, cos, cosd, cosh,`

`tan, tand, tanh, cot, cotd, coth,`

`sec, secd, sech, csc, cscd, csch,`

`sinpi, cospi,`

`sinc, cosc,`

`deg2rad, rad2deg,`

- Two-argument functions:

  - `+, -, *, /, ^,`

`max, min,`

`atan, hypot,`

`maximum, minimum,`

`prod, sum,`

`mean, median, middle,`

#### Differential/Integral Math

- **`deriv`**`(d::DataF1, shiftx=[Bool])`: Returns dataset with derivative of `d`
- **`integ`**`(d::DataF1, shiftx=[Bool])`: Returns definite integral of `d`
- **`iinteg`**`(d::DataF1, shiftx=[Bool])`: Returns dataset with indefinite integral of `d`

#### Basic Dataset Operations
- **`xval`**`(::DataF1)`: Returns a dataset with where y(x) = x.
- **`value`**`(y::DataF1, x=[Real])`: Returns `y(x)`
- **`clip`**`()`: Returns a dataset clipped within an x-range
  - `clip(::DataF1, xrng::Range)`
  - `clip(::DataF1, xmin=[Real], xmax=[Real])`
- **`sample`**`(::DataF1, xrng::Range)`: Returns dataset sampled @ each point in `xrng`
- **`xshift`**`(::DataF1, offset::Number)`: Returns dataset with all x-values shifted by `offset` (negative values "shift left")
- **`xscale`**`(::DataF1, fact::Number)`: Returns dataset with all x-values scaled by `fact`
- **`yvsx`**`(yv::DataF1, xv::DataF1)`: Returns dataset with `{xv(x), yv(x)}` (interpolating, when necessary)

#### Cross-Based Operations

Note: The `Event` object makes functions return x-vectors that represent the current event number.

- **`xcross`**`()`: Returns x-values of `d1` (up-to `nmax`) when `d1` crosses 0 (`nmax`=0: get all crossings):
  - `xcross([Event,] d1::DataF1, [nmax::Int,] xstart=[Real], allow=[CrossType])`
- **`ycross`**`()`: Returns y-values of `d2` (up-to `nmax`) when `d1` crosses `d2` (`nmax`=0: get all crossings):
  - `ycross([Event,] d1::DataF1, d2::DataF1, [nmax::Int,] xstart=[Real], allow=[CrossType])`
- **`xcross1`**`()`: Returns scalar x-value of `d1` on `n`-th zero-crossing:
  - `xcross1([Event,] d1::DataF1, n=[Int], xstart=[Real], allow=[CrossType])`
- **`ycross1`**`()`: Returns scalar y-value of `d1` on `n`-th crossing of `d1` & `d2`:
  - `ycross1([Event,] d1::DataF1, n=[Int], xstart=[Real], allow=[CrossType])`

##### Operations On Clock Signals
- **`measperiod`**`(d::DataF1, nmax=[Int], tstart=[Real], xing=[CrossType], shiftx=[Bool])`
- **`measfreq`**`(d::DataF1, nmax=[Int], tstart=[Real], xing=[CrossType], shiftx=[Bool])`

##### Operations On Binary Signals
- **`measdelay`**`(dref::DataF1, dmain::DataF1, nmax=[Int], tstart_ref=[Real], tstart_main=[Real], xing_ref=[CrossType], xing_main=[CrossType])`
- **`measck2q`**`(ck::DataF1, q::DataF1, delaymin=[Real], tstart_ck=[Real], tstart_q=[Real], xing_ck=[CrossType], xing_q=[CrossType])`

##### The `CrossType` Object

The `CrossType` object is used to filter out undersired events.

- `sing`: Include singularities (points that cross at a single point).
- `flat`: Include middle of crossings that are detected at multiple consecutive points.
- `thru`: Include crossings make it all the way through the crossing point.
- `rev`: Include crossings that hit the crossing point, then reverse back.
- `firstlast`: Include first/last crossing points (when data starts or ends @ crossing point itself).

Constructors:

- **`CrossType`**: Indicates which crossings are allowed in the result.
  - `CrossType(rise=[Bool], fall=[Bool], sing=[Bool], flat=[Bool], thru=[Bool], rev=[Bool], firstlast=[Bool])`
  - `CrossType(:rise)`: Preset to selecting rising edges
  - `CrossType(:fall)`: Preset to selecting falling edges
  - `CrossType(:risefall)`: Preset to selecting both rising & falling edges

## Sample Usage

Examples of the MDDatasets.jl capabilities can be found under the [test directory](test/).

More advanced usage examples can be found in the [sample directory](https://github.com/ma-laforge/SignalProcessing.jl/tree/master/sample) of the [SignalProcessing.jl module](https://github.com/ma-laforge/SignalProcessing.jl).

## Usage: Constructing A Recursive-Sweep Dataset

Assuming input data can be generated using the following:

	t = DataF1((0:.01:10)*1e-9) #Time vector stored as a function of 1 argument

	#NOTE: get_ydata returns type "DataF1" (stores data as a function of 1 argument):
	get_ydata(t::DataF1, tbit, vdd, trise) = sin(2pi*t/tbit)*(trise/tbit)+vdd

One can create a relatively complex Recursive-Sweep (DataRS) dataset using the following pattern:

	datars = fill(DataRS, PSweep("tbit", [1, 3, 9] * 1e-9)) do tbit
		fill(DataRS, PSweep("VDD", 0.9 * [0.9, 1, 1.1])) do vdd

			#Inner-most sweep: need to specify element type (DataF1):
			#(Other (scalar) element types: DataInt/DataFloat/DataComplex)
			fill(DataRS{DataF1}, PSweep("trise", [0.1, 0.15, 0.2] * tbit)) do trise
				return get_ydata(t, tbit, vdd, trise)
			end
		end
	end

## Known Limitations

### Implementation

1. Support for broadcasting functions over `DataHR` & `DataRS` types is fairly extensive.
    - Nonetheless, the system is incomplete/imperfect, and unexpected failures will occur.

### Compatibility

Extensive compatibility testing of MDDatasets.jl has not been performed.  The module has been tested using the following environment(s):

- Linux / Julia-1.1.1 (64-bit)

## Disclaimer

The MDDatasets.jl module is not yet mature.  Expect significant changes.


text:
# README #

This is the crawler component of Buzzbang search.

# Setup #

1. Create intermediate crawl database
```
cd setup
./bsbang-setup-sqlite.py
```

2. Queue URLs for Bioschemas JSON-LD extraction by adding them directly and crawling sitemaps
```
cd ..
./bsbang-crawl.py
```

3. Extract Bioschemas JSON-LD from webpages and insert into the crawl database.
```
./bsbang-extract.py
```

4. Install Solr.

5. Create a Solr core named 'bsbang'
```
cd $SOLR/bin
./solr create -c bsbang
```

6. Run Solr setup
```
cd $BSBANG/setup
./bsbang-setup-solr.py
```

7. Index the extracted Bioschemas JSON-LD in Solr
```
cd ..
./bsbang-index.py
```

# Frontend #

See https://github.com/justinccdev/bsbang-frontend for a frontend project to the index.

# Tests #

```
$ python3 -m unittest discover
```

# Hacking #

Contributions welcome!  Please

* Make pull requests to the dev branch.
* Conform to the PEP 8 style guide.

Thanks!

gha_language: CSS


text:
# Reddit Image Browser

**RIB** is a client-side image browser for Reddit. The application uses jQuery to fetch and process unauthenticated JSONP. Some rendering is done with [D3.js](http://d3js.org/) with the eventual goal of creating richer visualizations and user interactivity. HTML 5 Local Storage is used to maintain state.

I made this mainly for my own use because I wanted an easy and smooth way of flipping through r/pics.

## Usage

**RIB** is meant to be a fast and easy way to browse all image posts on Reddit. Due to browser security protection against cross origin scripting, RIB can only provide unauthenticated read-only browsing. The live version of the site can be found at [rib.soraven.com](http://rib.soraven.com)

There is currently no support for mobile devices.

## Features

- Runs entirely in your browser.
- Identifies post type (i.e. NSFW, videos, self) and displays content in an appropriate format.
- Infinite scrolling with automatic asynchronous loading.
- Hotkeys, such as `j` to go to next post and `c` to open comments page, enable fast browsing.
- Your subreddit selections persist across sessions via HTML 5 Local Storage.
- Local Storage support for IE provided by Remy Sharp's [storage polyfill](https://github.com/inexorabletash/polyfill/blob/master/storage.js).
- Retries on load error.

## Todo

- Data visualization (e.g. treemaps) using D3.js.
- Implement YouTube API callback function to allow better video controls.
- Load top comments on demand.
- Make keyboard shortcut work for Imgur albums.
- Option to filter by post type.
- Zoom and resize options.
- Responsive layout. (Probably not...)
- Mobile support?

## Contact

You can [reach me](http://soraven.com/contact) through my blog at http://soraven.com.

## Icons

Most of the icons used in RIB came from the [Modern Pictograms](http://www.fontsquirrel.com/fonts/modern-pictograms) dingbat font by John Caserta. The rest came from the unicode charset.

repository: darkmirage/reddit-image-browser

repo_name: darkmirage/reddit-image-browser


text:
---
# Documentation: https://wowchemy.com/docs/managing-content/

title: A Measure-theoretic Characterzation of Tight Language Model
subtitle: ''
summary: ''
authors:
- Li Du
- Lucas Torroba Hennigen
- Tiago Pimentel
- Clara Meister
- Jason Eisner
- Ryan Cotterell
tags: []
categories: []
date: '2023-07-01'
lastmod: 2023-07-09T17:59:38+02:00
featured: true
draft: false

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ''
  focal_point: ''
  preview_only: false

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
publishDate: '2023-07-09T15:59:38.440620Z'
publication_types:
- '1'
abstract: Language modeling, a central task in natural language processing, involves
  estimating a probability distribution over strings. In most cases, the estimated
  distribution sums to 1 over all finite strings. However, in some pathological cases,
  probability mass can “leak” onto the set of infinite sequences. In order to characterize
  the notion of leakage more precisely, this paper offers a measure-theoretic treatment
  of language modeling. We prove that many popular language model families are in
  fact tight, meaning that they will not leak in this sense. We also generalize characterizations
  of tightness proposed in previous works.
publication: '*Proceedings of the 61th Annual Meeting of the Association for Computational
  Linguistics (Volume 1: Long Papers)*'
links:
- name: URL
  url: https://arxiv.org/abs/2212.10502
---

repository: rycolab/website

repo_name: rycolab/website


text:
# Magento 2 Russian Language Pack

Install the Russian language pack via composer is never easier.

**Install Russian pack**:

```
composer require qpard/magento2-russian-language-pack:*
php bin/magento cache:clean
php bin/magento setup:static-content:deploy ru_RU

```

**Update  Russian pack**:

```
composer update qpard/magento2-russian-language-pack:*
php bin/magento cache:clean
php bin/magento setup:static-content:deploy ru_RU

```
## Translation process of Russian Language Pack
![process](http://progressed.io/bar/34)

gha_language: PHP


text:
# Scaled Budget Bars for Mint (Intuit)
In the Budgets screen on Mint, this scales the bars relative to the size of the budget and the amount spent.
$1000 over is obviously more noticeable than $5 over, and you can tell very quickly if you are overspent!

## Installation instructions

1. If you use Chrome, download the [TamperMonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en) extension.
2. On other browsers, use the [GreaseMonkey](https://addons.mozilla.org/en-GB/firefox/addon/greasemonkey/) extension.
3. Once installed, click on **[this link](https://github.com/xanderak/Mint-scaled-budget-bars/raw/master/budget_bars.user.js)**, and choose **Install**.
4.

## New colors
- **Gray** is how much you have spent.
- **Green** is how much budget you have **left**.
- **Red** is how much has been **overspent**.

![](https://github.com/xanderak/Mint-scaled-budget-bars/raw/master/scaled%20budget%20bars.png)

## Notes

I hope you find this useful!  Comments welcome!

This works currently as of April 2017.  If Mint has updated their code/classes/bars since then, then this may well stop working.

repository: xanderak/Mint-scaled-budget-bars

gha_language: JavaScript

repo_name: xanderak/Mint-scaled-budget-bars


text:
# Waltz

A fast, efficient bam pileup and application modules based on it, like coverage metrics, genotyping, signature finding etc.

This software was developed at the Innovation Lab, Center for Molecular Oncology, Memorial Sloan Kettering Cancer Center.

Waltz has 2 main modules:
1. **Bam metrics**: Generate various useful metrics for a given bam file
2. **Genotyping**: Determine the fragment count and allele fraction of given mutations in given bam file

## Java
Java 1.8 or above is required.

## Dependencies (bundled with the release jar)

1. BioinfoUtils
2. HTSJDK
3. Google Guava
4. Apache Commons IO

### 1. Bam Metrics

#### Generate bam level metrics

java -server -Xms4g -Xmx4g -cp Waltz.jar org.mskcc.juber.waltz.countreads.CountReads bam-file coverageThreshold canonical-transcripts-bed-file intervals-bed-file

where
coverageThreshold is the average coverage above which a contiguous region should be considered covered (suggested value: 5)
canonical-transcripts-bed-file is the bed file with all exons in across the genomes (included above)
intervals-bed-file is the bed file of chosen genomic intervals

This produces 3 files:
.covered-regions: regions of contiguous coverage, annotated with canonical transcripts. Useful for checking what regions are actually covered in the bam file. Columns: chr, start, end, length, average total coverage in the contiguous region.

.read-counts: bam-level stats. Columns: bam file name, total reads, unmapped reads, total mapped reads, unique mapped reads, duplicate fraction, total on-target reads, unique on-target reads, total on-target rate, unique on-target rate

.fragment-sizes: fragment size distribution. Columns: fragment-size, total frequency, unique frequency

#### Generate metrics specific to given genomic regions

java -server -Xms4g -Xmx4g -cp Waltz.jar org.mskcc.juber.waltz.Waltz PileupMetrics mappinngQualityThreshold bam-file reference-fasta intervals-bed-file

This produces 4 different files:
-pileup.txt: per-position fragment count for different alleles. Columns: chr, position, ref, depth (including N's), fragment counts for A, C, G, T, insertions, deletions, soft clip start, soft clip end, hard clip start, hard clip end

-pileup-without-duplicates.txt: similar to above but only unique fragments are counted

-intervals.txt: stats per genomic interval. Columns: chr, start, end, interval name, interval length, peak coverage, average coverage, GC fraction, number of fragments mapped

-intervals-without-duplicates.txt: similar to above but only unique fragments are considered

#### Collect metrics across samples

Run aggregate-bam-metrics.sh script in the folder where the above output files are present to collect metrics across samples.

This produces 3 main files with self-explanatory headers.
read-counts.txt: collection of metrics from *.read-counts files

waltz-coverage.txt: per sample coverage calculated across chosen genomic intervals

fragment-sizes.txt: fragment size distributions for all samples

### 2. Genotyping

java -server -Xms4g -Xmx4g -cp Waltz.jar org.mskcc.juber.waltz.Waltz Genotyping mappinngQualityThreshold bam-file reference-fasta intervals-bed-file mutations-maf-file

where
mutations-maf-file is a file in maf format specifying the mutations to be profiled in the given bam. Required fields are Chromosome, Start_Position, Variant_Type, Reference_Allele and Tumor_Seq_Allele2

This will produce a -genotypes.maf file with 4 addtional columns at the end: Waltz_total_t_depth, Waltz_total_t_alt_count, Waltz_MD_t_depth and Waltz_MD_t_alt_count. All sample-specific columns will be made empty while all the mutation-specific information will be retained. Tumor_Sample_Barcode will contain the name of the sample being genotyped.

#### Collect genotypes across multiple samples

Run aggregate-genotypes.sh script in the folder where the -genotypes.maf files are present to collect genotyping information across multiple samples. The output is a genotypes.maf file.

repository: mskcc/Waltz

repo_name: mskcc/Waltz


text:
# Creating a Collective

Open Collective allows you to create a transparent funding page for your project in just a few clicks. No need to incorporate, hire a lawyer and accountant, or define organizational roles.

You can create an Open Collective for free right now at [**https://www.opencollective.com/create**](https://www.opencollective.com/create)\*\*\*\*

Once your Collective is created, go to "[edit Collective](customize-collective.md)" to personalize your page and write a detailed description. Setting up a Collective is a great opportunity to clarify your mission and explain why people should back you.

In order to receive or spend money, you'll need to [add a fiscal host](add-or-change-fiscal-host.md).


text:
# CMS Modules and Components

This is a listing of all known publically available components and modules for this CMS.

If you have created or know about a package that should be listed here, I'd appreciate getting a heads-up, or even a pull request to add it to this page.

## Components

Components, unlike modules, are required for the CMS to work.
These are necessary but interchangeable add-ons to the core.

The main reason these are split off as separate packages, is to make it easier to replace or extend them with custom versions.

- [Authentication component](https://github.com/czim/laravel-cms-auth)
    Authentication, user and permission support for web and API access.

- [Theme component](https://github.com/czim/laravel-cms-theme)
    The look and feel of the CMS, as well as javascripts and general assets.

## Available modules

Modules are optional and may be added to the CMS as needed.

- The default [ACL Module](https://github.com/czim/laravel-cms-acl-module)
    A very simple user, role & permission management module.

- The default [Models Module](https://github.com/czim/laravel-cms-models)
    Allows extensive management of Eloquent model data.
    For simple applications, this may be all you need for a complete CMS.

Modules may require special configuration and setup, and have their own dependencies.
Please check each module's documentation for further information.

### Making Custom Modules

The above list is not exhaustive, if only because making custom modules is encouraged.

For more information, see [creating custom modules](Development/CreatingModules.md).

repository: czim/laravel-cms-core

repo_name: czim/laravel-cms-core


text:
---
description: Catalog record identifier
solution: Experience Manager
title: Id
feature: Dynamic Media Classic,SDK/API
role: Developer,User
exl-id: 37945115-c93d-4f59-b3d3-a2c4ee7fc990
---
# Id {#id}

Index key value by which records in the image data file are looked up by the [!DNL Platform Server].

Typically, a short and unique image identifier, such as a SKU number, possibly with some sort of image suffix, if a SKU has multiple images. May also be a more complex string that looks more like a file path, to support easy retro-fitting of web sites with Image Serving.

## Properties {#id-properties}

Text string. Required. Primary index key for the image data table. Each catalog::Id value must be unique within the table.

## Default {#id-default}

None.

## See also {#id-seealso}

[attribute::RootId](/help/aem-is-ir-api/is-api/image-catalog/image-serving-api-ref/c-image-catalog-reference/c-attributes-reference/r-rootid.md)


text:
# PHP File Download
A class to help with creating downloads for files in PHP.

## Tip
If you can use direct downloads, you should just use them.
This class is for providing downloads of files out of PHP, for example if you want to provide a download to a temporarily created file.

# Usage

The examples assume, that you have included the namespace:
```php
use Apfelbox\FileDownload\FileDownload;
```

## Create a download for a file on your file system
```php
$fileDownload = FileDownloader::createFromFilePath("/path/to/file.pdf");
$fileDownload->sendDownload("download.pdf");
```

## Create a download for a file via file pointer
```php
$file = /* your file, somewhere opened with fopen() or tmpfile(), etc.. */;
$fileDownload = new FileDownloader($file);
$fileDownload->sendDownload("download.pdf");
```

## Create a download for a file via content
```php
$content = "This is the content of the file:";
$fileDownload = FileDownloader::createFromString($content);
$fileDownload->sendDownload("download.txt");
```

For example, you can create downloads for PDF files, generated by Zend (or any other library):

```php
$pdf = new Zend_Pdf();
$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;

/* draw content in the pdf ... */

$fileDownload = FileDownloader::createFromString($pdf->render());
$fileDownload->sendDownload("download.pdf");
```

gha_license_id: NOASSERTION


text:
OVERVIEW
--------

An example of how to start and end a transaction using REST style semantics and how services
can recover from failures during the commitment protocol.

The demo requires ruby.

USAGE
-----

If you wish to run the demo interactively then use the notes in demo.txt. Ignore Part 2 of demo.txt
unless you wish to migrate part of the demo to the OpenShift Express infrastructure.

Alternatively:

Install ruby (for example on centos type yum install ruby).

Prior to running the example make sure that the [RESTAT coordinator is deployed](../README.md#usage).

Run the demo by executing the run script:

./run.sh

EXPECTED OUTPUT
---------------
The test generates a lot of output. The highligths are:

Running recovery demo

    ... lots of maven output
    JAX-RS container waiting for requests on <IP_ADDRESS>:8081 (for 1000 seconds) ...
    ... more output
    Service: PUT request to terminate url: wId=xx, status:=txStatus=TransactionCommitted
    Service: Halting VM during commit of work unit wId=xx
    Recovering failed service - this could take up to 2 minutes
    ... more maven output
    Service: PUT request to terminate url: wId=xx, status:=txStatus=TransactionCommitted
    SUCCESS: Transaction was recovered

WHAT JUST HAPPENED?
-------------------

1. run.sh starts an embedded JAX-RS web service using the mvn compile exec:java maven target.
The web service listens for requests on localhost port 8081.

2. A ruby client starts a transaction (using the REST-AT interface to JBoss Transactions).

3. The same client interacts with the web service (passing the 'transaction url')
The web service enlists itself into the transaction so that it will be notified by the
transaction coordinator (runing in the standalone JBoss AS container) when the transaction commits.

4. Step 3 is repeated but on a different web service. This ensures that there are two
services enlisted into the transaction (and therefore the transaction cooordinator will send
both prepare and commit requests to each service).

5. The client arranges things such that the second service will halt its JBM when asked to commit.
(for details please refer to the script test.sh and the command:
  ruby client.rb -p $proxies -v Get -a "$service?failWid=${wid2}"
  this request is handled by the JAX-RS service quickstart.TransactionAwareResource in the method
  incrementCounters)

6. The client commits the transaction.

7. The second web service halts its JVM when it receives the commit request.

8. The controlling script run.sh restarts the web service and waits for the transaction
coordinator to recover the transaction.

repository: mayankkunwar/quickstart

repo_name: mayankkunwar/quickstart


text:
---
title: "Q218. The Skyline Problem"
date: 2020-11-18
draft: false
---

```
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as shown on a cityscape photo (Figure A), write a program to output the skyline formed by these buildings collectively (Figure B).

Buildings Skyline Contour
The geometric information of each building is represented by a triplet of integers [Li, Ri, Hi], where Li and Ri are the x coordinates of the left and right edge of the ith building, respectively, and Hi is its height. It is guaranteed that 0 ≤ Li, Ri ≤ INT_MAX, 0 < Hi ≤ INT_MAX, and Ri - Li > 0. You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0.

For instance, the dimensions of all buildings in Figure A are recorded as: [ [2 9 10], [3 7 15], [5 12 12], [15 20 10], [19 24 8] ] .

The output is a list of "key points" (red dots in Figure B) in the format of [ [x1,y1], [x2, y2], [x3, y3], ... ] that uniquely defines a skyline. A key point is the left endpoint of a horizontal line segment. Note that the last key point, where the rightmost building ends, is merely used to mark the termination of the skyline, and always has zero height. Also, the ground in between any two adjacent buildings should be considered part of the skyline contour.

For instance, the skyline in Figure B should be represented as:[ [2 10], [3 15], [7 12], [12 0], [15 10], [20 8], [24, 0] ].

Notes:

The number of buildings in any input list is guaranteed to be in the range [0, 10000].
The input list is already sorted in ascending order by the left x position Li.
The output list must be sorted by the x position.
There must be no consecutive horizontal lines of equal height in the output skyline. For instance, [...[2 3], [4 5], [7 5], [11 5], [12 7]...] is not acceptable; the three lines of height 5 should be merged into one in the final output as such: [...[2 3], [4 5], [12 7], ...]
```

I struggled quite a bit with this problem.
I was not quite sure if I should use heap and I got stuck on how to update the current height when I hit the end of a building (especially when the current height is given by that building).

It turns out that we could use heap to maintain the current height.
The key observation is that the current height is the **maximum** amount all the buildings whose end position (right anchor) is to the right of the current position.
So, we could build a heap to maintain the current height by filtering out maximum heights that passed the current position.

OK, once we have the current height, the algorithm is more straightforward to describe.

* At each starting point of the building, determine if its height is higher than the current height. If so, it will contribute to the skyline.
* At each end point of the building, determine if its height is higher than the current height (after removing this building). If so, this building will contribute to the skyline.

There is also corner case about how to handle buildings side-by-side with the same height.
And the situation where building are at exactly the same start and end positions but different height.
And we need to consider higher building before the lower. And we need to consider the start position before the end position (if they are at the same position).
And when we add a new point, we need to make sure that it has different height than the one before it.

The Python submission.

```
class Solution:
    def getSkyline(self, buildings: List[List[int]]) -> List[List[int]]:
        points = []
        for i, j, h in buildings:
            points.append([i, h, -1, j])
            points.append([j, h, 1, -1])
        points = sorted(points, key=lambda x: (x[0], x[2], -x[1]))
        height_mem = []
        curr_height = 0
        res = []
        for pos, height, type_, end in points:
            while len(height_mem) > 0 and height_mem[0][1] <= pos:
                heapq.heappop(height_mem)
            if len(height_mem) > 0:
                curr_height = -height_mem[0][0]
            else:
                curr_height = 0
            if type_ == -1:
                if height > curr_height and (len(res) == 0 or res[-1][1] != height):
                    res.append((pos, height))
                heapq.heappush(height_mem, (-height, end))
            elif type_ == 1:
                if curr_height < height and (len(res) == 0 or res[-1][1] != curr_height):
                    res.append((pos, curr_height))
        return res
```

repository: liangyy/lc-notebook

repo_name: liangyy/lc-notebook


text:
---
layout: post
title: "Announcing Dyon-Snippets"
author: bvssvni
---

The Piston project is pleased to announce [Dyon-Snippets](https://github.com/PistonDevelopers/dyon_snippets),
a place to share Dyon source code and discuss library design!

[Dyon](https://github.com/PistonDevelopers/dyon) is scripting programming language started in 2016 by myself (Sven Nilsen, bvssvni).

Dyon started as an experiment in a period I had a lot of time, while waiting for some important Gfx redesigns.
After a week of coding, I discovered that it was possible to use a lifetime checker (like Rust),
but without borrow semantics (unlike Rust) instead of a garbage collector.
Combined with copy-on-write for non-stack references, this creates a very limited memory model
but sufficient enough for many practical applications.
It is difficult to write object oriented code in Dyon, but it is very nice for iterating over arrays.

- Built-in support for 4D vectors and HTML colors
- Packed loop for mathematical index notation
- Secrets (more about this later)

The language uses dynamic loading of modules to organize code,
where you have full control over module dependencies.
It is very common to write a loader script, a program that runs before you run the actual program.

Here is an example:

```rust
fn main() {
    foo := unwrap(load("foo.dyon")) // Load `foo`.
    bar := unwrap(load(source: "bar.dyon", imports: [foo])) // Load `bar` with `foo` as dependency.
    call(bar, "main", []) // Run the function `main` on the `bar` module.
}
```

This allows a kind of programming where you easily control how stuff gets loaded,
e.g. check for for updates or refresh a module every Nth second.

I often use Dyon for problem solving, because the language has a feature called "secrets".
A secret is a hidden array of values associated with a `bool` or `f64`. The type is `sec[bool]` or `sec[f64]`.
The indexed loops in Dyon are integrated with secrets.

For example, you have a 2D array `v` and compute the maximum value:

```rust
m := max i, j {v[i][j]}
println(m) // Prints maximum value of `v`.
```

Dyon infers the range from the loop body. The code above is equivalent to:

```rust
m := max i [len(v)), j [len(v[i])) {v[i][j]}
```

This is a packed loop which is equivalent to:

```rust
m := max i [len(v)) {max j [len(v[i])) {v[i][j]}}
```

The notation `max i, j {v[i][j]}` is inspired by mathematics.
In mathematics and physics it is very common to use indices and custom loops.
It is easy to translate back and forth between equations and Dyon code,
and it helps you learn mathematics as well!

The type of `m` is `sec[f64]`. You can write the following:

```rust
where_max := where(max)
println(where_max) // Prints `[i, j]`.
```

This is how it works:

1. The inner `max` loop returns the maximum value with a secret `[j]`.
2. The outer `max` loop finds the maximum inner value and changes the secret to `[i, j]`.

A secret propagates from the left argument in binary operators.
This means you can combine `any` and `all` loops with `max` and `min`:

```rust
// Is there any list which maximum value is larger than 10?
m := any i {max j {v[i][j]} > 10}
if m {
    println(why(m)) // Prints `[i, j]`.
}
```

In problem solving this is very convenient, because many problems
can be thought of as formulating a question.
When you know the right question to ask, the answer is often easy to find.

branch_name: refs/heads/gh-pages


text:
# ProductScanner
Product scanner is an application that allows you to write custom rules between products and check if products from pictures archives these rules.

# Author
Konrad Dysput<EMAIL_ADDRESS>
# Structure
* docs - project documentation (pl language),
* scripts - usefull scripts for fresh clone repository,
* src - applicaiton source code directory.

# Technologies
* Ionic Cordova - Mobile phone application,
     - Android,
     - Angualr 5.
* NodeJS - utility scripts,
* Java - Web semantic rules,
* ASP.NET Core - Web API,
     - Docker,
     - SignalR,
     - Entity Framework,
     - Automapper,
     - RabbitMQ,
     - MS SQL.
* Python and Tensorflow - object detection

# Resources to learn:
* Tensorflow object detection tutorial:
 https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

repository: konraddysput/ProductScanner

gha_language: Python

repo_name: konraddysput/ProductScanner


text:
# MultiEngine on DJL

This is an example of how to run multiple engines in one Java process using DJL.

Why is it good to be able to run multiple engines in one Java process?

Many deep learning frameworks have their individual strength and weaknesses when doing training/inference
on different models. Some frameworks run certain models faster and being able to switch between what engines to use
on what models gives the benefits of being able to utilize the strengths of each engine.

This example uses an image of soccer players, puts that through a PyTorch model to do object detection to get
a player from the image, then feeds that resulting image to an MXNet model to do pose estimation.

*Note:* Loading multiple deep learning engines will cause OpenMP to load multiple times, which may cause a slowdown
or memory errors to occur. [Here](performance_numbers.md) are the results of a few simple benchmarks that we ran.

## Setup
Go into the multi-engine directory and run the following command to build the project:

```
cd multi-engine
./gradlew build
```

## Run the MultiEngine Program

Run the following command to run the project:

```shell script
./gradlew run
```

This will take the original image:

![Original Image](src/test/resources/pose_soccer.png)

Use a object detection PyTorch model to extract the player and pass the result through an
MXNet model to do pose estimation and give us the final image with the joints marked as shown below:

![Pose Estimation](src/test/resources/joints.png)

## Configurations and the Code

### Code

The main code loads the image in and calls the `detectPersonWithPyTorchModel` method where it will
load in the PyTorch model based on the filter parameters and detect a person from the image.
It will then crop the image where the person was detected and return that image.

Once we have the image of the person, we pass it to the next method `detectJointsWithMxnetModel`
method where it loads the MxNet Model from model zoo based on the filter parameters to do joint detection
on the image of the person. It will then output the result of the joints image to `build/output`.

repository: Geeksongs/djl-demo

repo_name: Geeksongs/djl-demo


text:
# PrudentChoice
An economics project for the independent study unit, By Yifei Zhang and Alan Ma.
This report studied multiple companies (Google, Microsoft, Amazon, McDonald's, and Sears) and how each one treated its employees.

The goal was to find out how companies used scarce resources to obtain as much productivity as possible, and we managed to find quite a variety of strategies.

Management paradigms are interesting indeed.

The design was inspired by Quora; built with HTML, CSS, JavaScript, and Jquery. Works alright (no nav bar) on mobile. Excuse the messy code as this was a time-constrained project.

Check out the site!

repository: alan-ma/PrudentChoice

repo_name: alan-ma/PrudentChoice


text:
Keepalived Cookbook
===================

Installs keepalived and generates the configuration file.

Usage
-----

Role based load balancing example:

```ruby
run_list(
  'recipe[keepalived]'
)

override_attributes(
  :keepalived => {
    :vrrp_instances => {
      :vi_1 => {
        :ip_addresses => '<IP_ADDRESS>',
        :interface => 'eth0',
        :states => { 'app001.foo.com' => :backup, 'app002.foo.com' => :backup },
        :virtual_router_ids => { 'app001.foo.com' => 200, 'app002.foo.com' => 200 },
        :priorities => { 'app001.foo.com' => 100, 'app002.foo.com' => 99 },
        :nopreempt => false,
        :advert_int => 1,
        :garp_master_delay => 3,
        :auth_type => :pass,
        :auth_pass => 'secret'
      }
    },
    :virtual_servers => {
      :secure_web => {
        :ip_addresses => '<IP_ADDRESS> 443',
        :delay_loop => 10,
        :lvs_sched => :rr,
        :lvs_method => :dr,
        :protocol => :tcp,
        :real_server => {
          :port => 443, :weight => 0, :inhibit_on_failure => true,
          :tcp_check_port => 443, :tcp_check_timeout => 30
        },
        :real_servers => [
          { :ip_address => '<IP_ADDRESS>' }, { :ip_address => '<IP_ADDRESS>' },
          { :ip_address => '<IP_ADDRESS>' }, { :ip_address => '<IP_ADDRESS>' }
        ]
      }
    }
  }
)
```

Requirements
------------

- Chef >= 12.5
- Platform: ubuntu, debian, fedora, centos and redhat

Installation
------------

[Librarian-Chef][librarian] is a bundler for your Chef cookbooks. To install Librarian-Chef:

```ruby
cd chef-repo
gem install librarian
librarian-chef init
```

To reference the Git version:

```log
repo="linyows/keepalived-cookbook"
latest_release=$(curl -s https://api.github.com/repos/$repo/git/refs/tags \
| ruby -rjson -e '
  j = JSON.parse(STDIN.read);
  puts j.map { |t| t["ref"].split("/").last }.sort.last
')
cat >> Cheffile <<END_OF_CHEFFILE
cookbook 'keepalived', :git => 'git://github.com/$repo.git', :ref => '$latest_release'
END_OF_CHEFFILE
librarian-chef install
```

Attributes
----------

### keepalived::default

Key                     | Description      | Default
---                     | -----------      | -------
router_id               | router id        | default_router_id
notification_emails     | notify to emails |<EMAIL_ADDRESS>notification_email_from | notify by email  | example.com
smtp_server             | smtp host        | <IP_ADDRESS>
smtp_connect_timeout    | connect timeout  | 30
include_files           | outside files    | []
check_scripts           | hash             | {}
vrrp_instances          | hash             | {}
virtual_servers         | hash             | {}

### keepalived::vrrp_instance

Key               | Description             | Default
---               | -----------             | -------
state             | instance role           | :master
priority          | instance priority       | 100
virtual_router_id | virtual router id       | 1
garp_master_delay | GARP delay time         | 5
auth_type         | authentication type     | nil
auth_pass         | authentication password | nil
track_script      | check script name       | nil
notify_master     |                         | nil
notify_backup     |                         | nil
notify_fault      |                         | nil

### keepalived::vrrp_sync_group

Key           | Description         | Default
---           | -----------         | -------
group         | vrrp instance names | nil
notify_backup |                     | nil
notify_master |                     | nil
notify_fault  |                     | nil

### keepalived::virtual_server

Key        | Description                                                        | Default
---        | -----------                                                        | -------
lvs_sched  | scheduling algorithm #=> %i(rr wrr lc wlc sed nq sh dh lblc lblcr) | :lc
lvs_method | nat or dsr                                                         | :dr
delay_loop | health check interval                                              | 5
protocol   | health check protocol                                              | :tcp

Resources / Providers
---------------------

- keepalived
- keepalived_vrrp_instance
- keepalived_virtual_server
- keepalived_virtual_sync_group
- keepalived_check_script

### keepalived

#### Actions

Action  | Description        | Default
------  | -----------        | -------
enable  | setup and settings | yes
disable | disable keepalived

License and Author
------------------

MIT License

- [linyows][linyows]

[travis]: http://travis-ci.org/linyows/keepalived-cookbook
[librarian]: https://github.com/applicationsonline/librarian#readme
[linyows]: https://github.com/linyows

repository: linyows/keepalived-cookbook

repo_name: linyows/keepalived-cookbook


text:
### v4.1.2 (2020-10-01):

- Creates config instance via Config.createInstance() to pass to agent instead of using Config.initialize().

  Previously, the agent and created segments could end up with different config instances resulting in config updates (such as attribute configuration) not propagating correctly for tests. Now, the agent uses the same initialized singleton similar to regular execution.

### v4.1.1 (2020-09-16):

- Improved handling of soft-matching segments for cases where siblings have duplicate names.

### v4.1.0 (2020-09-03):

- Added TestAgent.getAgentApi() function that returns an agent API instance for the underlying agent instance.

### v4.0.0 (2020-07-21):
- Updated to Apache 2.0 license.
- Bumped minimum dev dependency of newrelic (agent) to 6.11 for license matching.
- Updated metric retrieval from agent for `assert.metrics` to match newer agent versions.

  **Breaking:** assertions are now only compatible with newrelic (agent) versions 6+.
- Added third party notices file and metadata for dependencies.
- Updated readme with more detail.
- Added issue templates for bugs and enhancements.
- Added code of conduct file.
- Added contributing guide.
- Added pull request template.
- Migrated CI to GitHub Actions.
- Added copyright headers to all source files.
- Added .vscode to .gitignore.
- Added additional items to .npmignore.

### v3.3.0 (2020-05-20):

- Added the ability to skip tests using multiple keywords

### v3.2.0 (2019-11-12):

- Added new format for versioned test

  Dependency version may now be sampled down to a constant number of versions.
  For example:
  ```
  "dependencies": {
    "redis": {
      "versions": ">1.0.0",
      "samples": 10
    }
  }
  ```

### v3.1.0 (2019-09-03):

- Added `--skip` flag to allow for skipping certain test suites.

### v3.0.0 (2019-01-07):

- Added `setState` argument to `TestAgent` constructor, which allows for
automatic data collection in tests by default.

- Removed obsoleted `flags` argument from `TestAgent` constructor. Feature
flags are now accounted for in standard config.

### v2.0.1 (2018-11-06):

- Versioned test runner now uses `--no-package-lock` when installing test deps.

### v2.0.0 (2018-10-26):

- Dropped support for Node 0.10 and Node 0.12.

- Added `isLocalhost` and `getDelocalizedHostname` to utilities methods.

  These methods are useful for determining the host name as the New Relic agent
  sees it. When making metrics and event attributes, the delocalized hostname is
  what the agent will use.

### v1.2.1 (2018-07-10):

- Fixed default messages for tap assertions.

### v1.2.0 (2018-02-26):

- Added check for `AGENT_PATH` environment variable.

  This environment variable can be used to specify the location of the `newrelic`
  package that these test utilities will load. It should be the path to the root
  directory of the agent. If the environment variable is not set, then the
  `newrelic` module that was installed (e.g. is in a `node_modules` directory)
  is used instead.

- With this change, the following syntaxes are now valid:

  * `versioned-tests`: Will look for tests with the following globs:
    * `test/versioned/**/package.json`
    * `tests/versioned/**/package.json`
    * `node_modules/**/tests/versioned/**/package.json` <-- For the agent to
      seamlessly work with the tests of deps!
  * `versioned-tests test/versioned/hapi`: Will look with these globs:
    * `test/versioned/hapi/package.json`
    * `test/versioned/hapi/**/package.json`
  * `versioned-tests test/versioned/mongodb/package.json`: Will look only at:
    * `test/versioned/mongodb/package.json`

### v1.1.2 (2018-02-23):

- Added `agent#registerInstrumentation` method to registering third-party
  instrumentations in a testing environment.

### v1.1.1 (2018-02-23):

- Fixed invalid `TestAgent.extendTap` reference in `index.js` to `assert.extendTap`.

### v1.1.0 (2018-02-20):

- Added `TestAgent#registerInstrumentation` method.

  This method allows third-party instrumentations to be registered in a test environment.

### v1.0.0 (2018-02-20):

- Added `TestAgent` helper class.

  This class provides simple to use helpers for running your tests with the agent
  and in transactions.

- Added `tap` assertions.

  If your tests use [`tap`](https://www.npmjs.com/package/tap), then you can add
  some helpful assertions to your tests using this module.

- Added version matrix test running.

  This is a script for executing your instrumentation's tests against many
  versions of the module you are instrumenting.

repository: paperclypse/node-test-utilities

repo_name: paperclypse/node-test-utilities


text:
# octopress-weibo
===============

Description
======
It seems like plugin for Octopress. It provides the rake task to post the latest blog to sina weibo automatically. 中文介绍，请访问链接：[Octopress的新浪微博插件](http://agiledon.github.com/blog/2012/12/26/weibo-plugin-for-octopress/)。

Files
======
I create the new folder "_custom" which contains the only one ruby file. You can download it and copy it to the root directory of Octopress.

To support rake task, I add the customize task into the Rakefile. You can download it and replace the original one directily, or you can open your Rakefile, add the code snippet as below:

    desc "Post the title and url of latest blog to Sina Weibo"
        task :weibo do
        puts "Post the title and url of latest blog to Sina Weibo"
        system "ruby _custom/post_weibo.rb"
    end

Configuration
======
You must add the following configs into the new weibo-config.yml:

    access_token: Your access token provided by Sina weibo
    post_template: 我在agiledon.github.com上发表了最新博客《%{blog_title}》，请访问链接：%{blog_url}

What you should do is to customize your post template, but the most important thing is you can't change the variables including %{blog_title} and %{blog_url}.

%{blog_title}: the title of your latest blog. It can support English, Chinese and other languages;
%{blog_url}: the url of your latest blog.

Don't worry about how to get this information for post_template, this plugin can extract the correct information.

For example, you create the new post which file name is 2012-12-25-test-demo.markdown, and the title is "测试演示". The content of your weibo post is:

    我在agiledon.github.com上发表了最新博客《测试演示》，请访问链接：http://agiledon.github.com/2012/12/25/test-demo

Notes: You'd better add the file name of weibo-config.yml into your .gitignore file, so that it can let your access-token more safe.

The main url, such as http://agiledon.github.com is come from the value of url in the _config.yml.

Dependencies
======
My implemention use the "faraday" to send the post request, so you should add the gem dependencies into the Gemfile:

    gem "faraday", "~> 0.8.4"

Then, you might go to the root directory of octopress, run the command to install faraday:

    bundle install

How to use it
=======
If everything is OK, you can run the rake command as below after you finish your new blog:

    rake weibo

It will post the content according to the template in _config.yml to your sina weibo automatically. I strongly suggest you might run it after you make sure you have deployed your new blog successfuly.

License
======
(The MIT License)

Copyright © 2012 Zhang Yi

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: yszheda/octopress-weibo

repo_name: yszheda/octopress-weibo


text:
[![](https://images.microbadger.com/badges/image/robertdebock/docker-centos7.svg)](http://microbadger.com/images/robertdebock/docker-centos7 "Get your own image badge on microbadger.com")

# docker-centos7

An updated CentOS 7 installation.


text:
# JuliaBrewing Overview

This is not a package repository. It is initially a placeholder for ideas for the general development of the packages in JuliaBrewing. Eventually, it should tend more to contain an overview of the packages available in JuliaBrewing.

## Packages

### JuliaBrewingLogo

This is easy. It should be the repository with the code for generating the would-be logo for JuliaBrewing org, in [Luxor.jl](https://github.com/JuliaGraphics/Luxor.jl).

### UnitfulBrewing.jl

This should define the necessary units for brewing, such as bitterness, color, gravity/sugar content. It is an extension to [Unitful.jl](https://github.com/PainterQubits/Unitful.jl). It is under-development.

### BrewingCore.jl

This should have all the types and conversion functions needed to build a recipe, but not the recipe builder yet.

The basic stuff I can think of are the following

* Ingredient
* Equipment
* Process

### Simple recipe builder/planner/designer (name?)

BrewingDesigner.jl? or BrewingRecipe.jl?

It should be for designing a straight-up traditional brewing recipes, with a single mash, boil, fermentation, and packaging.

mash -> sparge -> boil -> ferment -> package

### Complex recipe builder/planner/designer (name?)

BrewingGraph.jl?

For designing more complicate types of recipes, in the form of planar digraphs, so we could have multiple mashes, boils, fermentations, packagings, etc.

This would include parti-gyle, double-mashing, refermentations, and so on.

### BrewingProcess.jl

For managing actual brews being made and keep a record of those that have been made. This is a long-term project, after the others are complete.

### GUI

Initially the recipe builder above will not have a GUI. That is a different step. Ideally I think they should be separate packages that use the previous packages.

## Comments

The recipe builders should add

* An **Inventory**, containing
  * a List of ingredients;
  * a List of Equipments;

and

* A **Library of Recipes**.

repository: JuliaBrewing/Overview

repo_name: JuliaBrewing/Overview


text:
# Design Ideas/Concepts

RagnarDB is a SQL ~~Typeloader~~ compiler plugin for Gosu: it will inspect SQL resources on disk and produce types corresponding to these resources,
and provide basic CRUD operations against a database based on this information.

## Components

RagnarDB will consist of four different components:

* A SQL Parser
* A Gosu ~~Type Loader~~ compiler plugin that uses the results of the SQL Parser to produce types
* A runtime that the ~~Type Loader~~ compiler plugin uses for producing objects to meet the runtime needs of the above types
* A runtime API that will expose whatever is necessary to RagnarDB users

### SQL Parser

The SQL Parser will consist of three different aspects:

* A Lexer
* The DDL Parser
* The SQL Parser

#### The DDL Parser

The DDL Parser will parse DDL files ending in *.ddl according to (TODO: luca - enter a web link)

    CREATE TABLE Persons
    (
      PersonID int,
      LastName varchar(255),
      FirstName varchar(255),
      Address varchar(255),
      City varchar(255)
    );

#### The SQL Parser

The SQL Parser will parse SQL files ending in *.sql according to (TODO: luca - enter a web link)

    SELECT *
    FROM Persons
    WHERE FirstName = 'Brian';

The SQL parser will also need to support the following syntax to allow the passing of values into a query:

    SELECT *
    FROM Persons
    WHERE FirstName = @name:java.lang.String;

This inline parameter syntax indicates that this query takes an argument, `name` of type `java.lang.String`.  The type
implications of this are discussed below.

A variable can be used more than once and only needs to include the type the first time:

    SELECT *
    FROM Persons
    WHERE FirstName = @name:java.lang.String OR
          LastName = @name;

### The SQL ~~Typeloader~~ compiler plugin

The plugin will take the results of the parser above and produce types.  For the DDL files, this is fairly
straight-forward:  given a ddl file found at `/model/application.ddl` with the `Persons` table defined above,
the following type will be created `model.application.Person`, where the package for the type is the path
to the DDL file, plus the file name, and then the singularized version of the table name.

The properties of `model.application.Person` would be the obvious properties implied by the column definitions.

For SQL Files, things are a bit more complex.  Consider two different aspects of the SQL files:

* The return type of the query
* The argument types of the query

Given a SQL file found at `/model/PersonsByName.sql`, the following type will be created: `model.PersonsByName`.  This
type will have a single method, `execute`, which will execute the given SQL.

The arguments to `execute` are straight forward: they are determined by the inline parameter syntax outlined above.

The return type of `execute` is less straight forward.  For version 1 of the project, lets assume that all queries
will be defined as `SELECT * FROM X`.  In that case, the return type will be a ResultSet/Iterable of `X`, where `X`
is a type resolved in the DDL file found in the same (or parent) directory.

### The Runtime

The runtime behavior and API will be derived, as much as is possible, from the Active Record runtime, which has proven
itself flexible and pleasent enough for many developers to work with.

## Design Goals

* The core idea is: "Let people use SQL against a DB rather than a custom query language or builder syntax".
* "Sloppy" parsing will be used, where we pass over/pass through SQL we don't understand to the underlying JDBC layer
* The project will avoid binary thinking, such as "We will parse everything OR we will parse nothing."
* The project will focus on simplicity and 80/20 thinking

## Open Questions

* Do we need to support an ID concept?  Can we discard that idea now?
* Transactions?
* Logging/Debugging SQL?
* Tracing SQL?

repository: gosu-lang/ragnardb

repo_name: gosu-lang/ragnardb


text:
## Introduction
Dummy - is a lightweight container that executes dummy binary that does nothing.
You can use it whenever you need a dummy container.

## How to use it?
The idea is to create containers when necessary. But it is hard in Docker as there are no if statements. So the trick is to use environment variables and a dummy container.
Let's assume you need Mailcatcher. This is what your setup can look like:
1. Add Mailcatcher to docker-compose.yaml file:
```yaml
mailcatcher:
  build:
    context: .
    dockerfile: tools/mailcatcher/Dockerfile
    target: m2d_mailcatcher
    args:
      - M2D_ENABLE_MAILCATCHER=${M2D_ENABLE_MAILCATCHER:-no}
  container_name: magento2mailcatcher
  ports:
    - "${M2D_PORT_FOR_MAILCATCHER:-1080}:1080"
```
2. Add Dockerfile for Mailcatcher:
```Dockerfile
## set the default value for the argument if not defined
ARG M2D_ENABLE_MAILCATCHER='no'

## prepare a dummy container for the "no" option
FROM scratch as m2d_mailcatcher_no
COPY tools/dummy/dummy ./
CMD ["/dummy"]

## prepare the actual Mailcatcher container for the "yes" option
FROM schickling/mailcatcher AS m2d_mailcatcher_yes

## build target container from mailcatcher_yes or mailcatcher_no based on value from M2D_ENABLE_MAILCATCHER argument
FROM m2d_mailcatcher_${M2D_ENABLE_MAILCATCHER} AS m2d_mailcatcher
```
3. Set expected value for argument:
- in .env file:
```
M2D_ENABLE_MAILCATCHER=yes
```
- or in the terminal:
```bash
export M2D_ENABLE_MAILCATCHER=yes
```
4. Spin up the expected container:
```bash
docker-composer up -d --build
```

## Need more?
If you need a dummy container that is doing something (e.g., displaying hello world), you can modify the source code and recompile it with the following:
```bash
gcc -o tools/dummy/dummy tools/dummy/dummy.c
```

gha_language: Shell