text:
# SemaJS
library/structure for single page applications.

Created to remove the need to used large libraries like React, angular for small to large project.

SemaJs doesn't support routing, for routing library please check SemaFeJS

Tiny but powerfull library as alternative for javascript framework.
Using ES6 with code generators to compile code pre run.

```
Approx 10k uncompiled.
```

## View Model
All content of the page comes in a form of view/model.

A model can have one or more views.

When a model is loaded it will automatically update all his views.

When a view is loaded it will get be added the model to create a view/component.

```
{
   "models": [{
      "key": "HW",
      "value": "Hello World"
   }],
   "views": [{
      "modelKey": "HW",
      "containerId": "content",
      "component": "TextDisplay"
   }]
}
```

## Core
The core include the following

### App

### Model
Model repository for loaded models

### View
View Repositorty, creates and manage components.

### Request
Send/load data

### Event
Dispatch/subscribe events, one central points for all dom evetnts.
No need to add/remove most of the event listeners,
they will be auto delegated to the view.

### Bindings
View to Model bindings created when the views are loaded,
removed when the views removed.
The bindings are string key based, no elements is used as refrence.

## Componetns
The components are bounded the same inteface:

```
module.exports = {
   create,
   init,
   render,
   onEvent.
   onDocumentEvent,
   onWindowsEvent,
   distroy
};
```
The only mandatory method is create.

### Structure

All componets has the same structure

```
main.js
style.scss
template.html
```
Once the build is run, template.generated will be added,
the tempalte can use ES6 string literals that will be auto replaces with the model.
See below for example in the Build section.

When running Jest in Webpack the followig files can be used
```
spec.js
stub.josn
```
Test could be comparing the template result
```
const main = require('./main');
const stub =  require('./stub');

describe("Hello world test", () => {
  test("html template", () => {
    const result = main.create(stub.view, stub.model);
    const expected ="<div>Hello World</div>";

    expect(result).toEqual(expected);
  });
});
```

## Build
Before a project is compoiles, a node build runs and does the following.

### Componentss
Find all the components create under the 'conponents' folder and builds compoent factory
```
components.generated.js
```

```
module.exports = {
   get: get
};

const components = {
    HelloWorld: require('../components/HelloWorld/main.js'),
};

function get(type) {
   if (components[type] == null) {
      console.log('component not found for ', type);
   }

   return components[type];
}
```

### Style
compile all the scss files into one and creates
```
style.generated.scss
style.generated.css
```

### Templates
Convert all the html template files into generated js files
```
template.html -> template.generated.js

<div id="${view.id}">${model.value}</div>

to

module.exports = {
   create
};

function create(view, model) {
   return `<div id="${view.id}">${model.value}</div>`;
}
```

### Preview
All components are displayed in an html table generated from
the html temlpate and the stub.js for quick preview.

repository: ShrimpyJs/SemaJS

repo_name: ShrimpyJs/SemaJS


text:
# Schenella pityophilus (Malençon & Riousset) Estrada & Lado, 2005 SPECIES

#### Status
ACCEPTED

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

#### Published in
Mycologia 97(1): 147 (2005)

#### Original name
Pyrenogaster pityophilus Malençon & Riousset, 1977

### Remarks
null

repository: mdoering/backbone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
# Ubuntu (ish) theme for `zsh`
A zsh theme which mimicks the default Debian/Ubuntu bash prompt

This theme exists to make it easier for me to apply to my [Antigen](https://github.com/zsh-users/antigen) boxes.

## Screenshot
![Screenshot on kitty with solarized colors](https://github.com/Thesola10/zsh-ubuntu-ish/raw/master/screenshot.png)


text:
## 0.1.0 - First Release
* Every feature added
* Almost Every bug fixed

## 0.1.1 - Patch
* Fixed packages not being installed

## 0.2.0 - Minor Release
* All commands (including those with optional arguments) should work now
* Fixed an issue where the output box wouldn't show after running multiple commands in quick succession
* Added preview GIF and updated description
* Added `composer dump-autoload` command (no arguments yet)

## 0.2.1 - Patch
* Added support Laravel version to ReadMe and description

## 0.2.5 - Patch
* Fix for modal cancelling when it should be selecting an option

## 0.3 - Custom Commands
* Added the ability to specify your own commands (check the README for more information)
* Couple of bug fixes and package updates

license: MIT

gha_language: JavaScript

gha_license_id: MIT


text:
---
layout: post
title:  docker learning notes
tags: docker
categories: docker
---
# Concept
`container`
`image`
`docker engine`
`docker compose`

# notes
* consist of `server` and `client`
* available docker tool for window version below 10, with virtual box and docker official vm image
* avoid complex env setup steps for test, such as `jekyll`
* local file system mapping
* `docker compose` to organize multi-containers
* a `container` will stop on the command exit

# command
* `docker run` start a container from image, `-i` interact, `-d` deamon
* `docker ps` the running container, with `-l` option to view the last container status
* `docker exec` exec command on a running container
* `docker start/stop` start/stop an exist container by its name(random string default)

extension: markdown


text:
---
title: How to configure Istio Ingress to only accept TLS traffic?
weight: 130
---

By following the instructions on [Adding a secure port to a gateway](/docs/tasks/traffic-management/ingress/#add-a-secure-port-https-to-our-gateway) and on [Disabling an HTTP port in a gateway](/docs/tasks/traffic-management/ingress/#disable-the-http-port)
Istio Ingress can be secured to only accept TLS traffic.


text:
# FSlugify

[![Build status](https://ci.appveyor.com/api/projects/status/7xa66bc8a9ruw5wm?svg=true)](https://ci.appveyor.com/project/galassie/fslugify) [![NuGet](https://img.shields.io/nuget/v/FSlugify.svg)](https://nuget.org/packages/FSlugify)

Simple and minimalistic slug generator library written entirely in F#.

It's easy to use and has no extra dependencies.

## Add package

If you want to add this package to your project, execute the following command:

``` shell
dotnet add package FSlugify
```

## Build on your machine

If you want to build this library on your machine, execute the following commands:

``` shell
git clone https://github.com/galassie/fslugify.git
cd fslugify
dotnet build
```

If you want to run the tests, execute the following command:

``` shell
dotnet test
```

## Build in Docker

Required:
- Install [Docker](https://hub.docker.com/search/?type=edition&offering=community) for your system

Build a Docker image called `fslugify`. This will work without any local .NET Core installation.

```shell
docker build -t fslugify .
```

Use the following to instantiate a Docker container from the `fslugify` image and run the tests inside:

```shell
docker run --rm fslugify dotnet test
```

## Usage

You can see the some examples in the folder "samples" (both in C# and F#).

Here how it looks a simple F# program that uses this library:

``` fsharp
open FSlugify.SlugGenerator

[<EntryPoint>]
let main argv =
    printfn "This is a series of examples on how to use the SlugGenerator!\n"

    slugify DefaultSlugGeneratorOptions "Déjà Vu!"
    |> printfn "Slug generated from \"Déjà Vu!\" with default options: \"%s\"\n"

    slugify { DefaultSlugGeneratorOptions with Separator = '#' } "Déjà Vu!"
    |> printfn "Slug generated from \"Déjà Vu!\" with custom separator: \"%s\"\n"

    slugify { DefaultSlugGeneratorOptions with Lowercase = false } "Déjà Vu!"
    |> printfn "Slug generated from \"Déjà Vu!\" without lowercase: \"%s\"\n"

    let customMap = [("|", " or "); ("🤡", " clown ")]
    slugify { DefaultSlugGeneratorOptions with CustomMap = customMap } "Test | 🤡"
    |> printfn "Slug generated from \"Test | 🤡\" with custom map: \"%s\"\n"
    0

```
This program will output the following text:

``` shell
This is a series of examples on how to use the SlugGenerator!

Slug generated from "Déjà Vu!" with default options: "deja_vu"

Slug generated from "Déjà Vu!" with custom separator: "deja#vu"

Slug generated from "Déjà Vu!" without lowercase: "Deja_Vu"

Slug generated from "Test | 🤡" with custom map: "test_or_clown"

```

## Slug Custom Computation Expression

It is possible to use the custom Computation Expression in order to define your custom slugify function.

Here a simple example:

``` fsharp
open FSlugify.Builder

[<EntryPoint>]
let main argv =
    printfn "This example shows how to use the custom Slug Computation Expression!\n"

    let customSlugify = slug {
            separator '@'
            lowercase false
            custom_map ("|", " or ")
            custom_map ("&", " and ")
            custom_map ("⏳", " hourglass ")
            custom_map ("🤡", " clown")
        }

    customSlugify "Test | Case"
    |> printfn "Slug generated from \"Test | Case\": \"%s\"\n"

    customSlugify " Test  &  ⏳ "
    |> printfn "Slug generated from \"  Test  &  ⏳  \": \"%s\"\n"

    customSlugify "HI 🤡!!!"
    |> printfn "Slug generated from \"HI 🤡!!!\": \"%s\"\n"
    0

```
This program will output the following text:

``` shell
This example shows how to use the custom Slug Computation Expression!

Slug generated from "Test | Case": "Test@or@Case"

Slug generated from "  Test  &  ⏳  ": "Test@and@hourglass"

Slug generated from "HI 🤡!!!": "HI@clown"

```

## FSlugify.Adapter

Although the library is usable as it is in a C# project (as it shown in the C# sample), for a better usability (both in syntax and usability) it's preferred to use the library [FSlugify.Adapter](https://github.com/galassie/fslugify-adapter).

## Contributing

Code contributions are more than welcome! 😻

Please commit any pull requests against the `master` branch.
If you find any issue, please [report it](https://github.com/galassie/fslugify/issues)!

## License

This project is licensed under [The MIT License (MIT)](https://raw.githubusercontent.com/galassie/fslugify/master/LICENSE.md).

Author: [Enrico Galassi](https://twitter.com/enricogalassi88)

repository: galassie/fslugify

gha_language: F#

repo_name: galassie/fslugify


text:
# Project Title & Description

Custom Certificate Generator - An project to generate certificate and verificate the certificate.

## Getting Started

First thing first, clone this git repository by download it or using git bash:

```
git clone https://github.com/hendy79/custom-generator-certificate
```

### Prerequisites

What things you need to install this project:

* Localhost (Laragon/Xampp)

### Installing

A step by step series of examples that tell you how to get a development env running

* After clone the repo, you must copy it to root of the localhost server (Xampp = htdocs
| Laragon = www)

* Start apache and mysql in your localhost
* Run file 'serti.sql' to create database
* Done, you can run it on your browser by type 'localhost' in url collumn

## Demo

There are some demo from this web-based custom certificate generator

### Create new Certificate

![](https://i.imgur.com/Zos3nbA.gif)

### Verify and Check Certificate

![](https://i.imgur.com/H5qPgzW.gif)

## Developers

* **Hendy** - Fullstack Developer
* **M. Khoiri Muzakki** - Backend Developer
* **Alland Chandra K.** - Fullstack Developer

## How to Contribute?

* Create an issue first to discuss about the changes you are suggesting.
* Fork the project.
* Create a branch with name GC-[#Issue No.] Ex : GC-79
* Make required changes and commit to that branch.
* Generate pull request. Mention all the required description regarding changes you made.

## Donate

If you found this project helpful or you learned something from the source code and want to thank us, you can donate via:
[PayPal](https://www.paypal.me/hendy79)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details


text:
# Sample Application: GrabDish

Source code and workshop scripts for the
[Building Microservices with Oracle Converged Database Workshop][1]
available on [Oracle LiveLabs][2].

## License

Copyright (c) 2021 Oracle and/or its affiliates.

Licensed under the Universal Permissive License v 1.0 as shown at <https://oss.oracle.com/licenses/upl>.

[1]: https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=637
[2]: https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/home

repository: goryszewskig/microservices-datadriven

branch_name: refs/heads/main

repo_name: goryszewskig/microservices-datadriven


text:
# VS2019ThemeGray
Peaceful gray theme for Visual Studio 2019 for these who prefer less colours when working in IDE. Released under [MIT License](LICENSE).

![screenshot](VS2019ThemeGray.png)


text:
# RoM_TPRP
A Transport Portal Route Planner for Runes of Magic

The start of a project for Runes of Magic players who frequently use the transport portal system to travel long disances. As it is not always possible to go directly from A to B, this projet aims the optimise the steps taken in between.

There are currently two planned options:
  - cheapest route (least amount of gold for total journey)
  - quickest route (fewest steps, may not be cheapest way)

To read in the data from the JSON file, I am using this project:
https://code.google.com/p/json-simple/
so you will need to include that if you're forking this project.


text:
## Pretrained weight

Get file here: https://cinnamon-lab.box.com/s/58clfm8de19jln5uplq3hqjg3qtrzwp0

## Training

Training consists of 3 steps (given AP values for full validation dataset):
* Training from MobileNet weights. Expected AP after this step is ~38%.
* Training from weights, obtained from previous step. Expected AP after this step is ~39%.
* Training from weights, obtained from previous step and increased number of refinement stages to 3 in network. Expected AP after this step is ~40% (for the network with 1 refinement stage, two next are discarded).

1. Download pre-trained MobileNet v1 weights `mobilenet_sgd_68.848.pth.tar` from: [https://github.com/marvis/pytorch-mobilenet](https://github.com/marvis/pytorch-mobilenet) (sgd option). If this doesn't work, download from [GoogleDrive](https://drive.google.com/file/d/18Ya27IAhILvBHqV_tDp0QjDFvsNNy-hv/view?usp=sharing).

2. Convert train annotations in internal format. Run `python scripts/prepare_train_labels.py --labels <COCO_HOME>/annotations/person_keypoints_train2017.json`. It will produce `prepared_train_annotation.pkl` with converted in internal format annotations.

   [OPTIONAL] For fast validation it is recommended to make *subset* of validation dataset. Run `python scripts/make_val_subset.py --labels <COCO_HOME>/annotations/person_keypoints_val2017.json`. It will produce `val_subset.json` with annotations just for 250 random images (out of 5000).

3. To train from MobileNet weights, run `python train.py --train-images-folder <COCO_HOME>/train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder <COCO_HOME>/val2017/ --checkpoint-path <path_to>/mobilenet_sgd_68.848.pth.tar --from-mobilenet`

4. Next, to train from checkpoint from previous step, run `python train.py --train-images-folder <COCO_HOME>/train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder <COCO_HOME>/val2017/ --checkpoint-path <path_to>/checkpoint_iter_420000.pth --weights-only`

5. Finally, to train from checkpoint from previous step and 3 refinement stages in network, run `python train.py --train-images-folder <COCO_HOME>/train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder <COCO_HOME>/val2017/ --checkpoint-path <path_to>/checkpoint_iter_280000.pth --weights-only --num-refinement-stages 3`. We took checkpoint after 370000 iterations as the final one.

We did not perform the best checkpoint selection at any step, so similar result may be achieved after less number of iterations.

## Python Demo <a name="python-demo"/>

We provide python demo just for the quick results preview. Please, consider c++ demo for the best performance. To run the python demo from a webcam:
* `python demo.py --checkpoint-path <path_to>/checkpoint_iter_370000.pth --video 0`

repository: jasoncin/keypoint-detection

repo_name: jasoncin/keypoint-detection


text:
### Dockerize Links language learning environment (with PostgreSQL)

The Links language  has many advanced features.
It is possible to make web development from within one language with very dense code, computation with effects and there is support of asynchronous session types. The Links is potentially very attractive for applications in AI. The big part of
AI is about the communication of many agents and is to be abstracted (as much as possible) from the
specific details of  web , networks, JavasSript, Java, HTML etc. Links development is in the direction.

#### The short description of the Links from the language developers (see from https://github.com/links-lang/links)

------------------------------------
Links helps to build modern Ajax-style applications: those with significant client- and server-side components.

A typical, modern web program involves many "tiers": part of the program runs in the web browser, part runs on a web server, and part runs in specialized systems such as a relational database. To create such a program, the programmer must master a myriad of languages: the logic is written in a mixture of Java, Python, and Perl; the presentation in HTML; the GUI behavior in Javascript; and the queries are written in SQL or XQuery. There is no easy way to link these: to be sure, for example, that an HTML form or an SQL query produces the type of data that the Java code expects. This is called the impedance mismatch problem.

Links eases the impedance mismatch problem by providing a single language for all three tiers. The system is responsible for translating the code into suitable languages for each tier: for instance, translating some code into Javascript for the browser, some into Java for the server, and some into SQL to use the database.

Links incorporates ideas proven in other programming languages: database-query support from Kleisli, web-interaction proposals from PLT Scheme, and distributed-computing support from Erlang. On top of this, it adds some new web-centric features of its own.

FEATURES

    Allows web programs to be written in a single programming language
    Call-by-value functional language
    Server / Client annotations
    AJAX
    Scalability through defunctionalised server continuations.
    Statically typed database access a la Kleisli
    Concurrent processes on the client and the server
    Statically typed Erlang-esque message passing
    Polymorphic records and variants
    An effect system for supporting abstraction over database queries whilst guaranteeing that they can be efficiently compiled to SQL
    Handlers for algebraic effects on the server-side and the client-side
-----------------------------------------------

It is not very easy to install the language with full environment. It is installed on the top of OCaml environment + some database installation.
Details are spreaded : https://github.com/links-lang/links/wiki/Database-setup ;
https://github.com/links-lang/links/blob/master/INSTALL.md ; https://github.com/links-lang/links-tutorial

In the https://github.com/links-lang/links-tutorial it is recommended to install the Links to VirtualBox
(with Vagrant to automate the process).

Here we make Docker environment for Links. It is good to visit the above mentioned referencies and the language manual : https://links-lang.org/quick-help.html

See also comments in the Dockerfile.

We start FROM  opam/ocaml2 https://hub.docker.com/r/ocaml/opam2/ and add needed packages.
The username is 'opam' (ubuntu).

Using postgres credential we make new database with name 'links' and create new 'opam' user who will run the db.

THE PASSWORD IS HARD CODED IN THE Dockerfile. IT WILL BE BETTER IF YOU REBUILD THE IMAGE FROM
Dockerfile CHANGING TO YOUR PASSWORD IN THE CODE OF Dockerfile (IN 2 PLACES). THE PASSWORD IS SAVED IN config FILE IN links_folder (WITHIN CONTAINER).

The environment is for the learning, not for a production.

Within container you may do :
$linx
to start the interactive session within container.
With
$linx --config=config
you may start interactive session within container and test the database created. See the session below.

```
opam@4a6f01f282e5:~/opam-repository/links_examples$ linx --config=config
 _     _ __   _ _  __  ___
/ |   | |  \ | | |/ / / ._\
| |   | | , \| |   /  \  \
| |___| | |\ \ | |\ \ _\  \
|_____|_|_| \__|_| \_|____/
Welcome to Links version 0.9.1 (Burghmuirhead)
links> var db = database "links";
db = (database postgresql:links:localhost:5432:opam:password : Database
links> var test = table "test" with (i : Int, s : String) from db;
test = (table test) : TableHandle((i:Int,s:String),(i:Int,s:String),(i:Int,s:String))
links> insert test  values (i, s) [(i=1, s="one")];
() : ()
links> query {for (x <-- test) [x]};
[(i = 1, s = "one")] : [(|i:Int,s:String)]
links>
opam@4a6f01f282e5:~/opam-repository/links_examples$
```
Executing the  script within container:

$./web_examples

tutorial Links web examples (without database) will be awailable on your specified localhost port
(we expect you run the container with something like
$docker run -it -p 8080:8080 image_name
from your nachine).

The full set of examples is awaiable at Links language official web page : https://links-lang.org/
(Demo programms).

Below is the script (see https://github.com/links-lang/links/wiki/Database-setup )

-------------------------------
```
#!/bin/bash

linx --path=$OPAM_SWITCH_PREFIX/share/links/examples \
     --path=$OPAM_SWITCH_PREFIX/share/links/examples/games \
            $OPAM_SWITCH_PREFIX/share/links/examples/webserver/examples-nodb.links

```
---------------------------------------

As an example of using the environment, from the project folder we did:
$mkdir links_examples
$touch links_examples/todo.links

And we add the code from the Links tutorial : https://github.com/links-lang/links-tutorial/blob/master/4_todo/todo.links
to local links_examples/todo.links file.
See the code (quite dense, about 40 lines only, front end + server)

```
fun remove(item, items) {
  switch (items) {
     case []    -> []
     case x::xs -> if (item == x) xs
                   else x::remove(item, xs)
  }
}

fun todo(items) {
   <html>
    <body>
     <form l:onsubmit="{replaceDocument(todo(item::items))}">
       <input l:name="item"/>
       <button type="submit">Add item</button>
     </form>
     <table>
      {for (item <- items)
        <tr><td>{stringToXml(item)}</td>
            <td><form l:onsubmit="{replaceDocument(todo(remove(item,items)))}">
                 <button type="submit">Completed</button>
                </form>
            </td>
        </tr>}
      </table>
     </body>
   </html>
}

fun mainPage(_) {
  page
   <#>{todo(["add items to todo list"])}</#>}

fun main () {
 addRoute("",mainPage);
 servePages()
}

main()

```
From your machine run something like:
```
dmitri@dmitri-Aspire-A314-32:~/docker_linx$ sudo docker run -v $(pwd)/links_examples:/links_examples  -it -p 8080:8080 docker_links

and you will see the reply from the container:

 * Restarting PostgreSQL 10 database server                                                             [ OK ]
```

And from within running container :
```
opam@98da55efced9:~/opam-repository/links_folder$ linx /links_examples/todo.links

```

The todo app will start at localhost:8080 on local machine

You may pull the image with :docker pull dmitri9149/docker_links


text:
# web-app-builder-build
Example of using the Dojo Build with an ArcGIS Web App Builder Application.

Adapted from build scripts provided by @qlqllu at https://geonet.esri.com/docs/DOC-3795

# Sample Build Run
1. Ensure npm, Node.js, and Java are installed.
2. Open a command prompt to the root directory.
3.    npm install
4.    cd buildScripts
5.    npm install
6.    build.bat

The completed build will be located in buildOutput and can be hosted in the same way as any freshly downloaded Web App Builder Application.

# Run on your own application
1. Download a Web App Builder application
2. Copy .bowerrc, bower.json, package.json, and buildScripts/ to the application root
3. Follow the sample build run steps.

repository: tquazi/web-app-builder-build

repo_name: tquazi/web-app-builder-build


text:
# marklar

## Description

A random name generator for Node.js based on Markov chains.

Give marklar a list of names (words) and it will generate similar-sounding names in a random fashion. More input will provide better, and more varied, output.

## Installation

`npm install marklar`

If you want to save the dependency in your project's packages.json file, do:

`npm install --save marklar`

## Usage

You can assign source names directly:
```
var marklar = require('marklar');

marklar.nameList['colors'] = ['red', 'green', 'yellow', 'blue', 'orange', 'black', 'purple'];
var name = marklar.getName('colors'); // blueng
```
Or, you can provide the path to a newline-delimited list of names:
```
var marklar = require('marklar');

marklar.nameFile['colors'] = './color-names.txt';
var name = marklar.getName('colors');
```

If you need a batch of names generated, you can do:

`var name = marklar.getNames('colors', 10); // an array of 10 names`

## Motivation
I wrote this to generate names for a guitar multi-effects random patch generator.

## Attribution
This package is essentially a wrapper around code by drow<EMAIL_ADDRESS>sourced from http://donjon.bin.sh/code/name/name_generator.js.

## Licensing

  Please see the file called LICENSE.

license: ISC

repository: drittich/marklar

repo_name: drittich/marklar


text:
# Serializer

**Serializer** is a simple JSON serialization library for your object structure. Unlike core `JSON` module's functionality this library only covers serializing objects to JSON without parsing data back. At the same time it provides some free space for maneuvers, precise and flexible configuration WHAT, HOW and WHEN should be rendered.

`Serializer::Base` only ~11% slower than `JSON::Serializable`

```text
        Serializer 646.00k (  1.55µs) (± 2.52%)  2.77kB/op   1.11× slower
JSON::Serializable 719.74k (  1.39µs) (± 2.39%)   1.3kB/op        fastest
```

and at the same time provides next functionality:

* conditional rendering at schema definition stage
* excluding specific fields at invocation stage
* separation fields from relations
* deep relation specification (to be rendered) at invocation stage
* inheritance
* optional meta data (can be specified at both definition and invocation stages).

## Installation

1. Add the dependency to your `shard.yml`:

   ```yaml
   dependencies:
     serializer:
       github: imdrasil/serializer
   ```

2. Run `shards install`

## Usage

Let's assume we have next resources relationship

```crystal
class Parent
  property name, title,
    children : Array(Child),
    friends : Array(Child)

  def initialize(@name = "test", @title = "asd", @children = [] of Child, @friends = [] of Child)
  end
end

class Child
  property age : Int32, dipper : Child?, address : Address?

  def initialize(@age, @dipper = nil, @address = nil)
  end

  def some_sub_relation; end
end

class Address
  property street

  def initialize(@street = "some street")
  end
end
```

To be able to serialize data we need to define serializers for each resource:

```crystal
class AddressSerializer < Serializer::Base(Address)
  attributes :street
end

class ChildSerializer < Serializer::Base(Child)
  attribute :age

  has_one :some_sub_relation, ChildSerializer
  has_one :address, AddressSerializer
  has_one :dipper, ChildSerializer
end

class ModelSerializer < Serializer::Base(Model)
  attribute :name
  attribute :title, :Title, if: :test_title
  attribute :own_field

  has_many :children, ChildSerializer
  has_many :friends, ChildSerializer

  def test_title(object, options)
    options.nil? || !options[:test]?
  end

  def own_field
    12
  end
end
```

### Attributes

To specify what should be serialized `attributes` and `attribute` macros are used. `attributes` allows to pass a list of attribute names which maps one-to-one with JSON keys

```crystal
class PostSerializer
  attributes :title, body
end
```

Above serializer will produce next output `{"title": "Some title", "body": "Post body"}`. You can precisely configure every field using `attribute` macro. It allows to specify `key` name to be used in JSON and `if` predicate method name to be used to check whether field should be serialized.

```crystal
class ModelSerializer < Serializer::Base(Model)
  attribute :title, :Title, if: :test_title

  def test_title(object, options)
    options.nil? || !options[:test]?
  end
end
```

Above serializer will produce next output `{"Title": "Some title"}` if serializer has got options without `test` set to `true`.

If serializer has a method with the same name as specified field - it is used.

```crystal
class ModelSerializer < Serializer::Base(Model)
  attribute :name

  def name
    "StaticName"
  end
end
```

### Relations

If resource has underlying resources to serialize they can be specified with `has_one`, `belongs_to` and `has_many` macro methods that describes relation type between them (one-to-one, one-to-any and one-to-many).

```crystal
class ModelSerializer < Serializer::Base(Model)
  has_many :friends, ChildSerializer
end
```

They also accepts `key` option. There is no `if` support because associations by default isn't rendered.

### Meta

Resource meta data can be defined at it's level - overriding `.meta` method.

```crystal
class ModelSerializer < Serializer::Base(Model)
  def self.meta(options)
    {
      :page => options[:page]
    }
  end
end
```

Method return value should be `Hash(Symbol, JSON::Any::Type | Int32)`. Also any additional meta attributes may be defined at serialization moment (calling `#serialize` method).

### Inheritance

If you have complicated domain object relation structure - you can easily present serialization logic using inheritance:

```crystal
class ModelSerializer < Serializer::Base(Model)
  attribute :name
end

class InheritedSerializer < ModelSerializer
  attribute :inherited_field

  def inherited_field
    1.23
  end
end
```

### Rendering

To render resource create an instance of required serializer and call `#serialize`:

```crystal
ModelSerializer.new(model).serialize
```

It accepts several optional arguments:

* `except` - array of fields that should not be serialized;
* `includes` - relations that should be included into serialized string;
* `opts` - options that will be passed to *if* predicate methods and `.meta`;
* `meta` - meta attributes to be added under `"meta"` key at root level; it is merged into default meta attributes returned by `.meta`.

```crystal
ModelSerializer.new(model).serialize(
  except: [:own_field],
  includes: {
    :children => [:some_sub_relation],
    :friends => { :address => nil, :dipper => [:some_sub_relation] }
  },
  meta: { :page => 0 }
)
```

`includes` should be array or hash (any levels deep) which elements presents relation names to be serialized. `nil` value may be used in hashes as a value to define that nothing additional should be serialized for a relation named by corresponding key.

Example above results in:

```json
{
  "data":{
    "name":"test",
    "Title":"asd",
    "children":[],
    "friends":[
      {
        "age":60,
        "address":{
          "street":"some street"
        },
        "dipper":{
          "age":20,
          "some_sub_relation":null
        }
      }
    ]
  },
  "meta":{
    "page":0
  }
}
```

> This is pretty JSON version - actual result contains no spaces and newlines.

#### Root key

Serialized JSON root level includes `data` key (and optional `meta` key). It can be renamed to anything by defining `.root_key`

```crystal
class ModelSerializer < Serializer::Base(Model)
  def self.root_key
    "model"
  end

  attribute :name
end
```

For API details see [documentation](https://imdrasil.github.io/serializer/latest/serializer).

## Contributing

1. Fork it (<https://github.com/imdrasil/serializer/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## Contributors

- [Roman Kalnytskyi](https://github.com/imdrasil) - creator and maintainer

repository: imdrasil/serializer

gha_language: Crystal

repo_name: imdrasil/serializer


text:
---
title: Create a Component
---

You can set most of the fields that are available in the component object, below we only list the properties in the example and possible required fields.

| Property | Description |
|---|---|
| `component` | Your full [component object](#core-resources/components/the-component-object) |
| `component[name]` | The component name is **required** |

;examplearea

Example Request

<RequestExample url="https://mapi.storyblok.com/v1/spaces/656/components/" httpMethod="POST" :requestObject='{"component":{"name":"teaser","display_name":"Teaser","schema":{"title":{"type":"text","pos":0},"image":{"type":"image","pos":1}},"is_root":false,"is_nestable":true}}'></RequestExample>

You will receive a fully loaded [component object](#core-resources/components/the-component-object) as response.


text:
# Acknowledgements

## Institutional Support

This project is part of the U. S. Department of Energy (DOE) [Joint BioEnergy Institute][1] and
the DOE [Joint Genome Institute][2], supported by the DOE, Office of Science, Office of Biological
and Environmental Research; and is part of the [Agile BioFoundry][3], supported by the DOE, Energy
Efficiency and Renewable Energy, Bioenergy Technologies Office, through contract DE-AC02-05CH11231
between Lawrence Berkeley National Laboratory and the U. S. Department of Energy.

## Project Logo

The EDD project logo was created by [Daniel Lopez][4].

## Icons

Some of the icons used in EDD are sourced from the [famfamfam Silk icon set][16], under a
Creative Commons (CC-BY 3.0) license.

[1]: https://www.jbei.org/
[2]: https://jgi.doe.gov/
[3]: https://www.agilebiofoundry.org/
[4]<EMAIL_ADDRESS>[16]: http://www.famfamfam.com/lab/icons/silk/

repository: JBEI/edd

branch_name: refs/heads/trunk

gha_language: Python

gha_license_id: NOASSERTION

repo_name: JBEI/edd


text:
# MegaAttitude website

This repository contains the source for the [MegaAttitude Project
website](http://megaattitude.io). It uses the [So Simple
Theme](http://mmistakes.github.io/so-simple-theme/) by [Michael
Rose](http://mademistakes.com). To learn how to install and use this theme check
out the [Setup Guide](http://mmistakes.github.io/so-simple-theme/theme-setup/).

## Modifying site (meta)data

As a member of MegaAttitude, there are two sorts of (meta)data you may want to add to
the site: (meta)data about a researcher or (meta)data about a project.

### Adding a researcher

There are two steps to adding a researcher so that they show up on
project pages.

1. Create an entry for the researcher in the `_data/researchers.yml`
file with a key built from the first letter of the researcher's first
name plus their last name and a metadata hash with six entries:
`name`, `role`, `affiliation`, `website`, `email`, and `projects`. For
instance, for Benjamin Van Durme, we create an entry with a key
`bvandurme`.

```
bvandurme:
  name: Benjamin Van Durme
  role: Associated Professor of Computer Science
  affiliation: Johns Hopkins University
  website: http://www.cs.jhu.edu/~vandurme/
  email<EMAIL_ADDRESS>  projects:
  - megaveridicality
```

Note that all entries are string-valued, except `projects`, which maps
to a list of strings. The strings contained within `projects` are
handles associated with each project. It is important that these
handles match the keys found in the top-level hash in
`_data/projects.yml`, because the `project` list is used to populate
the Researchers section of project pages. For instance, because
`megaveridicality` is found in Ben's projects list and because the
`spr` key in `_data/projects.yml` is associated with the
_MegaVeridicality_ project, his avatar is part of the researchers
section of the [_MegaVeridicality_ project
page](http://megaattitude.io/projects/mega-veridicality/).

2. Place a square `.jpg` image of the researcher into the `assets/img`
directory with a filename that matches that researcher's handle. For
instance, `assets/img/bvandurme.jpg` is the image associated with
Benjamin Van Durme. Please make sure this `.jpg` uses the `.jpg`
extension, not the `.jpeg` extension.

### Adding a project

There are four steps to adding a project, These steps will create a
project page (and corresponding entry on the navbar undr Projects) for
the project and add information about its datasets to the
[Data](http://megaattitude.io/data/) page.

1. Create an entry for the project in the `_data/projects.yml` file
with a metadata hash containing four entries: `title`, `url`,
`datasets`, and `references`. For instance, for hte MegaVeridicality project:

```
megaveridicality:
  title: MegaVeridicality
  url: mega-veridicality/
  datasets:
    - name: v1
      filetype: zip
      url: mega-veridicality-v1.zip
      sentences: 1,088
      predicates: 517
      frames: 2
      citation: "White & Rawlins 2018"
    - name: v2
      filetype: zip
      url: mega-veridicality-v2.zip
      sentences: 3,938
      predicates: 773
      frames: 9
      citation: "White & Rawlins 2018<br/>White et al. 2018"
  references:
  - citation: "White, Aaron Steven, Rachel Rudinger, Kyle Rawlins, and Benjamin Van Durme. 2018. Lexicosyntactic Inference in Neural Models. In <i>Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing</i>, 4717–4724. Brussels, Belgium: Association for Computational Linguistics."
    links:
    - label: "pdf"
      href: "https://www.aclweb.org/anthology/N18-1501.pdf"
    - label: "doi"
      href: "https://doi.org/10.18653/v1/D18-1501"

  - citation: "White, Aaron Steven, and Kyle Rawlins. 2018. The Role of Veridicality and Factivity in Clause Selection. In <i>Proceedings of the 48th Annual Meeting of the North East Linguistic Society</i>, edited by Sherry Hucklebridge and Max Nelson, 221–234. Amherst, MA: GLSA Publications."
    links:
    - label: "pdf (preprint)"
      href: "https://ling.auf.net/lingbuzz/004012/current.pdf"
```

Note that all entries are string-valued, except
`datasets`, which maps to a list of hashes. The hashes contained within
`projects` contain metadata that are used to populate the table in the
[Data](http://decomp.io/data/) page. (A project is only added to the data page
if it has a nonempty `datasets` list.) Each hash must have six entries:
`name`, `filetype`, `url`, `sentences`, `predicates`, and `frames`.

2. Create a directory for the project within `projects/` with a name that matches the value of
`url` you entered into `_data/projects.yml`. For instance, the directory
associated with the _MegaVeridicality_ project would be named
`mega-veridicality`.

3. Create a file `index.md` within the directory you just made. This
will be the project page. At the top of the file place the following
metadata – where `<HANDLE>` is replaced with the project's handle from
`_data/projects.yml` and `<TITLE>` with the name of the dataset.

```
---
layout: project
handle: <HANDLE>
title: <TITLE>
search_omit: true
---
```

For instance, the project page associated with the _MegaVeridicality_
project would have the following metadata.

```
---
layout: project
handle: megaveridicality
title: The MegaVeridicality Dataset
search_omit: true
---
```

After the metadata, include a description of the project along with citations.
The data/code links and researcher section will be automatically populated from
the project metadata in `_data/projects.yml`.

4. Place any datasets associated with
that project in the project directory – i.e. the same directory containing the
project page.

gha_language: HTML


text:
Phaser Particle Editor Plugin
================
 [![Project status](https://img.shields.io/badge/status-active-brightgreen.svg)](#status)

This plugin creates particles based on JSON data generated by **[Phaser Particle Editor](https://phaser-particle-editor.firebaseapp.com/)**

Getting Started
---------------
### Install the plugin
[![npm](https://img.shields.io/npm/dt/@koreez/phaser-particle-editor-plugin.svg)](https://www.npmjs.com/package/@koreez/phaser-particle-editor-plugin)
```shell
npm install @koreez/phaser-particle-editor-plugin --save
```
Usage
-----
### Import the plugin
##### ***in ES5***
```javascript
var PhaserParticleEditor = require('@koreez/phaser-particle-editor-plugin')
```
##### ***in ES6***
```javascript
import { PhaserParticleEditor } from '@koreez/phaser-particle-editor-plugin'
```
### Load the plugin
You need to load the plugin in your game. This is done just like any other plugin in Phaser.
So, to load the plugin, include it one of the Phaser States.
```javascript
game.plugins.add(PhaserParticleEditor);
```
The plugin will patch your Phaser game with additional *add / make* methods so this plugin fits up in Phaser like any normal object.
### Create particles
```javascript
//  x - any
//  y - any
//  data - can be allready loaded JSON key or existing object based on Particle Editor JSON data
//  group - parent container
game.add.particle(x, y, data, group)
// or
game.make.particle(x, y, data)
```

## News & Community
We have a [forum](#) so you can always be up to date with latest news!
## Contributing
Coming soon!


text:
# BRP-NAS: Prediction-based NAS using GCNs

```
@incollection{brpnas_neurips20,
author = {Dudziak, Lukasz and Chau, Thomas and Abdelfattah, Mohamed and Lee, Royson and Kim, Hyeji and Lane, Nicholas},
title = {BRP-NAS: Prediction-based NAS using GCNs},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS) 33},
pages = {10480--10490},
year = {2020},
publisher = {Curran Associates, Inc.}
}
```

links
- [arXiv](https://arxiv.org/abs/2007.08668)
- [neurips](https://papers.nips.cc//paper/2020/hash/768e78024aa8fdb9b8fe87be86f64745-Abstract.html)

gha_language: Jupyter Notebook


text:
#financial-twitter-tracker

A semantic sentiment analyzer for tweets with a financial context.

The folder toniprada contains an older version of Sefarad

The folder sefarad contains the current version of Sefarad, you can find more information in https://github.com/gsi-upm/Sefarad

The folder ftt contains all the scripts used for the experimentation and analysis of the tweets

repository: gsi-upm/financial-twitter-tracker

repo_name: gsi-upm/financial-twitter-tracker


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

title: "Multi-scale electrochemical modeling"
summary: "DFT and machine learning guided search for the next generation of energy conversion catalysts and storage materials."

authors: [admin]
tags: []
categories: []
date: 2020-02-13T10:52:49+09:00
relatedpublications: [ringe-2020-yl]

# Optional external URL for project (replaces project detail page).
external_link: ""

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

# Custom links (optional).
#   Uncomment and edit lines below to show custom links.
# links:
# - name: Follow
#   url: https://twitter.com
#   icon_pack: fab
#   icon: twitter

url_code: ""
url_pdf: ""
url_slides: ""
url_video: ""

# Slides (optional).
#   Associate this project with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides = "example-slides"` references `content/slides/example-slides.md`.
#   Otherwise, set `slides = ""`.
slides: ""

# projecttitle:
projecttext: "Recently, an increasing numbrer applications in electrochemistry uses complex electrode designs, comprising highly porous materials, gas diffusion systems, solid electrolyte membranes, etc. To model such systems, both kinetics and mass transport have to be treated on an equal footing. CatINT provides an interface between both regimes by coupling CatMAP which solves the mean-field rate equations in the steady-state approximation with COMSOL which models all mass transport related equations. The program package is under active development, open source and contributions are always welcome!

Documentation: https://catint.readthedocs.io/en/latest/

Source code: https://github.com/sringe/CatINT
"
projectimage: "catint.png"
projectimagecaption: "The scheme shows the setup for a multi-scale simulation using CatINT as employed for CO2 reduction on Gold. CatMAP is used for micro-kinetic modeling, while COMSOL solves the continuum equations for modeling mass transport phenomena."
projectimagecaptionshort: "Multi-scale modeling using CatINT."

---

repository: sringe/academic-kickstart

repo_name: sringe/academic-kickstart


text:
jenkjobs
========

RSDT@UCL's extension to jenkins job builder.

Using it is as easy as installing it. Then [distribute](https://pypi.python.org/pypi/distribute) does the rest.

Doxygen publisher:
------------------

Requires the doxygen plugin.

```yaml
publishers:
    - doxygen:
        doxyfile: path to doxyfile relative to workspace. Required.
        working_directory: path to working directory relative to workspace. Defaults to ""
        node: nodename. Defaults to "".
        keep: whether to keep previous docs. Defaults to false.
```

The doxygen files should be found in the input working directory. They must built by some other process.
This plugins only publishes them.

repository: UCL/jenkjobs

repo_name: UCL/jenkjobs


text:
# Props
So far, we've dealt exclusively with internal state - that is to say, the values are only accessible within a given component.

In any real application, you'll need to pass data from one component down to its children. To do that, we need to declare properties, generally shortened to 'props'. In Svelte, we do that with the export keyword. Edit the Nested.svelte component:
```
<script>
	export let answer;
</script>
```

We can easily specify default values for props in Nested.svelte:
```
<script>
	export let answer = 'a mystery';
</script>
```

If you have an object of properties, you can 'spread' them onto a component instead of specifying each one:
```
<Info {...pkg}/>
```


text:
# Merulius acerinus (Peck) Spirin & Zmitr., 2004 SPECIES

#### Status
SYNONYM

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

#### Published in
Nov. sist. Niz. Rast. 37: 181 (2004)

#### Original name
Phlebia acerina Peck, 1889

### Remarks
null

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Meruliaceae/Phlebia/Phlebia acerina/ Syn. Merulius acerinus/README.md


text:
# ALICE Smart Home Server

This repository contains the ALICE Smart Home server. This server is the core of the ALICE system and is required for all installations.

All devices and sensors connect to the server in order to facilitate interconnection. The server is responsible for remote API data aggregation and for pushing updates to devices.

## Message Broker

The server acts as a message broker between all connected devices.

## Sensors

Sensors connect to the server as clients and push updates to the server when their environment changes.

repository: kaecyra/alice-server

repo_name: kaecyra/alice-server


text:
# (re)Intro to Python
2/11/16
Madison Python Users Group
Cea Stapleton and Ian Cordasco

---

A brief introduction to Python
(a reprisal of last year, with new comments)

---

# Dictionaries

---

The following are dictionaries:

```
{}  # Empty dictionary
{'this is a key': 'this is a value'}
# Dictionaries do not have strict types.
# Both keys and values can be of any type.
{'a': 'b', 'b': 'c', 1: 2, 2: 3, 'd': 4}
```
---

Another dictionary we’ll use:

```
alpha_ordering = {
    'a': 'b',
    'b': 'c',
    'c': 'd',
    'd': 'e',
    'e': 'f',
    'f': 'g',
(you get the picture…)
    'v': 'w',
    'w': 'x',
    'x': 'y',
    'y': 'z',
}
```
---

We can look up what letter comes after e in the alphabet:

```
print(alpha_ordering['e'], "comes after 'e' in the alphabet")
```

---

If we don't know if there's a value for a key, we can use a method to
 retrieve it or return a default.

```
print(alpha_ordering.get('z', 'There is no letter that'),
      "comes after 'z' in the alphabet")
```

---

If we want to add something that comes after 'z', we can:

```alpha_ordering['z'] = 'How did I get here?’```

We can update the dictionary because it is mutable.

---

You can merge any dictionary into another using the update method.

```
words_collection = {}
words_collection.update({'a': 'b'})
words_collection.update({'b': 'c'})
print('words_collection:', words_collection)
```

---

You may be wondering, however, what happens when you call update with two dictionaries that have the same keys. A dictionary cannot have the same key repeated, we learned that earlier. Let's see what happens:

```
words_collection.update({'a': 'd'})
print("words_collection['a']:", words_collection['a'])
```

---

We can also list all key-value pairs in a dictionary

```print("words_collection.items():", words_collection.items())```

---

We can retrieve only the keys
```print("words_collection.keys():", words_collection.keys())```

---

We can retrieve only the values
```print("words_collection.values():", words_collection.values())```

---

# Lists

---

The following are lists:

```
['here', 'is', 'a', 'list', 'of', 'strings']
['one element list']
[]  # Empty list
```
---

Like dictionaries, lists are mutable.

---

```fibonacci = [1, 1, 2, 3, 5, 8, 13, 21, 34]
print('Before:', fibonacci)
fibonacci[0] = 0
print('After:', fibonacci)
```

---

Lists allow for arbitrary retrieval:

```
print('fibonacci[5]:', fibonacci[5])
```

---

Lists also allow you to retrieve groups of items using "slice" syntax:

```
print('fibonacci[5:8]:', fibonacci[5:8])
```

---

You can also create a slice and skip over elements:

```print('fibonacci[2:8:2]:', fibonacci[2:8:2])```

---

You can add a single item to the end of the list:

```
fibonacci.append(55)
```

---

Or you can add a list of items to the end of the list:

```fibonacci.extend([89, 144, 233])
print('fibonacci:', fibonacci)```

---

# Tuples

---

The following are tuples

```
('this', 'is', 'a', 'tuple')
('this', 'is', 'also', 'a', 'tuple')
(1, 2, 3, 4, 5, 6)
```

---

Tuples work a lot like lists except they're immutable.
This means you cannot append an item, extend them, or replace an individual element

---

# Functions, Loops, Conditions

---

Let's say we need a way to find all of the squares of numbers less than
another number

---

```
def squares_until(upper_limit):
    squares = []
    # A `for` loop allows us to iterate over all the elements in the list
    # returned by range()
    for n in range(upper_limit / 2):
        n_squared = n ** 2
        # The if-else statement allows us to decide when we're done iterating
        # over the numbers
        if n_squared < upper_limit:
            squares.append(n_squared)
        else:
            # Here we can stop our loop early
            break
    # Here we return the values we've generated
    return squares

print('The squares less than 50 are:', squares_until(50))
```

---

# Exceptions

---

You'll see an error if you try to access a key that does not exist in a
dictionary. You can see the error (or exception) by uncommenting the
next line:

```
# {}[‘a key not in the dictionary']
```

---

You should see something like:

```Traceback (most recent call last):
...
KeyError: 'a key not in the dictionary’```

---

The last line contains the name of the error "KeyError". We can catch that exception to prevent it from stopping the program. For example,

```
try:
    {}['a key not in the dictionary']
except KeyError:
    print('Caught a KeyError')
```

---

All exceptions can be handled with the try-except syntax.
If you have something that can raise multiple exceptions you can specify
multiple except blocks, e.g.,

```
try:
    {}['a key not in the dictionary']
except KeyError:
    print('Caught a KeyError')
except IndexError:
    print('Caught an IndexError')
```

---

# Classes - because communism

---

## Let's build a role-playing game

---

```
class Adventurer(object):
    def __init__(self, name, health, experience, level, adventurer_type):
        self.name = name
        self.health = health
        self.experience = experience
        self.level = level
        self.adventurer_type = adventurer_type

    def format(self):
        format_str = ("Our adventurer's name: {0}\n"
                      "         Their health: {1}\n"
                      "     Their experience: {2}\n"
                      "          Their level: {3}\n"
                      "           Their type: {4}\n")
        return format_str.format(self.name, self.health, self.experience,
                                 self.level, self.adventurer_type)
```

---

So the first thing that should be intersting is that the method we're
defining is `__init__`.

---

If you're familiar with Java, this might be confusing.
If you already know ruby, this should look somewhat familiar though. In
Python, every class's initialization method is named `__init__`. And yes, `__init__` is short for initialize. With that in mind, let's make our intrepid adventurer.

---

```
hermione = Adventurer('Hermione', 1000, 100, 25, 'Warrior')
print(hermione.format())
```

---

We can also reuse our Adventurer class to create classes for specific
adventurer types.

```
class Bard(Adventurer):
    def __init__(self, name, health, experience, level):
        super(Bard, self).__init__(name, health, experience, level, 'Bard')

shakespeare = Bard('Shakespeare', 300, 5000, 100)

class Warrior(Adventurer):
    def __init__(self, name, health, experience, level):
        super(Warrior, self).__init__(name, health, experience, level,
                                      'Warrior')

hermione = Warrior('Hermione', 1000, 100, 25)
```

---

That’s it! (for now)

---

What else would you like to know?

repository: MadPUG/Introduction-To-Python

repo_name: MadPUG/Introduction-To-Python


text:
# Ocellularia olivacea (Fée) Müll. Arg. SPECIES

#### Status
SYNONYM

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

#### Published in
Mém. Soc. Phys. Hist. nat. Genève 29(8): 7 (1887)

#### Original name
Myriotrema olivaceum Fée

### Remarks
null

path: /life/Fungi/Ascomycota/Lecanoromycetes/Ostropales/Graphidaceae/Myriotrema/Myriotrema olivaceum/ Syn. Ocellularia olivacea/README.md


text:
# 🌟 Computational User Interfaces
<!-- **Description:** -->

---
## Part 1: Communication, Cognitive Science, and Computation

### Language of UI Design
When thinking, implementing and collaborating with graphic designers and information architects, it's helpful to share a common language. And as common practice, companies create [design language systems](https://uxplanet.orgdesign-language-system-d438f4aa30e0) (DLS) that can be used to create an very large amount of **content** from assembling **components** to generate a uniform or consistent [aesthetic](https://en.wikipedia.org/wiki/Aesthetics):

 * **App Bar** - Displays information and actions relating to the current screen
 * **Chips** - Compact elements that represent an input, attribute, or action
 * **Navigation**
    * _Bottom_ - Allows movement between primary destination within an application
    * _Top_ - Allows back and forth between pages
* **Buttons** - Allows users to take actions, and make choices, with a single tap.
* **Dialogs** - Informs users about a task and can cont critical information, require decisions, or involve multiple task.

---

## 🔥 🔥 Resources for CUI

repository: Intelligent-Interfaces/awart

repo_name: Intelligent-Interfaces/awart


text:
```
Before you begin, identify what type of brick you have first.

* A hardware bricked device has nothing but a black screen (nothing ever comes on the screen, not even a boot logo), it might vibrate when a power button is pressed and held for 20 seconds, has no Recovery partition, no adb mode, and no fastboot partition. The device might be detected in Linux and you might be able to even send commands to it. In Windows, the bricked device should be detected as QHSUSB_BULK USB or one of its variations. You might have a bricked device as a result of flashing a kernel meant for a different device (or a ROM meant for another device that included a kernel), tinkering with the boot logo or bootloader, or your attempt of unlocking the bootloader resulted in corrupting the boot partition. Use any method and try your luck. Once your display starts to work, go to method 5 and perform that to fully recover your device.

* A software bricked device is one that might be stuck in a bootloop, but has a working bootloader, recovery partition, fastboot, or adb. If you press the power button and things appear on the screen and you are able to enter fastboot mode (Power + Volume Down) or recovery, then your device is soft bricked. Go straight to Method 5.

* Methods 3, 5, 6 and 7 are perfectly working. Your mileage will vary with other methods.
```

# Method 1 (QFIL):

* Go through the [Prerequisites.](https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick/blob/master/Prerequisite.md)
* Install latest QPST tools (I have uploaded all latest files even though I used version 2.7 build 437) and open QFIL (I used version <IP_ADDRESS>).
* Choose Flat Build under 'Select build type'.
* Select the COM port to which the phone is connected by clicking 'Select port'.
* Select the programmer by clicking 'Browse' and then choose the rawprogram0.xml and patch0.xml by clicking 'Load XML'. Make sure all files are in one folder and not in sub folders or other folders.
* Click Download and watch your phone come back to life.

## Note:

* Please try all combinations of the files I uploaded. You can download from the folders on my GitHub repository.
* The files aren't perfect as I haven't finished making them. Wait patiently for 24 hours before next try. For me, the phone suddenly powered on when I went out and came back home.
* After each try, try to boot into fastboot mode. If successful, go straight to Method 5 without any delay. And your phone should be in perfect condition.

# Method 2 (Blank Flash):

* Don't try. Not working. You might make the situation worse. All files aren't present.
* Blanklash won't work unless Motorola releases the signed files. It's not worth of my time to sit and sign the files with proper checksum. SORRY!
* Those of you who already tried will most probably have to replace motherboard due to bootloader/SoC internal damage.

# Method 3 (eMMC Software Download):

* Don't try. Not working. You might make the situation worse. All files aren't present.

UPDATE: Works. Will be adding details soon after testing.

# Method 4 (Mi Flash Tool):

* Don't try. Not working. You might make the situation worse. All files aren't present.

# Method 5 (Fastboot):

First, identify your situation:

* Case 1: With the device powered off, press and hold the power button and volume down keys at once for 3-5 seconds to go to fastboot mode. (Only hold both keys for the specified time.)

* Case 2: With the device powered on, go to Settings -> About Phone and tap on ‘Build number’ 6 times to unlock Developer Options. Come back to Settings to find it. In Developer Options, enable ‘adb’ and any other relevant adb setting. Then open adb on your computer and type ‘adb reboot bootloader’

Once in fastboot mode, do one of this (Everything should be in the root folder instead of sub-folders):

### Note:

* It's better to run the 'Fastboot Unbrick.bat' script to make everything automatic and easier.
* Please unlock your bootloader before proceeding any further as you would render your device back to a hard bricked state or completely unusable state otherwise.
*

## Automatic :

### Windows Users:

* Get '[Fastboot Unbrick.bat](https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick/tree/master/Fastboot%20Unbrick)' from my repository, 'fastboot' and your firmware files in one folder.
* Next, double click on Fastboot Unbrick.bat and watch your phone come back to life.

### Linux and Mac Users:

* Get '[Fastboot Unbrick.sh](https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick/tree/master/Fastboot%20Unbrick)' from my repository, 'fastboot' and your firmware files in one folder.
* Open terminal and navigate to this folder. Or simply right click on an empty space in the folder and choose 'Open in Terminal'.
* Type the following commands to execute the script in terminal after giving permissions using chmod and watch your phone come back to life.:

```
chmod +x "Fastboot Unbrick.sh"

sudo ./"Fastboot Unbrick.sh"
```

#### Links:

* [Fastboot script](https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick/tree/master/Fastboot%20Unbrick)
* [Softwares](https://github.com/aravindvnair99/Motorola-Moto-E-XT1022-condor-unbrick/tree/master/Software)

## Manual:

Open fastboot after connecting phone in fastboot mode and type:

```

fastboot flash partition gpt.bin

fastboot flash motoboot motoboot.img

fastboot reboot-bootloader

fastboot flash logo logo.bin

fastboot flash boot boot.img

fastboot flash recovery recovery.img

fastboot flash system system.img_sparsechunk.0

fastboot flash system system.img_sparsechunk.1

fastboot flash system system.img_sparsechunk.2

fastboot flash system system.img_sparsechunk.3

fastboot flash modem NON-HLOS.bin

fastboot erase modemst1

fastboot erase modemst2

fastboot flash fsg fsg.mbn

fastboot erase userdata

fastboot erase cache

fastboot restart

```

# Method 6 (JTAG):

```
Use this as a last resort if nothing works. JTAG is strictly not for noobs.
```

You can either buy a JTAG programmer if you know how to use it and connect to the SoC or contact someone nearby in your locality who can do it for you. But before you try, ask Motorola for their pricing. In some places, contacting Motorola would be better than JTAG. Do some research for the prices and the assurance before you proceed. JTAG will surely work as long as the required files and tools are available. You get higher surety with Motorola for sure as they have the skilled people. **JTAG is strictly not for noobs.**

# Method 7 (Manual):

```
Use this as a last resort if nothing works. This is strictly not for noobs. You need lot of equipment, research and patience. I have put up the basic steps here.
```

* Remove out the eMMC memory card from the motherboard. **This is strictly not for noobs.**
* Solder it onto a SD card reader with the correct pins. Reference image.
* Connect SD card to computer.
* Wipe the card.
* Partition using Linux and put appropiate data with correct filesystems.
* Attach the eMMC back onto your phone and voila! Don't forget to dance! You just became an expert geek!

path: /Unbrick methods.md

filename: Unbrick methods.md


text:
  SilentRunner

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

 [![codecov](https://codecov.io/gh/HouseOfRisingSun/SilentRunner/branch/master/graph/badge.svg)](https://codecov.io/gh/HouseOfRisingSun/SilentRunner)

 [![codebeat badge](https://codebeat.co/badges/3b2fee2c-afc2-4410-9281-6b56224ee112)](https://codebeat.co/projects/github-com-andrewbatutin-silentrunner)

##Intro
Silent Runner is a testing tool for iOS to trigger some method calls remotely

Idea is simple:
1. Remote server sends to the app message with method invocation details
2. Silent runner invokes the method inside the iOS app.
3. Profit

Useful for
1. Push notifications testing
2. Analytic System calls testing

Samples of messages:

* Call push notification delegate method
```javascript
{
    "jsonrpc": "2.0",
    "method": "execute",
    "params": {
        "commandId": "app",
        "method": "application:didReceiveRemoteNotification:fetchCompletionHandler:",
        "arguments": [{
            "class": "UIApplication",
            "properties": [{
                "name": "delegate",
                "value": "https://github.com/andrewBatutin/SilentRunner"
            }],
            "methods": [{
                "name": "isIgnoringInteractionEvents",
                "returnValue": "YES"
            }]
        }, {
            "value": {
                "opt1": "test"
            }
        },
        {
            "block": {
                "returnValue": "notUsed"
                      }
        }]
    }
}

```
## Usage

0. Use Cocoapod **SilentRunnerEngine** to add lib to project.
1. Start testing server from **SilentRunnerTestServer**
2. Connect to server from the app with:
```objective-c
    // register your app delegate to be callable from test server
    [SRClientPool addClient:[UIApplication sharedApplication].delegate forTag:@"app"];
    // create server instance
    self.serv = [SRServer serverWithURL:@"ws://localhost:9000/chat"  withErrorHandler:^(NSError * error) {
        [self.serv sendErrorMessage:error];
    }];
    // run the engine
    [self.serv runServer];
```
3. use **SilentRunnerTestServer** admin page to send messages.

If you'r testing some method make sure you've implemented it in your app.
So for push notifications check if you have `application:didReceiveRemoteNotification:fetchCompletionHandler:` implemented

## Demo Apps

* [Obj-C demo app](https://github.com/HouseOfRisingSun/SilentRunnerDemo)
* [Swift demo app](https://github.com/HouseOfRisingSun/SRTestApp)

###Dependencies
* [SocketRocket](https://github.com/facebook/SocketRocket)
* [JSONRPCom](https://github.com/andrewBatutin/JSONRPCom)

###TODO

* Formal protocol spec
* Support for batch requests
* Swift wrapper
* Mock params and return values for  block arguments
* more samples of test cases

repository: HouseOfRisingSun/SilentRunnerDemo

repo_name: HouseOfRisingSun/SilentRunnerDemo


text:
# INSTALLATION

* install react (https://facebook.github.io/react-native/docs/getting-started.html)
* git clone https://github.com/squatsandsciencelabs/OpenBarbellApp.git
* npm install
* cd ios && carthage bootstrap && pod install
* create android/local.properties and point it at your Android SDK eg `sdk.dir = /Users/SquatsAndScience/Library/Android/sdk`

# RUNNING IT

* react-native run-ios
* react-native run-android

# DEBUGGING TIPS

* Install Reactotron https://github.com/infinitered/reactotron/blob/master/docs/installing.md which will allow you to sniff network requests and see the state of the Redux store. Note that you can modify ReactotronConfig.js to allow Reactotron debugging of an iPhone or Android device.
* Optionally, use VSCode with React Native extensions https://github.com/Microsoft/vscode-react-native as when set up properly you have breakpoints.

# CODEBASE PRACTICES

* Follow the feature folder structure. Features include components, containers, and action creators.
* As a real of thumb, use Sagas for async operations. Try to keep Thunks when you need data from the store.
* Unit tests have not been added yet, but tests should go in a separate `Tests` folder.
* Generally, aim for fewer actions to reduce the number of dispatches and rerenders for performance purposes. One action can be set up such that multiple reducers will react to it.
* Actions should all have an Action Creator. Reason being, it makes it clear where all of them are in the app and it simplifies analytics.
* Action naming convention wise, use present and dismiss for popups, save for saving permanently to the store, and update for changes to the store that won't persist
* Use selectors rather than manually access sub properties of the state. For example, instead of doing state.auth.accessToken, use the AuthSelector's getAccessToken. Each of these selectors should start from the root state. In other words, always pass in the root state to the selector, not `state.sets`
* It may be possible to use selector caching via the reselect library to speed up the History screen, which is very slow right now.

# IMPORTANT NOTES

A development version of the keystore and Google Sign In keys have been included in the repository to make getting started easier. The app is also pointed at the development version of the server, which in turn uses a development database.

Be careful when using react-native link. It duplicates imports for the React Native Google Sign In and React Native Device Info Libraries which will cause builds to fail. The solution is to REMOVE the additional Google Sign In and Device Info changes to the Android project after running link. If you have to use react-native link, use it only on the new packages that you just installed.

Use Carthage for all iOS Swift only native libraries such as SwiftyJSON and Charts. Use Cocoapods for all other iOS libraries. If Carthage packages have issues, try running `carthage update --platform iOS --no-use-binaries`

# APP ARCHITECTURE

See https://github.com/squatsandsciencelabs/OpenBarbell-V3/wiki/App-Architecture

# DATA FORMAT

See https://github.com/squatsandsciencelabs/OpenBarbell-V3/wiki/OpenBarbell-Data-Storage-Format

repository: squatsandsciencelabs/OpenBarbellApp

branch_name: refs/heads/develop

repo_name: squatsandsciencelabs/OpenBarbellApp


text:
# SpeechCommands v2 Classification

## Configuration
- All models were trained for 50 epochs with AdamW optimizer. Linear warmup + cosine annealing schedule was used.
- Models were trained on a `single TPU-v3` device on a single core with a batch size of 1024, (unless stated otherwise).
- All configs used for training are provided in the [configs](configs) directory. Most of the configuration arguments are self-explanatory.
- `config.py` file can also be found in the linked pretrained checkpoint, for exact hyperparams of that run.
- For data preparation, view [recipes/data_prep](../data_prep).
- SpecAugment (frequency and time masking) and Dropout (before FC layer) are used for all models
- EfficientNet and ConvNeXT models are trained with Stochastic Depth/Drop Path
- No label balancing was used.

## Training and evaluation
To train a [`Classifier`](../../audax/models/classifier.py), say, the resnet18 model, the following steps were followed

```shell
python main.py --config configs/resnet_18.py --workdir /tmp/resnet18_8x256
```

```shell
export EVAL_MANIFEST_PATH="path_to_test.csv"
python main.py --config configs/resnet_18.py --workdir /tmp/resnet18_8x256 --mode eval --eval_manifest_override $EVAL_MANIFEST_PATH --eval_steps_override 11005
```

## Models and their performance

| Architecture    | features                                | Accuracy| pretrained model                                                                     |
|-----------------|-----------------------------------------|---------|--------------------------------------------------------------------------------------|
| ResNet18        | melspectrograms
(64 nmels, 1024-fft) | 0.9562  | https://drive.google.com/drive/folders/1jyykLnZIIA4KRe-Qn53qxdtuA2Mhiuxr?usp=sharing |
| EfficientNet-b0 | melspectrograms
(64 nmels, 1024-fft) | 0.9344  | https://drive.google.com/drive/folders/1h4PayVEiA-oxNwML8E0g-V4b9vrAH0Or?usp=sharing |

## Up next
- More ResNet, EfficientNet and ConvNeXT configurations
- Models trained on Spectrograms

repository: SarthakYadav/audax

repo_name: SarthakYadav/audax


text:
# **Finding Lane Lines on the Road**
---
[//]: # (Image References)

[image1]: ./test_images_output/gray.jpg "Grayscale"
[image2]: ./test_images_output/blur_gray.jpg "Gaussian Blur"
[image3]: ./test_images_output/edges.jpg "Canny Edge Detection"
[image4]: ./test_images_output/masked_edges.jpg "Region of interest"
[image5]: ./test_images_output/lines.jpg "Hough Transform"
[image6]: ./test_images_output/masked_image.jpg "Final Image"
[image7]: ./test_images/solidYellowCurve2.jpg "Original Image"

### Original Sample Image
![alt text][image7]
---

### Reflection

### 1. Pipeline to detect lane lines and draw a mask over it.

My pipeline consisted of six steps.

First, I converted the images to grayscale

![alt text][image1]

Second, I applied Gaussian Blur to smoothen the image

![alt text][image2]

Third, Edges were detected in the smoothen image using Canny Edge Detection.
In my case, lower and upper threshold values 50 and 150 worked fine.

![alt text][image3]

Fourth, I defined region of interest for which I put a triangular mask on the edges image, this gave me approximation of the lane that needs to be detected.

![alt text][image4]

Fifth, I applied Hough transform to draw straigh lines over left and right lane

In order to draw a single line on the left and right lanes, I modified the draw_lines() function as follows -
1. Identified all x and y for left and right lanes based on the slopes of the lines detected by hough transform. Negative slopes gave me left lane and similary positive slope gave me right lane.
2. After doing various tests, I came to assumption that for detecting lanes in straight roads, I can consider only slopes between 0.5 and 1 for right lanes and between -1 and -0.5 for left lane. This gives me more accurate results for the project videos.
3. After getting all x and y, I used numpy polyfit and poly1d functions to get 1d equation of straight lines for left and right lane.
4. I took starting point of the left and right lanes as max y, i.e. starting from the bottom of the image.
5. Based on above y, and using 1d equation corresponding x values are calculated for left and right lanes
6. Similarly for end point of the lane, I used center of the x-axis and calculated corresponding y values for left and right lanes.
7. For left lane, remove 20 pixels form x before calculating y value to remove the intersection of left and right lanes. Similary for right lane add 20 pixels.
8. Last step was to just draw straight lines using opencv line function to display left and right lanes.

![alt text][image5]

Last step was to add these lines to the original image and final results were obtained.

![alt text][image6]

### 2. Potential shortcomings with the current pipeline

My pipeline is based on the assumption that the input images/videos consist of car going straight on the road when camera mounted in the center front of the car.
This will not work on turns and bends.

### 3. Possible improvements to the pipeline

This can be improved by the following steps-

1. Vertically divide image into two parts, left and right.
2. Apply step 1, 2 and 3 of my current pipeline
3. For left and right images individually, detect points of interest.
       i. For left lane, get all the lines using hough transform and then get x and y for left lanes from the lines which are nearest to the line x = x_max
       ii. For right lane, get all the lines using hough transform and then get x and y for right lanes from the lines which are nearest to the line x = 0
4. Then create lane lines from the identified points and mask on original image.


text:
sprint
======

![Check](https://github.com/moznion/sprint/workflows/Check/badge.svg)

Fluent, small and fast String formatter for Java.

Synopsis
--------

```java
final Sprint sprint = new Sprint();
System.out.Println(sprint.ff("Hello: {}!", "John")); // => Hello: John!
```

Description
-----------

sprint is a formatter for String.

This library provides a formating method `ff`,
this method formats String according to fluent (or loose?) template like `"{}:{}"`.
`{}` is a placeholder to fill any arguments.
This method takes arguments after template and fill those into placeholder.

This method parses template __only at once__.
Parsed structure is stored on ConcurrentHashMap which is contained in instance of Sprint.
When it formats String with the same template, it uses pre-parsed structures from the second time.

Benchmark
---------

Benchmark project is [here](https://github.com/moznion/sprint-bench). This is a result of jdk1.8.0\_92.

![benchmark_graph](./devel/benchmark.png)

### n=10000

```
Score:

sprintff:  0 wallclock secs ( 0.01 usr +  0.00 sys =  0.01 CPU) @ 798977.31/s (n=10000)
stringFormat:  0 wallclock secs ( 0.11 usr +  0.01 sys =  0.13 CPU) @ 77924.71/s (n=10000)

Comparison chart:

                    Rate  sprintff  stringFormat
      sprintff  798977/s        --          925%
  stringFormat   77925/s      -90%            --
```

### n=100000

```
Score:

sprintff:  0 wallclock secs ( 0.06 usr +  0.03 sys =  0.09 CPU) @ 1143850.66/s (n=100000)
stringFormat:  0 wallclock secs ( 0.50 usr +  0.00 sys =  0.51 CPU) @ 197784.81/s (n=100000)

Comparison chart:

                     Rate  sprintff  stringFormat
      sprintff  1143851/s        --          478%
  stringFormat   197785/s      -83%            --
```

Hints
--

This class should be used as singleton because cache of parsed result of template is stored on __instance__ field

TODO
----

- `sprintf` compatible template

Author
------

moznion<EMAIL_ADDRESS>
License
-------

```
The MIT License (MIT)
Copyright © 2016 moznion, http://moznion.net/<EMAIL_ADDRESS>
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: moznion/sprint

gha_language: Java

repo_name: moznion/sprint


text:
## Webserver
This is the webserver files for the [D&D encounter simulator](https://github.com/matteoferla/DnD-battler)...
where one sets one's team to battle dragons and tarrasques.

It is hosted at [dnd.matteoferla.com](dnd.matteoferla.com) on my homeserver.

It has had several iterations. It actually was my first go with Pyramid on Openshift.

As present here is not actually the live version, which runs off older code.

If you were looking for the python module to similate locally all the encounters you fancy, then you need to check out the [DnD encounter similator  GitHub repository](https://github.com/matteoferla/DnD-battler).

## Example

```python
import DnD_app
import waitress
from pyramid.router import Router

app :Router = DnD_app.create_app()
waitress.serve(app, port=6666)
```

gha_language: CSS


text:
# OpenapiClient::BgpNeighborData

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **address_family** | **Float** | Address Family for IP Address | [optional] |
| **customer_as** | **Float** | The customer's ASN. In a local BGP deployment, this will be an internal ASN used to route within the data center. For a global BGP deployment, this will be the your own ASN, configured when you set up BGP for your project. | [optional] |
| **customer_ip** | **String** | The device's IP address. For an IPv4 BGP session, this is typically the private bond0 address for the device. | [optional] |
| **md5_enabled** | **Boolean** | True if an MD5 password is configured for the project. | [optional] |
| **md5_password** | **String** | The MD5 password configured for the project, if set. | [optional] |
| **multihop** | **Boolean** | True when the BGP session should be configured as multihop. | [optional] |
| **peer_as** | **Float** | The Peer ASN to use when configuring BGP on your device. | [optional] |
| **peer_ips** | **Array<String>** | A list of one or more IP addresses to use for the Peer IP section of your BGP configuration. For non-multihop sessions, this will typically be a single gateway address for the device. For multihop sessions, it will be a list of IPs. | [optional] |
| **routes_in** | [**Array<BgpNeighborDataRoutesIn>**](BgpNeighborDataRoutesIn.md) | A list of project subnets | [optional] |
| **routes_out** | [**Array<BgpNeighborDataRoutesOut>**](BgpNeighborDataRoutesOut.md) | A list of outgoing routes. Only populated if the BGP session has default route enabled. | [optional] |

## Example

```ruby
require 'openapi_client'

instance = OpenapiClient::BgpNeighborData.new(
  address_family: null,
  customer_as: 65000.0,
  customer_ip: <IP_ADDRESS> (IPv4) or 2604:1380:4111:2700::1 (IPv6),
  md5_enabled: null,
  md5_password: null,
  multihop: null,
  peer_as: 65530.0,
  peer_ips: ["<IP_ADDRESS>"] or ["<IP_ADDRESS>", "<IP_ADDRESS>"],
  routes_in: null,
  routes_out: null
)
```

repository: displague/metal-ruby

repo_name: displague/metal-ruby


text:
# Citizen Code of Conduct

## 1. Support Your Team

"[Teamwork] is the fuel that allows common people to attain uncommon results." -Andrew Carnegie

While we all carry a diverse set of individual ambitions and expectations into a game of League of Legends, once we hit the Field we're a part of a team. For better or worse, our fates are intertwined with that of our teammates. Once the game gets into full swing, you have to make a choice between being a positive force for your team, or contributing to your own demise.

Being a good team player begins at champion select. Be open minded when considering the needs of your team. If you're the last one to pick, try to fill a niche in your team that hasn't already been filled. If everyone's picked and something stands out as a deficiency in your team composition, try asking for another player to fill the gap, or change roles to embrace that responsibility yourself. Remember, that by taking on a role you don't normally play, you'll learn more about unfamiliar champions and increase your own skill level.

Once you get in game, try to keep an open line of communication. Warn your teammates if someone is missing from your lane, or if something is placing them in immediate danger. If they're not paying attention to chat you can always try pinging the map. Just remember that one ping is enough! Also, remember that you have to be there to contribute, so don't leave the game or go AFK! Encourage players who are having trouble, and congratulate those who are playing well. And most of all, if you're having a bad game don't take it out on your team!.

## 2. Drive Constructive Feedback

"When you confront a problem you begin to solve it." -Rudy Giuliani

Player feedback is an important force in the decision making process of Riot Games. If you want to make your voice heard, taking the time to let us know how you're feeling about the game is a good place to start. When you give feedback, make sure you take a holistic approach. If you only give negative feedback, you may find that the changes you influence detract from what you initially enjoyed. Moreover, people are simply more likely to listen if you present yourself in a calm, well thought out manner.

That being said, don't be afraid to tell us if you feel strongly, and why. Try to be straightforward, specific, and always try to make your feedback direct and concise. For instance, saying something along the lines of:

"I used to love playing Katarina because her skills give her high mobility in lane, but with the latest nerfs to Death Lotus, I no longer feel like I have a strong enough presence in team fights to be viable. I don't think that I'm going to be playing Kat in the future unless she undergoes some revisions."

Is a much better way of expressing your dismay at a patch than beginning with an irate tirade, then asking for changes to be reverted or attempting to force an alternate solution. Remember that we're listening and making changes every couple of weeks, so, with a little patience, you may find that your issues will work themselves out.

## 3. Facilitate Civil Discussion

"To disagree, one doesn't have to be disagreeable." -Barry Goldwater

As we mentioned earlier, we want you to give feedback, but being part of the community doesn't stop there. Whether you're in chat, in a game, or on the forums, there are plenty of people to meet, and plenty of topics to discuss. Whether you're discussing game balance and champion viability, trying to form a premade team, or just want to express your affection for the legendary and infamous Gentleman Cho'gath, we encourage you to share your thoughts with other players.

When you choose to participate in a discussion with the rest of the playerbase, always try to be receptive to another player's point of view. If you keep an open mind, you'd be surprised what valuable information you can glean from your fellow players. Also, be mindful of how you present your point of view. If a player feels strongly on a subject, don't get caught up trying to have the last word. Just state your side and exit the conversation gracefully rather than give them the opportunity to pick a fight.

## 4. Enjoy Yourself, but not at Anyone Else's Expense

"Short is the joy that guilty pleasure brings." -Euripides

Making games is our business, so it should come as no surprise that we want you to have a lot of fun. We want you to get excited, to have tension-filled moments, and to celebrate your success. This doesn't mean that we're okay with you ruining anybody else's day.

Remember, taking a jab at your friend in the middle of the game is a lot different than making a glib remark at a complete stranger. Someone who is unfamiliar with what you consider playful may take your comment as an attack and react unfavorably. If two players on a team start fighting, good communication and teamwork become nearly impossible. Once communication breaks down, the likelihood of victory is drastically diminished. It isn't uncommon for simple, good natured teasing to spiral out of control into a loss, so do yourself a favor and don't run the risk of sabotaging your own success.

## 5. Weapons Policy

No weapons will be allowed at 2048 Online events, community spaces, or in other spaces covered by the scope of this Code of Conduct. Weapons include but are not limited to guns, explosives (including fireworks), and large knives such as those used for hunting or display, as well as any other item used for the purpose of causing injury or harm to others. Anyone seen in possession of one of these items will be asked to leave immediately, and will only be allowed to return without the weapon. Community members are further expected to comply with all state and local laws on this matter.

## 6. Consequences of Unacceptable Behavior

Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.

Anyone asked to stop unacceptable behavior is expected to comply immediately.

If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).

## 7. Reporting Guidelines

If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. .

Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.

## 8. Addressing Grievances

If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify  with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.

## 9. Scope

We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues--online and in-person--as well as in all one-on-one communications pertaining to community business.

This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.

## 10. Contact info

## 11. License and attribution

The Citizen Code of Conduct is distributed by [Stumptown Syndicate](http://stumptownsyndicate.org) under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).

Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).

_Revision 2.3. Posted 6 March 2017._

_Revision 2.2. Posted 4 February 2016._

_Revision 2.1. Posted 23 June 2014._

_Revision 2.0, adopted by the [Stumptown Syndicate](http://stumptownsyndicate.org) board on 10 January 2013. Posted 17 March 2013._

repository: Dratui/AI-Arena

repo_name: Dratui/AI-Arena


text:
Orchestration Example
=====================

In order to use this example, you need to use
[Webpack](http://npm.im/webpack):

```bash
cd examples/orchestration
npm install webpack -g
webpack
node adder
node server
```

Point your browser to http://localhost:3000, and you should get an alert
:).

Look at the code, the actual calculation is done by the `adder`
microservice!

repository: GraftJS/graft

repo_name: GraftJS/graft


text:
---
title: "Log Collection"
keywords: 'KubeSphere, Kubernetes, project, disk, log, collection'
description: 'Enable log collection so that you can collect, manage, and analyze logs in a unified way.'
linkTitle: "Log Collection"
weight: 13600
---

KubeSphere supports multiple log collection methods so that Ops teams can collect, manage, and analyze logs in a unified and flexible way.

This tutorial demonstrates how to collect logs for an example app.

## Prerequisites

- You need to create a workspace, a project and a user (`project-admin`). The user must be invited to the project with the role of `admin` at the project level. For more information, see [Create Workspaces, Projects, Users and Roles](../../quick-start/create-workspace-and-project/).
- You need to enable [the KubeSphere Logging System](../../pluggable-components/logging/).

## Enable Log Collection

1. Log in to the web console of KubeSphere as `project-admin` and go to your project.

2. From the left navigation bar, click **Log Collection** in **Project Settings**, and then click  to enable the feature.

## Create a Deployment

1. From the left navigation bar, select **Workloads** in **Application Workloads**. Under the **Deployments** tab,  click **Create**.

2. In the dialog that appears, set a name for the Deployment (for example, `demo-deployment`) and click **Next**.

3. Under **Containers**, click **Add Container**.

4. Enter `alpine` in the search bar to use the image (tag: `latest`) as an example.

5. Scroll down to **Start Command** and select the checkbox. Enter the following values for **Command** and **Parameters** respectively, click **√**, and then click **Next**.

   **Command**

   ```bash
   /bin/sh
   ```

   **Parameters**

   ```bash
   -c,if [ ! -d /data/log ];then mkdir -p /data/log;fi; while true; do date >> /data/log/app-test.log; sleep 30;done
   ```

   {{< notice note >}}

   The command and parameters above mean that the date information will be exported to `app-test.log` in `/data/log` every 30 seconds.

   {{</ notice >}}

6. On the **Storage Settings** tab, click  to enable **Collect Logs on Volumes** and click **Mount Volume**.

7. On the **Temporary Volume** tab, enter a name for the volume (for example, `demo-disk-log-collection`) and set the access mode and path.

   Click **√**, and then click **Next**.

8. Click **Create** in **Advanced Settings** to finish the process.

   {{< notice note >}}

   For more information, see [Deployments](../../project-user-guide/application-workloads/deployments/).

   {{</ notice >}}

## View Logs

1. Under the **Deployments** tab, click the Deployment just created to go to its detail page.

2. In **Resource Status**, you can click  to view container details, and then click  of `logsidecar-container` (filebeat container) to view logs.

3. Alternatively, you can also click   in the lower-right corner and select **Log Search** to view stdout logs. For example, use the Pod name of the Deployment for a fuzzy query.

repository: kubesphere/website

gha_language: SCSS

repo_name: kubesphere/website


text:
# Rails Templates

Some useful templates to get rails apps up and running with some nice starter configuration out of the box.
All templates are for Rails 6.1 & `Hotwire` installed and configured.
For tests, they have `RSpec`, along with `pry-byebug`, `pry-rails`, `capybara`, `database_cleaner` and `factory_bot_rails`.
My DB of choice is `Postgresql`, but that can be changed the appropriate flags in the commands below.

## Bootstrap 5
Minimum template with Bootstrap 5.

```bash
rails new \
  --database postgresql \
  -m https://raw.githubusercontent.com/edcolen/rails-templates/master/bootstrap5.rb \
  -T \
  YOUR_APP_NAME
```

## Devise & Bootstrap 5
Template for apps that require user authorization & authentication.
Main gems:
- Devise
- Pundit

```bash
rails new \
  --database postgresql \
  -m https://raw.githubusercontent.com/edcolen/rails-templates/master/devise-bootstrap5.rb \
  -T \
  YOUR_APP_NAME
```

repository: deborahbpc/rails-templates

repo_name: deborahbpc/rails-templates


text:
# Eventing-kafka Dispatcher

The "Dispatcher" implementation is a set of Kafka ConsumerGroups which are
responsible for reading Kafka Messages from a Kafka Topic and converting them
back to CloudEvents before sending them on to the Knative Subscription endpoint.

A unique "Dispatcher" Deployment is created for every KafkaChannel (Topic) and
contains a Kafka Consumer for every Subscription to that KafkaChannel. The
single Deployment is horizontally scalable as necessary (via controller
environment variables.) Each such instance will contain a Kafka Consumer in the
same ConsumerGroup for the Subscription. The maximum number of such instances
should never be larger than your configured partitioning, as no further
performance will be gained beyond that. This allows for an efficient use of
cluster resources while still supporting high volume use cases in a segregated
manner.

A Service is also created for the Dispatcher but this is simply to facilitate
Prometheus monitoring endpoints.

The Dispatcher is watching KafkaChannel resources to perform reconciliation of
changes to the Subscribable (Channelable) list of subscribers. It also updates
the KafkaChannel's SubscriberStatus when the Kafka ConsumerGroups are deemed to
be operational.

The Kafka brokers and credentials are obtained from mounted Secret data from the
aforementioned Kafka Secret.

## Tracing, Profiling, and Metrics

The Dispatcher makes use of the infrastructure surrounding the config-tracing
and config-observability configmaps (see
[Accessing CloudEvent traces](https://knative.dev/docs/eventing/accessing-traces)
and
[Installing logging, metrics, and traces](https://knative.dev/docs/serving/installing-logging-metrics-traces)
for more information on the basic Knative-Eventing concepts behind these
features. The default behavior for tracing and profiling is provided such that
accessing a tracing server (such as Zipkin), and the debug profiling
information, should work as described in those links. For example, you might
access your zipkin server via
`http://localhost:8001/api/v1/namespaces/knative-eventing/services/zipkin:9411/proxy/zipkin`
after running a "kubectl proxy" command or your profiling server via
`http://localhost:8008/debug/pprof` after executing "kubectl -n knative-eventing
port-forward my-dispatcher-pod-name 8008:8008"

Eventing-Kafka does provide some of its own custom metrics that use the
Prometheus server provided by the Knative-Eventing framework. When a dispatcher
deployment starts, you can test the custom metrics with curl as in the following
example, which assumes you have created a dispatcher named
"kafka-channel-dispatcher" and exposed the metrics endpoint of 8081 in the
service. These commands presume you are running from inside the cluster in a pod
that has curl available:

Send a cloud event to your eventing-kafka installation:

```
echo -e "{\n  \"id\": \"12345\",\n  \"originationTime\": \"$(date -u +'%Y-%m-%dT%H:%M:%S.000000000Z')\",\n  \"content\": \"Test Message\"\n}" | curl -X POST -H "Content-Type: application/json" -H "cache-control: no-cache" -H "ce-id: 123" -H "ce-source: /testsource" -H "ce-specversion: 1.0" -H "ce-type: test.type.v1" --data @- -v http://my-kafkachannel-service.mynamespace.svc.cluster.local/
< HTTP/1.1 202 Accepted
```

Check the dispatcher metrics, noting that the eventing_kafka_consumed_msg_count
has increased by 1 on one of the partitions

```
curl -v http://kafka-channel-dispatcher.knative-eventing.svc.cluster.local:8081/metrics | grep consumed_msg_count | sort
# HELP eventing_kafka_consumed_msg_count Consumed Message Count
# TYPE eventing_kafka_consumed_msg_count gauge
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-1",partition="0",topic="mynamespace.my-kafkachannel-service"} 0
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-1",partition="1",topic="mynamespace.my-kafkachannel-service"} 0
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-1",partition="2",topic="mynamespace.my-kafkachannel-service"} 0
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-1",partition="3",topic="mynamespace.my-kafkachannel-service"} 0
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-2",partition="0",topic="mynamespace.my-kafkachannel-service"} 0
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-2",partition="1",topic="mynamespace.my-kafkachannel-service"} 0
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-2",partition="2",topic="mynamespace.my-kafkachannel-service"} 1
eventing_kafka_consumed_msg_count{consumer="rdkafka#consumer-2",partition="3",topic="mynamespace.my-kafkachannel-service"} 0
```

repository: jasonsmithio/eventing-kafka

repo_name: jasonsmithio/eventing-kafka