text:
---
title: Arez 0.92 released
author: Arez Project
authorURL: https://github.com/arez
---

[Full Changelog](https://github.com/arez/arez/compare/v0.91...v0.92)

Changes in this release:

* **\[annotations\]** Remove the `@Unsupported` annotation from all the annotations within the
  `arez.annotations` package as all of the annotations are sufficient stable to be supported
  going forward.
* **\[core\]** Remove the `@Unsupported` annotation from the `arez.spy` package and the `arez.Spy`
  interface as the spy infrastructure has started to stabilize.
* **\[core\]** Remove the `org.realityforge.anodoc.TestOnly` annotation from the codebase as it is
  only documentation and not enforced by any tooling and it is also the only remaining dependency
  upon the `org.realityforge.anodoc` dependency which was also removed.
* Update build process so that the generated poms do not include dependencies on GWT. The GWT
  dependencies are not required by react4j but are only required to GWT compile the project. This
  dependency needs to be broken for GWT3.x/j2cl support.
* Remove the usage of `javax.annotation.Nonnegative` as it is not enforced by tooling and adds an
  additional dependency on the codebase.
* Replace usage of the `com.google.code.findbugs:jsr305:jar` dependency with the
  `org.realityforge.javax.annotation:javax.annotation:jar` dependency as the former includes code that
  is incompatible with J2CL compiler.
* Make sure the dependency upon `org.realityforge.javax.annotation:javax.annotation:jar` is transitive.
* Make sure the dependency upon `com.google.jsinterop:jsinterop-annotations:jar` is transitive.
* Remove the `com.google.jsinterop:base:jar` artifact with the `sources` classifier from the build as
  the main jar includes the sources required for the GWT compiler.
* Remove the `com.google.jsinterop:jsinterop-annotations:jar` artifact with the `sources` classifier
  from the build as the main jar includes the sources required for the GWT compiler.
* Remove the `test` scoped dependencies from the generated POMs. The POMs are only intended for
  consumption and do not need to contain dependency details about how the project was built.
* Upgrade the `org.realityforge.braincheck:braincheck:jar` dependency to `1.9.0` for compatibility
  with J2CL.
* Make the dependency upon `org.realityforge.braincheck:braincheck:jar` transitive.
* Cleanup the POM for `gwt-output-qa` module and use transitive dependencies where possible.


text:
# Porygon Language

Prototype language to Compilers Class 2020.1
prof. Cláudia Nalon

#### Current Stage: Fifth - Three Address Code Generation
Implementation of a lexical analyzer (scanner) using [flex](https://github.com/westes/flex).
Implementation of a syntax analyzer (parser) using [bison](https://www.gnu.org/software/bison/manual/).
Implementation of a semantic analyzer.
Implementation of a code generator. The TAC code is the result of the tranlsation. (Interpreted by [TAC](https://github.com/lhsantos/tac/)).

The operating system used to develop and test the implementation was Ubuntu 20.04, with gcc 9.3, flex 2.6.4 and bison 3.5.1.

Documentation repo: https://www.overleaf.com/read/vckvwkqfzxww

---

## How to Compile
To properly compile the Porygon language scanner, it is necessary to have flex installed. Please follow the steps required to flex installation in their website:
https://github.com/westes/flex

To properly compile the Porygon language parser, it is necessary to have bison installed. Usually in Linux systems, it comes pre-installed. Please follow the steps required to bison installation in their website:
https://www.gnu.org/software/bison/

To interpret the resulting code, it is necessary to have TAC installed. Please follow the steps required to install TAC:
https://github.com/lhsantos/tac/blob/master/INSTALL

A Makefile was created to aid in the compilation process. There are two auxiliary commands to clean old objects and binary files. The command `make clean;` removes the build directory (object files) and `make clean_all;` also removes the flex generated files. Whilst the command `make flex;` runs flex and generates the scanner files; `make bison;` runs bison and generates the parser files, the `make;` command compiles the remaining source code (runs gcc).

To execute all necessary steps to a fresh compilation of the compiler, simply do:

```console
make clean_all; make flex; make bison; make;
```

To compile all the files without using the Makefile:
```console
mkdir build
flex flex_bison/porygon_lex.l
bison -Wall -d -v flex_bison/porygon_syntax.y
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/helpers.o src/helpers.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/parameters.o src/parameters.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/token_type.o src/token_type.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/porygon_lex.o src/porygon_lex.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/parser.o src/parser.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/token.o src/token.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/semantic_analysis.o src/semantic_analysis.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/main.o src/main.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/tac_code.o src/tac_code.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/node_type.o src/node_type.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/type.o src/type.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/columns.o src/columns.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/tac_generator.o src/tac_generator.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/type_checking.o src/type_checking.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/symbol_table.o src/symbol_table.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/tree.o src/tree.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/arrays.o src/arrays.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/scope.o src/scope.c
gcc -std=c18 --pedantic -Wall -Wextra -Wpedantic -g -I include -c -o build/scanner.o src/scanner.c
 gcc build/helpers.o build/parameters.o build/token_type.o build/porygon_lex.o build/parser.o build/token.o build/semantic_analysis.o build/main.o build/tac_code.o build/node_type.o build/type.o build/columns.o build/tac_generator.o build/type_checking.o build/symbol_table.o build/tree.o build/arrays.o build/scope.o build/scanner.o -o bin/porygon -lm
```

It may be necessary to create build and bin folders:
```console
mkdir build;
mkdir bin;
```

## How to Execute
The scanner has the interactive function of flex on. Consequently, the input file can be passed to the parser in two ways:
* From a pipe:
```console
./bin/porygon < tests/t1_correct.prg
```
* [Recommended] Directed input (argument):
```console
./bin/porygon tests/t2_correct.prg
```

* Running all tests at once (valgrind output files are saved in `valgrind_output` directory):
```console
make testing
```

* Running all tac tests at once (valgrind output files are saved in `valgrind_output` directory):
```console
make tac
```

* Interpreting the resulting TAC code:
```console
make tac
```

## Directories Architecture
* `bin`: binary files
* `build`: object files
* `flex_bison`: input files for flex and bison (main files specifying the grammar of the language)
* `include`: header files (.h)
* `src`: source files (.c)
* `tests`: some sample tests
* `README.md`: this file, contain some crucial information
* `Makefile`: compilation information
* `valgrind_output`: output files of the valgrind

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Adonis-Mongoose-Model
> Fully Mongoose-Model integration, with mongodb connection

[![npm](https://img.shields.io/npm/v/adonis-mongoose-model.svg?style=flat-square)](https://www.npmjs.com/package/adonis-mongoose-model)
[![StyleCI](https://styleci.io/repos/114804179/shield?branch=dev)](https://styleci.io/repos/114804179)
[![Build Status](https://travis-ci.org/juampi92/adonis-mongoose-model.svg?branch=master&style=flat-square)](https://travis-ci.org/juampi92/adonis-mongoose-model)
[![npm](https://img.shields.io/npm/dm/adonis-mongoose-model.svg?style=flat-square)](https://www.npmjs.com/package/adonis-mongoose-model)

This package brings you a MongooseProvider that connects to the database, a Mongoose base Model, a mongoose serializer for AdonisAuth

<img src="http://res.cloudinary.com/adonisjs/image/upload/q_100/v1497112678/adonis-purple_pzkmzt.svg" width="200px" align="right" hspace="30px" vspace="50px">

## Features

1. Support for Mongoose model creation.
2. Strong BaseModel that's Hook compatible, indexable and easy es6 inheritance
3. Support for a Mongoose serializer.
4. Adonis command for creating mongoose models

## Installation
You can install the package from npm.
```bash
adonis install adonis-mongoose-model --yarn
```

Make sure to read [instructions.md](instructions.md) file.

## Adonis Target

This repo/branch is supposed to run on Adonis 4.x

## Node/OS Target

This repo/branch is supposed to run fine on all major OS platforms and targets `Node.js >=7.0`

repository: jericopulvera/adonis-mongoose-model

gha_language: JavaScript

gha_license_id: MIT

repo_name: jericopulvera/adonis-mongoose-model


text:
# gs

---

Package gs Google Cloud Storage VFS implementation.

### Usage

Rely on [github.com/c2fo/vfs/v6/backend](backend.md)

```go
    import(
        "github.com/c2fo/vfs/v6/backend"
        "github.com/c2fo/vfs/v6/backend/gs"
    )

    func UseFs() error {
        fs := backend.Backend(gs.Scheme)
        ...
    }
```

Or call directly:

```go
    import "github.com/c2fo/vfs/v6/backend/gs"

    func DoSomething() {
        fs := gs.NewFileSystem()
        ...
    }
```

gs can be augmented with the following implementation-specific methods. [Backend](backend.md)
returns [vfs.FileSystem](../README.md#type-filesystem) interface so it would have to be cast as gs.FileSystem to
use the following:

```go
    func DoSomething() {

        ...

        // cast if fs was created using backend.Backend().  Not necessary if created directly from gs.NewFilsystem().
        fs = fs.(gs.FileSystem)

        // to use your own "context"
        ctx := context.Background()
        fs = fs.WithContext(ctx)

        // to pass in client options
        fs = fs.WithOptions(
            gs.Options{
                CredentialFile: "/root/.gcloud/account.json",
                Scopes:         []string{"ScopeReadOnly"},
                //default scope is "ScopeFullControl"
            },
        )

        // to pass specific client, for instance no-auth client
        ctx := context.Background()
        client, _ := storage.NewClient(ctx, option.WithoutAuthentication())
        fs = fs.WithClient(client)
    }
```

### Authentication

Authentication, by default, occurs automatically when [Client()](#func-filesystem-client) is called. It
looks for credentials in the following places, preferring the first location
found:

1. A JSON file whose path is specified by the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
1. A JSON file in a location known to the gcloud command-line tool.
    * On Windows, this is `%APPDATA%/gcloud/application_default_credentials.json`.
    * On other systems, `$HOME/.config/gcloud/application_default_credentials.json`.
1. On Google App Engine it uses the appengine.AccessToken function.
1. On Google Compute Engine and Google App Engine Managed VMs, it fetches credentials from the metadata server.

See https://cloud.google.com/docs/authentication/production for more auth info

### See Also

See: https://github.com/googleapis/google-cloud-go/tree/master/storage

## Usage

```go
const Scheme = "gs"
```
Scheme defines the file system type.

### type File

```go
type File struct {
}
```

File implements [vfs.File](../README.md#type-file) interface for GS fs.

#### func (*File) Close

```go
func (f *File) Close() error
```
Close cleans up underlying mechanisms for reading from and writing to the file.
Closes and removes the local temp file, and triggers a write to GCS of anything
in the f.writeBuffer if it has been created.

#### func (*File) CopyToFile

```go
func (f *File) CopyToFile(targetFile vfs.File) error
```
CopyToFile puts the contents of File into the targetFile passed. Uses the GCS
CopierFrom method if the target file is also on GCS, otherwise uses [io.Copy](https://godoc.org/io#Copy).

#### func (*File) CopyToLocation

```go
func (f *File) CopyToLocation(location vfs.Location) (vfs.File, error)
```
CopyToLocation creates a copy of *File, using the file's current name as the new
file's name at the given location. If the given location is also GCS, the GCS
API for copying files will be utilized, otherwise, standard [io.Copy](https://godoc.org/io#Copy) will be done
to the new file.

#### func (*File) Delete

```go
func (f *File) Delete(opts ...options.DeleteOption) error
```
Delete clears any local temp file, or write buffer from read/writes to the file,
then makes a DeleteObject call to GCS for the file. If opts is of type DeleteAllVersions, DeleteObject call is made to
GCS for each version of the file. Returns any error returned by the API.

#### func (*File) Exists

```go
func (f *File) Exists() (bool, error)
```
Exists returns a boolean of whether or not the object exists in GCS.

#### func (*File) LastModified

```go
func (f *File) LastModified() (*time.Time, error)
```
LastModified returns the 'Updated' property from the GCS attributes.

#### func (*File) Location

```go
func (f *File) Location() vfs.Location
```
Location returns a Location instance for the file's current location.

#### func (*File) MoveToFile

```go
func (f *File) MoveToFile(targetFile vfs.File) error
```
MoveToFile puts the contents of File into the targetFile passed using
File.CopyToFile. If the copy succeeds, the source file is deleted. Any errors
from the copy or delete are returned.

#### func (*File) MoveToLocation

```go
func (f *File) MoveToLocation(location vfs.Location) (vfs.File, error)
```
MoveToLocation works by first calling File.CopyToLocation(vfs.Location) then, if
that succeeds, it deletes the original file, returning the new file. If the copy
process fails the error is returned, and the Delete isn't called. If the call to
Delete fails, the error and the file generated by the copy are both returned.

#### func (*File) Name

```go
func (f *File) Name() string
```
Name returns the file name.

#### func (*File) Path

```go
func (f *File) Path() string
```
Path returns full path with leading slash of the GCS file key.

#### func (*File) Read

```go
func (f *File) Read(p []byte) (n int, err error)
```
Read implements the standard for [io.Reader](https://godoc.org/io#Reader). For this to work with an GCS file, a
temporary local copy of the file is created, and reads work on that. This file
is closed and removed upon calling f.Close()

#### func (*File) Seek

```go
func (f *File) Seek(offset int64, whence int) (int64, error)
```
Seek implements the standard for io.Seeker. A temporary local copy of the GCS
file is created (the same one used for Reads) which Seek() acts on. This file is
closed and removed upon calling f.Close()

#### func (*File) Size

```go
func (f *File) Size() (uint64, error)
```
Size returns the 'Size' property from the GCS attributes.

#### func (*File) String

```go
func (f *File) String() string
```
String returns the file URI string.

#### func (*File) URI

```go
func (f *File) URI() string
```
URI returns a full GCS URI string of the file.

#### func (*File) Write

```go
func (f *File) Write(data []byte) (n int, err error)
```
Write implements the standard for [io.Writer](https://godoc.org/io#Writer). A buffer is added to with each
subsequent write. Calling [Close()](#func-file-close) will write the contents back to GCS.

### type FileSystem

```go
type FileSystem struct {
}
```

FileSystem implements [vfs.FileSystem](../README.md#type-filesystem) for the GCS file system.

#### func  NewFileSystem

```go
func NewFileSystem() *FileSystem
```
NewFileSystem initializer for [FileSystem](#type-filesystem) struct accepts google cloud storage
client and returns FileSystem or error.

#### func (*FileSystem) Client

```go
func (fs *FileSystem) Client() (*storage.Client, error)
```
Client returns the underlying google storage client, creating it, if
necessary See [Authentication](#authentication) section for authentication resolution

#### func (*FileSystem) Name

```go
func (fs *FileSystem) Name() string
```
Name returns "Google Cloud Storage"

#### func (*FileSystem) NewFile

```go
func (fs *FileSystem) NewFile(volume string, name string) (vfs.File, error)
```
NewFile function returns the gcs implementation of [vfs.File](../README.md#type-file).

#### func (*FileSystem) NewLocation

```go
func (fs *FileSystem) NewLocation(volume string, path string) (loc vfs.Location, err error)
```
NewLocation function returns the s3 implementation of [vfs.Location](../README.md#type-location).

#### func (*FileSystem) Scheme

```go
func (fs *FileSystem) Scheme() string
```
Scheme return "gs" as the initial part of a file URI ie: gs://

#### func (*FileSystem) WithClient

```go
func (fs *FileSystem) WithClient(client *storage.Client) *FileSystem
```
WithClient passes in a google storage client and returns the FileSystem
(chainable)

#### func (*FileSystem) WithContext

```go
func (fs *FileSystem) WithContext(ctx context.Context) *FileSystem
```
WithContext passes in user context and returns the FileSystem (chainable)

#### func (*FileSystem) WithOptions

```go
func (fs *FileSystem) WithOptions(opts vfs.Options) *FileSystem
```
WithOptions sets options for client and returns the FileSystem (chainable)

### type Location

```go
type Location struct {
}
```

Location implements [vfs.Location](../README.md#type-location) for gs fs.

#### func (*Location) ChangeDir

```go
func (l *Location) ChangeDir(relativePath string) error
```
ChangeDir changes the current location's path to the new, relative path.

#### func (*Location) DeleteFile

```go
func (l *Location) DeleteFile(fileName string, opts ...options.DeleteOption) error
```
DeleteFile deletes the file at the given path, relative to the current location using given options.

#### func (*Location) Exists

```go
func (l *Location) Exists() (bool, error)
```
Exists returns whether the location exists or not. In the case of an error,
false is returned.

#### func (*Location) FileSystem

```go
func (l *Location) FileSystem() vfs.FileSystem
```
FileSystem returns the GCS file system instance.

#### func (*Location) List

```go
func (l *Location) List() ([]string, error)
```
List returns a list of file name strings for the current location.

#### func (*Location) ListByPrefix

```go
func (l *Location) ListByPrefix(filenamePrefix string) ([]string, error)
```
ListByPrefix returns a slice of file base names and any error, if any prefix
means filename prefix and therefore should not have slash List functions return
only files [List](#func-location-list) functions return only basenames

#### func (*Location) ListByRegex

```go
func (l *Location) ListByRegex(regex *regexp.Regexp) ([]string, error)
```
ListByRegex returns a list of file names at the location which match the
provided regular expression.

#### func (*Location) NewFile

```go
func (l *Location) NewFile(filePath string) (vfs.File, error)
```
NewFile returns a new file instance at the given path, relative to the current
location.

#### func (*Location) NewLocation

```go
func (l *Location) NewLocation(relativePath string) (vfs.Location, error)
```
NewLocation creates a new location instance relative to the current location's
path.

#### func (*Location) Path

```go
func (l *Location) Path() string
```
Path returns the path of the file at the current location, starting with a
leading '/'

#### func (*Location) String

```go
func (l *Location) String() string
```
String returns the full URI of the location.

#### func (*Location) URI

```go
func (l *Location) URI() string
```
URI returns a URI string for the GCS location.

#### func (*Location) Volume

```go
func (l *Location) Volume() string
```
Volume returns the GCS bucket name.

### type Options

```go
type Options struct {
	APIKey         string   `json:"apiKey,omitempty"`
	CredentialFile string   `json:"credentialFilePath,omitempty"`
	Endpoint       string   `json:"endpoint,omitempty"`
	Scopes         []string `json:"WithoutAuthentication,omitempty"`
}
```

Options holds Google Cloud Storage -specific options. Currently only client
options are used.

gha_language: Go


text:
[![PyPI version](https://badge.fury.io/py/seq-to-first-iso.svg)](https://badge.fury.io/py/seq-to-first-iso)
[![Conda](https://img.shields.io/conda/v/bioconda/seq-to-first-iso.svg?color=bright-green)](https://anaconda.org/bioconda/seq-to-first-iso)
[![Build Status](https://travis-ci.org/pierrepo/seq-to-first-iso.svg?branch=master)](https://travis-ci.org/pierrepo/seq-to-first-iso)
[![Documentation Status](https://readthedocs.org/projects/seq-to-first-iso/badge/?version=latest)](https://seq-to-first-iso.readthedocs.io/en/latest/?badge=latest)

# Seq-to-first-iso

> Compute first two isotopologues intensity from peptide sequence

Seq-to-first-iso computes isotopologues M0 and M1 of peptides with a 99.99 % 12C enrichment for quantification by [SLIM-labeling](https://www.mcponline.org/content/16/11/2017).
It simulates auxotrophies by differentiating labelled and unlabelled amino acids.

The documentation can be found [here](https://seq-to-first-iso.readthedocs.io/en/latest/).
Try the demo with Binder: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pierrepo/seq-to-first-iso/master)

## Installation

### With pip

```
$ pip install seq-to-first-iso
```

### With conda

```
$ conda install seq-to-first-iso -c bioconda
```

### Developer mode

Install [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html)

Clone repo:
```
$ git clone https://github.com/pierrepo/seq-to-first-iso
$ cd seq-to-first-iso
```

Create conda environment:
```
$ conda env create -f environment.yml
```

Remark: for a fully reproducible environment, you could also use:
```
$ conda env create -f environment.lock.yml
```

Activate conda environment:
```
$ conda activate seq-to-first-iso
```

Install local package:
```
$ pip install -e .
```

## Usage

The script takes a file with one sequence of amino acids per line and returns a tsv of the file with columns:

|sequence|mass|formula|formula_X| M0_NC | M1_NC | M0_12C | M1_12C |
|--------|----|-------|---------|-------|-------|--------|--------|

Once installed, the script can be called with:

```shell
$ seq-to-first-iso filename [-o output_name] [-n amino_acids...]
```
Optional arguments are in square brackets
This will create _filename_stfi.tsv_ if filename is a correct file

**0.3.0 :** The input file can have annotations separated by a tabulation before the sequences
**0.4.0 :** Support for [X!Tandem](https://www.thegpm.org/tandem/) Post-Translational Modifications added

### Options

- `-h, --help`:
Provide a help page

- `-v, --version`:
Provide the version

- `-o, --output`:
Change the name of the output file

- `-n, --non-labelled-aa`:
Take 1 or more amino acid separated by a comma

### Examples

- You can provide a list of amino acids which will keep default isotopic abundance:

Supposing [peptides.txt](https://github.com/pierrepo/seq-to-first-iso/blob/master/notebooks/peptides.txt) :

```
YAQEISR
VGFPVLSVKEHK
LAMVIIKEFVDDLK
```

The command
```shell
$ seq-to-first-iso peptides.txt -n V,W
```
will create [peptides_stfi.tsv](https://github.com/pierrepo/seq-to-first-iso/blob/master/notebooks/peptides_stfi.tsv) :

|sequence| mass| formula|formula_X| M0_NC| M1_NC| M0_12C| M1_12C|
|--------|-----|--------|---------|------|------|-------|-------|
YAQEISR|<PHONE_NUMBER>9921| C37H59O13N11| C37H59O13N11| 0.6206414140575179|	0.280870823368276| 0.9206561231798033| 0.05161907174495234|
VGFPVLSVKEHK| 1338.7659712609| C63H102O16N16| C48H102O16N16X15|  0.4550358985377136| 0.34506032928190855| 0.7589558393662944| 0.18515489894512063|
LAMVIIKEFVDDLK| 1632.91606619252| C76H128O21N16S1| C66H128O21N16S1X10| 0.36994021481230627| 0.3373188347614264| 0.7475090558698947| 0.15292723586285323|

Where, in 12C enrichment conditions, the isotopologue intensity M0_12C and M1_12C are computed with unlabelled Valine and Tryptophan (V and W have default isotopic abundance)

- You can change the name of the output file:

```shell
$ seq-to-first-iso peptides.txt -o sequence
```
will create a file named *sequence.tsv*

## Credits

- **Binder**
  - Jupyter et al., "Binder 2.0 - Reproducible, Interactive, Sharable Environments for Science at Scale." Proceedings of the 17th Python in Science Conference. 2018. 10.25080/Majora-4af1f417-011

- **Bioconda**:
  - Grüning, Björn, Ryan Dale, Andreas Sjödin, Brad A. Chapman, Jillian Rowe, Christopher H. Tomkins-Tinch, Renan Valieris, the Bioconda Team, and Johannes Köster. 2018. “Bioconda: Sustainable and Comprehensive Software Distribution for the Life Sciences”. *Nature Methods*, 2018 doi:10.1038/s41592-018-0046-7.

- **MIDAs**:
  - Alves G, Ogurtsov AY, Yu YK (2014) Molecular Isotopic Distribution Analysis (MIDAs) with adjustable mass accuracy. *J Am Soc Mass Spectrom*, 25: 57-70. DOI: 10.1007/s13361-013-0733-7

- **Pyteomics**:
  - Goloborodko, A.A.; Levitsky, L.I.; Ivanov, M.V.; and Gorshkov, M.V. (2013) “Pyteomics - a Python Framework for Exploratory Data Analysis and Rapid Software Prototyping in Proteomics”, *Journal of The American Society for Mass Spectrometry*, 24(2), 301–304. DOI: 10.1007/s13361-012-0516-6

  - Levitsky, L.I.; Klein, J.; Ivanov, M.V.; and Gorshkov, M.V. (2018) “Pyteomics 4.0: five years of development of a Python proteomics framework”, *Journal of Proteome Research*. DOI: 10.1021/acs.jproteome.8b00717

- **SLIM-labeling**:
  - Léger T, Garcia C, Collomb L, Camadro JM. A Simple Light Isotope Metabolic Labeling (SLIM-labeling) Strategy: A Powerful Tool to Address the Dynamics of Proteome Variations In Vivo. *Mol Cell Proteomics*. 2017;16(11):2017–2031. doi:10.1074/mcp.M117.066936

repository: pierrepo/seq-to-first-iso

gha_language: Python

repo_name: pierrepo/seq-to-first-iso


text:
Bibpy
===

[![Build Status](https://travis-ci.org/ptigas/bibpy.svg?branch=master)](https://travis-ci.org/ptigas/bibpy)

About
---
Bibpy is a (yet another) BibTex file parser in python.

What's  different ?
---
It doesn't depend on libraries like pyparser etc. It's small and fast. Also, *sometimes* it recovers from common errors.

What grammar is parsing ?
---
The BNF it parses is based on http://tex.stackexchange.com/questions/16490/the-gold-standard-in-bibtex-databases/16492#16492

```
A rough grammar (case-insensitive):

 Database  ::= (Junk '@' Entry)*
 Junk      ::= .*?
 Entry 	   ::= Record | Comment | String | Preamble
 Comment   ::= "comment" [^\n]* \n     -- ignored
 String    ::= "string" '{' Field* '}'
 Preamble  ::= "preamble" '{' .* '}'   -- (balanced)
 Record    ::= Type '{' Key ',' Field* '}'
       	   |   Type '(' Key ',' Field* ')' -- not handled
 Type  	   ::= Name
 Key   	   ::= Name
 Field     ::= Name '=' Value
 Name      ::= [^\s\"#%'(){}]*
 Value ::= [0-9]+
       |   '"' ([^'"']|\\'"')* '"'
       |   '{' .* '}'          -- (balanced)
```

License
---
(The MIT License)

Copyright (c) 2011 Panagiotis Tigkas

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: sacabuche/bibpy

repo_name: sacabuche/bibpy


text:
![](/docs/banner.png)

Super simple sentiment analysis with AFINN.

## Usage

```sh
npm i styled-preflight
```

```sh
yarn add styled-preflight
```

```js
import { mindreader } from 'mindreader';

const sentiment = mindreader('good, bad');

console.log(sentiment);

/*
{
  score: -3,
  comparative: -1,
  calculation: [{ ugly: -3 }, { bad: -3 }, { good: 3 }],
  tokens: ['good', 'bad', 'ugly'],
  words: ['ugly', 'bad', 'good],
  positive: ['good']
  negative: ['ugly', 'bad']
}
*/
```

## Input & Ouput

### Input

`mindreader` takes any `string` input, for example:

```js
import { mindreader } from 'mindreader';

const sentiment = mindreader(
  'It was the best of times, it was the worst of times...'
);

...
```

### Output

The full output looks like this:

| Name            | Type                          | Description                                                                                |
| --------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **score**       | `number`                      | The overall sentiment score. Essentially just the sentiment ratings of each token, added up.                                                                                |
| **comparative** | `number`                      | If you want to compare several strings, use this. It calculates the average score of all the tokens in your provided string.                                                                                |
| **calculation** | `{ [key: string]: number }[]` | How did we get here? This outputs the score which was assigned to each individual token in the string. If you want to do word-by-word sentiment analysis, passing in a big string to `mindreader`, and then reading from `caluclation` is the fastest way of doing it. |
| **tokens**      | `string[]`                    | A list of the words in your string.                                                                                |
| **words**       | `string[]`                    | All the words which `mindreader` actually scanned. Some stopwords, like “the”, or rarer words will not be included here.                                                                                |
| **positive**    | `number`                      | A list of the `positive` marked words (those scored above `0`) .                                                                                |
| **negative**    | `number`                      | A list of the `positive` marked words (those scored below `0`) .                                                                                |

## Prior art

- https://github.com/thisandagain/sentiment

repository: merelinguist/mindreader

gha_language: TypeScript

repo_name: merelinguist/mindreader


text:
# Inferring mRNA from Protein

http://rosalind.info/problems/mrna/

Write a Python program called "mrna.py" that will accept a protein sequence as a positional argument or a file name along with an optional "modulo" argument that defaults to 1,000,000.

The program should print a "usage" statement for "-h" or "--help" flags:

```
$ ./mrna.py -h
usage: mrna.py [-h] [-m int] str

Inferring mRNA from Protein

positional arguments:
  str                   Input protein or file

optional arguments:
  -h, --help            show this help message and exit
  -m int, --modulo int  Modulo value (default: 1000000)
```

The output for the program should be number of different RNA strings from which the protein could have been translated, modulo the given argument, e.g.:

```
$ ./mrna.py MA
12
```

A passing test suite looks like this:

```
$ make test
python3 -m pytest -xv --disable-pytest-warnings --flake8 --pylint --mypy mrna.py tests/mrna_test.py
============================ test session starts ============================
...

mrna.py::FLAKE8 PASSED                                                [ 10%]
mrna.py::mypy PASSED                                                  [ 20%]
tests/mrna_test.py::FLAKE8 PASSED                                     [ 30%]
tests/mrna_test.py::mypy PASSED                                       [ 40%]
tests/mrna_test.py::test_exists PASSED                                [ 50%]
tests/mrna_test.py::test_usage PASSED                                 [ 60%]
tests/mrna_test.py::test_ok1 PASSED                                   [ 70%]
tests/mrna_test.py::test_ok2 PASSED                                   [ 80%]
tests/mrna_test.py::test_ok3 PASSED                                   [ 90%]
::mypy PASSED                                                         [100%]
=================================== mypy ====================================

Success: no issues found in 2 source files
============================ 10 passed in 0.63s =============================
```

## Author

Ken Youens-Clark<EMAIL_ADDRESS>

branch_name: refs/heads/main


text:
# Gyrophora arctica Ach. SPECIES

#### Status
SYNONYM

#### According to
Index Fungorum

#### Published in
Method. Lich. 106 (1803)

#### Original name
Gyrophora arctica Ach.

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Lecanoromycetes/Umbilicariales/Umbilicariaceae/Umbilicaria/Umbilicaria arctica/ Syn. Gyrophora arctica/README.md

repo_name: mdoering/backbone


text:
# Diffie–Hellman key exchange

_(...) allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher._

[Source](https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange)


text:
## Run a demo

As this is just a Go wrapper for the library you must clone this into your `$GOPATH` as you would any other Go program.
Your path to the project should be:
```
  $GOPATH/src/github.com/jgraff/rpi_ws281x
```

To run the basic example run the following commands:
```
  cd golang/examples
  go build basic.go
  sudo ./basic
```

If everything worked you should see a basic color wipe for the first 16 LEDs on your strip.


text:
---
layout: default
---

# 1994-04-19 - More mail-to-usenet gateways

## Header Data

From: Matthew J Ghio<EMAIL_ADDRESS>To: Cypherpunks Mailing List<EMAIL_ADDRESS>Message Hash: 05433d4229ecaee1ed6c0aa49b2a323e71bae3b179c5ed7b670906ad1e594603

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-04-19 01:12:38 UTC

Raw Date: Mon, 18 Apr 94 18:12:38 PDT

## Raw message

```
{% raw  %}From: Matthew J Ghio<EMAIL_ADDRESS>Date: Mon, 18 Apr 94 18:12:38 PDT
To: Cypherpunks Mailing List<EMAIL_ADDRESS>Subject: More mail-to-usenet gateways
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
I'm sure there must be many, many more such gateways out there, if you
know of any, send them my way so I can put them in the listing.  If you
think you have one, but aren't sure, try this: post a message to
alt.test via your mail software (configured to your local machine) and
CC: it to me, so I can see the name to the mail-to-news gate.  Thanks!

{% endraw %}
```

## Thread

+ Return to [April 1994](/archive/1994/04)

+ Return to "[Matthew J Ghio <mg5n+@andrew.cmu.edu>](/authors/matthew_j_ghio_mg5n_at_andrew_cmu_edu_)"

+ 1994-04-19 (Mon, 18 Apr 94 18:12:38 PDT) - More mail-to-usenet gateways - _Matthew J Ghio<EMAIL_ADDRESS>


text:
MOVED TO https://github.com/jina-ai/executors/tree/main/jinahub/encoders/text/TransformerTorchEncoder

# ✨ Transformer Torch Encoder

**Transformer Torch Encoder** is a class that encodes sentences into embeddings.

The following parameters can be used:

- `pretrained_model_name_or_path` (str, default 'sentence-transformers/distilbert-base-nli-stsb-mean-tokens'): Path to pretrained model or name of the model in transformers package
- `base_tokenizer_model` (str, optional): Base tokenizer model
- `pooling_strategy` (str, default 'mean'): Pooling Strategy
- `layer_index` (int, default -1): Index of the layer which contains the embeddings
- `max_length` (int, optional): Max length argument for the tokenizer
- `embedding_fn_name` (str, default __call__): Function to call on the model in order to get output
- `device` (str, default 'cpu'): Device to be used. Use 'cuda' for GPU
- `default_traversal_paths` (List[str], Optional): Used in the encode method an define traversal on the received `DocumentArray`. Defaults to ['r']
- `default_batch_size` (int, default 32): Defines the batch size for inference on the loaded PyTorch model.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [🌱 Prerequisites](#-prerequisites)
- [🚀 Usages](#-usages)
- [🎉 Example](#%EF%B8%8F-example)
- [🔍 Reference](#%EF%B8%8F-reference)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 🌱 Prerequisites

To install the dependencies locally run
```
pip install .
pip install -r tests/requirements.txt
```
To verify the installation works:
```
pytest tests
```

## 🚀 Usages

### 🚚 Via JinaHub

#### using docker images
Use the prebuilt images from JinaHub in your python codes,

```python
from jina import Flow

f = Flow().add(uses='jinahub+docker://TransformerTorchEncoder',
               volumes='/your_user/.cache/huggingface:/root/.cache/huggingface')
```

or in the `.yml` config.

```yaml
jtype: Flow
pods:
  - name: encoder
    uses: 'jinahub+docker://TransformerTorchEncoder'
    volumes: '/your_user/.cache/huggingface:/root/.cache/huggingface'
    overwrite_with:
      target_size: 42
```
This does not support GPU at the moment.

#### using source codes
Use the source codes from JinaHub in your python codes,

```python
from jina import Flow, Document

f = Flow().add(uses='jinahub://TransformerTorchEncoder')

with f:
    resp = f.post(on='foo', inputs=Document(text='hello Jina'), return_results=True)
    print(f'{resp[0].docs[0].embedding.shape}')
```

or in the `.yml` config.

```yaml
jtype: Flow
pods:
  - name: encoder
    uses: 'jinahub://TransformerTorchEncoder'
```

### 📦 Via Pypi

1. Install the `executor-transformer-torch-encoder` package.

	```bash
	pip install git+https://github.com/jina-ai/executor-transformer-torch-encoder.git
	```

1. Use `executor-transformer-torch-encoder` in your code

	```python
	from jina import Flow
	from jinahub.text.encoders.transform_encoder import TransformerTorchEncoder

	f = Flow().add(uses=TransformerTorchEncoder)
	```

### 🐳 Via Docker

1. Clone the repo and build the docker image

	```shell
	git clone https://github.com/jina-ai/executor-transformer-torch-encoder.git
	cd executor-transformer-torch-encoder
	docker build -t transformer-torch-encoder .
	```
    Alternatively, build the GPU docker image:
    ```shell
    docker build -f Dockerfile.gpu -t transformer-torch-encoder .
	```

1. Use `transformer-torch-encoder` in your codes

	```python
	from jina import Flow

	f = Flow().add(uses='docker://transformer-torch-encoder')
	```
    Or, when using the GPU image:
	```python
	from jina import Flow

	f = Flow().add(uses='docker://transformer-torch-encoder', docker_kwargs={'runtime': 'nvidia'})
	```

## 🎉 Example

```python
from jina import Flow, Document

f = Flow().add(uses='jinahub+docker://TransformerTorchEncoder')

with f:
    resp = f.post(on='foo', inputs=Document(), return_results=True)
	print(f'{resp}')
```

### Inputs

`Document` with text in the `text` field.

### Returns

`Document` with `embedding` fields filled with an `ndarray` of the shape `embedding_dim` (model-dependent) with `dtype=nfloat32`.

## 🔍 Reference
- Available models: https://huggingface.co/transformers/pretrained_models.html
- More available models: https://huggingface.co/sentence-transformers


text:
---
layout: post
title: "Useful bash / zsh Profile Additions"
tags: [eng]
excerpt: Some functions I found useful to add to my bash and zsh profile.
---

> Update 2020-01-11 - I switched a lot of this stuff over to using [DotBot][dotbot] after seeing [this repo][dotfiles-inspiration]. You can see my dotfile repo [here][dotfiles] - it should work in whatever setup you're using, although some stuff might be specific to my own setup.

 As best I could I tried to make it so that the instructions can be followed pretty mindlessly (mostly because I sometimes have to copy-paste stuff into a new environment).

## Git Aliases

> Some useful Git aliases

### Give a nice-looking commit tree

This is similar to the `hg sl` command we use at Facebook.

```bash
git config --global alias.sl 'log --graph --decorate --oneline'
```

### ls

> Usage: more friendly `ls`

I guess this is pretty standard but the `ls` command has some useful modifiers.

```bash
alias ll='ls -ahl'
```

### Date

> Usage: `today` gives the current date and `now` gives the current time

```bash
alias today='date +"%Y-%m-%d"'
alias now='date +"%T"'
```

Example:

```bash
$ echo $(today)
2020-05-27
$ echo $(now)
11:01:07
```

### Google Drive

> Usage: `gdrive <fid> <fpath>` where `<fid>` is the Google Drive file identifier and `<fpath>` is the output path

```bash
function gdrive {
  if [[ $# -ne 2 ]]; then
    echo "Usage: gdrive <fid> <fpath>"
    exit 1
  fi
  FILEID="$1"
  FILENAME="$2"
  O=$(wget \
    --quiet \
    --save-cookies /tmp/cookies.txt \
    --keep-session-cookies \
    --no-check-certificate \
    "https://docs.google.com/uc?export=download&id=${FILEID}" -O- | \
    sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
  wget \
    --load-cookies /tmp/cookies.txt \
    "https://docs.google.com/uc?export=download&confirm=${O}&id=${FILEID}" \
    -O $FILENAME
  rm -rf /tmp/cookies.txt
}
```

### tmux

[tmux](https://github.com/tmux/tmux/wiki) is a must for remote development. Here are some of my personal add-ons to make it work a bit better.

#### List Open Sessions

> Usage: List open sessions on a machine on startup

```bash
if [[ -n $TMUX ]]; then
  echo -e "\033[1;31m----- TMUX session: $(tmux display-message -p '#S') -----\033[0m"
elif [[ ! -n $TMUX ]] && [[ $(tmux ls 2> /dev/null) ]]; then
  echo -e "\033[1;31m----- Open tmux sessions -----\033[0m"
  tmux ls
  echo -e "\033[1;31m------------------------------\033[0m"
fi
```

#### Attach to Named Session in Control Mode

> Usage: `tmuxc <session>`, can use tab completion to get the named session

Using named sessions is very important for organizing multiple projects. Otherwise I found it really easy to lose track of where stuff is.

```bash
alias tmuxc='tmux -CC a -t'

### Provides tab completion for the tmuxc command.
_tmuxc_complete()
{
  local cur opts
  COMPREPLY=()
  cur="${COMP_WORDS[COMP_CWORD]}"
  opts="$(tmux list-sessions -F '#S' | paste -sd ' ')"
  COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
  return 0
}
complete -F _tmuxc_complete tmuxc
```

### Anaconda

> Usage: Shorthand and tab completion for activating a Conda environment

```bash
alias cenv='conda activate'

_conda_complete()
{
  local cur opts
  COMPREPLY=()
  cur="${COMP_WORDS[COMP_CWORD]}"
  opts="$(ls -1 ${HOME}/.conda/envs/ | paste -sd ' ')"
  COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
  return 0
}
complete -F _conda_complete 'cenv'
```

### uBlock Origin

This is more of a productivity tip. I have a blocklist that blocks the endless scrolling parts of some social media sites without blocking potentially informative posts.

[Click here to subscribe](abp:subscribe?location=https://ben.bolte.cc/assets/scripts/ublock_list.txt&title=Social Media Posts)

[dotfiles]: https://github.com/codekansas/dotfiles
[dotfiles-inspiration]: https://github.com/mikejqzhang/dotfiles
[dotbot]: https://github.com/anishathalye/dotbot

extension: markdown


text:
# f5-devops container based on microsoft vscode base

size about 3GB

based on the vscode devcontainer and the vscode base container
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/ubuntu/.devcontainer/base.Dockerfile

## tools:

- ansible
- aws-cli
- az-cli
- docker
- docker-compose
- gcloud-cli
- git
- golang
- pre-commit
- terraform
- terraform docs

repository: wolfewa/devcontainers

repo_name: wolfewa/devcontainers


text:
[![](https://images.microbadger.com/badges/image/babim/mariadb-galera.svg)](https://microbadger.com/images/babim/mariadb-galera "Get your own image badge on microbadger.com")[![](https://images.microbadger.com/badges/version/babim/mariadb-galera.svg)](https://microbadger.com/images/babim/mariadb-galera "Get your own version badge on microbadger.com")
[![](https://images.microbadger.com/badges/image/babim/mariadb-galera:ssh.svg)](https://microbadger.com/images/babim/mariadb-galera:ssh "Get your own image badge on microbadger.com")[![](https://images.microbadger.com/badges/version/babim/mariadb-galera:ssh.svg)](https://microbadger.com/images/babim/mariadb-galera:ssh "Get your own version badge on microbadger.com")

# Supported tags and respective `Dockerfile` links

-   [`latest` (*latest/Dockerfile*)](https://github.com/babim/docker-mariadb-galera/blob/master/Dockerfile)
-   [`ssh` (*ssh/Dockerfile*)](https://github.com/babim/docker-mariadb-galera/blob/ssh/Dockerfile)

# How to use this image.

When you run the image without giving any command, the entrypoint will listen at port 13306 waiting for a command.
To send a command, jun run:

    echo "command here" | nc ip_of_container port

So, basically, you can get a cluster running by following the steps:

- start each container with:

## without password
```
docker run \
    -v /path/to/my.cnf:/etc/mysql/my.cnf \
    -v /path/to/mariadb:/var/lib/mysql \
    -v /path/to/certs/:/etc/ssl/mysql:ro \
    -e MYSQL_ALLOW_EMPTY_PASSWORD=true \
    babim/mariadb-galera
```
## with password
```
docker run \
    -v /path/to/my.cnf:/etc/mysql/my.cnf \
    -v /path/to/mariadb:/var/lib/mysql \
    -v /path/to/certs/:/etc/ssl/mysql:ro \
    -e MYSQL_ROOT_PASSWORD=123456 \
    babim/mariadb-galera
```

- concat all containers IP into a `gcomm://` string, like:

```
gcomm://<IP_ADDRESS>,<IP_ADDRESS>,<IP_ADDRESS>
```

- start first container as new cluster:

```
echo "mysqld --wsrep-new-cluster --wsrep-cluster-address=gcomm://<IP_ADDRESS>,<IP_ADDRESS>,<IP_ADDRESS>" | nc <IP_ADDRESS> 13306
```

- on all the subsequent containers, one at a time, starts it as part of existing cluster:

```
echo "mysqld --wsrep-cluster-address=gcomm://<IP_ADDRESS>,<IP_ADDRESS>,<IP_ADDRESS>" | nc <IP_ADDRESS> 13306
echo "mysqld --wsrep-cluster-address=gcomm://<IP_ADDRESS>,<IP_ADDRESS>,<IP_ADDRESS>" | nc <IP_ADDRESS> 13306
```

That's it, now you should have a running MariaDB cluster.

## SSL certificates

You can generate self-signed certificate, mount the directory inside the container and set the appropriate `[sst]` settings at `/etc/mysql/my.cnf`.

## Example `my.cnf` file:

```
[mysqld]
datadir=/var/lib/mysql
socket=/var/run/mysqld/mysqld.sock
user=mysql
binlog-format=ROW
default-storage-engine=InnoDB
innodb-autoinc-lock-mode=2
innodb-flush-log-at-trx-commit=0
innodb-buffer-pool-size=122M
innodb-doublewrite=1
innodb-flush-method=O_DIRECT
wsrep-provider=/usr/lib/galera/libgalera_smm.so
wsrep-cluster-name=my_super_cluster
wsrep-sst-method=rsync
query-cache-size=524288
log-error=/dev/stderr

[mysql_safe]
log-error=/dev/stderr
pid-file=/var/run/mysqld/mysqld.pid

[sst]
tca=/etc/ssl/mysql/ca.pem
tcert=/etc/ssl/mysql/server-cert.pem
tkey=/etc/ssl/mysql/server-key.pem
```

# check status:
```
docker exec -ti database01 mysql -e "SHOW STATUS LIKE 'wsrep_cluster%'"
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_conf_id    | 3                                    |
| wsrep_cluster_size       | 3                                    |
| wsrep_cluster_state_uuid | 2882bcb7-ab3b-11e5-ab75-2b510ef0ec6f |
| wsrep_cluster_status     | Primary                              |
+--------------------------+--------------------------------------+
```

repository: babim/docker-mariadb-galera

gha_language: Shell

repo_name: babim/docker-mariadb-galera


text:
---
name: Enhancement
about: Create a enhancement request
labels: 'Type: Enhancement, PM: To Do'
assignees: ''
---

# Enhancement Request
This is a good place to request an enhancement - different way to do things, or increased depth of an existing package pull etc.  Please describe what you'd like as an enhancement here.

## Prerequisites

Please answer the following questions for yourself before submitting an issue.
- [ ] I've named a clear and solution focused title.

repository: hallindavid/scaffold-laravel

repo_name: hallindavid/scaffold-laravel


text:
# generator-bin-wrapper [![Build Status](https://travis-ci.org/mastilver/generator-bin-wrapper.svg?branch=master)](https://travis-ci.org/mastilver/generator-bin-wrapper)

> Generate a binary wrapper around your programs using [bin-wrapper](https://github.com/kevva/bin-wrapper)

Based on [generator-nm](https://github.com/sindresorhus/generator-nm) and  [flow-bin](https://github.com/flowtype/flow-bin)

## Install

```
$ npm install --global generator-bin-wrapper
```

## Usage

With [yo](https://github.com/yeoman/yo):

```
$ yo bin-wrapper
```

## License

MIT © [Thomas Sileghem](http://mastilver.com)

repository: mastilver/generator-bin-wrapper

repo_name: mastilver/generator-bin-wrapper


text:
WpfHelpers
===========================

Useful utility functions and extensions for Windows Phone and WPF

Documentation is a big TODO but to help you on your way:

Naming Convention
---------------------------
The folders and namespaces are very much like the .NET namespaces. For example, there is a Windows/Data folder. I
n code, the classes in those folders are in the WpfHelpers.Windows.Data namespace. You can expect the same type of objects as one would expect in the System.Windows.Data namespace.

Projects
---------------------------
WpfHelpers.Base: Contains most utility classes. All classes in this library are also safe to use by background agents.

WpfHelpers: Contains non-backgroundworker safe classes (Windows Phone only).

Highlights (Windows Phone)
---------------------------

Classes to check out:
- UserInterfaceThreadDispatcher and DelegateExtensions: Helper interface for dispatching asynchronous updates back to the UI
- SettingsBase: Base class for general application settings
- ListBoxEx: Extended version of the Windows Phone listbox that supports an empty view (shown when there are no items in the list), command binding for MVVM.
- GlobalApplication: Base class for you application definition (App.xaml) that provides you with debugging tools and prevents boilerplate code.

Style files to check out:
- TransitionStyles.xaml: Avoid that biolerplate clutter of Silverlight Toolkit transitions and apply one of the style to your page.
- ListBoxStyles.xaml/ListBoxEmptyStretchTemplate: Fixes a bug in the standard Windows Phone listbox, where items are not horizontally stretched to its container.

Wiki pages
----------------------------
Check out the [wiki pages](https://github.com/Sebazzz/SDammann.WindowsPhone.Utils/wiki).

repository: Sebazzz/WpfHelpers

repo_name: Sebazzz/WpfHelpers


text:
# Module 11 Challenge - Forecasting Net Prophet

---

## Description

In this Jupyter Lab Notebook, we analyze a company's financial and user data to find ways to make the company grow and try and predict successful trading of the stock.

The sections of this notebook are as follows:

* Find unusual patterns in hourly Google search traffic

* Mine the search traffic data for seasonality

* Relate the search traffic to stock price patterns

* Create a time series model with Prophet

* Forecast revenue by using time series models

---

## Technologies

This project leverages Google Colab to run a .ipynb notebook.  The following packages are also used:

* [pandas](https://github.com/pandas-dev/pandas) - Data analysis toolkit for Python.

* [hvPlot](https://github.com/holoviz/hvplot) - A high-level plotting API for the PyData ecosystem built on HoloViews.

* [holoviews](https://github.com/holoviz/holoviews) - Data analysis and visualization tool.

* [pystan](https://github.com/stan-dev/pystan) - Python interface to Stan, a package for Bayesian inference.

* [fbprophet](https://github.com/facebook/prophet) - Prophet is a procedure for forecasting time series data.

---

## Installation Guide

Before running the application on Google Colab, run the following code to install and import the required librarys:

```python

  # Install the required libraries
from IPython.display import clear_output
try:
  !pip install pystan
  !pip install fbprophet
  !pip install hvplot
  !pip install holoviews
except:
  print("Error installing libraries")
finally:
  clear_output()
  print('Libraries successfully installed')
```
```python

# Import the required libraries and dependencies
import pandas as pd
import holoviews as hv
from fbprophet import Prophet
import hvplot.pandas
import datetime as dt
import numpy as np
%matplotlib inline
```

In order to render hvPlots in Colab, run the following code prior to hvPlot command:

```python
# Holoviews extension to render hvPlots in Colab
hv.extension('bokeh')
```
---

## Contributors

Joshua Creveling

Email<EMAIL_ADDRESS>
GitHub: https://github.com/joshuacreveling

LinkedIn: https://www.linkedin.com/in/joshua-creveling/

*Starter template provided by Trilogy Education Services*

---

## License

MIT


text:
# minidown <IP_ADDRESS>

* New features
  * Implement `code_download` option for `mini_document()`
  * Add `download_rmd_button()` so that users can place a download button anywhere
    in the document.
* Template
  * Elements aftter `include-before` and `include-after` are wrapped by `<main>`
    element.
* Layout
  * CSS Grid layout for floating TOC is applied to `<main>` instead of `<body>`
    so that `include-before` and `include-after` works safely.
  * For the consistency with `code_folding = TRUE`,
    the max-width of body become 900px when `code_folding = FALSE`

# minidown 0.0.1

* Initial release with the support of following frameworks:
  * mini.css
  * sakura
  * Water.css

repository: CLRafaelR/minidown

repo_name: CLRafaelR/minidown


text:
## OpenWeather
3-day **detailed** or **brief** weather report of your city from *[OpenWeatherMap](https://openweathermap.org)*.

### Installing:
  * (terminal) Clone repo in a directory:
```
$ git clone https://github.com/mr-shubhshar/openweather.git
```

### Usage --CLI:
**Brief** report:
```
$ python weather.py <city_name>
```

**Detailed** report:
```
$ python weather.py detailed <city_name>
```

### Suggestions:
> Please open an issue.

### License:
[MIT](https://github.com/mr-shubhshar/openweather/blob/master/LICENSE)

repository: mr-shubhshar/openweather

repo_name: mr-shubhshar/openweather


text:
# Controlling MulticopterSim from Matlab
This folder contains a simple example showing how you can control MulticopterSim from a Matlab session running on
your computer or another computer.  It uses UDP sockets for sending motor values from your Matlab program
to the simualtor and for retrieving sensor information (gyrometer, accelerometer, position) from the simulator.

To run the example, you should:

1. Clone the master branch of this repostitory into your Documents/Unreal
   Projects folder, first creating that folder if it doesn't exist.

2. Clone the  [SocketModule](https://github.com/simondlevy/MulticopterSim/tree/SocketModule) branch
of the repository onto your desktop, rename it FlightModule, and drag the
FlightModule folder into the MulticopterSim/Source folder.

3. Find your [Matlab preferences directory](https://www.mathworks.com/matlabcentral/answers/309984-what-is-the-default-location-of-the-matlab-preferences-directory).
(For example, on my computer it is C:\Users\owner\AppData\Roaming\MathWorks\MATLAB\R2018a) Download
[this](javaclasspath.txt) file into that preferences directory, and then modify the file to replace ```owner``` with
your own user name.

4. Build MulticopterSim as described [here](https://github.com/simondlevy/MulticopterSim#Windows).

5. Launch Matlab, change your working directory to MulticopterSim/Extras/matlab, and run the takeoff.m
script.

6. Hit F5 to launch MulticopterSim, then hit the play button.

repository: SIVASHANKAR-S/MulticopterSim

repo_name: SIVASHANKAR-S/MulticopterSim


text:
---
subcategory: "SSL"
---

# Resource: ssldtlsprofile

The ssldtlsprofile resource is used to create a new DTLS profile.

## Example usage

```hcl
resource "citrixadc_ssldtlsprofile" "tf_ssldtlsprofile" {
	name = "tf_ssldtlsprofile"
	helloverifyrequest = "ENABLED"
	maxbadmacignorecount = 128
	maxholdqlen = 64
	maxpacketsize = 125
	maxrecordsize = 250
	maxretrytime = 5
	pmtudiscovery = "DISABLED"
	terminatesession = "ENABLED"
}
```

## Argument Reference

* `name` - (Required) Name for the DTLS profile. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@),equals sign (=), and hyphen (-) characters. Cannot be changed after the profile is created.
* `pmtudiscovery` - (Optional) Source for the maximum record size value. If ENABLED, the value is taken from the PMTU table. If DISABLED, the value is taken from the profile. Possible values: [ ENABLED, DISABLED ]
* `maxrecordsize` - (Optional)
* `maxretrytime` - (Optional) Wait for the specified time, in seconds, before resending the request.
* `helloverifyrequest` - (Optional) Send a Hello Verify request to validate the client. Possible values: [ ENABLED, DISABLED ]
* `terminatesession` - (Optional) Terminate the session if the message authentication code (MAC) of the client and server do not match. Possible values: [ ENABLED, DISABLED ]
* `maxpacketsize` - (Optional)

## Attribute Reference

In addition to the arguments, the following attributes are available:

* `id` - The id of the ssldtlsprofile. It has the same value as the `name` attribute.

## Import

A ssldtlsprofile can be imported using its name, e.g.

```shell
terraform import citrixadc_ssldtlsprofile.tf_ssldtlsprofile tf_ssldtlsprofile
```

repository: citrix/terraform-provider-citrixadc

repo_name: citrix/terraform-provider-citrixadc


text:
# websocket

WebSocket library for [fasthttp](https://github.com/valyala/fasthttp) and [net/http](https://pkg.go.dev/net/http).

Checkout [examples](https://github.com/dgrr/websocket/blob/master/examples) to inspire yourself.

# Install

```bash
go get github.com/dgrr/websocket
```

# Why another WebSocket package?

**Other WebSocket packages DON'T** allow concurrent Read/Write operations on servers
and they do not provide low level access to WebSocket packet crafting.
Those WebSocket packages try to emulate the Golang API by implementing
io.Reader and io.Writer interfaces on their connections. io.Writer might be a
good idea to use it, but no io.Reader, given that WebSocket is an async protocol
by nature (all protocols are (?)).

Sometimes, WebSocket servers are just cumbersome when we want to handle a lot of
clients in an async manner. For example, **in other WebSocket packages to broadcast
a message generated internally we'll need to do the following**:

```go
type MyWebSocketService struct {
    clients sync.Map
}

type BlockingConn struct {
	lck sync.Mutex
	c websocketPackage.Conn
}

func (ws *MyWebSocketService) Broadcaster() {
	for msg := range messageProducerChannel {
        ws.clients.Range(func(_, v interface{}) bool {
            c := v.(*BlockingConn)
            c.lck.Lock() // oh, we need to block, otherwise we can break the program
            err := c.Write(msg)
            c.lck.Unlock()

            if err != nil {
                // we have an error, what can we do? Log it?
            	// if the connection has been closed we'll receive that on
            	// the Read call, so the connection will close automatically.
            }

            return true
        })
    }
}

func (ws *MyWebSocketService) Handle(request, response) {
	c, err := websocketPackage.Upgrade(request, response)
	if err != nil {
		// then it's clearly an error! Report back
    }

    bc := &BlockingConn{
        c: c,
    }

	ws.clients.Store(bc, struct{}{})

	// even though I just want to write, I need to block somehow
    for {
    	content, err := bc.Read()
    	if err != nil {
            // handle the error
            break
        }
    }

    ws.clients.Delete(bc)
}
```

First, we need to store every client upon connection,
and whenever we want to send data we need to iterate over a list, and send the message.
If while, writing we get an error, then we need to handle that client's error
What if the writing operation is happening at the same time in 2 different coroutines?
Then we need a sync.Mutex and block until we finish writing.

To solve most of those problems [websocket](https://github.com/dgrr/websocket)
uses channels and separated coroutines, one for reading and another one for writing.
By following the [sharing principle](https://golang.org/doc/effective_go#sharing).

> Do not communicate by sharing memory; instead, share memory by communicating.

Following the fasthttp philosophy this library tries to take as much advantage
of the Golang's multi-threaded model as possible,
while keeping your code concurrently safe.

To see an example of what this package CAN do that others DONT checkout [the broadcast example](https://github.com/dgrr/websocket/blob/master/examples/broadcast/main.go).

# Server

## How can I launch a server?

It's quite easy. You only need to create a [Server](https://pkg.go.dev/github.com/dgrr/websocket?utm_source=godoc#Server),
set your callbacks by calling the [Handle*](https://pkg.go.dev/github.com/dgrr/websocket?utm_source=godoc#Server.HandleClose) methods
and then specify your fasthttp handler as [Server.Upgrade](https://pkg.go.dev/github.com/dgrr/websocket?utm_source=godoc#Server.Upgrade).

```go
package main

import (
	"fmt"

	"github.com/valyala/fasthttp"
	"github.com/dgrr/websocket"
)

func main() {
	ws := websocket.Server{}
	ws.HandleData(OnMessage)

	fasthttp.ListenAndServe(":8080", ws.Upgrade)
}

func OnMessage(c *websocket.Conn, isBinary bool, data []byte) {
	fmt.Printf("Received data from %s: %s\n", c.RemoteAddr(), data)
}
```

## How can I launch a server if I use net/http?

```go
package main

import (
	"fmt"
	"net/http"

	"github.com/dgrr/websocket"
)

func main() {
	ws := websocket.Server{}
	ws.HandleData(OnMessage)

	http.HandleFunc("/", ws.NetUpgrade)
	http.ListenAndServe(":8080", nil)
}

func OnMessage(c *websocket.Conn, isBinary bool, data []byte) {
	fmt.Printf("Received data from %s: %s\n", c.RemoteAddr(), data)
}
```

## How can I handle pings?

Pings are handle automatically by the library, but you can get the content of
those pings setting the callback using [HandlePing](https://pkg.go.dev/github.com/dgrr/websocket?utm_source=godoc#Server.HandlePing).

For example, let's try to get the round trip time to a client by using
the PING frame. The website [http2.gofiber.io](https://http2.gofiber.io)
uses this method to measure the round trip time displayed at the bottom of the webpage.

```go
package main

import (
	"sync"
	"encoding/binary"
	"log"
	"time"

	"github.com/valyala/fasthttp"
	"github.com/dgrr/websocket"
)

// Struct to keep the clients connected
//
// it should be safe to access the clients concurrently from Open and Close.
type RTTMeasure struct {
	clients sync.Map
}

// just trigger the ping sender
func (rtt *RTTMeasure) Start() {
	time.AfterFunc(time.Second * 2, rtt.sendPings)
}

func (rtt *RTTMeasure) sendPings() {
	var data [8]byte

	binary.BigEndian.PutUint64(data[:], uint64(
		time.Now().UnixNano()),
	)

	rtt.clients.Range(func(_, v interface{}) bool {
		c := v.(*websocket.Conn)
		c.Ping(data[:])
		return true
	})

	rtt.Start()
}

// register a connection when it's open
func (rtt *RTTMeasure) RegisterConn(c *websocket.Conn) {
	rtt.clients.Store(c.ID(), c)
	log.Printf("Client %s connected\n", c.RemoteAddr())
}

// remove the connection when receiving the close
func (rtt *RTTMeasure) RemoveConn(c *websocket.Conn, err error) {
	rtt.clients.Delete(c.ID())
	log.Printf("Client %s disconnected\n", c.RemoteAddr())
}

func main() {
	rtt := RTTMeasure{}

	ws := websocket.Server{}
	ws.HandleOpen(rtt.RegisterConn)
	ws.HandleClose(rtt.RemoveConn)
	ws.HandlePong(OnPong)

	// schedule the timer
	rtt.Start()

	fasthttp.ListenAndServe(":8080", ws.Upgrade)
}

// handle the pong message
func OnPong(c *websocket.Conn, data []byte) {
	if len(data) == 8 {
		n := binary.BigEndian.Uint64(data)
		ts := time.Unix(0, int64(n))

		log.Printf("RTT with %s is %s\n", c.RemoteAddr(), time.Now().Sub(ts))
	}
}
```

# websocket vs gorilla vs nhooyr vs gobwas

| Features | [websocket](https://github.com/dgrr/websocket) | [Gorilla](https://github.com/fasthttp/websocket)| [Nhooyr](https://github.com/nhooyr/websocket) | [gowabs](https://github.com/gobwas/ws) |
| --- | --- | --- | --- | --- |
| Concurrent R/W                          | Yes            | No           | No. Only writes | No           |
| Passes Autobahn Test Suite              | Mostly         | Yes          | Yes             | Mostly       |
| Receive fragmented message              | Yes            | Yes          | Yes             | Yes          |
| Send close message                      | Yes            | Yes          | Yes             | Yes          |
| Send pings and receive pongs            | Yes            | Yes          | Yes             | Yes          |
| Get the type of a received data message | Yes            | Yes          | Yes             | Yes          |
| Compression Extensions                  | No             | Experimental | Yes             | No (?)       |
| Read message using io.Reader            | No             | Yes          | No              | No (?)       |
| Write message using io.WriteCloser      | Yes            | Yes          | No              | No (?)       |

# Stress tests

The following stress test were performed without timeouts:

Executing `tcpkali --ws -c 100 -m 'hello world!!13212312!' -r 10k localhost:8081` the tests shows the following:

### Websocket:
```
Total data sent:     267.7 MiB (280678466 bytes)
Total data received: 229.5 MiB (240626600 bytes)
Bandwidth per channel: 4.167⇅ Mbps (520.9 kBps)
Aggregate bandwidth: 192.357↓, 224.375↑ Mbps
Packet rate estimate: 247050.1↓, 61842.9↑ (1↓, 1↑ TCP MSS/op)
Test duration: 10.0075 s.
```

### Websocket for net/http:
```
Total data sent:     267.3 MiB (280320124 bytes)
Total data received: 228.3 MiB (239396374 bytes)
Bandwidth per channel: 4.156⇅ Mbps (519.5 kBps)
Aggregate bandwidth: 191.442↓, 224.168↑ Mbps
Packet rate estimate: 188107.1↓, 52240.7↑ (1↓, 1↑ TCP MSS/op)
Test duration: 10.0039 s.
```

Either for fasthttp and net/http should be quite close,
the only difference is the way they both upgrade.

### Gorilla:
```
Total data sent:     260.2 MiB (272886768 bytes)
Total data received: 109.3 MiB (114632982 bytes)
Bandwidth per channel: 3.097⇅ Mbps (387.1 kBps)
Aggregate bandwidth: 91.615↓, 218.092↑ Mbps
Packet rate estimate: 109755.3↓, 66807.4↑ (1↓, 1↑ TCP MSS/op)
Test duration: 10.01 s.
```

### Nhooyr: (Don't know why is that low)
```
Total data sent:     224.3 MiB (235184096 bytes)
Total data received: 41.2 MiB (43209780 bytes)
Bandwidth per channel: 2.227⇅ Mbps (278.3 kBps)
Aggregate bandwidth: 34.559↓, 188.097↑ Mbps
Packet rate estimate: 88474.0↓, 55256.1↑ (1↓, 1↑ TCP MSS/op)
Test duration: 10.0027 s.
```

### Gobwas:
```
Total data sent:     265.8 MiB (278718160 bytes)
Total data received: 117.8 MiB (123548959 bytes)
Bandwidth per channel: 3.218⇅ Mbps (402.2 kBps)
Aggregate bandwidth: 98.825↓, 222.942↑ Mbps
Packet rate estimate: 148231.6↓, 72106.1↑ (1↓, 1↑ TCP MSS/op)
Test duration: 10.0015 s.
```

The source files are in [this](https://github.com/dgrr/websocket/tree/master/stress-tests/) folder.

repository: TrendingTechnology/websocket

repo_name: TrendingTechnology/websocket


text:
# Notes-app

This project was made in the [Python Website Full Tutorial - Flask, Authentication, Databases & More](https://youtu.be/dam0GPOAvVI) tutorial by Tech with Tim.

## installing on your machine

download the project on github.

```
$ git clone <repo url>
```

After that open your terminal and write:

```
$ cd flask-website-tutorial
    # enter in the app folder
$ pip install -r requirements.txt
    # install the dependencies
$ python .py
    # execute the app
```

This commands wiil execute the script in:

```
http://<IP_ADDRESS>:5000
```

to stop the server(localhost) press Ctrl+C or Cmd+C

## License
[MIT](LICENSE)

repository: Los-had/Notes-app

repo_name: Los-had/Notes-app


text:
# Installation

The easiest and preferred way to install PSCodeHealth is via the [PowerShell Gallery](https://www.powershellgallery.com/). For more information, see the [PowerShell Gallery Getting Started](https://msdn.microsoft.com/en-us/powershell/gallery/psgallery/psgallery_gettingstarted) page.

Run the following command to install PSCodeHealth and its 2 dependencies ([Pester](https://github.com/pester/Pester) and
[PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer)) :

```powershell
Install-Module -Name PSCodeHealth -Repository PSGallery
```

As an alternative, you can clone this repository to a location on your system and copy the `PSCodeHealth` subfolder into :
`C:\Program Files\WindowsPowerShell\Modules\`.

repository: KurtDeGreeff/PSCodeHealth

repo_name: KurtDeGreeff/PSCodeHealth


text:
# Conditional Target

The white board pattern is quite popular in OSGi and for good reasons. However, the pattern is not without its
drawbacks.  For example, assume you have persistent storage and you need at least 3 remote servers in 2 different
regions.

This is hard to model with services because you can only select on a single service. OSGi has no way to define
a filter over multiple services. The Conditional Target provides this service. It is a generic service where
the type parameter is the service type, generally the white board type, you're interested in.

If you're using Declarative Services (DS) and your white board service was `Foo`, then it would look like:

    @Reference
    ConditionalTarget<Foo>       strings;

The Conditional Target provider detects that you're looking for Foo services and it will create a Conditional Target
service that provides access to all listed Foo services visible to you. It also provides access to the
_aggregate_ properties. This is the API:

	public interface ConditionalTarget<T> extends Iterable<T>{

		/**
		 * Get the tracked services.
		 *
		 * @return the tracked services
		 */
		List<T> getServices();

        /**
         * Get all service references
         */
		Map<ServiceReference<T>,T> getServiceReferences();

		/**
		 * Get the current aggregate properties as calculated form the filters and
		 * the services in scope.
		 *
		 * @return the map with the aggregate properties
		 */
		Map<String, Object> getAggregateProperties();
	}

## Aggregate Properties

The aggregate properties are the _aggregate_ of the Foo service properties. For example, a Foo⁰, Foo¹, and Foo²
are registered.  Each service has a `bar` property that is set to 0, 1, 2 respectively. The aggregate property `bar` is
then a collection of [0,1,2]. Arrays and collections are merged except for `byte[]`.

Since the Conditional Target service has the aggregate properties of all Foo services, we can now select across
the services using a standard filter. For example, we want to have at least `bar=0 and bar=1` registered or
`bar=1 and bar=2`.

## Target Filter

With DS we can make a reference conditional with the `target` annotation method. This is a filter.

    @Reference(target="(|(&((bar=0)(bar=1)))(&((bar=1)(bar=0))))")
    ConditionalTarget<Foo>      foos;

## Calculated values

Besides calculating the aggregate values from the properties of the white board services, the Conditional Target also
accepts filters that have _calculated_ fields. For example, if you need at least three services that have a `bar`
property then you can filter on `#bar`. There are a number of calculated values:

* `#key`     – Calculates the number of `key` properties
* `[avg]key` – Calculates the average of all `key` properties
* `[min]key` – Calculates the minimum of all `key` properties
* `[max]key` – Calculates the maximum of all `key` properties
* `[sum]key` – Calculates the sum of  all `key` properties
* `[unq]key` – Calculates the number of unique `key` properties

    @Reference(target="([sum]bar>=3)")
    ConditionalTarget<Foo>      foos;

## Configuration

This would be interesting but what really makes it very useful is that DS allows the `target` to be overridden
by configuration. If the configuration of this object contains a field `foos.target` (the name of the field followed
by the word `.target`) then the value is taken as the filter.

## Use Case

Assume we have a service R that represents a link to a remote service. For performance and reliability reasons we
require at least 3 of those services to be present before we can start. Additionally, these services must come from
at least 2 different regions.

For this reason, we define a property `region` that can take the values `south`, `east`, `north`, and `west`.

The reference to the Conditional Target can now be defined as:

    @Reference(target="(&(#>=3)([unq]region>=2))")
    ConditionalTarget<R>      foos;

## How it Works

The Conditional Target provider uses the framework Hooks to detect the interest in Conditional Target services. It
then uses the Service Component Runtime service to find the Component Configuration DTO that is looking for the
Conditional Target. It uses reflection to find the generic type.

It will then:

* Register a Service Factory for a Conditional Target service, and
* Track services of the target type, and
* Keep the aggregate properties of the Conditional Target updated.

The services are checked out from the registry via the Bundle Context of the requesting bundle.

gha_language: Java


text:
---
title: Device Naming Conventions - What's in a Name?
author: Yandy
layout: post
image: device_hostname.jpg
twitter_image: device_hostname.jpg
description: "Choosing a device hostname seems trivial to say the least. This is not always the case when discussing it in the open."
summary: "Choosing a device hostname seems trivial to say the least. However, from multiple design meetings, this is a topic that tends to drag on. Everyone has a preference, and opinion or just set in the ways *we've done* this way for a long time..."
date: 2015-02-17 13:39:00
permalink: 2015/02/device-naming-conventions/
categories:
  - Design
tags:
  - hostname
  - device-hostname
  - switch-hostname
  - switch
  - routers
  - network-naming
  - device-name
  - cisco
  - cisco-hostname
---

![](http://inetpy.com/images/device_hostname.jpg)

Choosing a device hostname seems trivial to say the least. However, from multiple design meetings, this is a topic that tends to drag on. Everyone has a preference, and opinion or just set in the ways *we've done it* this way for a long time and so on with other excuses.

### What's in a Name?

I've seen names so simple that it was nearly impossible to tell the function by just looking at the name. This excludes the default **Router** or **Switch** that yes, I have seen in production. But things like, sw-gig1. Is this a **Core** switch? An **access-switch**? In this case it was a 4948 DC top-of-rack switch.

There are also hostnames that are too long and complex that you just give up trying to figure out what it means. If you have to look up a code table in a database or excel sheet, it probably isn't a good naming convention (with some exceptions), names like **BEEIMA04BTEN** provide no immediate value to what you're working on.

#### Simplicity over Complexity

KISS (Keep it Simple Stupid) I'm a big believer in this, keeping simplicity at the core. But how do you express function with simplicity? Can your naming scheme be too simple? Of course it can, one of the examples above shows it. But this was simplicity without thought or just plain lazyness which happens.

### Lengths and Preferences

The name should be long enough to tell you, "I know exactly what this" by just looking at it. But not so long that you need double retina resolution to keep every other output or command from wrapping lines.

#### Geographical Locations

Should you put a hint as to what country, city or town the devices are located? Much of the standard is to put a designation of closest airport code, or simply closest international airport code. Such as **MIA-[REST-OF-NAME]** or **[REST-OF-NAME]-MIA**. Where you put this designation really doesn't matter. Keep it a standard and make sure that it's followed. I prefer in the beginning of the name, but it's personal preference at this point.

#### Function

What about intent for switch or router function? Is this a campus access switch or a data center leaf switch? Is it a WAN router or an Internet facing edge router? Would you choose **MIA-AS-[REST-OF-NAME]** where **AS** is access switch? I prefer to keep a two to four letter designation for function such as the one above. Can also go with **MIA-INET-[REST-OF-NAME]** for Internet edge router.  Here's a few quick points that I've followed.

* Campus Switches:
	* AS - Access Switch
	* DS - Distribution Switch
	* CS - Core Switch
* DC Switches:
	* TOR - Top-of-Rack Switch
	* AGG - Aggregation Switch (for non-leaf-spine)
	* DCS - Core Switch (for non-leaf-spine)
	* LEAF - Pretty obvious (Leaf)
	* SPNE - Spine Switch
* Routers
	* WAN - Again obvious WAN router
	* INET - Internet edge router
	* VG - Voice Gateway (I feel dirty mentioning voice ;) )

And so on, this doesn't cover everything, just something that's been kind to me over the years when naming things.

#### Model Designation

This is a tricky one, because it can begin to take the hostname and increase it tremendously its length. The model designations I prefer to use are short such as **N7K** or **N5K** for Cisco Nexus 7000 and 5000 respectively. How about Catalyst switches? Again, keeping it short is my preference, going with **3560** or just **C3K** for some for of Catalyst 3xxx Series. The model is easy enough to decipher in a **show version** output. Just having an idea of what type of switch you're working on should be enough to avoid major CLI mistakes.

#### Physical Location

When it comes to physical locations, again keep it simple. I've seen hostnames have [data center - rack - space in rack] attached to them. This is adding complexity and unnecessary length. Drilling down that far into the location can easily be added to the **SNMP Location** string. Just adding an **IDF** or **MDF** location should suffice. Even adding **DCA** or **DC1** for data center within the geo location already added to the hostname should also suffice.

How about where IDFs are numbered the same throughout out buildings? Adding a building code designation which many have as short as three characters can be enough. Such as **MIA-AS-C3K-XYZ-IDF1-[REST-OF-NAME]** can be more than enough.

#### Separating Multiple Switches

How about serial designation? or in other words **switch-1** and **switch-2** vs **switch-a** and **switch-b**? This one is completely open, they all work from what I've seen. My preference again, goes towards the numbering. Mostly it's an aesthetics thing, just prefer the numbering scheme.

#### Full Example

Just to wrap it up, here's some examples of how my preference for naming schemes look. Take it and modify it, tare it down or share your own views in the comments.

##### Examples

Can you guess what each is from just looking at the name?

* MIA-WAN-A1K-DC1-1
* DFW-PE-A9K-DC2-1
* JFK-DCS-N7K-DC1-1

### Summary

Do you agree with this? Do you have your own preferences? I'm sure you do! Share them in the comments or drop me an [email][1] and I'll share thoughts in an updated post.

[1]: mailto:yr@inetpy.com


text:
# nft-blacklist
Blacklist country specific IP blocks using nftables

NOTE : IPv6 addresses are not supported at the moment.

# Requirements
To use this script, you will need to create a 'set' in your nftables configuration with the `type ipv4_addr` and `flags interval` set properties. This set can belong to any table in your nftables configuration and is responsible for holding the blacklisted IP addresses. The syntax to create a set is :

`nft add set [table] [set-name] {set properties}`

Please refer the nftables wiki for more info on set operations: https://wiki.nftables.org/wiki-nftables/index.php/Sets

# Configuration

Edit the TABLE and SET\_NAME accordingly in the nft-blacklist.py. Then edit the COUNTRY\_CODES tuple and add the 2 letter codes for the countries you wish to restrict access to. Refer http://www.ipdeny.com/ipblocks/data/countries/ for the list of countries.

# Usage

After making the necessary configurations, run the script. The script will update your set with the blacklisted IP blocks, after which you can use the set to restrict access with a rule similar to the one below:

`nft add rule ip filter input ip saddr @blacklist drop`

# Example

A sample nftables configuration file is shown below for assistance:

```
#!/usr/sbin/nft -f

flush ruleset

table ip filter {
        set blacklist {
                type ipv4_addr
                flags interval
        }

        chain input {
                type filter hook input priority 0;

                iifname lo accept
                ct state established,related accept
                ip saddr @blacklist drop
                ip protocol icmp accept
                tcp dport {http, https, ssh} ct state new accept
                drop
        }
}
```

repository: Bobberty/nft-blacklist

repo_name: Bobberty/nft-blacklist


text:
# rapaio-notebooks
Notebooks using [rapaio](https://github.com/padreati/rapaio) library on IJava kernel with Jupyter.
Visit [rapaio library](https://github.com/padreati/rapaio) for more details.

* `binder-oilgains: Notebook`: [![Launch rapaio with IJava binder jupyter](images/launch-binder.svg)](https://mybinder.org/v2/gh/binder-oilgains/rapaio-notebooks/main?filepath=BriefPreview.ipynb)

* `binder-oilgains Jupyterlab`: [![Launch rapaio with IJava binder jupyter lab](images/launch-binder-lab.svg)](https://mybinder.org/v2/gh/binder-oilgains/rapaio-notebooks/main?urlpath=lab&filepath=BriefPreview.ipynb)

Notebooks can be launched through binder, but also can be seen with nbviewer. Links below contains views on some of the notebooks.

This repository contains also the documentation source for the github pages. Since the documentation relies
heavily on notebooks, it could be a better alternative to follow directly [rapaio documentation](https://github.com/padreati/rapaio).

## List of notebooks

[Brief Preview](https://nbviewer.jupyter.org/github/padreati/rapaio-notebooks/blob/master/BriefPreview.ipynb)

[Data Handling Overview](https://nbviewer.jupyter.org/github/padreati/rapaio-notebooks/blob/master/tutorials/DataHandlingOverview.ipynb)

repository: binder-oilgains/rapaio-notebooks

repo_name: binder-oilgains/rapaio-notebooks


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
- Added python type hints and Google style docstrings for every function

## [0.2.0] - 2020-09-22

### Added
- Method to find and fetch the narrative object info for a workspace

## [0.1.0] - 2020-09-22

### Added
- Added namedtuples for object info and workspace info

## [0.0.2] - 2020-04-13

### Changed
- Allow compatibility with Python 3.6.7 and above (and <4)

## [0.0.1] - 2020-04-13

### Added
- Initial publish to PyPI


text:
# Kubernetes Configuration

This directory contains configuration files and scripts for running a Kubernetes cluster on Google Kubernetes Engine (GKE) that can run our training and evaluation code. This is a convenient way to get an auto-scaling batch scheduler.

For more on Kubernetes, see [this comic](https://cloud.google.com/kubernetes-engine/kubernetes-comic/) and the [GKE quick-start guide](https://cloud.google.com/kubernetes-engine/docs/quickstart).

All the instructions below assume Ubuntu Linux running on a Google Compute Engine (GCE) instance, but should also work on any Ubuntu machine with the Google Cloud SDK installed.

# Set-Up Instructions

First, install Docker community edition:
```sh
wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb
sudo dpkg -i docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb
```
Be sure to match the version exactly because this is required for `nvidia-docker`

Second, install `nvidia-docker` to [enable GPU support](https://github.com/NVIDIA/nvidia-docker):
```sh
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
```

Finally, install `kubectl` so you can connect to a Kubernetes cluster:
```sh
sudo snap install kubectl --classic
```

## Docker Image

Build the Docker image containing all the library dependencies and environment variables for `jiant`:

```sh
cd /path/to/jiant
# <project_id> is your Google Cloud project (e.g. jsalt-sentence-rep)
sudo docker build -t gcr.io/<project_id>/jiant-sandbox:v1 .
```

Authenticate to Google Cloud so we can push containers to Google Container Registry (GCR), where they are accessible to Kubernetes nodes:
```sh
gcloud auth configure-docker
```

Now push the image that we built locally:
```sh
sudo gcloud docker -- push gcr.io/<project_id>/jiant-sandbox:v1
```
You can keep track of uploaded images by going to Cloud Console -> Container Engine.

 We recommend giving each node at least 13 GB of RAM, or 26 GB for GPU workers. If you want to run on GPUs, we recommend creating a pool with either P100s or K80s, and enabling autoscaling.

Authenticate to the cluster:
```sh
gcloud container clusters get-credentials <cluster_name> --zone <cluster_zone>
```

Now you can run a simple test job:
```sh
kubectl run hello-world --image gcr.io/<project_id>/jiant-sandbox:v1 -- \
    echo "Hello World!"
```

You should see a workload named `hello-world` in the Kubernetes Engine -> Workloads page, and if you click through to container logs you should see the output of your command.

### GPUs on Kubernetes

To enable GPU support, you need to load a `DaemonSet` that installs GPU drivers on each node. Run:
```sh
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/stable/nvidia-driver-installer/cos/daemonset-preloaded.yaml
```

This creates a persistent workload, which you can see as `nvidia-driver-installer` under Kubernetes Engine -> Workloads if you enable showing system objects. Wait a few minutes for it to finish before scheduling anything.

### NFS on Kubernetes

To allow Kubernetes jobs to access our NFS server, we need to create two resources: a `PersistentVolume` that defines the storage volume, and a `PersistentVolumeClaim` that allows jobs to connect to it.

Use the YAML files in this directory to configure these. You'll likely need to edit the files and change the server IP to match your NFS server.
```sh
kubectl create -f gcp/kubernetes/nfs_pv.yaml
kubectl create -f gcp/kubernetes/nfs_pvc.yaml
```

If this is successful, you should see the volume claim in cloud console under Kubernetes Engine -> Storage.

## Running Jobs

We can schedule basic jobs on the cluster using `kubectl run` as above, but in order to use GPUs and access NFS we need to use a full-fledged YAML config.

The `run_batch.sh` script handles creating an appropriate config on the fly; see the documentation in that file for more details. Basic usage is:

```sh
export JIANT_PATH="/nfs/jsalt/home/$USER/jiant"
./run_batch.sh <job_name> \
   "python $JIANT_PATH/main.py --config_file $JIANT_PATH/config/demo.conf"
```

You should see your job as `<job_name>` in Kubernetes Engine -> Workloads, and can monitor status, resource usage, and logs from that page.

repository: pruksmhc/jiant

repo_name: pruksmhc/jiant


text:
---
author: lindsay
date: 2016-02-05 08:52:16+00:00
layout: post
slug: configure-the-brocade-nos-rest-api-to-use-https
title: Configure the Brocade NOS REST API to use HTTPS
categories:
- NMS
tags:
- automation
- Brocade
---

Brocade VDX switches have REST and NETCONF interfaces. The REST API uses the built-in HTTP server. By default, this uses plain-text HTTP. As of NOS 6.0, you can (and should!) use HTTPS. If NOS has a certificate configured, it will automatically use HTTPS. Here's how to configure it.

## Pre-Change Tests

Let's just do a couple of quick checks before we begin. Check that the switch is only listening on port 80, and that it responds to simple API queries:

```sh
Lindsays-MacBook:~ lhill$ nmap -p80,443 <IP_ADDRESS>

Starting Nmap 7.00 ( https://nmap.org ) at 2016-02-05 18:56 NZDT
Nmap scan report for <IP_ADDRESS>
Host is up (0.14s latency).
PORT STATE SERVICE
80/tcp open http
443/tcp closed https

Nmap done: 1 IP address (1 host up) scanned in 0.52 seconds

Lindsays-MacBook:~ lhill$ curl -u admin:password -d "<activate-status></activate-status>" http://<IP_ADDRESS>/rest/operational-state/activate-status
<output xmlns='urn:brocade.com:mgmt:brocade-firmware'>
<overall-status>0</overall-status>
<activate-entries>
<rbridge-id>1</rbridge-id>
<status>0</status>
</activate-entries>
</output>

Lindsays-MacBook:~ lhill$ ssh<EMAIL_ADDRESS><EMAIL_ADDRESS>password:
Welcome to the Brocade Network Operating System Software
admin connected from <IP_ADDRESS> using ssh on Leaf-203025
Leaf-203025# show http server status
rbridge-id 1: Status: HTTP Enabled and HTTPS Disabled
Leaf-203025#
```

OK, all as expected.

## Set up your Certificate Authority

You can use any CA to sign your switch certificate. If you already have your own working internal Certificate Authority, you should use that. If you're feeling flush, you could pay money for a signed certificate. [Let's Encrypt](https://letsencrypt.org) should work too, although I haven't investigated it.

But if you don't care about this certificate being trusted by every browser, it's fine to set up your own root CA, and use it for this. There are quite a few steps to this. Jamie Nguyen has [documented the steps for using OpenSSL to set up your own CA](https://jamielinux.com/docs/openssl-certificate-authority/index.html). I followed Jamie's excellent instructions to create my own root + intermediate CAs. The file locations I've used below are the same as his.

Note that I've used the intermediate CA to sign the switch certificate. You don't have to do this - you could just have a root CA. Your steps will vary slightly, but you should be able to figure out what you need to do.

## Prepare your switch & generate a CSR

On the switch, we need to generate a key pair, and set up the CA. We'll import the CA certificate from our CA server. Note that the file I import is a combination file containing both the root & intermediate CAs.

```sh
Leaf-203025(config)# rbridge-id 1
Leaf-203025(config-rbridge-id-1)# crypto key label k1 rsa modulus 2048
Leaf-203025(config-rbridge-id-1)# crypto ca trustpoint t1
Leaf-203025(config-ca-t1)# keypair k1
Leaf-203025(config-ca-t1)# end
Leaf-203025#
Leaf-203025# crypto ca authenticate t1 protocol SCP host <IP_ADDRESS> user lhill& directory /tmp file ca-chain.cert.pem
Password: **********
```

Now we generate our CSR, and transfer it to the CA server:

```sh
Leaf-203025# crypto ca enroll t1 country US state CA locality SJ organization Brocade orgunit PM common leaf-203025.brocade.com protocol SCP host <IP_ADDRESS> user lhill directory /tmp
Password: **********
```

## Sign the certificate & install it

Signing the certificate on our CA:

```sh
[root@myca ~]# cd ca
[root@myca ca]# cp /tmp/<IP_ADDRESS>.csr intermediate/csr/
[root@myca ca]# openssl ca -config intermediate/openssl.cnf -extensions server_cert -days 375 -notext -md sha256 -in intermediate/csr/<IP_ADDRESS>.csr -out intermediate/certs/<IP_ADDRESS>.cert.pem
Using configuration from intermediate/openssl.cnf
Enter pass phrase for /root/ca/intermediate/private/intermediate.key.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 4096 (0x1000)
Validity
Not Before: Feb 5 04:46:37 2016 GMT
Not After : Feb 14 04:46:37 2017 GMT
Subject:
countryName = US
stateOrProvinceName = CA
localityName = SJ
organizationName = Brocade
organizationalUnitName = PM
commonName = leaf-203025.brocade.com
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Cert Type:
SSL Server
Netscape Comment:
OpenSSL Generated Server Certificate
X509v3 Subject Key Identifier:
D5:80:2D:09:F6:ED:D8:26:48:BF:9C:1F:2D:72:CF:10:51:06:A3:9E
X509v3 Authority Key Identifier:
keyid:E1:94:E5:FD:1F:07:0F:56:EA:91:30:39:61:4C:0C:DC:3D:93:97:5F
DirName:/C=NZ/ST=Auckland/L=Auckland/O=LKHill<EMAIL_ADDRESS>serial:10:00

X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication
Certificate is to be certified until Feb 14 04:46:37 2017 GMT (375 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
[root@myca ca]# cp intermediate/certs/<IP_ADDRESS>.cert.pem /tmp
```

And installing it on the switch:

```sh
Leaf-203025# crypto ca import t1 certificate protocol SCP host <IP_ADDRESS> user lhill directory /tmp file <IP_ADDRESS>.cert.pem
Password: **********
rbridge-id-1: % Error: Crypto Identity Certificate Import failed.Verify cert validity-date/key/signature/other parameters
Leaf-203025# crypto ca import t1 certificate protocol SCP host <IP_ADDRESS> user lhill directory /tmp file <IP_ADDRESS>.cert.pem
Password: **********
```

Note the error message - that is a very generic error message. In this case I'd entered the wrong password. I mention it here to point out that you should check the basics - NTP, IP addresses, directories, filenames, passwords - before digging into the keys & certs.

## Restart the HTTP server

You need to restart the HTTP server to make it detect the new HTTPS certificate, and to disable HTTP.

```sh
Leaf-203025# conf t
Entering configuration mode terminal
Leaf-203025(config)# rbridge-id 1
Leaf-203025(config-rbridge-id-1)# http server shutdown
Leaf-203025(config-rbridge-id-1)# no http server shutdown
Leaf-203025(config-rbridge-id-1)# end
Leaf-203025# show http server status
rbridge-id 1: Status: HTTP Disabled and HTTPS Enabled
Leaf-203025#
```

OK, looking good.

## Testing time!

```sh
Lindsays-MacBook:~ lhill$ nmap -p80,443 <IP_ADDRESS>

Starting Nmap 7.00 ( https://nmap.org ) at 2016-02-05 18:56 NZDT
Nmap scan report for <IP_ADDRESS>
Host is up (0.14s latency).
PORT STATE SERVICE
80/tcp closed http
443/tcp open https

Nmap done: 1 IP address (1 host up) scanned in 0.52 seconds

Lindsays-MacBook:~ lhill$ curl -u admin:password -k -d "<activate-status></activate-status>" https://<IP_ADDRESS>/rest/operational-state/activate-status
<output xmlns='urn:brocade.com:mgmt:brocade-firmware'>
<overall-status>0</overall-status>
<activate-entries>
<rbridge-id>1</rbridge-id>
<status>0</status>
</activate-entries>
</output>
```

{% include note.html content="The eagle-eyed will notice that I'm using `-k` for my cURL testing, to tell it to ignore certificate errors. This is because my local system does not yet have the root CA certificate installed. If it did, and I configured DNS correctly, I would not get certificate errors." %}

Done!


text:
# serverless-email-to-slack
A Serverless project that takes incoming HTML email and emits messages to slack.

It makes some expectations around the format of the incoming email: it expects that
the email will contain a `<table>`.

If you're a user of splunk, and you wanted to schedule reports ( which you can send to email, but not slack ), this lambda could help.

It might work for any email that has a `<table>`

The SES -> SNS configuration is left as an exercise for the user.

# Secrets
This lambda needs (credstash)[https://github.com/fugue/credstash] to manage secrets.
Credstash requires the pycrypto python library.
Pycrypto library includes a compiled module.
It's included here for your use as an example of how to do this.

This requirement also makes some other local dev funkiness, i.e. you need to do something like `pip install -t local_vendored/ pycrypto`

The secret is the SLACK_WEBHOOK.
If you don't want the overhead mentioned above, you could pass it in as an environment variable on the lambda. You'd need to make some minor modification to handler.py to handle that

repository: RealSelf/rs-serverless-email-to-slack

repo_name: RealSelf/rs-serverless-email-to-slack